当前位置: 首页>>代码示例>>C++>>正文


C++ clone_object函数代码示例

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


在下文中一共展示了clone_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: extra_reset

extra_reset() {
    if (!the_guard) {
        object the_weapon, the_money;

        the_guard = clone_object("obj/monster");
        the_guard->set_name("security guard");
        the_guard->set_alias("guard");
        the_guard->set_level(4);
        the_guard->set_hp(100);
        the_guard->set_wc(5);
        the_guard->set_al(-10);
        the_guard->set_short("A security guard");
        the_guard->set_long("This is a security guard in a dark suit, tie and sunglasses.\n" +
                            "He is responsible for the security here.\n");
        the_guard->set_aggressive(1);
        the_guard->set_male();
        the_guard->set_spell_mess1("The guard yells: This is a private area! Get out, terrorist!");
        the_guard->set_spell_mess2("The guard yells at you: This is a private area! Get out, terrorist!");
        the_guard->set_chance(50);
        move_object(the_guard, this_object());

        the_weapon = clone_object("players/padrone/obj/m16");
        the_weapon->set_monsters_reload_at_reset(1);
        move_object(the_weapon, the_guard);
        the_guard->init_command("wield m16");

        the_money = clone_object("obj/money");
        the_money->set_money(random(50));
        move_object(the_money, the_guard);
    }
}
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:31,代码来源:tower2.c

示例2: open_account

int open_account(string str) {

	int i ;
	object ob ;

	if (!str || str != "account") {
		notify_fail ("Open what?\n") ;
		return 0 ;
	}
	if (present("bank card", this_player())) {
		write ("You already have an account.\n") ;
		return 1 ;
	}
	if (this_player()->query("bank_balance")) {
		write ("Hm, you seem to have lost your card.. but you already have an account.\n"+"Let me give you a new card.\n") ;
		ob = clone_object(BANK_CARD_FILE) ;
		ob->assign(this_player()) ;
		return 1 ;
	}
	i = this_player()->query("wealth/gold") ;
	if (i<25) {
		write ("You need to have 25 gold coins to open an account.\n") ;
		return 1 ;
	}
	this_player()->set("wealth/gold",i-25) ;
	this_player()->set("capacity",this_player()->query("capacity")+25) ;
	ob = clone_object (BANK_CARD_FILE) ;
	ob -> assign(this_player()) ;
	write ("The banker hands you a shiny new bank card.\n"+
		"You now have an account with First Mudwide Bank of TMI.\n") ;
	say (this_player()->query("cap_name")+" opens a bank account.\n") ;
	this_player()->set("bank_balance", ([ ]) ) ;
	return 1 ;
}
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:34,代码来源:bank.c

示例3: extra_reset

extra_reset() {
    if (!rakshasa || !living(rakshasa)) {
	rakshasa = clone_object ("obj/monster");
	call_other (rakshasa, "set_name", "rakshasa");
	call_other (rakshasa, "set_race", "demon");
	call_other (rakshasa, "set_short", "An evil rakshasa");
	call_other (rakshasa, "set_long",
		"A fearsome rakshasa, one of the tiger-demons of India.\n");
	call_other (rakshasa, "set_level", 18);
	call_other (rakshasa, "set_ep", 400000); /* Was 1125000 Pell */
	call_other (rakshasa, "set_hp", 400); /* Was 600 */
	call_other (rakshasa, "set_ac", 7); /* Was 8 */
	call_other (rakshasa, "set_wc", 20); /* Was 25 */
	call_other (rakshasa, "set_al", -1000);
	call_other (rakshasa, "set_aggressive", 1);
	call_other (rakshasa, "set_spell_mess1", /* Pell */
		"The demon screams for your soul, chilling your body."); /* Pell */
	call_other (rakshasa, "set_spell_mess2",
		"The demon sucks out part of your soul, chilling your body.");
	call_other (rakshasa, "set_chance", 2);
	call_other (rakshasa, "set_spell_dam", 60); /* Was 80 */
	move_object (rakshasa, this_object());

	scroll = clone_object ("obj/money");
	call_other (scroll, "set_money", 1000 + random(1000));
	move_object (scroll, rakshasa);
    }
}
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:28,代码来源:maze184.c

