int do_approve (string arg) { object who; object me = this_player(); object where = this_object (); if (! arg) return notify_fail ("批准谁?\n"); who = present (arg); if (who == me) return notify_fail ("批准您自己?\n"); tell_object (me,"您批准"+who->query("name")+"进入西游记世界!\n"); tell_object (who,"欢迎您进入西游记世界!\n"); who->set("banned_approved",1); who->set("startroom","/d/city/kezhan"); who->move("/d/city/kezhan"); who->save(); return 1; }
int do_pass(string arg) { object ob; if (!arg || !(ob = present(arg, this_player()))) return notify_fail("你要送什么?\n"); if (ob->query_weight() > 5000) return notify_fail(ob->query("name")+"太大了,不能从窗口里塞进去。\n"); if (ob->query("id") == "huashi fen" || ob->query("id") == "tie he" || ob->is_container() || ob->query("hsf")) return notify_fail("这个东西放不进去。\n"); message_vision("$N把一"+ob->query("unit")+"$n从窗口塞了进去。\n", this_player(), ob); ob->move("/d/city/dalao"); message("vision", this_player()->name()+"从窗外塞进来一" +ob->query("unit")+ob->query("name")+"。\n",environment(ob), ob); return 1; }
int exert_function(object me, string arg) { string func, target, file; object target_ob; if( sscanf(arg, "%s %s", func, target)==2 ) { target_ob = present(target, environment(me)); if( !target_ob ) return notify_fail("这里没有 " + target + "。\n"); } else { func = arg; target_ob = me; } if( !stringp(file = (string)this_object()->exert_function_file(func)) || file_size(file + ".c") <= 0 ) return 0; return (int)call_other( file, "exert", me, target_ob); }
int valid_leave(object me, string dir) { object guarder; if (! objectp(guarder = present("men wei", this_object()))) return 1; if (dir == "east") return guarder->permit_pass(me, dir); if (dir == "west" // && (int)me->query("combat_exp") < 600 && count_lt(me->query("combat_exp"), 600) && guarder) return notify_fail(CYN "门卫拦住你道:你经验太低,会被" "毒蛇咬死,还是不要乱闯的好。\n" NOR); return 1; }
int main(object me, string arg) { object ob, *inv; int i; if( !arg ) return notify_fail("你要脱掉什麽?\n"); if(arg=="all") { inv = all_inventory(me); for(i=0; i<sizeof(inv); i++) do_remove(me, inv[i]); write("Ok.\n"); return 1; } if( !objectp(ob = present(arg, me)) ) return notify_fail("你身上没有这样东西。\n"); return do_remove(me, ob); }
int main(object me, string str) { object ob; string file; mapping ol; string item; string *items; string nitem; string msg; if (! SECURITY_D->valid_grant(me, "(admin)")) return 0; if (! str) ob = me; else { ob = present(str, environment(me)); if (! ob) ob = find_player(str); if (! ob) ob = find_living(str); if (! ob) return notify_fail("你要查看谁的召唤列表?\n"); } // 获取可召唤物品列表 if (! mapp(ol = ob->query("can_summon")) || sizeof(ol) < 1) return notify_fail("你现在还没有可以召唤的物品。\n"); msg = ob->query("name") + "(" + ob->query("id") + ")可以召唤的物品有:\n\n"; items = keys(ol); foreach (item in items) { file = (string) ol[item]; if (file_size(file + ".c") < 0 && file_size(file) < 0) nitem = HIR"<不存在的武器ID,请与巫师联系>"NOR; else { call_other(file, "???"); if (objectp(ob = find_object(file))) nitem = ob->name(); } msg += sprintf(WHT "%-14s %-14s\n", item, nitem); }
int valid_leave (object me, string dir) { object madao; madao = present("ma dao",environment(me)); if (madao && living(madao) && (string)me->query("family/family_name")!="五庄观" && (me->query_temp("has_paid") <= 0) && (me->query("obstacle/number") < 2) && dir == "northwest") { if (random(3) == 0) message_vision ("$N恶狠狠地劈胸一把揪住$n:往哪儿跑!给钱!\n",madao,me); return notify_fail("马盗喊叫着:不给钱我要杀人啦!\n"); } if (me->query_temp("has_paid") > 0) me->set_temp("has_paid",me->query_temp("has_paid")-1); return 1; }
int do_kill(string arg) { object ob, me=this_player(); if ( arg == "daoxiang chanshi" || arg == "daoxiang" || arg == "chanshi" ) { if ( !ob=present(arg, environment(me)) ) return 0; message_vision("$N对著$n喝道:「死秃驴!今日不是你死就是我活!」\n", me, ob); me->kill_ob(ob); message_vision("$N一声冷笑,伸手在墙上一按,地上突然裂开一个大洞,$n意料之余跌了下去!\n", ob, me); me->move("/d/shaolin/jianyu.c"); tell_object(me,"你跌入陷阱,直落到少林寺的监狱里!\n"); return 1; } return 0; }
int main(object me, string arg) { object ob; int cost, i = 0; seteuid(getuid()); if ( !arg ) return notify_fail("你要让什么野兽停止咬人?\n"); if( !objectp(ob = present(arg, environment(me)) )) return notify_fail("这里没有这个野兽吧?\n"); if( ob->query_temp("owner") != me->query("id") ) return notify_fail("你不是它的主人,它根本不理你!\n"); if( ob->is_busy() ) return notify_fail(ob->name() + "正在忙乎,没空理你!\n"); message_vision("只见$N冲着$n口中一声呼哨,$n向后一窜,不咬了!\n\n",me,ob); ob->remove_all_enemy(); return 1; }
int valid_leave(object obj, string dir){ object gov; if(dir == "east"){ if (REWARD_D->riddle_check( obj, "纵横天下")){ message_vision("$N推门向东离去。\n", obj); return 1; }else { if(gov = present("master yin", this_object())){ message_vision("$N道:“那是本官书库,闲杂人等莫入。”\n", gov); return notify_fail(""); } else { message_vision("$N推门向东离去。\n", obj); return 1; } } } return :: valid_leave(obj, dir); }
int main(object me, string arg) { object obj; string *killer, callname; seteuid(getuid()); if( environment(me)->query("no_fight") ) return notify_fail("这里不准战斗。\n"); if( !arg ) return notify_fail("你想杀谁?\n"); if(!objectp(obj = present(arg, environment(me)))) return notify_fail("这里没有这个人。\n"); if( !obj->is_character() || obj->is_corpse() ) return notify_fail("看清楚一点,那并不是活物。\n"); if(obj==me) return notify_fail("用 suicide 指令会比较快:P。\n"); callname = RANK_D->query_rude(obj); // if( userp(obj) && // (int) obj->query("combat_exp") < LOWER_LIMIT && // !me->query("licensed_to_kill") // ) // return notify_fail("唉!你可不可以改掉以强凌弱的恶习?\n"); if( userp(obj)) log_file( "KILL_LOG", sprintf("(%s) %s tried to kill %s\n", ctime(time()), me->query("name"), obj->query("name"))); message_vision("\n$N对著$n喝道:「" + callname + "!今日不是你死就是我活!」\n\n", me, obj); me->kill_ob(obj); if( !userp(obj) ) obj->kill_ob(me); else { obj->fight_ob(me); tell_object(obj, HIR "如果你要和" + me->name() + "性命相搏,请你也对这个人下一次 kill 指令。\n" NOR); } return 1; }
void CanvasContext::strokeText(const std::string &text, float x, float y) { prepare(); gl::SaveColorState saveColor; gl::color(state->strokeStyle.r, state->strokeStyle.g, state->strokeStyle.b, state->strokeStyle.a * state->globalAlpha); if (state->textAlign == TextAlign::kTextAlignLeft) { gl::drawString(text, Vec2f(x, y), state->strokeStyle, state->font); } else if (state->textAlign == TextAlign::kTextAlignCenter) { gl::drawStringCentered(text, Vec2f(x, y), state->strokeStyle, state->font); } else if (state->textAlign == TextAlign::kTextAlignRight) { gl::drawStringRight(text, Vec2f(x, y), state->strokeStyle, state->font); } present(); }
void reset() { object river,stone,*inv; ::reset(); river = present("山壁", this_object()); if (!river) return; inv = all_inventory(river); if (sizeof(inv) < 1 && !query("get")) { set("get",1); // stone = new(__DIR__"obj/sachet"); // if(stone) // stone->move(river); } return; }
int valid_leave(object who , string dir) { object room, guo; if (dir == "east") { room = find_object(__DIR__"sl-end"); if (room && room->usr_in()) return notify_fail("殿中似乎有人正在争斗,且静观其变。\n"); if (REWARD_D->riddle_check(who,"勇入少林")<2 && !REWARD_D->check_m_success(who,"勇入少林")) return notify_fail("你为殿中佛号所震,竟然迈不开脚步。\n"); if (room) { if (guo = present("afei",room)) destruct(guo); room->reset(); } } return ::valid_leave(who,dir); }
void greeting(object me) { object basket,food; if(!me->query("food_carrier")) return ; if(me->query("food_carrier")+60>time()) { message_vision(CYN"�����������һ�ۣ�˵��������ʹ������Ҫ�ٵ�һ�� \n"NOR,me); remove_call_out("make_food"); call_out("make_food",60+me->query("food_carrier")-time(),me); return ; } message_vision(CYN "��ϵ����ȥ��߶Ȱ����IJ˶���ɹ���� \n"NOR,me); basket=present("bamboo basket",this_object()); if(!basket) { basket=new(__DIR__"obj/zhulan"); basket->move(this_object()); }
string lishi_kill(object feng) { int i; object *enemy; object lishi; seteuid(getuid()); lishi = present("li shi",environment()); if (!objectp(lishi)) return ""; message_vision("$N´óºÈ£º¡°Éñ¸«Á¦Ê¿ºÎÔÚ£¡¡±\n", this_object() ); enemy = feng->query_enemy(); i = sizeof(enemy); while(i--) { if( enemy[i] && living(enemy[i]) ) { lishi->kill_ob(enemy[i]); enemy[i]->kill_ob(lishi); } } }
int do_catch(string arg) { object rabbit, me, room; me = this_player(); if(!arg || arg != "野兔" && arg != "rabbit" ) return 0; rabbit = present("rabbit", this_object()); if(!objectp(rabbit)) return 0; switch ( random (7)) { case 0: message_vision("$N向前一扑!野兔往後一跳,$N落了个空。 \n", me); break; case 1: message_vision("$N向右一扑!野兔向左一闪,$N落了个空。 \n", me); break; case 2: message_vision("$N向左一扑 , 野兔向右一闪,$N落了个空。\n", me); break; case 3: message_vision("$N左扑右挡紧紧地跟着野兔,深怕一转眼就不见了...\n", me); break; case 4: message_vision("$N合身扑上 , 野兔向旁边一窜躲开了你,$N收势不住摔了个嘴啃泥。 \n", me); break; case 5: message_vision("$N蹑手蹑脚地朝野兔摸过去,想从后面抓住它,野兔机灵地向前一冲,$N没成功。\n", me); break; case 6: message_vision("$N往前一扑 , 野兔向前一冲 , 从$N的胯下飞快的钻了过去。 \n", me); message_vision("$N调头便向野兔逃跑的方向追去.... \n", me); message_vision("\n野兔三转两转,倏地一下不见了踪影。\n\n", me); message("vision", me->name() + "紧紧跟着野兔倏地一下也不见了踪影。\n", environment(me), me); room = find_object(__DIR__"fenghuo"); if(!objectp(room)) room=load_object(__DIR__"fenghuo"); me->move(room); destruct(rabbit); break; } return 1; }
int cmd_polymorph(string str) { object tp = this_player(); object env = environment(tp); object tgt; object *allowed; int cost, allow; if (!spell()) return 0; if (str) tgt = present(str, env); else tgt = tp->query_current_attacker(); if (!can_cast(tp, tgt)) return 0; cost = tp->query_skill("wizardry")/5 + random(tp->query_stats("wisdom")/2); if (tp->query_mp() < cost) FAIL("Your magic is too low."); allowed = tgt->query_allow("polymorph"); if (member_array(tp->query_name(), allowed) != -1) allow = 1; if (!allow && tp != tgt && (tgt->query_skill("magic defense") > tp->query_skill("conjuring") || tgt->query_stats("wisdom")*3/2 > tp->query_stats("wisdom"))) FAIL("Your magic bounces off of "+tgt->query_cap_name()+"!"); message("magic", COL+"You move your hands in an "+intricate+COL+" pattern, " "and suddenly a cloud of "+COL2+"smoke"+COL+" appears around "+ tgt->query_cap_name()+" then fades away!"+RES, tp); message("magic", COL+tp->query_cap_name()+" moves "+tp->query_possessive()+ "hands in an "+intricate+COL+" pattern, " "and suddenly a cloud of "+COL2+"smoke"+COL+" appears around " "you then fades away!\n\n"+COL2 "You feel an overwhelming urge to cluck... like a chicken."+RES, tgt); message("magic", COL+tp->query_cap_name()+" moves "+tp->query_possessive()+ "hands in an "+intricate+COL+" pattern, " "and suddenly a cloud of "+COL2+"smoke"+COL+" appears around "+ tgt->query_cap_name()+" then fades away!"+RES, env, ({ tp, tgt }) );
int cmd_taunt(string str) { object tp=this_player(); object ob, tauntob; int chr, level, wis; if (!abil()) return 0; if (tp->query_disable()) return 1; if (sizeof(tp->query_attackers())) BAIL("You can't do that while fighting!\n"); if (!ob=present(str,environment(tp))) BAIL("You don't see that here.\n"); if (tp==ob) BAIL("Neener neener neener.\n"); if (!(tp->kill_ob(ob) || ob->kill_ob(tp))) BAIL("You can't start fighting with that.\n"); chr=tp->query_stats("charisma"); level=tp->query_level(); wis=ob->query_stats("wisdom"); if (tp->query_sp() < 50) BAIL("You're too tired to do that right now.\n"); ob->add_skill_bonus("defense",-(chr*2/3+level-wis*2/3),level*4/3); ob->add_skill_bonus("attack",(chr*2/3+level)/2,level*4/3); tauntob=new(PLACE"tauntob"); tauntob->move(ob); tauntob->set_owner(tp); tauntob->heart_beat(); tp->set_disable(2); tp->add_sp(-(chr/3+wis/3+level/3)); message("info","You run around "+ob->query_cap_name()+", shouting and making obscene gestures!",tp); message("info",tp->query_cap_name()+" runs around you, shouting and making obscene gestures.\n" "%^RED%^You feel the need to hurt "+tp->query_objective()+" badly!%^RESET%^",ob); message("info",tp->query_cap_name()+" runs around "+ob->query_cap_name()+", shouting and making obscene " "gestures!", environment(tp), ({tp, ob}));
int main(object me, string arg) { object victim; string comm; if (!arg) return notify_fail("你要让谁跟着你走?\n"); if ( arg == me->query("id") ) return notify_fail("你要自己跟着自己,疯啦?\n"); victim = present(arg, environment(me)); if (!victim) return notify_fail("这里并无此人!\n"); if (!living(victim)) return notify_fail("这不是活物!\n"); if (victim->query("no_get", 1)) return notify_fail("这个人领不走!\n"); if ( !me->query("env/invisibility") ){ if ( !userp(victim) && victim->query("sjsz/team_name") && victim->query("sjsz/team_name") == me->query("sjsz/team_name") ){ message_vision("\n$N对著$n说道:跟着我走吧,我带你去个地方。\n",me, victim); message_vision("$N看了看$n,痛快地说道:好吧!\n\n",victim, me, ); victim->set_leader(me); return 1; } if( victim->query_condition("xs_necromancy") < 0 || !victim->query_temp("block_msg/all", 1) || (me->query("id") != victim->query("xueshan/necromancy_singer")) ) { // if ( !victim->query_temp("cursed", 1) || !victim->query_temp("block_msg/all", 1)){ message_vision("\n$N对著$n说道:跟着我走吧,我带你去个地方。\n\n",me, victim); tell_object(victim, YEL "如果你愿意跟着" + me->query("name") +"走,请你键入 follow " + me->query("id") +"的指令。\n" NOR); write(YEL "你必须等对方同意才能领着对方走。\n" NOR); return 1; } if (me->query_skill("necromancy", 1) < 45) return notify_fail("你的降伏法火候不够!\n"); message_vision(HIR "$N诡笑中伸手向$n一招。\n" NOR, me, victim); tell_object(victim,"你迷迷糊糊中觉得"+me->name()+"是你的主人,须得跟随他!\n"); victim->set_leader(me); return 1; }
int main(object me, string arg) { object ob; mapping my; seteuid(getuid(me)); if(!arg) ob = me; else if (wizardp(me)) { ob = present(arg, environment(me)); if (!ob) ob = find_player(arg); if (!ob) ob = find_living(arg); if (!ob) return notify_fail("你要察看谁的状态?\n"); } else return notify_fail("只有巫师能察看别人的状态。\n"); my = ob->query_entire_dbase(); printf(" 精: %s%4d/ %4d %s(%3d%%)" NOR " 精力: %s%4d / %4d (+%d)\n" NOR, status_color(my["jing"], my["eff_jing"]), my["jing"], my["eff_jing"], status_color(my["eff_jing"], my["max_jing"]), my["eff_jing"] * 100 / my["max_jing"], status_color(my["jingli"], my["max_jingli"]), my["jingli"], my["max_jingli"], my["jiajin"] ); printf(" 气: %s%4d/ %4d %s(%3d%%)" NOR " 内力: %s%4d / %4d (+%d)\n" NOR, status_color(my["qi"], my["eff_qi"]), my["qi"], my["eff_qi"], status_color(my["eff_qi"], my["max_qi"]), my["eff_qi"] * 100 / my["max_qi"], status_color(my["neili"], my["max_neili"]), my["neili"], my["max_neili"], my["jiali"] ); printf(" 食物: %s%4d/ %4d " NOR " 潜能: %s%4d / %4d\n" NOR, status_color(my["food"], ob->max_food_capacity()), my["food"], ob->max_food_capacity(), HIY, (int)ob->query("potential"), (int)ob->query("max_potential")); printf(" 饮水: %s%4d/ %4d " NOR " 经验: %s%d\n" NOR, status_color(my["water"], ob->max_water_capacity()), my["water"], ob->max_water_capacity(), HIM, my["combat_exp"] ); return 1; }
int cmd_peek(string targ) { object ob; int money; if (!targ){ write("Who did you want to peek?\n"); return 1; } ob = present(targ, environment(this_player())); if (!ob) { write("There's nothing by that name to peek.\n") ; return 1; } if (TP->query_level() < 5) { write("You are not yet skilled enough to do that!\n"); return 1; } attkr = (object)TP->query_current_attacker(); if (attkr) { write("You are a bit busy at the moment.\n"); return 1; } if(!this_player()->query("vision")) { write("Peek who? You can't see anything!\n"); return 1; } money = ob->query("wealth"); switch (money){ case -10..100 : write ("looks you should give money to him.\n");break; case 101..1000 : write ("looks like they buying the next round of drinks.\n");break; case 1001..10000 : write ("look like thier pockets are full.\n");break; case 10001..100000 : write ("looks like a shitload of cash.\n");break; case 100001..1000000 : write ("looks like they could buy the town.\n");break; case 1000001..10000000 : write ("HOLY SHIT!, thats alot of cash!\n");break; default : write ("looks like a metric butt-load of cash.\n");break; } return 1; }
int heal_him(object me, object target, int level) { int amount; // amount=target->query("max_kee")/10*level; amount=6000; if (!present(target,environment(me))) { tell_object(me,"你要救治的人已经不在这里了。\n"); return notify_fail(""); } if (target!=me) message_vision(HIY"过了不久,$N额头上冒出豆大的汗珠,$n吐出一口瘀血,脸色看起来红润多了。\n"NOR,me,target); else message_vision(HIY"过了不久,$N吐出一口瘀血,脸色看起来红润多了。\n"NOR,me); target->receive_curing("kee", amount); if (target->query("kee")+ amount<target->query("max_kee")) target->add("kee",amount); else target->set("kee",target->query("max_kee")); }
void SendMsgDlg::onRecvMessage(const char *name, time_t when, const char *text) { bool found = false; std::list<SendMsgDlgTab *>::iterator iter; for (iter = tabList.begin(); iter!= tabList.end(); ++iter) { if ((*iter)->getName() == name) { (*iter)->onRecvMessage(when, text); (*iter)->doActive(); found = true; break; } } if (!found) { SendMsgDlgTab *tab; tab = new SendMsgDlgTab(this, name); tab->onRecvMessage(when, text); tab->doActive(); } present(); }
int main(object me, string arg) { object ob; string Nbow; if( !arg ) return notify_fail("[指令格式]:bcheck <弓>\n"); if(sscanf(arg, "%s",Nbow) !=1 ) return notify_fail("[指令格式]:bcheck <弓>\n"); if( me->query("family/family_name") != "射日派") return notify_fail("你不是射日派的人。\n"); if( !ob = present(Nbow, me) ) return notify_fail("你身上没有这把弓 ...。\n"); if( ob->query("skill_type") != "archery" ) return notify_fail("看清楚那不是弓 .....!\n"); if(ob->query("arrow/id") != "none") write("剩余箭数:" HIC + ob->query("arrow/amount") + NOR "支" +ob->query("arrow/name")+ "(" +ob->query("arrow/id")+ ")\n" ); else write("现在"+ob->query("name")+"上没有任何弓箭\n"); return 1; }
int do_mobai() { object who; who = this_player(); if((int) who->query("sen") <=50) return notify_fail("你的神不够。\n"); message_vision("$N虔诚地跪在真武帝君像前磕了个头。\n" ,who); who->receive_damage("sen",50); if( (int)who->query("bellicosity") > 0) who->add("bellicosity", - (random((int)who->query("kar")) + 7 ) ); message_vision("$N身上的杀孽之气似乎轻了。 \n" , who); add("number",1); if((int) query("number") > random(40) + 20 ) { message_vision( HIY "\n\n$N觉得眼前一花,真武大帝似乎动了一下!!!!\n\n"NOR,who); if ( !objectp(who = present("master zhenwu", this_object())) ) { who = new(__DIR__"npc/zhenwu"); who->move(this_object()); }
int valid_leave(object me, string dir) { if (dir != "north") { return ::valid_leave(me,dir); } if (objectp(present("zengzhang tianwang", environment(me)))) { if (me->query("combat_exp")<100000) { return notify_fail(HIY"增长天王对你说道:" + RANK_D->query_respect(me) +"似乎还未入仙道,回去多下点苦功吧。\n你满怀失望的离开了。\n"NOR); } else { return notify_fail(HIY"增长天王对你拱手作了个揖:这位" + RANK_D->query_respect(me) +",实在对不起。天庭正在准备蟠桃大会,暂不接待外客。\n看来得下次了。\n"NOR); } } return ::valid_leave(me,dir); }
void event1(object me, int count) { object ob,girl; ob=this_object(); if (environment(me)!=environment(this_object()) || this_object()->is_fighting()) return; girl=present("bilian",environment(ob)); if (!girl || girl->is_fighting()) return; message_vision(event1_msg[count]+"\n",me); if(++count==sizeof(event1_msg)) { message_vision(CYN" 碧莲满脸通红,低著头一声不吭。\n\n"NOR,me); ob->delete_temp("talking"); return; } else call_out("event1",2,me,count); return ; }
void reset() { int dayTime; mixed *local; object xiaohe; :: reset(); if (xiaohe=present("xiao he",this_object())) if (!xiaohe->is_fighting()) { destruct(xiaohe); set("xiaohe",1); return; } local = NATURE_D->get_current_time(); dayTime = local[5]; if(dayTime > 0 && dayTime < 360) { call_out("do_reveal",2); } return; }
int do_mobai() { object who; who = this_player(); if((int) who->query("sen") <=50) return notify_fail("�������\n"); message_vision("$N�ϵع�������۾���ǰ���˸�ͷ��\n" ,who); who->receive_damage("sen",50); if( (int)who->query("bellicosity") > 0) who->add("bellicosity", - (random((int)who->query("kar")) + 7 ) ); message_vision("$N���ϵ�ɱ��֮���ƺ����ˡ� \n" , who); add("number",1); if((int) query("number") > random(40) + 20 ) { message_vision( HIY "\n\n$N������ǰһ�����������ƺ�����һ�£�������\n\n"NOR,who); if ( !objectp(who = present("master zhenwu", this_object())) ) { who = new(__DIR__"npc/zhenwu"); who->move(this_object()); }