本文整理汇总了C++中object::add方法的典型用法代码示例。如果您正苦于以下问题:C++ object::add方法的具体用法?C++ object::add怎么用?C++ object::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类object
的用法示例。
在下文中一共展示了object::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exert
int exert(object me, object target)
{
string force;
if (userp(me) && ! me->query("can_exert/yijin-duangu/heal"))
return notify_fail("你所学的内功中没有这种功能。\n");
if (! target)
return notify_fail("你要用真气为谁疗伤?\n");
if (target == me)
return notify_fail(HEAL "只能对别人施展。\n");
if (me->is_fighting() || target->is_fighting())
return notify_fail("战斗中无法运功疗伤。\n");
if (target->query("not_living"))
return notify_fail("你无法给" + target->name() + "疗伤。\n");
if ((int)me->query_skill("yijin-duangu", 1) < 100)
return notify_fail("你的易筋锻骨不够娴熟,难以施展" HEAL "。\n");
if (me->query_skill_mapped("force") != "yijin-duangu")
return notify_fail("你没有激发易筋锻骨,难以施展" HEAL "。\n");
if ((int)me->query("max_neili") < 1500)
return notify_fail("你的内力修为太浅,难以施展" HEAL "。\n");
if ((int)me->query("neili") < 1000)
return notify_fail("你现在的真气不足,难以施展" HEAL "。\n");
if ((int)me->query("jing") < 100)
return notify_fail("你现在的状态不佳,难以施展" HEAL "。\n");
if (target->query("eff_qi") >= target->query("max_qi") &&
target->query("eff_jing") >= target->query("max_jing"))
return notify_fail("对方没有受伤,不需要接受治疗。\n");
message_sort(HIY "\n只见$N" HIY "默默运转" + to_chinese(force) +
HIY ",深深吸进一口气,头上隐隐冒出白雾,陡然施展开"
"易筋锻骨,以纯阴内力瞬时点遍了$n" HIY "全身七十二"
"处大穴。过得一会,便见得$n" HIY "“哇”的一下吐出"
"几口瘀血,脸色登时看起来红润多了。\n" NOR, me, target);
me->add("neili", -800);
me->receive_damage("qi", 100);
me->receive_damage("jing", 50);
target->receive_curing("qi", 100 + (int)me->query_skill("force") +
(int)me->query_skill("yijin-duangu", 1) * 3);
if (target->query("qi") <= 0)
target->set("qi", 1);
target->receive_curing("jing", 100 + (int)me->query_skill("force") / 3 +
(int)me->query_skill("yijin-duangu", 1));
if (target->query("jing") <= 0)
target->set("jing", 1);
if ((int)target->query_condition("hamagong_poison"))
{
target->clear_condition("hamagong_poison");
tell_object(target, HIC "\n你只觉体内残存的蛤蟆功伤慢慢"
"消退,感觉好多了。\n" NOR);
}
if (! living(target))
target->revive();
if (! target->is_busy())
target->stary_busy(2);
message_vision("\n$N闭目冥坐,开始运功调息。\n", me);
me->start_busy(10);
return 1;
}
示例2: kee_out
int kee_out(object me,object target)
{
int mkilluse,cor,maxskee;
int magic_lv,makee_lv;
int sha_lv,rain_lv;
int mix_power;
int ext_power=0;
if (me->query("quest/worldpill") == 1)
ext_power=120; //吃下绝世丹药后的威力增幅
cor=me->query("cor");
maxskee =me->query("max_s_kee");
magic_lv =me->query_skill("magic",1);
sha_lv =me->query_skill("shadow-kill",1)*2; //max lv 90
rain_lv =me->query_skill("rain-throwing",1); //max lv 100
makee_lv =me->query("/functions/manakee/level")*2; //max lv 150
mix_power=sha_lv+rain_lv+makee_lv+ext_power;
//如果magic lv 80的话,最多可以使用10单位的杀气
//加1是避免出现零次的机会
//用于控制持续回数
if (magic_lv > 80)
magic_lv=80;
mkilluse=random(magic_lv /8)+1;
if(me->query("class") != "killer")
{
tell_object(me,"自从你离开杀手后,就发现心中的魔气逐渐消失...\n");
return 1;
}
if(me->query("quest/head-kill") != 1)
{
tell_object(me,"ㄟ......你想用什么气呀?要用?自己放屁会快一点\n");
return 1;
}
if(me->query("s_kee")< 20)
{
tell_object(me,"你的杀意魔气修练不够精深,多练一下再用吧!\n");
return 1;
}
if( !target || !target->is_character() || !me->is_fighting(target) )
return notify_fail("‘杀意魔气’只能对战斗中的对手使用。\n");
if(target->query_temp("mkill")==1)
{
tell_object(me,"敌人目前被杀意魔气纠缠着,先攻击等会再放杀气\n");
return 1;
}
if (me->query("bellup") != 1)
{
tell_object(me, "感觉起来你还不够想杀人嘛!怎么不用杀意升这一招\n");
return 1;
}
if (me->query("bellicosity") < 500)
{
tell_object(me, "杀气不够啦!那要怎么用杀气来威吓对手呢?\n");
return 1;
}
if (me->query_skill("magic") < 10)
{
tell_object(me, "连点法术也不学,那怎么会有足够的灵力来控制杀气\n");
return 1;
}
if (me->query("atman") < 30)
{
tell_object(me, "灵力不够啦,这样你会自灭哦!?\n");
return 1;
}
//以下是花费
me->add("bellicosity",-(mkilluse*5)); //因为使用杀气恫吓对方
me->add("atman",-30); //使用灵力来结合杀气与灵气
me->add("s_kee",-20); //所需花去的灵气量
//持续回数最高mkilluse可能到10,威力以最大灵气量来分等级
//这根本是变态,把灵气练到lv 250以上,由lv200->lv 250最少需要230000的atman值
//所以给予一击必杀的威力,但把灵气等级降30,使玩家不能练比lv 250更高
if (maxskee > 250)
{
me->add("max_s_kee",-30); //所需花去的灵气等级
message_vision(HIM" 杀 意 魔 气\n\n"NOR,me);
message_vision(HIM"超顶级威力 **紫**级**魔**气** \n\n"NOR,me);
message_vision(HIM"超精纯的杀意魔气化成真元由$N体内射出,这是具有无比威力的魔气\n"NOR,me);
message_vision(HIM"$N的魔气真元在瞬间射入$n体内,无比的威力在其体内爆发!\n"NOR,me,target);
target->start_busy(2);
target->receive_damage("gin",random(mix_power*2));
target->receive_damage("sen",random(cor*40)); //胆识30*40=1200 一般是一击必杀,重要NPC不会有问题
//且杀手的胆识大约在20-25之间, 20*20=400,也就是只要胆识低一些,威力就降很多
}
else if (maxskee > 200)
{
message_vision(HIM" 杀 意 魔 气\n\n"NOR,me);
message_vision(HIG"顶级威力 *绿*级*魔*气* \n\n"NOR,me);
message_vision(HIG"$N由自身爆出强烈的杀气,这是一种带有魔力的杀气\n"NOR,me);
message_vision(HIG"$N地狱般的魔气瞬间笼罩$n,令其感到剧烈的恐惧感!\n"NOR,me,target);
target->start_busy(2);
target->receive_damage("gin",random(mix_power));
target->receive_damage("sen",random(cor*20)); //胆识30*20=600
}
//.........这里部分代码省略.........
示例3: ningxie_result
void ningxie_result(object me, object target)
{
int afp,vfp,mod_val;
object weapon;
string str;
weapon=me->query_temp("weapon");
message_vision(HIB"\n随着$N手中"+weapon->name()+HIB"的舞动,周围的空气越来越冷了。\n"NOR,me);
afp = COMBAT_D->skill_power(me, "force", SKILL_USAGE_DEFENSE);
if( afp < 1) afp = 1;
vfp = COMBAT_D->skill_power(target, "force", SKILL_USAGE_ATTACK);
if( vfp < 1 ) vfp = 1;
if( me->query("force_factor") && (me->query("force") > me->query("force_factor")) )
mod_val = (100+me->query("force_factor")/10);
else mod_val=100;
if( afp > 1000000 ) mod_val = afp / 100 * (100 + mod_val);
else mod_val = (100 + mod_val) * afp / 100;
if( mod_val < 1 ) mod_val = 1;
if( random(mod_val + vfp) < vfp )
{message_vision(YEL"$N运气一转,全不把寒冷放在心上!\n"NOR,target);
target->add_temp("ningxie_effect",-1);
if ( target->query_temp("ningxie_effect") < 0 ) target->set_temp("ningxie_effect",0);
}
else{ if( me->query("force_factor") && (me->query("force") > me->query("force_factor")) )
me->add("force",-me->query("force_factor"));
switch (target->query_temp("ningxie_effect"))
{
case 0: {message_vision(WHT"$N打了一个寒颤。\n"NOR,target);
me->set_temp("ex_ningxie",7);
COMBAT_D->do_attack_damage(me, target, me->query_temp("weapon"));
COMBAT_D->report_status(target);
target->receive_damage("sen",random(me->query_skill("force")));
COMBAT_D->report_sen_status(target);
target->add_temp("ningxie_effect",1);
me->delete_temp("ex_ningxie");
break;
}
case 1: { message_vision(WHT"$N冷的浑身颤抖!\n"NOR,target);
me->set_temp("ex_ningxie",8);
COMBAT_D->do_attack_damage(me, target, me->query_temp("weapon"));
COMBAT_D->report_status(target);
target->receive_damage("sen",random(me->query_skill("force")));
COMBAT_D->report_sen_status(target);
target->add_temp("ningxie_effect",1);
me->delete_temp("ex_ningxie");
break;
}
case 2: {message_vision(WHT"$N冷得脸色惨白!\n"NOR,target);
me->set_temp("ex_ningxie",9);
COMBAT_D->do_attack_damage(me, target, me->query_temp("weapon"));
COMBAT_D->report_status(target);
target->receive_wound("sen",random(me->query_skill("force")));
COMBAT_D->report_sen_status(target);
target->add_temp("ningxie_effect",1);
me->delete_temp("ex_ningxie");
break;
}
case 3: {message_vision(WHT"$N冷得像一条冰棍了!\n"NOR,target);
me->set_temp("ex_ningxie",10);
COMBAT_D->do_attack_damage(me, target, me->query_temp("weapon"));
COMBAT_D->report_status(target);
target->receive_wound("sen",random(me->query_skill("force")));
COMBAT_D->report_sen_status(target);
me->delete_temp("ex_ningxie");
}
}
if (target->query("eff_kee")<0 || target->query("eff_sen")<0 || (!living(target) && ((target->query("sen")<0) || target->query("kee")<0)) )
{str=target->name()+"被"+me->name()+"手中"+weapon->name()+HIM"所带出的寒气活活冻死了,听说连尸体也青一块紫一快的!"NOR;
CHANNEL_D->do_channel(me, "rumor",str);
target->die();
me->delete_temp("last_channel_msg");
}
}
if ( me->query_temp("ningxie") ) call_out("ningxie_result",3+random(6),me,target);
}
示例4: perform
int perform(object me, object target)
{
object weapon;
string msg;
int ap, dp;
int i, attack_time;
if (userp(me) && ! me->query("can_perform/guxing-jian/lian"))
return notify_fail("你所使用的外功中没有这种功能。\n");
if (! target) target = offensive_target(me);
if (! target || ! me->is_fighting(target))
return notify_fail(LIAN "只能对战斗中的对手使用。\n");
if (! objectp(weapon = me->query_temp("weapon"))
|| (string)weapon->query("skill_type") != "sword")
return notify_fail("你所使用的武器不对,难以施展" LIAN "。\n");
if ((int)me->query_skill("guxing-jian", 1) < 100)
return notify_fail("你的孤星剑法不够娴熟,难以施展" LIAN "。\n");
if (me->query_skill_mapped("sword") != "guxing-jian")
return notify_fail("你没有激发孤星剑法,难以施展" LIAN "。\n");
if (me->query("neili") < 300)
return notify_fail("你目前的真气不够,难以施展" LIAN "。\n");
if (! living(target))
return notify_fail("对方都已经这样了,用不着这么费力吧?\n");
msg = HIW "\n$N" HIW "蓦的一声清啸,施出绝学「" HIM "九星连珠"
HIW "」,手中" + weapon->name() + HIW "呼呼作响。霎时间"
"孤星剑法剑招连绵涌出,此起彼伏,剑气笼罩$n" HIW "全身。" NOR;
message_sort(msg, me, target);
attack_time = 4;
ap = me->query_skill("sword");
dp = target->query_skill("dodge");
attack_time += random(ap / 40);
if (attack_time > 8)
attack_time = 8;
me->add("neili", -attack_time * 20);
if (ap / 2 + random(ap) > dp)
{
msg = HIY "$n" HIY "见$P" HIY "剑势汹涌,寒意顿生,竟"
"被逼得连连后退,狼狈不已。\n" NOR;
} else
{
msg = HIC "$n" HIC "见$N" HIC "这几剑来势迅猛无比,毫"
"无破绽,只得小心应付。\n" NOR;
}
message_combatd(msg, me, target);
for (i = 0; i < attack_time; i++)
{
if (! me->is_fighting(target))
break;
COMBAT_D->do_attack(me, target, weapon, 0);
}
me->start_busy(1 + random(attack_time));
return 1;
}
示例5: valid_leave
int valid_leave(object me, string dir)
{
me->add("mana", -10);
return ::valid_leave(me, dir);
}
示例6: perform
int perform(object me, object target)
{
object weapon;
int damage;
string msg;
int ap, dp;
if (userp(me) && ! me->query("can_perform/hujia-daofa/zhui"))
return notify_fail("你还没有受过高人指点,无法施展" ZHUI "。\n");
if (! target)
{
me->clean_up_enemy();
target = me->select_opponent();
}
if (! target || ! me->is_fighting(target))
return notify_fail(ZHUI "只能对战斗中的对手使用。\n");
if (! objectp(weapon = me->query_temp("weapon")) ||
(string)weapon->query("skill_type") != "blade")
return notify_fail("你使用的武器不对,难以施展" ZHUI "。\n");
if ((int)me->query_skill("force") < 200)
return notify_fail("你的内功火候不够,难以施展" ZHUI "。\n");
if ((int)me->query_skill("hujia-daofa", 1) < 140)
return notify_fail("你的胡家刀法还不到家,难以施展" ZHUI "。\n");
if (me->query_skill_mapped("blade") != "hujia-daofa")
return notify_fail("你没有激发胡家刀法,难以施展" ZHUI "。\n");
if ((int)me->query("neili") < 200)
return notify_fail("你的真气不够,难以施展" ZHUI "。\n");
if (! living(target))
return notify_fail("对方都已经这样了,用不着这么费力吧?\n");
msg = HIR "$N" HIR "手中的" + weapon->name() + HIR "一振,施出「卸"
"甲锥心势」,顿时一股凌厉无比的无形刀气破空袭向$n" HIR "!\n"NOR;
ap = ap_power(me, "blade");
dp = dp_power(target, "parry");
if (ap / 2 + random(ap) > dp)
{
damage = da_power(me, "blade");
me->add("neili", -150);
msg += COMBAT_D->do_damage(me, target, WEAPON_ATTACK, damage, 65,
HIR "只见$n" HIR "一声惨叫,整个人如遭"
"电击,刀气穿心,口中鲜血狂喷而出!\n" NOR);
me->start_busy(2);
} else
{
msg += CYN "可是$p" CYN "默运内力,硬是抵挡了$P"
CYN "的这记无形刀气。\n"NOR;
me->add("neili", -50);
me->start_busy(3);
}
message_combatd(msg, me, target);
return 1;
}
示例7: perform
int perform(object me, object target)
{
object weapon, weapon1 ;
string msg;
int extra, dodge, speed, parry ,damage;
if (!target) target = offensive_target(me);
if (me->query_skill_mapped("force") != "kurong-changong" &&
me->query_skill_mapped("force") != "duanshi-xinfa")
return notify_fail(HIW"你所用得内功心法不对,无法跃起身形。\n" NOR);
if (!target
|| !target->is_character()
|| !me->is_fighting(target))
return notify_fail( HIW "「凤舞九天」只能在战斗中使用。\n" NOR);
if (me->query("gender") !="女性")
return notify_fail( HIW "「凤舞九天」只有女性能舞!\n" NOR);
if (me->query_temp("jiutian"))
return notify_fail( HIW "你正在舞「凤舞九天」!\n" NOR);
if (!objectp(weapon = me->query_temp("weapon"))
|| (string)weapon->query("skill_type") != "whip")
return notify_fail("你使用的武器不对。\n");
if ((int)me->query_skill("kurong-changong", 1) < 130 &&
(int)me->query_skill("duanshi-xinfa",1) < 130)
return notify_fail( HIW "你的内功修为未到,无法施展「凤舞九天」。\n" NOR);
if ((int)me->query_skill("feifeng-whip", 1) < 150)
return notify_fail( HIW "你的飞凤鞭法修为还不够,尚未领悟到「凤舞九天」。\n" NOR);
if (me->query("max_neili") <= 1000)
return notify_fail( HIW "你的内力修为不足,劲力不足以施展「凤舞九天」!\n" NOR);
if ((int)me->query("neili", 1) < 500)
return notify_fail( HIW "你现在内力不够,劲力不足以施展「凤舞九天」!\n" NOR);
if (me->query("jingli") <= 300)
return notify_fail( HIW "你的精力不足,无法施展「凤舞九天」!\n" NOR);
if (me->query("combat_exp")*3 > target->query("combat_exp")*4)
return notify_fail( HIW "想用「凤舞九天」欺负弱小?不太好吧!\n" NOR);
if (! living(target))
return notify_fail( HIW "对方都已经这样了,还舞给谁看啊!\n" NOR);
message_vision(MAG"$N向后纵身一跃,翩翩起舞,手中的"NOR+weapon->name()+NOR MAG"响起阵阵凤鸣,舞姿奇诡莫测,变化无端,宛如凤凰一般刹是好看。\n\n" NOR, me);
if (random(me->query("per"))+8 > 20)
{
message_vision(HIR"突然$n一个失神,被$N的动作所吸引,顿感心旷神怡,心猿意马,被$N的舞姿迷的神魂颠倒!\n\n"NOR, me, target);
target->start_busy(random(5)+5);
if (target->query_temp("weapon")) {
weapon1 = target->query_temp("weapon");
if (me->query("combat_exp") < random(target->query("combat_exp")*8/5)) {
message_vision(HIW"$n手指一松,"NOR+weapon1->name()+NOR HIW"险些脱手!\n" NOR, me, target);
}
else {
message_vision(HIW"$n手上一松,不由自主的丢下了"NOR+weapon1->name()+NOR HIW"!\n" NOR, me, target);
weapon1->unequip();
weapon1->move(environment(target));
target->reset_action();
}
}
extra = (int)me->query_skill("feifeng-whip",1);
dodge = extra*3/4 + random(extra/2);
damage = extra/3 + random(extra/2);
parry = extra*3/4 + random(extra/5);
me->add_temp("apply/dodge", dodge);
me->add_temp("apply/damage", damage);
target->add_temp("apply/parry", -parry);
me->set_temp("jiutian", 25+extra/6);
call_out("checking", 1, me, target, weapon, dodge, damage, parry);
me->start_busy(1+random(2));
me->add("neili", -250);
me->add("jing", -50);
}
else
{
message_vision(RED"就看$n收敛心神,心如明镜,全神贯注,并未被$N的舞姿所迷。\n"NOR, me, target);
me->start_busy(random(5)+2);
}
return 1;
}
示例8: perform
int perform(object me, object target)
{
object weapon;
int damage =0, dragon;
int myhammer;
string msg;
if( !target ) target = offensive_target(me);
if( !target || !target->is_character() || !me->is_fighting(target) )
return notify_fail("天狼斩只能对战斗中的对手使用。\n");
if (!objectp(weapon = me->query_temp("weapon"))
|| (string)weapon->query("skill_type") != "blade")
return notify_fail("你使用的武器不对。\n");
if(me->query("family/family_name") != "天空界")
return notify_fail("不是天界弟子的也想用天狼斩?\n");
if( (int)me->query_skill("tianlang-blade", 1) < 150 )
return notify_fail("你的天狼夜摩刀不够娴熟,不能发出「天狼斩」。\n");
if( (int)me->query_skill("shouya-force", 1) < 150 )
return notify_fail("你的兽牙魔经不够高,不能够运起那股劲气。\n");
if( (int)me->query("force", 1) < 600 )
return notify_fail("你现在内力太弱,不能发出「雷霆三击」。\n");
msg = HIG "$N撮嘴尖啸,猛吸一口气,快速运转兽牙魔经,浑圆霸气散布四周五丈范围
随后将浑圆内力灌注于刀上,
一连三刀带起三道劲风,从上,中,下三路带着撕晋烈帛般的声音扫向$n。
这正是黑幕凯的绝学"HIR"「天狼斩」\n"NOR;
if( !target->is_killing(me) ) target->kill_ob(me);
if (random(me->query_skill("shouya-force", 1)) > target->query_skill("force", 1)/4)
{
target->start_busy(1);
damage += (int)me->query_skill("tianlang-blade", 1);
damage = damage + (int)me->query_skill("shouya-force", 1);
damage = damage + (int)me->query_skill("shanbishu", 1);
if (damage < 600) {
dragon = 1;
} else if (damage < 900) {
damage = damage/3*4;
dragon = 2;
} else {
damage = damage/5*8;
dragon = 3;
}
if (damage >= target->query("max_kee")) damage = target->query("max_kee")-1;
target->receive_damage("kee", damage);
target->receive_wound("kee", damage/3);
me->add("force", -300);
msg += HIC"$n被$N的兽牙魔经的劲力牵制动弹不得,身中"+chinese_number(dragon)+"刀!\n$n只觉兵刃对身体造成的疼痛似乎已经不算什么,强大的霸气,只震的$n的五脏六腑都在颤抖!\n"NOR;
me->start_busy(1+random(2));
} else
{
msg += MAG"$p识得这招的厉害,向后几个纵身跳出了$P浑圆霸气散布的范围。\n"NOR;
me->add("force", -350);
me->start_busy(1+random(2));
}
message_vision(msg, me, target);
if (damage > 0) COMBAT_D->report_status(target);
return 1;
}
示例9: perform
int perform(object me)
{
int force, sword;
object weapon = me->query_temp("weapon");
string shape = weapon->query("id");
if( !me->is_fighting() )
return notify_fail("「绕指柔剑」只能在战斗中使用。\n");
if( !me->query("wudang/raozhi") )
return notify_fail("你未得高人指点,不知该如何施展「绕指柔剑」。\n");
if( !objectp(weapon) || weapon->query("skill_type") != "sword" )
return notify_fail("你手中无剑,怎能使出「绕指柔剑」?!\n");
if( me->query_temp("yield") )
return notify_fail("你不出剑,如何使出「绕指柔剑」?\n");
if( me->query_temp("wudang/raozhi") )
return notify_fail("你已经将内力贯注入剑中了!!\n");
if( me->query_skill_mapped("force") != "wudang-jiuyang" )
return notify_fail("你所用的内功与「绕指柔剑」心法相悖!\n");
if( me->query_skill("sword") < 200 )
return notify_fail("你的剑法修为还不够,难以施展「绕指柔剑」!\n");
if( me->query_skill("force") < 200 )
return notify_fail("你的内功修为火候未足,无法以内力逼弯剑刃!\n");
if( me->query("max_neili") <= 1500 )
return notify_fail("你的内力不够浑厚,劲力不足以逼弯剑刃!\n");
if( me->query("neili") <= 500 )
return notify_fail("你的内力不够,劲力不足以逼弯剑刃!\n");
if( me->query("jingli") <= 200 )
return notify_fail("你的体力有限,难以施展「绕指柔剑」!\n");
if( shape == "xuantie jian" )
return notify_fail("你所持之剑质地过於坚硬,难以用内力将其逼弯!\n");
if( shape == "tie di" || shape == "tie xiao" || shape == "zhu xiao"
|| shape == "yu xiao")
return notify_fail("箫笛形状不适合施展「绕指柔剑」!\n");
if( shape == "xiuhua zhen" || shape == "qijue zhen" || shape == "emei ci"
|| shape == "duanjian" || shape == "bishou" )
return notify_fail("你所持之剑太短,不适合施展「绕指柔剑」!\n");
me->add("neili", -100);
me->add("jingli", -150);
if( (string)weapon->query("material") != "steel" )
{
message_vision(HIW "\n猛地里$N一声清啸,剑法忽变。可是手中"+ weapon->name()
+HIW"却已经不住内力冲击,裂成碎片!!\n"NOR, me);
destruct(weapon);
me->set_temp("apply/damage", 0);
me->reset_action();
me->start_busy(1);
return 1;
}
force = me->query_skill("force")/2;
sword = me->query_skill("sword")/3;
weapon->add("rigidity", force);
me->add_temp("apply/attack", sword);
me->set_temp("wudang/raozhi", sword);
message_vision(HIG "\n猛地里$N一声清啸,剑法忽变,那柄"+ weapon->name()
+HIG"竟似成了一条软带,轻柔曲折,飘忽不定。\n正是武当派绝技"+
HIW +"「绕指柔剑」"+ HIG +"!\n"NOR, me);
call_out("checking", 1, me, weapon, sword, force);
return 1;
}
示例10: cast
int cast(object me, object target)
{
string msg;
int success, ap, dp, ap2, ap3, dp2, dp3, damage;
if( !target ) target = offensive_target(me);
if((int)me->query_skill("spells") < 100 || (int)me->query_skill("pingtian-dafa",1) < 60)
return notify_fail("你还没学会妖火。。。\n");
if( !target
|| !target->is_character()
|| target->is_corpse()
|| target==me)
return notify_fail("你想对谁喷火?\n");
if( target->is_busy() )
return notify_fail(target->name()+"已经够忙了。\n");
if(target->query_temp("no_move"))
return notify_fail(target->query("name")+"已经动弹不得了!\n");
if((int)me->query("mana") < 200 )
return notify_fail("你的法力不够!\n");
if((int)me->query("sen") < 10 )
return notify_fail("你无法集中精力!\n");
me->add("mana", -100);
me->receive_damage("sen", 20);
msg = HIG
"$N凸腹鼓腮,咬破舌尖,张口一喷,一团碧磷磷的妖火直朝$n喷去!\n\n"
NOR;
success = 1;
ap = me->query_skill("spells");
ap = ap * ap * ap /12 ;
ap += (int)me->query("daoxing");
dp = target->query("daoxing");
//呵呵,看你怕不怕,比胆识
ap2 = (int)me->query_cor();
dp2 = (int)target->query_cor();
ap3 = (int)me->query("mana");
dp3 = (int)target->query("mana");
if( random(ap + dp + 2500*(ap2+dp2)+200*(ap3+dp3)) < (dp+2500*dp2+200*dp3) ) success = 0;
// 哈哈,中招了,没这么简单,我pingtian-dafa高低,你惨的程度不一样
if(success == 1 && (int)me->query_skill("pingtian-dafa",1) < 100){
msg += HIR "$n看着$N那鄙陋相正想抢攻,不料一团碧火袭来,顿时手忙脚乱。\n" NOR;
target->start_busy(2+random(2));
if( living(target) ) target->kill_ob(me);
}
else if(success == 1 && (int)me->query_skill("pingtian-dafa",1) > 100){
// 难道就这么结束了,没呢!还有更厉害要你致命的!
// 不过得看我运气,就是福缘了
if(random(me->query("kar"))>18){
msg += HIR "$n被妖火袭中,一股火毒直冲入脑髓、骨髓、血髓、脉髓。。。。\n" NOR;
target->apply_condition("yaohuo_poison",((int)me->query_skill("pingtian-dafa",1)/5));
target->start_busy(3+random(2));
damage = (int)me->query_skill("force", 1);
damage = damage + (int)me->query_skill("pingtian-dafa",1);
target->receive_damage("sen", damage);
target->receive_wound("sen", damage/3);
}
msg += HIR "$n一个不防,被妖火笼罩了全身。只听见$n在碧磷般的妖火中惨叫连连!\n" NOR;
target->start_busy(1+random(2));
damage = (int)me->query_skill("force", 1);
damage = damage + (int)me->query_skill("pingtian-dafa",1);
target->receive_damage("sen", damage);
target->receive_wound("sen", damage/3);
if((int)me->query("mana") > 100 )
me->add("mana", -100);
if( living(target) ) target->kill_ob(me);
me->start_busy(2+random(2));
}
else {
msg += HIR "$n显然觑出$N这招的厉害,后掠三步,躲过了妖火!\n" NOR;
me->start_busy(2+random(2));
if((int)me->query("mana") > 100 )
me->add("mana", -100);
if( living(target) ) target->kill_ob(me);
}
message_vision(msg, me, target);
return 1;
}
示例11: perform
int perform(object me, object target)
{
string msg,*limbs;
int i,size,damage;
object my_w,target_w;
my_w = me->query_temp("weapon");
target_w = target->query_temp("weapon");
if( !target ) target = offensive_target(me);
if( target->is_busy() )
return notify_fail(target->name() + "Ŀǰ��ãȻ��֪���룬�ӽ������ɡ�\n"
);
if( (int)me->query_skill("duanyun-fu",1) < 50)
return notify_fail("��Ŀǰ������ʹ�����������ҡ���\n");
if( (int)me->query("neili") < 100 )
return notify_fail("�������������\n");
me->add("neili", -60);
msg = CYN"$NͻȻ����һ���������ң����ң��������ң��������о���Ȼ����$p���б��У�\n"NOR;
me->start_busy(1);
if (target->query_temp("weapon") ||
target->query_temp("secondary_weapon")) {
if( random(me->query("combat_exp")) >
(int)target->query("combat_exp")/3 ) {
if( target_w->weight() > 2 * random(my_w->weight()) ) {
msg += "���$p���е�"+target_w->query("name")+"��$P�ĺ������Ҹ����ţ���Ҳ���ղ��
ס���������ַɳ���\n" NOR;
target_w->unequip();
target_w->move(environment(target));
target->reset_action();
target->start_busy( (int)me->query_skill("duanyun-fu") / 20 );
}
msg += HIC
"ֻ��$n���е�"+target_w->query("name")+"��Ȼ���Ҷ������Σ�����
�ܵ�$N�ľ����ļ�������$nѸ����ȥ��\n"NOR;
message_combatd(msg,me,target);
target_w->unequip();
target_w->move(environment(target));
target_w->set("name", target_w->query("name") + "����Ƭ");
target_w->set("value", target_w->query("value")/10);
target_w->set("weapon_prop", 0);
target->reset_action();
target->start_busy( (int)me->query_skill("duanyun-fu") / 20 );
limbs=target->query("limbs");
me->start_busy(1);
msg += "���$p���������������˸����ֲ�����\n" NOR;
size=(int)(me->query_skill("duanyun-fu")/10);
damage=random(size)+size;
damage=damage+me->query_str()/3+random(me->query_temp("apply/damage"));
for(i=0;i<=random(size);i++)
{
msg =HIB"���͡�����Ƭ����$p"+limbs[random(sizeof(limbs))]+"��\n"NOR;
message_combatd(msg,me,target);
target->receive_damage("qi",damage,me);
target->receive_wound("qi",damage/3,me);
}
COMBAT_D->report_status(target);
} else {
msg += "����$p��æ���Լ��ı�����������û����$P�ļ�ı�óѡ�\n" NOR;
}
return 1;
}
return notify_fail(target->name() + "Ŀǰ�ǿ��֣�������ʲô��\n");
}
示例12: cast
int cast(object me, object target)
{
int success_adj, damage_adj;
success_adj = 180;
damage_adj = 170;
if (!target) target = offensive_target(me);
if (me->query("family/family_name")!="火云洞")
return notify_fail("“三味真火”只有火云洞门人才可以用!\n");
if (!target
|| !target->is_character()
|| target->is_corpse()
|| target==me)
return notify_fail("你要对谁喷三味真火?\n");
if ((int)me->query_skill("pingtian-dafa", 1) < 30)
return notify_fail("你的平天大法火候不够,哪里喷得出真火!\n");
if ((int)me->query("mana") < 25+(int)me->query("mana_factor"))
return notify_fail("你的法力不够,喷出的真火恐怕没有什么用!\n");
if ((int)me->query("force") < 100)
return notify_fail("你的内力不够,无法将真火喷出。\n");
if ((int)me->query("sen") < 10)
return notify_fail("你现在神智不清,别把自己烧伤了!\n");
me->add("mana", -25-2*(int)me->query("mana_factor"));
me->receive_damage("sen", 50);
if (random(me->query("max_mana")) < 50) {
message_vision(HIM"$N口中念念有词。。。但什么也没有发生!\n"NOR,me);
return 1;
}
me->receive_wound("kee", 10);
msg = HIC "$N伸手在鼻子上砸了两,顿时鲜血直冒,突然红橙黄三道火焰呼!地一声向$n卷去!\n" NOR;
message_vision(msg, me, target);
ap = (int)me->query_skill("spells");
ap = ap * ap / 1000 * ap;
ap = ap * (1 + (int)me->query("combat_exp")/5000000);
ap = ap + (int)me->query("combat_exp");
ap = ap/100*180;
dp = (int)target->query("combat_exp");
if (random(ap+dp) < dp) {
msg = HIC"\n结果被$n躲开了。\n"NOR;
message_vision(msg, me, target);
}
else {
a_damage = me->query("mana")/40;
d_damage = target->query("mana")/40;
a_damage += random(me->query("eff_sen")/20);
d_damage += random(target->query("eff_sen")/20);
a_damage += me->query("mana_factor")*170/100;
d_damage += random(target->query("mana_factor")*170/100);
if (a_damage > d_damage) {
damage = a_damage - d_damage;
damage += me->query("mana_factor")*170/100;
damage = damage*170/100;
damage_bonus = (int)me->query_skill("spells")/200;
if (damage_bonus > 3) damage_bonus = 3;
damage += damage*damage_bonus;
if (damage > 3000) damage = 3000;
msg = HIC "结果$n被烧得焦头烂额!\n" NOR;
message_vision(msg, me, target);
target->receive_damage("kee", damage*3/5, me);
target->receive_wound("kee", damage/2, me);
COMBAT_D->report_status(target);
} else if (a_damage < d_damage) {
msg = HIC "结果火焰被$n以法力一逼,反向$N回卷而去!\n" NOR;
message_vision(msg, me, target);
damage = d_damage;
if (damage > 400) damage = 400;
damage -= target->query("mana_factor");
damage = damage*170/100;
damage_bonus = (int)me->query_skill("spells")/200;
if (damage_bonus < 1) damage_bonus = 1;
if (damage_bonus > 10) damage_bonus = 10;
damage += damage/damage_bonus;
msg = HIR "\n结果$n躲避不及,被烧得焦头烂额!\n" NOR;
message_vision(msg, me, target);
me->receive_damage("kee", damage*3/5, target);
me->receive_wound("kee", damage/2, target);
COMBAT_D->report_status(me);
} else
message_vision(HIB "结果正好被$N以法力逼住,谁也没有吃亏。\n" NOR, target);
}
me->start_busy(1+random(2));
//.........这里部分代码省略.........
示例13: main
//inherit F_YAO;
int main(object me, string arg)
{
object ob;
object ob1, ob2,ob3,ob4,ob5,ob6;
int lv;
lv=me->query_skill("medical",1);
seteuid(getuid());
if( me->is_busy() )
return notify_fail("你正忙着呢。\n");
if( !arg )
return notify_fail("你要制什么药?\n");
if( me->is_fighting() )
return notify_fail("你正在战斗,制什么药啊?\n");
if(me->query("sen")<=50)
return notify_fail("你现在太累了,休息休息吧!\n");
if(me->query("force")<50)
return notify_fail("你的真气不够,不能做什么了。\n");
if( me->is_busy() || me->query_temp("pending/exercising"))
return notify_fail("你正忙着呢,没时间制药。\n");
//制作的药品
switch (arg)
{
case "jinchuang":
ob1 = present("hong hua", me) ;
ob2 = present("tian qi", me) ;
if (!ob1 || !ob2)
return notify_fail("你的药材不齐全。\n");
if( lv < 20 )
return notify_fail("你的医术不足制出金疮药。\n");
ob1->set("done", 1);
ob2->set("done", 1);
done(me);
ob=new("/obj/jineng/obj2/jinchuang.c");
ob->move(me);
me->add("sen",-20);
me->add("force",-50);
me->start_busy(1);
break;
case "hunyuandan":
ob1 = present("hu gu", me) ;
ob2 = present("du huo", me) ;
if (!ob1 || !ob2)
return notify_fail("你的药材不齐全。\n");
if( lv < 25 )
return notify_fail("你的医术不足制出混元丹。\n");
ob1->set("done", 1);
ob2->set("done", 1);
done(me);
ob=new("/obj/jineng/obj2/hunyuandan.c");
ob->move(me);
me->add("sen",-20);
me->add("force",-50);
me->start_busy(1);
break;
default: notify_fail("你没有能力制这种药。\n");
}
return 1;
}
示例14: main
int main(object me, string arg)
{
string skill, teacher, master;
object ob;
int master_skill, my_skill, sen_cost;
int time, upper, sen1;
int amount, qskill, qlearned, i;
if(!arg) return notify_fail
("指令格式:learn <技能> from <某人> for <次数>\n");
if(sscanf(arg, "%s for %d", arg, time)!=2 )
time=1;
if(time<1) time=1;
if(time>50) time=50;
if(!arg || sscanf(arg, "%s from %s", skill, teacher)!=2 )
return notify_fail
("指令格式:learn <技能> from <某人> for <次数>\n");
if( me->is_fighting() )
return notify_fail("临阵磨枪?来不及啦。\n");
if(me->is_busy())
return notify_fail("你正忙着呢。\n");
if( !(ob = present(teacher, environment(me))) || !ob->is_character())
return notify_fail("你要向谁求教?\n");
if( !living(ob) )
return notify_fail("嗯...你得先把" + ob->name() + "弄醒再说。\n");
if( !me->is_apprentice_of(ob) && getuid(ob)!=me->query("couple/id")
) {
// && getuid(ob)!=me->query("bonze/dadangid") ) {
notify_fail( ob ->name() + reject_msg[random(sizeof(reject_msg))] );
if( (string)me->query("family/family_name") !=
(string)ob->query("family/family_name")
|| (int)ob->query("family/privs") != -1 ) {
if( !(ob->recognize_apprentice(me)) ) return 0;
} else return 0; // mon add this return 0. 5/6/98
}
if (getuid(ob) == me->query("couple/id") && !userp(ob) )
return notify_fail("你这个家伙,想干什么?\n");
if( ob->is_fighting())
return notify_fail("你的师傅暂时没空指点你武功。\n");
if( !master_skill = ob->query_skill(skill, 1) )
return notify_fail("这项技能你恐怕必须找别人学了。\n");
notify_fail(ob->name() + "不愿意教你这项技能。\n");
if( ob->prevent_learn(me, skill) )
return 0;
my_skill = me->query_skill(skill, 1);
if( my_skill < 1&& userp(ob) )
return notify_fail("你还是先把基础打好再说吧!\n");// xintai 2/5/01
notify_fail("依你目前的能力,没有办法学习这种技能。\n");
if( !SKILL_D(skill)->valid_learn(me) ) return 0;
sen_cost = 300 / (int)me->query_int();
if( !my_skill ) {
sen_cost *= 2;
me->set_skill(skill,0);
}
upper= (int)me->query("potential")-(int)me->query("learned_points");
if(time>upper) time=upper;
if(upper<=0)
return notify_fail("你的潜能已经发挥到极限了,没有办法再成长了。\n");
qskill=me->query_skills()[skill]+1;
qskill*=qskill;
qlearned=me->query_learned()[skill];
amount = qlearned;
// for those level higher than master's
if( amount > qskill ) {
for(i=0; i<time; i++)
amount += random(me->query_int())+1;
}
else {
for(i=0; i<time; i++) {
amount += random(me->query_int())+1;
if( amount > qskill ) {i++;break;}
}
}
amount -= qlearned;
time = i;
//.........这里部分代码省略.........
示例15: remove_effect
void remove_effect(object me, object weapon, int sword, int force)
{
me->delete_temp("wudang/raozhi");
me->add_temp("apply/attack", -sword);
weapon->add("rigidity", -force);
}