示例4: extra_reset

extra_reset() {
    if (!slug2 || !living(slug2)) {
	slug2 = clone_object("obj/monster");
	call_other(slug2, "set_name", "slime puddle");
	call_other(slug2, "set_alias", "puddle");
	call_other(slug2, "set_level", 14);
        call_other(slug2, "set_hp", 150);
	call_other(slug2, "set_short", "A puddle of slime");
	call_other(slug2, "set_wc", 12);
	call_other(slug2, "set_ac", 4);
	call_other(slug2, "set_al", -350);
	call_other(slug2, "set_aggressive", 1);
	move_object(slug2, this_object());
    }
    if (!slug1 || !living(slug1)) {
	slug1 = clone_object("obj/monster");
	call_other(slug1, "set_name", "slug");
	call_other(slug1, "set_alias", "slime slug");
	call_other(slug1, "set_level", 14);
        call_other(slug1, "set_hp", 150);
	call_other(slug1, "set_short", "A slime slug");
	call_other(slug1, "set_wc", 12);
	call_other(slug1, "set_ac", 4);
	call_other(slug1, "set_al", -350);
	call_other(slug1, "set_aggressive", 1);
	move_object(slug1, this_object());
    }
}
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:28,代码来源:pool.c

示例5: extra_reset

extra_reset() {
    object treasure;
    if (!dragon || !living(dragon)) {
	dragon = clone_object("obj/monster");
	call_other(dragon, "set_name", "dragon");
	call_other(dragon, "set_alias", "wyrm");
	call_other(dragon, "set_level", 19);
        call_other(dragon, "set_hp", 200);
	call_other(dragon, "set_short", "A gold dragon");
	call_other(dragon, "set_wc", 22);
	call_other(dragon, "set_ac", 5);
	call_other(dragon, "set_al", 900);
	call_other(dragon, "set_aggressive", 0);
        call_other(dragon, "set_chance",20);
        call_other(dragon, "set_spell_mess1",
                   "The dragon breathes fire.");
        call_other(dragon, "set_spell_mess2",
                   "The dragon breathes fire on you.");
        call_other(dragon, "set_spell_dam",30);
	move_object(dragon, this_object());
	treasure = clone_object("obj/treasure");
	call_other(treasure, "set_id", "diamond");
	call_other(treasure, "set_alias", "gem");
	call_other(treasure, "set_short", "A giant diamond");
	call_other(treasure, "set_weight", 3);
	call_other(treasure, "set_value", 1000);
	move_object(treasure, dragon);
    }
}
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:29,代码来源:dragon.c

示例6: create

