|
- // force.c
- inherit SKILL;
- mixed hit_ob(object me, object victim, int damage_bonus, int factor)
- {
- int damage;
- int my_max_nl,victim_max_nl;
-
- me->add("neili", - factor );
- if (me->query("neili") < me->query("max_neili") * 2)
- my_max_nl = me->query("neili");
- else
- my_max_nl = me->query("max_neili") * 2;
- if (victim->query("neili") < victim->query("max_neili") * 2)
- victim_max_nl = victim->query("neili");
- else
- victim_max_nl = victim->query("max_neili") * 2;
-
- damage = my_max_nl/20 + factor
- - victim_max_nl/25;
-
- if( damage < 0 ) {
- // 自己内力不如敌人时被反震
- if( !me->query_temp("weapon") //为什么还要考虑自己是否带武器呢?
- && random(victim->query_skill("force")) > me->query_skill("force")/2 ) {
- damage = - damage;
- me->receive_damage( "qi", damage * 2 );
- me->receive_wound( "qi", damage );
- if( damage < 10 ) return "$N受到$n的内力反震,闷哼一声。\n";
- else if( damage < 20 ) return "$N被$n以内力反震,「嘿」地一声退了两步。\n";
- else if( damage < 40 ) return "$N被$N以内力一震,胸口有如受到一记重锤,连退了五六步!\n";
- else return "$N被$n的内力一震,眼前一黑,身子向后飞出丈许!!\n";
- }
- if( damage_bonus + damage < 0 ) return - damage_bonus;
- return damage;
- }
-
- damage -= victim->query_temp("apply/armor_vs_force");
- if( damage_bonus + damage < 0 ) return - damage_bonus;
- // 执行到这里 damage 通常大于0,damage_bonus + damage < 0 会成立吗??
- if( random(me->query_skill("force")) < damage )
- return damage;
- //假定通常情况下,me->query_skill("force")=600 ,damage = 100
- //这个判断很难成立,因此大多数情况,函数没有返回值
- }
复制代码
[ Last edited by notme on 2004-4-28 at 09:58 PM ] |
|