yinyang-shiertian的特殊防御:
int ob_hit(object ob, object me, int damage, object weapon)
{
string result;
int ap, dp;
weapon = me->query_temp("weapon");
ap = ob->query_skill("parry");
dp = me->query_skill("yinyang-shiertian", 1);
if (weapon) return damage;
if (me->query_skill_mapped("parry") != "yinyang-shiertian") return damage;
if( me->is_busy() && random(2)==0) return damage;
if (me->query("zhuanfinal/4") ==1 && random(3)==0)
{
if (me->query("qi") < me->query("max_qi") )
me->add("qi", me->query("max_qi") / 8);
if (me->query("eff_qi",1) < me->query("max_qi",1) )
me->add("eff_qi",me->query("max_qi")/8);
if (me->query("qi") < me->query("max_qi") )
result = HIY"$N使用了妙仙决!!$N全身的伤好了很多!\n"NOR;
}
else
if (me->query("zhuanfinal/5") ==1 && random(3)==0)
{
if (me->is_busy() )
me->start_busy(1);
if (!ob->is_busy() )
ob->start_busy(2);
result = HIY"$N使用了动仙决!!$N突然动作又快了!\n"NOR;
}
else
if (me->query("zhuanfinal/6") ==1 && random(3)==0)
{
if ((int)me->query("neili",1) < (int)me->query("max_neili",1)*2 )
me->add("neili", me->query("max_neili") / 8);
result = HIY"$N使用了银仙决!!$N突然内力恢复了!\n"NOR;
}
if (random(6)==0)
{
if (!ob->is_busy())
ob->start_busy(2);
result = HIW "$n" HIW "面含微笑,轻轻一格,已将天下所有进攻招数全部封死。\n" NOR;
}
else if (random(5)==0)
{
if (me->query("qi") < me->query("max_qi") )
me->add("qi", me->query("max_qi") / 10);
if (me->query("eff_qi",1) < me->query("max_qi",1) )
me->add("eff_qi",me->query("max_qi")/10);
result = HIC "$n" HIC "放声长叹,霎那间,身上的伤"
"在内力的作用下,好了很多。\n" NOR;
}
else if (random(ap * 2 / 3) < dp * 3 / 2 || random(3)==1)
{
// result = ([ "damage": -damage ]);
damage=10;
result = HIW "$n" HIW "一声轻哼,身形微微一动,已"
"飘然远去,使$N" HIW "的进攻全无用处。\n" NOR;
switch (random(4))
{
case 0:
result = HIW "$n" HIW "面含微笑,轻轻一格,已将天"
"下所有进攻招数全部封死。\n" NOR;
break;
case 1:
result = HIW "$n" HIW "眉头微微一皱,动也不动,将"
"$N" HIW "震到一边。\n" NOR;
break;
case 2:
result = HIW "$n" HIW "身形微微一抖,已将$N" HIW
"迫退至丈许开外。\n" NOR;
break;
default:
result = HIW "$n" HIW "一声轻哼,身形微微一动,已"
"飘然远去,使$N" HIW "的进攻全无用处。\n" NOR;
break;
}
}
if (result && ob && me)
message_vision(result,ob,me);
return damage;
}
返回的都是正数的damage,等于特殊防御生效或者失效都会成倍的增加自己受到的伤害呀!
能否改成:
int ob_hit(object ob, object me, int damage, object weapon)
{
string result;
int ap, dp;
weapon = me->query_temp("weapon");
ap = ob->query_skill("parry");
dp = me->query_skill("yinyang-shiertian", 1);
if (weapon) return 0;
if (me->query_skill_mapped("parry") != "yinyang-shiertian") return 0;
if( me->is_busy() && random(2)==0) return 0;
if (me->query("zhuanfinal/4") ==1 && random(3)==0)
{
if (me->query("qi") < me->query("max_qi") )
me->add("qi", me->query("max_qi") / 8);
if (me->query("eff_qi",1) < me->query("max_qi",1) )
me->add("eff_qi",me->query("max_qi")/8);
if (me->query("qi") < me->query("max_qi") )
result = HIY"$N使用了妙仙决!!$N全身的伤好了很多!\n"NOR;
damage = 0;
}
else
if (me->query("zhuanfinal/5") ==1 && random(3)==0)
{
if (me->is_busy() )
me->start_busy(1);
if (!ob->is_busy() )
ob->start_busy(2);
result = HIY"$N使用了动仙决!!$N突然动作又快了!\n"NOR;
damage = 0;
}
else
if (me->query("zhuanfinal/6") ==1 && random(3)==0)
{
if ((int)me->query("neili",1) < (int)me->query("max_neili",1)*2 )
me->add("neili", me->query("max_neili") / 8);
result = HIY"$N使用了银仙决!!$N突然内力恢复了!\n"NOR;
damage = 0;
}
if (random(6)==0)
{
if (!ob->is_busy())
ob->start_busy(2);
result = HIW "$n" HIW "面含微笑,轻轻一格,已将天下所有进攻招数全部封死。\n" NOR;
damage = 0;
}
else if (random(5)==0)
{
if (me->query("qi") < me->query("max_qi") )
me->add("qi", me->query("max_qi") / 10);
if (me->query("eff_qi",1) < me->query("max_qi",1) )
me->add("eff_qi",me->query("max_qi")/10);
result = HIC "$n" HIC "放声长叹,霎那间,身上的伤"
"在内力的作用下,好了很多。\n" NOR;
damage = 0;
}
else if (random(ap * 2 / 3) < dp * 3 / 2 || random(3)==1)
{
// result = ([ "damage": -damage ]);
damage = - (damage - 10);
result = HIW "$n" HIW "一声轻哼,身形微微一动,已"
"飘然远去,使$N" HIW "的进攻全无用处。\n" NOR;
switch (random(4))
{
case 0:
result = HIW "$n" HIW "面含微笑,轻轻一格,已将天"
"下所有进攻招数全部封死。\n" NOR;
break;
case 1:
result = HIW "$n" HIW "眉头微微一皱,动也不动,将"
"$N" HIW "震到一边。\n" NOR;
break;
case 2:
result = HIW "$n" HIW "身形微微一抖,已将$N" HIW
"迫退至丈许开外。\n" NOR;
break;
default:
result = HIW "$n" HIW "一声轻哼,身形微微一动,已"
"飘然远去,使$N" HIW "的进攻全无用处。\n" NOR;
break;
}
}
if (result && ob && me)
message_vision(result,ob,me);
return damage;
}
|