wandu2.c

来自「C实现的MUD,对大家基本入门网络游戏很有帮助!」· C语言 代码 · 共 110 行

C
110
字号
// by victoriinherit NPC;#include <ansi.h>void create(){        set_name("人面蜘蛛",({"zhi zhu"}));        set("race", "野兽");        set("long", "一只面盆大小,长着人样脑袋的大蜘蛛。\n");        set("age", 10000);        set("attitude", "peaceful");        set("max_jing", 1500);        set("max_qi", 1500);        set("str", 40);        set("con", 50);        set("limbs", ({ "头部", "身体", "长腿" }) );        set("verbs", ({ "bite" }) );        set_temp("apply/attack", 200);        set_temp("apply/defense", 200);        set_temp("apply/armor", 200);       set_skill("unarmed",180);       set_skill("parry",180);       set_skill("dodge",180);       set_skill("force",180);        set("combat_exp", 500000);         set_weight(500000);        setup();}void init(){        object me;        add_action("do_xun", "xun");//       object me,ob;//        ::init();        if (interactive(me = this_player()))        {               remove_call_out("kill_ob");              call_out("kill_ob", 1, me);        }        ::init();}int do_xun(string arg){        object me,who;        me =this_object();        who=this_player();        if (!arg || (arg != "zhi zhu"))                return notify_fail("你要驯服什么?\n");        if(me->is_fighting())                return notify_fail("这只蜘蛛正在战斗。\n");        if((string)who->query("family/family_name")!="五毒教")                return notify_fail("什么?\n");                message_vision("$N对$n一阵怪啸:大胆,还不驯服更待何时?\n\n", who,me);        message_vision("$N勃然大怒道:咱们谁驯谁还不一定哪。\n冲上来和$n扭打到一起。\n",me,who);        me->kill_ob(who);        who->kill_ob(me);        COMBAT_D->do_attack(me, who, query_temp("weapon"));        me->set("owner",who->query("id"));        return 1;}void die(){        string owner,name;        object owner_ob;                   object ob;        owner = query("owner");        if(owner) owner_ob= find_player(owner);        if(owner_ob &&  (object)query_temp("last_damage_from") == owner_ob ) {                message_vision("$N趴在地上,一动也不敢动了。\n",this_object());        ob=new(__DIR__"zhizhu3.c");        ob->move(environment(owner_ob));        ob->set_leader(owner_ob);       ob->set("host_id",owner_ob->query("id"));       name=this_object()->query("name");       ob->set_name(name,({"zhi zhu"}));        destruct(this_object());        return;        }       else {            message_vision("$N倒在地上,死了!\n", this_object());            ob=new(__DIR__"obj/zhizhudu.c");              ob->move(environment(this_object()));              destruct(this_object());       }//    return 1;//      ::die();}int hit_ob(object me, object ob, int damage){       if ((string)ob->query("family/family_name") != "五毒教") {                ob->apply_condition("zhizhu_poison", 20              +(int)ob->query_condition("zhizhu_poison") );              tell_object(ob, HIG "你觉得被咬中的地方一阵麻木!\n" NOR );        }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?