lev7.c
来自「C实现的MUD,对大家基本入门网络游戏很有帮助!」· C语言 代码 · 共 142 行
C
142 行
#include <ansi.h>inherit NPC;string *order = ({""HIY"", ""HIG"", ""RED"", ""MAG"", ""YEL"", ""HIC"", ""HIW"", ""HIR"",""HIB"", ""CYN"",""WHT"",""HIM"",""BLU""});void create(){ mapping npc,mp,j; int i,k,a,b,c,d,e,f,temp; set_name(order[random(13)]+"雷鸟"NOR, ({ "thunderbird"})); set("magicgift",3); set("magicset",1); set("zhuanbest",1); set("long","一只可怕的雷鸟。\n"); set("attitude", "aggressive"); set("vendetta/authority",1); set("max_qi",500+random(500)); set("combat_exp",20000000+random(8000000)); set_skill("spells",300+random(200)); set_skill("force",400+random(200)); set_skill("unarmed",400+random(200)); set_skill("sword",400+random(200)); set_skill("club",400+random(200)); set_skill("whip",400+random(200)); set_skill("throwing",400+random(200)); set_skill("parry",400+random(200)); set_skill("magic-unarmed", 400+random(200)); set_skill("magic-sword", 400+random(200)); set_skill("magic-fire", 400+random(200)); set_skill("magic-water", 400+random(200)); set_skill("magic-ice", 400+random(200)); map_skill("sword", "magic-sword"); map_skill("unarmed", "magic-unarmed"); map_skill("parry", "magic-unarmed");map_skill("spells", "magic-ice"); set("no_get",1);b=4500+random(5000);a=5500+random(5000);d=30+random(60);set("str",d);set("dex",30+d);set("int",d);set("con",d);set("per",d);set("kar",d); set("jing",b); set("max_jing",b);set("eff_jing",b); set("qi",a); set("max_qi",a);set("eff_qi",a); set("neili",a); set("max_neili",a); set("age", 15); set("shen_type", -1); set("intellgent",1); set("pursuer",1); set_temp("apply/attack",150); set_temp("apply/defense",150); set_temp("apply/armor",500); set_temp("apply/damage",400); set("chat_chance_combat", 50); set("chat_msg_combat", ({ (: perform_action, "spells.lightningball" :), (: perform_action, "spells.implosion" :), }) ); set("chat_chance", 5); set("chat_msg", ({ (: random_move :), }) ); setup();//carry_object(__DIR__"obj/sword")->wield();carry_object(__DIR__"obj/cloth")->wear();}void init( ){ object ob; remove_call_out("hunting"); if( interactive(ob = this_player()) ) {ob->start_busy(1); call_out("hunting",0); } if(!environment()->query("no_fight")) call_out("hunting",0);}void hunting(){ int i; object *ob; ob = all_inventory(environment()); for(i=sizeof(ob)-1; i>=0; i--) { if( !ob[i]->is_character() || ob[i]==this_object() || !living(ob[i])) continue; if(ob[i]->query("vendetta/authority")) continue; kill_ob(ob[i]); ob[i]->fight(this_object()); }}void die(){ object ob, me, corpse; ob = this_object(); me = query_temp("last_damage_from");if (!me) return; me->add("score",1); message_vision(RED"$N,倒地而亡,不动弹了。\n"NOR,ob,me); if((int)me->query("combat_exp") < ob->query("combat_exp")) { message("vision", me->name() + HIG"成功消灭"+ob->query("name")+",增加了160经验和80潜能。\n"NOR, me); me->add("combat_exp",160); me->add("potential",80); me->add("score",1); destruct(ob); } destruct(ob); return;}int hit_ob(object me, object ob, int damage){string msg; if(random((int)me->query("combat_exp")) > ob->query("combat_exp")/2) { ob->add("jing",-ob->query("jing")/30); ob->add("eff_jing",-ob->query("eff_jing")/30); msg = HIC"$N"HIC"全身发光!!一道闪电打在了$n"HIC"身上!\n"NOR; message_vision(msg, me, ob);}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?