void create()
{
    ::create();
    seteuid( getuid() );
    set("author", "shya");
    set( "light", 1 );
    set("short", "Antarctica");
    set( "long", @EndText
This looks to be the shoreline of a huge pond covered in ice. 
More footprints are around the shoreline and some look to be 
headed North across the pond. To the North you see the outline 
of an icehouse sitting in the middle of the pond. To the South 
all you see are more snow covered trees.
EndText
    );
    set( "exits", ([
      "north" : "/d/Arctic/Shya/rooms/pond.c",
      "south" : "/d/Arctic/Shya/rooms/room2.c",
	"east" : "/d/Arctic/Shya/rooms/castle/stables.c"
    ]) );

    snowcat = clone_object("/d/Arctic/Shya/monsters/snowcat.c");
    snowcat->move(this_object());
    snowman = clone_object("/d/Arctic/Shya/monsters/snowman.c");
    snowman->move (this_object());
set("item_desc", ([
 "footprints" : "Ordinary footprints leading South and North.\n",
 "icehouse" : "A small building sitting on ice.\n",
 "ice" : "Frozen water.\n",
 "pond" : "A body of water smallar than a lake.\n",
 "trees" : "Perennial plants with one main trunk and many branches.\n",
 "igloo" : "Domeshaped and build of blocks of packed snow.\n" 
]));
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:34,代码来源:shoreline.c

示例7: extra_reset

extra_reset() {
    if (!paladin || !living(paladin)) {
        paladin = clone_object("obj/monster");
        call_other(paladin, "set_name", "paladin");
        call_other(paladin, "set_alias", "knight");
        call_other(paladin, "set_level", 19);
        call_other(paladin, "set_hp", 300);
        call_other(paladin, "set_al", 1000);
        call_other(paladin, "set_short", "A noble knight");
        call_other(paladin, "set_long", "A noble paladin.\n");
	move_object(paladin, this_object());
        weapon = clone_object("obj/weapon");
        call_other(weapon, "set_name", "glowing sword");
        call_other(weapon, "set_short", "A softly glowing sword");
        call_other(weapon, "set_alias", "sword");
        call_other(weapon, "set_long",
"It is a long sword of finest workmanship, and it glows with goodness.\n");
        call_other(weapon, "set_class", 20);
        call_other(weapon, "set_value", 1000);
        call_other(weapon, "set_weight", 3);
        call_other(weapon, "set_hit_func", this_object());
        call_other(weapon, "set_wield_func", this_object());
	transfer(weapon, paladin);
	call_other(paladin, "init_command", "wield sword");
    }
}
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:26,代码来源:tower3.c

示例8: reset

void reset ()
{
    object bat, roots;

    seteuid( getuid() );
    ::reset();
    if (! present("roots")) {
        set( "long", @EndText
You are in a cave. 
The cave continues to the east further into the darkness.  
A tangled mass of roots blocks your progress east.
EndText
        );
        roots = clone_object("/u/s/shya/private/roots.c");
	  if (roots)
          roots->move(this_object());
    }

    if (! present("bat")) {
        bat = clone_object("/u/s/shya/private/bat.c");
	  if (bat)
            bat->move(this_object());
    }

}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:25,代码来源:cave3.c

示例9: setup

void setup() {
   object obj;

   set_name("shayman");
   set_gender( "female" );
   add_adj("orc");
   add_ids("orc", "orc shayman");
   set_short("Orc shayman");
   set_long("An ugly orc shayman.  This thing looks wilder than your average " +
      "orc.");
   set_race("orc");
   set_level(10);
   set_aggressive(1);

   set_spell_chance(20);
   set_spell_damage(20);
   set_spell_message("The shayman casts a magic missile at $t.");

   set_hit_skill("combat/unarmed");
   set_skill("combat/unarmed", 50);
   set_skill("combat/defense", 100);

   obj = clone_object(DIR + "/obj/gold_staff.c");
   obj->setup();
   obj->move(this_object());
   obj = clone_object(DIR + "/obj/orc_slayer.c");
   obj->setup();
   obj->move(this_object());
   do_wield(obj);
}
开发者ID:november-kilo,项目名称:gurbalib,代码行数:30,代码来源:orc_shayman.c

示例10: on_build

void on_build() {
   object start_room, door;
//   int ix, iy;

   ROOM_MAP( 3, 3, 1,
   "bbb"
   "aaa"
   "aaa")
   ROOM_KEY( "a", "start", "The cottage's front room", "This small front room is cramped but cozy." )
   ROOM_KEY( "b", "backroom", "The back room", "A small space at the back of the cottage." )

   start_room = find_room("start", this_object());

   door = clone_object("/world/exit/door");
   door->move( environment() );
   door->set_host( this_object() );
   door->set_coord( MAKE_C(2,2,0) );
   door->set_dir( "cottage" );
   door->set_link( "start" );
   door->query_backlink()->set_coord( MAKE_C(8,7,0) );

   door = clone_object("/world/exit/door");
   door->move( start_room );
   door->set_coord( MAKE_C(8,0,0) );
   door->set_dir( "north" );
   door->set_link( "backroom" );
   door->query_backlink()->set_coord( MAKE_C(8,4,0) );
}
开发者ID:shentino,项目名称:simud,代码行数:28,代码来源:cottage.c

示例11: init

init() {
    ::init();
    if(!present("hide"))
       move_object(clone_object(OBJ+"gspiplat"), this_object());

// Added clonep check cuz of stupid unique bug - Picard: Easter of 97
    if(!present("stinger") && clonep(this_object()))
       move_object(clone_object(OBJ+"gstinger"), this_object());
}
开发者ID:dharmabumstead,项目名称:vrmud,代码行数:9,代码来源:GSPIDER.C

示例12: make_golem

make_golem() {
    object temp;

    golem = clone_object("obj/monster");	/* NEW, IMPROVED monster class! */
    golem->set_name("golem-padrone");
    golem->set_alias("golem");
    golem->set_level(21);
    golem->set_ep(120000);
    golem->set_hp(1000);
    golem->set_ac(5);
    golem->set_ac(5);
    golem->set_al(0);
    golem->set_short("Padrone the Wizard of Law and Balance (grey lord)");
    golem->set_long("The famous wizard doesn't have time to sit here and wait all day.\n" +
		    "Therefore he made this golem, named it Golem-padrone, and put\n" +
		    "it here. It is a silicon golem, and it is equipped with a\n" +
		    "limited amount of intelligence.\n");
    
    golem->set_aggressive(0);

    /* The NEW, IMPROVED monster calls: */
    if (!chat_str)
	setup_arrays();
    golem->load_chat(10, chat_str);
    golem->load_a_chat(20, a_chat_str);
    golem->set_match(this_object(), function, type, match);

    move_object(call_other("players/padrone/outside/front_yard", "make_ticket"), golem);
    move_object(golem, this_object());

    temp = clone_object("players/padrone/obj/wizardshat");
    move_object(temp, golem);
    golem->init_command("wear hat");
    golem->init_command("say lux");

    temp = clone_object("obj/weapon");
    temp->set_name("debugging tool");
    temp->set_alt_name("tool");
    temp->set_alias("debugger");
    temp->set_class(10);
    temp->set_value(100);
    temp->set_weight(3);
    temp->set_short("A debugging tool");
    temp->set_long("This is a debugging tool.\n" +
		   "One of the wizards probably made it to take care of all\n" +
		   "the bugs that crawl into his correct and beautiful programs\n" +
		   "as soon as he's looking the other way.\n" +
		   "It looks like a big iron hammer with an extra wide head.\n");
    temp->set_hit_func(this_object());
    move_object(temp, golem);

    golem->set_ac(10);		/* After all wear commands! */
} /* make_robot_padrone */
开发者ID:Shea690901,项目名称:Castles_and_Quests,代码行数:53,代码来源:finish_quest.c

示例13: reset

void reset() {
    object ob;
    if(!present("eel")) {
	ob = clone_object(O_MON+"eleceel.c");
	ob->move(TO);
	ob = clone_object(O_MON+"eleceel.c");
	ob->move(TO);
    }
    if(!present("ursula", TO)) {
	ob = clone_object(O_MON+"ursula.c");
	ob->move(TO);
    }
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:13,代码来源:uroom.c

示例14: on_heat

void on_heat( int temp ) {
   if( temp > 100 ) {
       remove_call_out( "rise" );
       cooked++;
      if( cooked > 2 ) {
         if( state == 0 )
            clone_object("/items/food/flatbread")->move( environment(this_object()) );
         else
            clone_object("/items/food/bread")->move( environment(this_object()) );
         destruct( this_object() );
      }
   }
}
开发者ID:shentino,项目名称:simud,代码行数:13,代码来源:dough.c

示例15: reset

void reset() {
    object ob;
    if (!present("jellyfish")) {
	ob = clone_object(O_MON+"jfish.c");
	ob->move(TO);
	ob = clone_object(O_MON+"jfish.c");
	ob->move(TO);
    }
    if (!present("anemone",TO)) {
	ob = clone_object(O_MON+"anemone.c");
	ob->move(TO);
    }
}
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:13,代码来源:sea11.c


注:本文中的clone_object函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。