本文整理汇总了C++中query_temp函数的典型用法代码示例。如果您正苦于以下问题:C++ query_temp函数的具体用法?C++ query_temp怎么用?C++ query_temp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了query_temp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_open
int do_open(string arg)
{
object me=this_player(), room;
if(!arg || arg!="door")
return notify_fail("你要开什么?\n");
if( query_temp("lock") == 1 && !present("key", me) )
return notify_fail("你想怎么开门?\n");
if(!( room = find_object("/u/yuki/room/taoyuan")) )
room = load_object("/u/yuki/room/taoyuan");
if(!objectp(room))
return notify_fail("ERROR:not found 'taoyuan.c' \n");
if(query_temp("lock") == 1 && present("key", me))
{
set_temp("lock", 0);
message_vision("$N把钥匙插进锁孔,轻轻一转,锁开了。\n", me);
message("vision", "外面传来一阵开锁的声音,只听见‘卡嗒’一声,锁开了。
\n",room);
}
message_vision("$N推开门,眼前一阵强烈的光线。门自己关上了。\n",me);
message("vision", "有人走了进来,门在身后自动关上了。\n",room);
me->move(room);
return 1;
}
示例2: inquiry_dao
int inquiry_dao()
{
object me=this_player();
object ob;
if (present("cut knife",me))
{
message_vision("你就别寻老头子开心了,你身上不是也有一把吗?\n", me);
return 1;
}
if( query_temp("buyed")==0 )
{
message_vision("这位大爷,实在不是我舍不得这刀,小人一家就全靠它过\n"
"日子了,给了你,叫我怎么过活啊!\n", me);
return 1;
}
if( query_temp("buyed")==1 )
{
message_vision("既然好心人想要,就给你吧,本来史婆婆要我好好保管的,\n"
"你可千万别瞎送给别人,否则她会生气的。\n", me);
ob=new("/d/xiakedao/obj/knife");
ob->move(me);
message_vision("樵夫递给你一把柴刀!\n", me);
set_temp("buyed", 0);
}
示例3: receive_damage
varargs int receive_damage(string type, int damage, object who)
{
int val;
int reduction,r_damage;
// if( damage < 0 ) error("F_DAMAGE: 伤害值为负值。\n");
if (damage <0) damage =0;
if( type!="gin" && type!="kee" && type!="sen" )
error("F_DAMAGE: 伤害种类错误( 只能是 gin, kee, sen 其中之一 )。\n");
if (query("resistance/"+type) || query_temp("resistance/"+type)){
reduction=query("resistance/"+type) + query_temp("resistance/"+type);
damage=damage-damage*reduction/100;
}
if( objectp(who) ) set_temp("last_damage_from", who);
val = (int)query(type) - damage;
// 这个是用来记录NPC作战对手的伤害力。精神的计算值x2,对玩家虽然有记录,但是没有现实意义。
if (who) {
if (query("kee")==query("max_kee") && query("eff_kee")==query("max_kee")
&& query("kee")==query("max_kee") && query("eff_kee")==query("max_kee")
&& query("kee")==query("max_kee") && query("eff_kee")==query("max_kee"))
damage_list=([]); // NPC 复原时清零。
if (type!="kee") r_damage=damage*2;
else r_damage=damage;
if( !mapp(damage_list) )
damage_list = ([ who : r_damage ]);
else
damage_list[who]=damage_list[who]+r_damage;
}
示例4: receive_message
void receive_message(string msgclass, string msg)
{
string subclass, *ch;
if( !interactive(this_object()) ) {
this_object()->relay_message(msgclass, msg);
return;
}
if( sscanf(msgclass, "%s:%s", subclass, msgclass)==2 ) {
switch(subclass) {
case "channel":
if( !pointerp(ch = query("channels"))
|| member_array(msgclass, ch)==-1 )
return;
break;
case "outdoor":
if( !environment() || !environment()->query("outdoors") )
return;
break;
default:
error("Message: Invalid Subclass " + subclass + ".\n");
}
}
if( query_temp("block_msg/all") || query_temp("block_msg/" + msgclass) )
return;
if( in_input(this_object()) || in_edit(this_object()) ) {
if( sizeof(msg_buffer) < MAX_MSG_BUFFER )
msg_buffer += ({ msg });
} else
示例5: do_open
int do_open(string arg)
{
object me=this_player(), room;
object *inv;
int j;
if(!arg || arg!="door") return notify_fail("你要开什么?\n");
if( query_temp("lock") == 1 && !present("key", me) )
return notify_fail("钥匙都没有,怎么开门?\n");
if(!( room = find_object(__DIR__"storeroom")) )
room = load_object(__DIR__"storeroom");
inv = all_inventory(me);
for (j = 0; j < sizeof(inv); j++)
{
if (inv[j]->is_character())
{
return notify_fail("屋子里位置有限,挤不下那么多人。\n");
}
}
if(!objectp(room))
return notify_fail("ERROR:not found 'storeroom.c' \n");
if(query_temp("lock") == 1 && present("key", me))
{
set_temp("lock", 0);
message_vision("$N把钥匙插进锁孔,只听见‘卡嗒’一声,锁开了。\n", me);
message("vision","外面传来一阵开锁的声音,只听见‘卡嗒’一声,锁开了。\n",room);
}
message_vision("$N轻轻推开门,走了进去,随手把门掩了起来。\n",me);
message("vision", "有人走了进来,随手把门掩上了。\n",room);
me->move(room);
return 1;
}
示例6: unconcious
void unconcious()
{
string owner;
object owner_ob;
owner = query_temp("owner");
if( owner ) {
owner_ob= find_player(owner);
if( objectp(owner_ob = find_player(owner)) ) {
if( (object)query_temp("last_damage_from") == owner_ob ) {
set("owner", owner_ob->query("id"));
delete_temp("owner");
reset_status();
this_object()->remove_all_killer();
this_object()->set("attitude", "heroism");
message_vision(HIY"\n$N低头缩尾,以示降服。\n"NOR, this_object());
return;
}
}
}
// message_vision(HIY"$N run away!\n"NOR, this_object());
die();
// ::unconcious();
}
示例7: do_push
int do_push(string arg)
{
object me = this_player();
if (!arg) return 0;
if ( (int)me->query_str() < 28 ) {
return notify_fail("你没那么大力气搬动墓碑。\n");
}
if (arg == "left") {
add_temp("left",1);
write("墓碑摇晃了一阵,再不见动静...\n");
}
if ((arg == "right") && ((int)query_temp("left")==3)) {
add_temp("right",1);
write("墓碑摇晃了一阵,再不见动静...\n");
}
if ((arg == "front") && ((int)query_temp("right")==3) && ((int)query_temp("left")==3)) {
write("墓碑摇晃了一阵,缓缓向后倒去,露出一个入口。\n");
set("exits/enter", __DIR__"didao");
remove_call_out("close_door");
call_out("close_door",15,me);
}
return 1;
}
示例8: close_door
void close_door()
{
if (((int)query_temp("left")!=3) || ((int)query_temp("right")!=3)) return;
delete("exits/enter");
delete_temp("left");
delete_temp("right");
}
示例9: hit_ob
// check the poison attack
mixed hit_ob(object me, object victim, int damage_bonus)
{
object unarmed_weapon;
if (unarmed_weapon = query_temp("armor/hands"))
return unarmed_weapon->hit_ob(me, victim, damage_bonus);
if (! mapp(query_temp("daub")))
return;
return COMBAT_D->hit_with_poison(me, victim, this_object());
}
示例10: do_use
int do_use(string arg){
object me;
int cure, gin, kee, sen, eff_gin, eff_kee, eff_sen, dan_number;
string to_cure;
me = this_player();
dan_number= (int )me->query_temp("dan_number");
if(!arg || (arg != "pill" && arg != "dan")){
return notify_fail("你要用什么?\n");;
}
cure = (int) query_temp("cure");
to_cure = (string) query_temp("to_cure");
if (!cure) cure =2;
gin = (int) me->query("max_gin");
kee = (int) me->query("max_kee");
sen = (int) me->query("max_sen");
eff_gin = (int) me->query("eff_gin");
eff_kee = (int) me->query("eff_kee");
eff_sen = (int) me->query("eff_sen");
message_vision( HIG"$N急忙取出一丸$n"HIG"吞入口中,稍时,有微微宝光透出$N体外!!\n" NOR, me, this_object());
if (to_cure == "all" ||to_cure == "gin") {
if (eff_gin < gin - ((10-cure)*(gin-eff_gin))/10 ) {
eff_gin = gin - ((10-cure)*(gin-eff_gin))/10;
}
me->set("eff_gin",eff_gin);
me->set("gin", eff_gin);
}
if (to_cure == "all" ||to_cure == "kee") {
if (eff_kee < kee - ((10-cure)*(kee-eff_kee))/10 ) {
eff_kee = kee - ((10-cure)*(kee-eff_kee))/10;
}
me->set("kee",eff_kee);
me->set("eff_kee",eff_kee);
}
if (to_cure == "all" ||to_cure == "sen") {
if (eff_sen < sen - ((10-cure)*(sen-eff_sen))/10 ) {
eff_sen = sen - ((10-cure)*(sen-eff_sen))/10;
}
me->set("sen", eff_sen);
me->set("eff_sen", eff_sen);
}
if (dan_number>0)
me->add_temp("dan_number", -1);
destruct(this_object());
return 1;
}
示例11: wield_new_weapon
void wield_new_weapon()
{
object old_weapon = query_temp("weapon");
object me = this_object();
object *inv;
int i;
string wskill, pskill;
if (old_weapon) {
/*
if (old_weapon->is_unique()) {
"/cmds/std/drop.c"->do_drop(me, old_weapon);
}else{
destruct(old_weapon);
}
*/
"/cmds/std/drop.c"->do_drop(me, old_weapon);
}
inv = all_inventory(me);
for (i=sizeof(inv)-1; i>=0; i--){
if (inv[i]->query("weapon_prop")) {
"/cmds/std/wield.c"->do_wield(me, inv[i]);
wskill = inv[i]->query("skill_type");
pskill = me->query_skill_mapped(wskill);
if (pskill) {
map_skill("parry", pskill);
}
if (inv[i]->is_unique()) {
me->delete("default_weapon");
}else{
示例12: unconcious
void unconcious()
{
object defeater;
if( !living(this_object()) ) return;
if( wizardp(this_object()) && query("env/immortal") ) return;
if( objectp(defeater = query_temp("last_damage_from")) )
{
COMBAT_D->winner_reward(defeater, this_object());
// cyz&kitten 99/05/08 to check who fainted victim
if(userp(defeater))
set_temp("last_fainted_from", defeater->query("id"));
}
this_object()->remove_all_enemy();
// xuy, interrupt all dazuo, jingzuo etc.
this_object()->interrupt_me();
this_object()->dismiss_team();
message("system", HIR "\n你的眼前一黑,接著什么也不知道了....\n\n" NOR,
this_object());
this_object()->disable_player(" <昏迷不醒>");
set("jing", 0);
set("qi", 0);
set("jingli", 0);
set_temp("block_msg/all", 1);
COMBAT_D->announce(this_object(), "unconcious");
call_out("revive", random(100 - query("con")) + 30);
}
示例13: visible
// mon optimize this function 4/20/98
// this function is extensively referenced, for example from id(),
// present(), ... so must be fast.
int visible(object ob)
{
int lvl, invis;
/*
lvl = wiz_level(this_object());
if( lvl > 1) return 1;
if( lvl > wiz_level(ob) ) return 1;
*/
if(wizardp(this_object())) return 1;
invis = ob->query("env/invisibility");
if( !invis ) invis = ob->query_temp("invisiblity");
// if( intp(invis) && (invis > lvl) ) return 0;
if( invis ) {
if( wizardp(ob) ) return 0;
if(!userp(ob)) return 0;
if( query("env/invisibility") ) return 1;
return 0;
}
if( ob->is_ghost() ) {
if( is_ghost() ) return 1;
if( query_temp("apply/astral_vision") ) return 1;
return 0;
}
return 1;
}
示例14: query_spi
// 灵性 -- 能学更多的武功,且速度也快
int query_spi()
{
int improve = query_skill("buddhism", 1) / 10;
if ( query_skill("buddhism", 1) || query_skill("mahayana", 1) ||
query_skill("lamaism", 1) || query_skill("taoism", 1) ||
query_skill("ziyunyin",1) || query_skill("zhengqijue",1)||
query_skill("poison"),1)
{
if ( query_skill("buddhism", 1) >= improve * 10 )
improve = (int)query_skill("buddhism", 1) / 10;
if ( query_skill("mahayana", 1) >= improve * 10)
improve = (int)query_skill("mahayana", 1) / 10;
if ( query_skill("lamaism", 1) >= improve * 10)
improve = (int)query_skill("lamaism", 1) / 10;
if ( query_skill("taoism", 1) >= improve * 10)
improve = (int)query_skill("taoism", 1) / 10;
if ( query_skill("ziyunyin", 1) >= improve * 10)
improve = (int)query_skill("ziyunyin", 1) / 10;
if ( query_skill("zhengqijue", 1) >= improve * 10)
improve = (int)query_skill("zhengqijue", 1) / 10;
if ( query_skill("poison", 1) >= improve * 10)
improve = (int)query_skill("poison", 1) / 10;
}
return (int)query("spi") + query_temp("apply/spirit") + improve;
}
示例15: die
void die()
{
object ob, me, corpse;
ob = this_object();
me = query_temp("last_damage_from");
message_vision(WHT"$N大叫一声,天绝我也!!倒地而亡。\n"NOR,ob,me);
if( objectp(corpse = CHAR_D->make_corpse(this_object())) )
corpse->move(environment(this_object()));
if(!me) { destruct(ob); return; }
else{
if((int)me->query("combat_exp") < 10000000) {//有点问题
message("vision", me->name() + "杀死食人妖怪,修为又有所增长。\n", me);
me->add("combat_exp",1000);
me->add("potential",1000);
destruct(ob);
}
message("vision", me->name() + "修为增加了。\n", me);
// me->add("score",2);
// me->add("shen",10);
destruct(ob);
return;
}
}