怪脱战不完全的bug,
mud吧
全部回复
仅看楼主
level 2
眉烟如黛 楼主
if ( me->move(obj) )
{
me->remove_all_enemy(flag);
if ( !playerp(me) && objectp(follow_ob=me->query_leader()) )
{
if ( me->is_killing(follow_ob) )
me->kill_ob(follow_ob);
if ( playerp(follow_ob) &&
(me->query("is_boss") || me->query("end_boss")) )
me->fight_ob(follow_ob);
}
if ( !(wizardp(me) && me->query("env/invisibility") == 10) )
{
if ( me->query_condition("killer") ) min = HIR"【杀人通缉犯】"NOR + min;
message( "go", min, environment(me), ({me}) );
}
me->set_temp("pending", 0);
me->delete_temp("pended");
if ( me->query("jing") > me->query("max_jing") )
me->set("jing",me->query("max_jing"));
all_inventory(env)->follow_me(me, arg);
return 1;
}
return 0;
}
其中已经找到这段代码的问题 ,
if ( !playerp(me) && objectp(follow_ob=me->query_leader()) )
{
if ( me->is_killing(follow_ob) )
me->kill_ob(follow_ob);
if ( playerp(follow_ob) &&
(me->query("is_boss") || me->query("end_boss")) )
me->fight_ob(follow_ob);
}
但是把这段代码注释掉之后,你在原地不动,如果怪走过来撞你,他显示会想杀死你,但是不会出招。求教学
2015年03月08日 12点03分 1
level 2
眉烟如黛 楼主
feature/attack.c
下面还有这2段代码,感觉貌似没关联不大....还是关联上面发的go.c里面的
if ( (enemy[i]->query("end_boss") || enemy[i]->query("is_boss"))
&& environment()==env ) continue;
// We ask our enemy to stop fight, but not nessessary to confirm
// if the fight is succeffully stopped, bcz the fight will start
// again if our enemy keeping call COMBAT_D->fight() on us.
enemy[i]->remove_enemy(me);
enemy[i] = 0;
// boss无法解除仇恨
if ( !wiz && environment(enemy[i]) == environment() )
{
if ( enemy[i]->query("end_boss") || enemy[i]->query("is_boss") )
{
is_boss = 1;
continue;
}
}
// 解除跟随
if ( enemy[i]->query_leader()==this_object() )
enemy[i]->set_leader(0);
if( enemy[i]->remove_killer(this_object()) )
{
killer -= ({ enemy[i] });
enemy -= ({ enemy[i] });
}
}
if ( !is_boss )
{
killer = ({ });
enemy -= ({ 0 });
}
2015年03月09日 03点03分 3
attack.c 里面 fight_ob() , kill_ob(), 里面没有俩人环境不一样 return 的判断么
2015年03月09日 03点03分
不过,在flight.c和kill.c里面不是有 没有这个人的判定么?
2015年03月09日 03点03分
求教学!~[泪]
2015年03月09日 09点03分
回复
ü������
:fight.c跟kill.c是指令. 但是npc对玩家的自动叫杀是直接调用 kill_ob的, 不走指令
2015年03月10日 07点03分
level 2
眉烟如黛 楼主
void kill_ob(object ob)
{
string uid, mid;
int no_msg;
object me=this_object();
if(!ob || ob==this_object()) return;
if (!living(this_object())) return;
if (environment()->query("no_fight") && !this_object()->query("demogorgon") ) return;
if ( playerp(this_object()) && !playerp(ob) )
{
if ( no_msg=this_object()->query("env/no_combat_msg") )
ob->set("env/no_combat_msg", no_msg);
else
ob->delete("env/no_combat_msg");
}
if ( !playerp(this_object()) && playerp(ob) )
{
if ( no_msg=ob->query("env/no_combat_msg") )
this_object()->set("env/no_combat_msg", no_msg);
else
this_object()->delete("env/no_combat_msg");
}
mid = query("id");
uid = ob->query("id");
if ( playerp(me) && playerp(ob)
&& !me->is_fighting(ob)
&& !ob->is_fightingo(me)
&& base_name(environment())!="/d/wizard/fightroom3" )
{
if (!query_temp("other_kill/"+uid))
{
set_temp("kill_other/"+uid, 1);
ob->set_temp("other_kill/"+mid, 1);
}
else
ob->set_temp("kill_other/"+mid, 1);
}
if( member_array(ob, killer)==-1 )
killer += ({ ob });
if (environment()==environment(ob))
tell_object(ob, HIR "看起来" + this_object()->name() + HIR + "想杀死你!\n" NOR);
fight_ob(ob);
if ( me->query("env/myhp_show") && !me->query("xieyi/zmud") )
tell_object(me, me->my_hp(me, ob));
if ( ob->query("env/myhp_show") && !ob->query("xieyi/zmud") )
tell_object(ob, me->my_hp(ob, me));
}
2015年03月09日 03点03分 4
level 13
// This function starts killing between this_object() and ob
void kill_ob(object ob)
{
object *guarded;
object me;
object env;
object gob;
int i;
me = this_object();
if (! living(me) || ! ob)
return;
env = environment();
if (environment(ob) != env ||
env->query("no_fight"))
return;
fight_ob 类似
2015年03月10日 07点03分 5
加到attack里面么? 貌似连战斗都不会了
2015年03月10日 08点03分
回复
ü������
: 你kill npc, 没战斗描述了?战斗中不?
2015年03月10日 11点03分
hmm....这个怪也是 主动怪,他来回走,也不进战,然后我kill 他,没反映
2015年03月10日 13点03分
没战斗,没描述
2015年03月10日 13点03分
level 10
看看
2015年03月11日 00点03分 6
1