本文整理汇总了C++中present函数的典型用法代码示例。如果您正苦于以下问题:C++ present函数的具体用法?C++ present怎么用?C++ present使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了present函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_approve
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;
}
示例2: do_pass
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;
}
示例3: valid_leave
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;
}
示例4: main
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);
}
示例5: main
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);
}
示例6: valid_leave
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;
}
示例7: do_kill
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;
}
示例8: main
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;
}
示例9: valid_leave
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);
}
示例10: main
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;
}
示例11: prepare
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();
}
示例12: reset
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;
}
示例13: valid_leave
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);
}
示例14: greeting
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());
}
示例15: lishi_kill
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);
}
}
}