• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ present函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中present函数的典型用法代码示例。如果您正苦于以下问题:C++ present函数的具体用法?C++ present怎么用?C++ present使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了present函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:mudchina,项目名称:sjsh,代码行数:19,代码来源:guest.c


示例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;
}
开发者ID:heypnus,项目名称:xkx2001,代码行数:19,代码来源:bingyin.c


示例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;
}
开发者ID:mudchina,项目名称:nitan3,代码行数:19,代码来源:ximen.c


示例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);
}
开发者ID:mudchina,项目名称:es2-utf8,代码行数:19,代码来源:remove.c


示例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); 
        } 
开发者ID:mudchina,项目名称:nitan3,代码行数:43,代码来源:chksum.c


示例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;
}
开发者ID:cosin,项目名称:XYJ,代码行数:19,代码来源:yinma.c


示例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;
}
开发者ID:heypnus,项目名称:xkx2001,代码行数:19,代码来源:fangjuku.c


示例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;
}
开发者ID:aricxu,项目名称:xkx100,代码行数:19,代码来源:stop.c


示例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);
}
开发者ID:huangleon,项目名称:fy2005,代码行数:19,代码来源:shufang.c


示例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;
}
开发者ID:mudchina,项目名称:fy2,代码行数:43,代码来源:kill.c


示例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();
    }
开发者ID:caivega,项目名称:Mural,代码行数:19,代码来源:CanvasContext.cpp


示例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;
}
开发者ID:huangleon,项目名称:fy2005,代码行数:19,代码来源:path3.c


示例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);
}
开发者ID:huangleon,项目名称:fy2005,代码行数:19,代码来源:sl-exit.c


示例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"�����������һ�ۣ�˵��������ʹ������Ҫ�ٵ�һ� 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ press函数代码示例发布时间:2022-05-30
下一篇:
C++ preprocess函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap