// Cracked by Roath
// Modify by Jingxue for XYCQ 6.20.2003

#include <command.h>
#include <combat.h>
#include <mudlib.h>

inherit F_CLEAN_UP;

void create() { seteuid(ROOT_UID); }

int main(object me, string arg)
{
        object ob;
        mapping my;
        string line, str, msg, skill_type, *marks;
        object weapon;
        int i, attack_points, dodge_points, parry_points,obstacles,dntg, age;

        seteuid(getuid(me));
        if(!arg)
                ob = me;
        else if (wizardp(me)) {
                ob = present(arg, environment(me));
                if (!ob) ob = find_player(arg);
                if (!ob) ob = find_living(arg);
                if (!ob) return notify_fail("你要察看谁的状态？\n");
        } else
                return notify_fail("只有巫师能察看别人的状态。\n");

        my = ob->query_entire_dbase();
        line = sprintf( "  %s%s\n",RANK_D->query_rank(ob),ob->short(1));
        line += "╭━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╮\n"NOR;
       	line += sprintf( "┃【气血上限】"YEL"%-5d"NOR"%s"YEL"%-3d"NOR"【体格】"HIR"%-5d%s%-3d"NOR"【外功修为】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
		my["max_kee"],ob->query_combat_level("max_kee")<my["max_kee"]?"-":"+",abs(ob->query_combat_level("max_kee")-my["max_kee"]),
       		my["str"],ob->query_str()<my["str"]?"-":"+",abs(ob->query_str()-my["str"]),
       		RANK_D->skill_level("waigong",ob->query_combat_level("attack")),
	       	ob->query_combat_level("attack_ba2"),
       		ob->query_combat_level("attack")<ob->query_combat_level("attack_ba2")?"-":"+",
	       	abs(ob->query_combat_level("attack")-ob->query_combat_level("attack_ba2")));
       	line += sprintf( "┃【精神上限】"YEL"%-5d"NOR"%s"YEL"%-3d"NOR"【敏捷】"HIW"%-5d%s%-3d"NOR"【内功修为】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
       		my["max_sen"],ob->query_combat_level("max_sen")<my["max_sen"]?"-":"+",abs(ob->query_combat_level("max_sen")-my["max_sen"]),
       		my["dex"],ob->query_dex()<my["dex"]?"-":"+",abs(ob->query_dex()-my["dex"]),
	       	RANK_D->skill_level("force",ob->query_combat_level("force")),
	       	ob->query_combat_level("force_ba2"),
	       	ob->query_combat_level("force")<ob->query_combat_level("force_ba2")?"-":"+",
	       	abs(ob->query_combat_level("force")-ob->query_combat_level("force_ba2")));
       	line += sprintf( "┃【内力上限】"YEL"%-5d"NOR"%s"YEL"%-3d"NOR"【根骨】"HIY"%-5d%s%-3d"NOR"【灵法修为】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
       		my["max_force"],ob->query_combat_level("max_force")<my["max_force"]?"-":"+",abs(ob->query_combat_level("max_force")-my["max_force"]),
       		my["con"],ob->query_con()<my["con"]?"-":"+",abs(ob->query_con()-my["con"]),
	       	RANK_D->skill_level("spells",ob->query_combat_level("spells")),
	       	ob->query_combat_level("spells_ba2"),
	       	ob->query_combat_level("spells")<ob->query_combat_level("spells_ba2")?"-":"+",
	       	abs(ob->query_combat_level("spells")-ob->query_combat_level("spells_ba2")));
       	line += sprintf( "┃【法力上限】"YEL"%-5d"NOR"%s"YEL"%-3d"NOR"【灵性】"HIG"%-5d%s%-3d"NOR"【轻功修为】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
       		my["max_mana"],ob->query_combat_level("max_mana")<my["max_mana"]?"-":"+",abs(ob->query_combat_level("max_mana")-my["max_mana"]),
       		my["spi"],ob->query_spi()<my["spi"]?"-":"+",abs(ob->query_spi()-my["spi"]),
	       	RANK_D->skill_level("dodge",ob->query_combat_level("dodge")),
	       	ob->query_combat_level("dodge_ba2"),
	       	ob->query_combat_level("dodge")<ob->query_combat_level("dodge_ba2")?"-":"+",
	       	abs(ob->query_combat_level("dodge")-ob->query_combat_level("dodge_ba2")));
       	line += sprintf( "┃【气血回复】"YEL"%-3d"NOR"/ %s"YEL"%-3d"NOR"【悟性】"HIC"%-5d%s%-3d"NOR"【伤 害 力】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
       		ob->query_combat_level("RLC_kee_bas"),ob->query_combat_level("RLC_kee")<ob->query_combat_level("RLC_kee_bas")?"-":"+",abs(ob->query_combat_level("RLC_kee")-ob->query_combat_level("RLC_kee_bas")),
	       	my["int"],ob->query_int()<my["int"]?"-":"+",abs(ob->query_int()-my["int"]),
	       	RANK_D->skill_level("damage",ob->query_combat_level("damage")),
	       	ob->query_combat_level("damage_ba2"),
	       	ob->query_combat_level("damage")<ob->query_combat_level("damage_ba2")?"-":"+",
	       	abs(ob->query_combat_level("damage")-ob->query_combat_level("damage_ba2")));
       	line += sprintf( "┃【精神回复】"YEL"%-3d"NOR"/ %s"YEL"%-3d"NOR"【胆识】"HIB"%-5d%s%-3d"NOR"【保 护 力】%s "HIY"%-3d%1s%-3d"NOR"┃\n",
       		ob->query_combat_level("RLC_sen_bas"),ob->query_combat_level("RLC_sen")<ob->query_combat_level("RLC_sen_bas")?"-":"+",abs(ob->query_combat_level("RLC_sen")-ob->query_combat_level("RLC_sen_bas")),
       		my["cor"],ob->query_cor()<my["cor"]?"-":"+",abs(ob->query_cor()-my["cor"]),
	       	RANK_D->skill_level("armor",ob->query_combat_level("armor")),
	       	ob->query_combat_level("armor_ba2"),
	       	ob->query_combat_level("armor")<ob->query_combat_level("armor_ba2")?"-":"+",
	       	abs(ob->query_combat_level("armor")-ob->query_combat_level("armor_ba2")));
       	line += sprintf( "┃【内力回复】"YEL"%-3d"NOR"/ %s"YEL"%-3d"NOR"【容貌】"HIM"%-5d%s%-3d"NOR"                              ┃\n",
       		ob->query_combat_level("RLC_force_bas"),ob->query_combat_level("RLC_force")<ob->query_combat_level("RLC_force_bas")?"-":"+",abs(ob->query_combat_level("RLC_force")-ob->query_combat_level("RLC_force_bas")),
       		my["per"],ob->query_per()<my["per"]?"-":"+",abs(ob->query_per()-my["per"]));
       	line += sprintf( "┃【法力回复】"YEL"%-3d"NOR"/ %s"YEL"%-3d"NOR"【福缘】"HIY"%-5d%s%-3d"NOR"                              ┃\n",
       		ob->query_combat_level("RLC_mana_bas"),ob->query_combat_level("RLC_mana")<ob->query_combat_level("RLC_mana_bas")?"-":"+",abs(ob->query_combat_level("RLC_mana")-ob->query_combat_level("RLC_mana_bas")),
       		my["kar"],ob->query_kar()<my["kar"]?"-":"+",abs(ob->query_kar()-my["kar"]));
       	line += sprintf( "┃【内功抵抗】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【年龄】"WHT"%-9d"NOR"【所属门派】"HIC"%-18s"NOR"┃\n",
       		ob->query_combat_level("DF_force_bas"),ob->query_combat_level("DF_force")<ob->query_combat_level("DF_force_bas")?"-":"+",abs(ob->query_combat_level("DF_force")-ob->query_combat_level("DF_force_bas")),
		ob->query("age"),
	       	stringp(ob->query("family/family_name"))?ob->query("family/family_name"):"无");
       	line += sprintf( "┃【法术抵抗】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【性别】"WHT"%-9s"NOR"【所属帮会】"HIR"%-18s"NOR"┃\n",
       		ob->query_combat_level("DF_spells_bas"),ob->query_combat_level("DF_spells")<ob->query_combat_level("DF_spells_bas")?"-":"+",abs(ob->query_combat_level("DF_spells")-ob->query_combat_level("DF_spells_bas")),
	       	ob->query("gender"),
	       	ob->query("bh/name")?ob->query("bh/name"):"无");
       	line += sprintf( "┃【内功反弹】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【体重】"WHT"%-9s"NOR"【婚姻配偶】"HIM"%-18s"NOR"┃\n",
       		ob->query_combat_level("RE_force_bas"),ob->query_combat_level("RE_force")<ob->query_combat_level("RE_force_bas")?"-":"+",abs(ob->query_combat_level("RE_force")-ob->query_combat_level("RE_force_bas")),
	       	(int)ob->query_weight()/500+"斤",
	       	ob->query("婚姻/name")?ob->query("婚姻/name"):"无");
       	line += sprintf( "┃【法术反弹】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【ＰＫ】"HIR"%-5d"NOR"人次"NOR"【常规死亡】"HIW"%-5d"NOR"次"NOR"           ┃\n",
       		ob->query_combat_level("RE_spells_bas"),ob->query_combat_level("RE_spells")<ob->query_combat_level("RE_spells_bas")?"-":"+",abs(ob->query_combat_level("RE_spells")-ob->query_combat_level("RE_spells_bas")),
       		ob->query("生死A/PKS"),
	       	ob->query("生死B/dietimes"));
       	line += sprintf( "┃【经验获得】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【ＮＫ】"RED"%-5d"NOR"人次"NOR"【意外阵亡】"WHT"%-5d"NOR"次"NOR"           ┃\n",
       		ob->query_combat_level("gain_exp_bas"),ob->query_combat_level("gain_exp")<ob->query_combat_level("gain_exp_bas")?"-":"+",abs(ob->query_combat_level("gain_exp")-ob->query_combat_level("gain_exp_bas")),
       		ob->query("生死A/MKS"),
       		ob->query("生死B/normal_die"));
       	line += sprintf( "┃【潜能获得】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【存款】"YEL"%-39s"NOR"┃\n",
       		ob->query_combat_level("gain_pot_bas"),ob->query_combat_level("gain_pot")<ob->query_combat_level("gain_pot_bas")?"-":"+",abs(ob->query_combat_level("gain_pot")-ob->query_combat_level("gain_pot_bas")),
       		(ob->query("balance")/10000)+"金"+((ob->query("balance")%10000)/100)+"银"+(ob->query("balance")%100)+"铜");
       	line += sprintf( "┃【赏金获得】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【生辰】"YEL"%-39s"NOR"┃\n",
       		ob->query_combat_level("gain_gold_bas"),ob->query_combat_level("gain_gold")<ob->query_combat_level("gain_gold_bas")?"-":"+",abs(ob->query_combat_level("gain_gold")-ob->query_combat_level("gain_gold_bas")),
       		TIME_D->check_usr_birthday(ob));
       	line += sprintf( "┃【属性装备】"YEL"%-3d"NOR"%% %s"YEL"%-3d"NOR"【经历】"YEL"%-39s"NOR"┃\n",
       		ob->query_combat_level("gain_eq_bas"),ob->query_combat_level("gain_eq")<ob->query_combat_level("gain_eq_bas")?"-":"+",abs(ob->query_combat_level("gain_eq")-ob->query_combat_level("gain_eq_bas")),
       		FINGER_D->age_string( (int)ob->query("mud_age")));
	str = sprintf( "%s%s%s%s%s%s%s", 
		ob->query_temp("buff_attack")?HIR+ob->query_temp("buff_attack")+NOR" ":"",
		ob->query_temp("buff_force")?HIY+ob->query_temp("buff_force")+NOR" ":"",
		ob->query_temp("buff_spells")?HIC+ob->query_temp("buff_spells")+NOR" ":"",
		ob->query_temp("buff_dodge")?HIW+ob->query_temp("buff_dodge")+NOR" ":"",
		ob->query_temp("buff_damage")?HIM+ob->query_temp("buff_damage")+NOR" ":"",
		ob->query_temp("buff_armor")?HIG+ob->query_temp("buff_armor")+NOR" ":"",
		ob->query_temp("buff_ultimate")?HIB+ob->query_temp("buff_ultimate")+NOR" ":"");
	if (str != "")
	{
       		msg = sprintf( "┃【增益状态】%-56s┃\n",filter_color(str));
       		msg = replace_string(msg, filter_color(str), str);
       		line += msg;
	}
	str = sprintf( "%s%s%s%s%s%s%s", 
		ob->query_temp("debuff_attack")?HIR+ob->query_temp("debuff_attack")+NOR" ":"",
		ob->query_temp("debuff_force")?HIY+ob->query_temp("debuff_force")+NOR" ":"",
		ob->query_temp("debuff_spells")?HIC+ob->query_temp("debuff_spells")+NOR" ":"",
		ob->query_temp("debuff_dodge")?HIW+ob->query_temp("debuff_dodge")+NOR" ":"",
		ob->query_temp("debuff_damage")?HIM+ob->query_temp("debuff_damage")+NOR" ":"",
		ob->query_temp("debuff_armor")?HIG+ob->query_temp("debuff_armor")+NOR" ":"",
		ob->query_temp("debuff_ultimate")?HIB+ob->query_temp("debuff_ultimate")+NOR" ":"");
	if (str != "")
	{
       		msg = sprintf( "┃【减益状态】%-56s┃\n",filter_color(str));
       		msg = replace_string(msg, filter_color(str), str);
       		line += msg;
	}
	line += "╰━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╯\n"NOR;
//	line += sprintf(" 生于"+MUDLIB_NAME+"纪元%s\n",TIME_D->check_usr_birthday(ob));
//     	line += sprintf(" 注册于北京时间%s\n",BJTIME_CMD->chinese_time(1, ctime(ob->query("birthday"))));
//	line += sprintf(" 游戏时间：%s\n",FINGER_D->age_string( (int)ob->query("mud_age")));

        write(line+BBLK);
        return 1;
}
int help(object me)
{
        write(@HELP
指令格式：score
          score <对象名称>      （巫师专用）

显示自己或者指定对象（含怪物）的基本资料。

相关讯息：hp
HELP
        );

        return 1;
}
