コード例 #1
0
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);
    }
}
コード例 #2
0
ファイル: bank.c プロジェクト: Hobbitron/tmi2_fluffos_v3
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 ;
}
コード例 #3
0
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);
    }
}
コード例 #4
0
ファイル: pool.c プロジェクト: Shea690901/Castles_and_Quests
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());
    }
}
コード例 #5
0
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);
    }
}
コード例 #6
0
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" 
]));
}
コード例 #7
0
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");
    }
}
コード例 #8
0
ファイル: cave3.c プロジェクト: ClockworkSoul/MortalRemains
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());
    }

}
コード例 #9
0
ファイル: orc_shayman.c プロジェクト: november-kilo/gurbalib
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);
}
コード例 #10
0
ファイル: cottage.c プロジェクト: shentino/simud
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) );
}
コード例 #11
0
object connection(string ip, int port) {
   object con, session;

   session = clone_object("/sys/daemons/ftp_session");
   con = clone_object("/kernel/obj/net/connection");
   session->set_connection(con);
   return (con);
}
コード例 #12
0
ファイル: GSPIDER.C プロジェクト: dharmabumstead/vrmud
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());
}
コード例 #13
0
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 */
コード例 #14
0
ファイル: uroom.c プロジェクト: ClockworkSoul/MortalRemains
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);
    }
}
コード例 #15
0
ファイル: dough.c プロジェクト: shentino/simud
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() );
      }
   }
}
コード例 #16
0
ファイル: sea11.c プロジェクト: ClockworkSoul/MortalRemains
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);
    }
}
コード例 #17
0
ファイル: wolf.c プロジェクト: shentino/simud
void create() {
   object ob;
   ::create();
   set_gender( random(2)+1 );
/* OBJEDIT { */
   set_spd( 12 );
   set_con( 13 );
   set_str( 14 );
   set_dex( 15 );
   set_wil( 10 );
   set_cha( 3 );
   set_int( 4 );
   set_emp( 3 );
   set_distant( "a wolf" );
   set_specific( "the wolf" );
   set_look( "~Name ~verbhas gray fur, penetrating yellow eyes, and a generally surly disposition. ~Pron is $(HP)." );
   set_plural( "wolves" );
   set_name( "wolf" );
   set_type( "wolf" );
   set_droppable( 1 );
   set_weight( 45000 );
/* } OBJEDIT */

   set_living_name( name );

   set_food(query_food_capacity()/2);
   set_drink(query_drink_capacity()/2);

   add_form("animal");
   set_form("animal", 1);
   remove_form("brawl");

   set_race("canine");
   set_wc((["piercing":6]));
   set_wimpy(30);

   /*
   set_env_var( "skin_type", "/monsters/skin/wolf_pelt" );
   set_env_var( "meat_type", "/monsters/meat/wolf" );
   */
   set_product_aspect( C_WOLF );
   add_product( C_MEAT, 3, 40 );
   add_product( C_PELT, 7, 20 );
   // add_product( C_TOOTH, 4, 40 );

   clone_object("/ai/carnivore")->move(this_object());
   ob = clone_object("/ai/aggro");
   ob->set_aggro_level(10);
   ob->move(this_object());
}
コード例 #18
0
ファイル: mstrings.c プロジェクト: khamidou/mojo
void create_string_object(void)
{
	/* init number object */
	number_object = clone_object(base_object);
	number_object->type = T_STRING;
	number_object->name = "String";
	number_object->value.s_value = dup_string("");
	
	struct Object *plus_met = clone_object(builtin_object);
	plus_met->name = "+";
	plus_met->value.c_method = (struct Object * (*)(struct Object *parent, struct Object *arg1, 
						   struct Object *arg2))num_plus;

	list_append(number_object->methods, plus_met);
}
コード例 #19
0
extra_reset() {
    object book;
    if (!present("book")) {
        book=clone_object("players/morgar/book");
        move_object(book,this_object());
    }
}
コード例 #20
0
ファイル: decoy.c プロジェクト: shentino/simud
varargs int on_cast(mapping param) {
	object decoy;
	int hp;

	// debit hp first
	hp = to_int(param["caster"]->query_hp() * 0.95);
	param["caster"]->add_hp( -hp );

	// check for existing decoys... backlash
	decoy = present_clone( "/monsters/summon/decoy", environment(param["caster"]) );
	if( decoy ) {
		param["caster"]->msg_local( "~[030~Name ~verbstand completely still until ~pron ~verbis knocked down by a green blast.~CDEF" );
		msg_object( param["caster"], "~CWRNThere is already a decoy spirit at this location. Your spell has backfired.~CDEF" );
		param["caster"]->set_stance( ST_LYING );
		return 1;
	}

	// actually create the pet now
	decoy = clone_object( "/monsters/summon/decoy" );
	decoy->move(environment(param["caster"]));
    decoy->set_coord(WALK_DAEMON->query_random_adjacent(param["caster"]));
	decoy->validate_position();
	decoy->setup( param["caster"]->query_name(), hp );

	set_actor(param["caster"]);
	set_target(decoy);
	param["caster"]->msg_local( "~[030~Name ~verbstand completely still as ~targ ~vertfade into view beside ~obje.~CDEF" );

	return 1;
}
コード例 #21
0
ファイル: monsterwell.c プロジェクト: smokeless/eotl
void makeone()
{
    object socialism = find_player( "socialism" );
    
    string *locations = get_dir( FROOM "*1.c" );
    object monster;
    object room = load_object( locations[ random( sizeof(
      locations) )] );
      
    tell_player( socialism, "Loaded random room." );
    
    int gotime = random( 300 ) + 4;
    if( monster = present_clone( FMONS "tent2.c", room ) )
    {
      tell_object( room, "The tendrils recede into the ground." );
      destruct( monster );
      call_out( "makeone", gotime );
      tell_player( socialism, "Tent already in this room.\n" );
      return;
    }
    move_object( clone_object( FMONS "tent2" ), room );
    tell_object( room, "Tendrils erupt from the ground!\n" );
    call_out( "makeone", gotime );
    tell_player( socialism, "Cloned a monster in a room." );
    return;
}
コード例 #22
0
extra_reset() {
    if (!present("world map")) {
        map = clone_object("obj/treasure");
        call_other(map, "set_id", "world map");
        call_other(map, "set_alias", "map");
        call_other(map, "set_short", "A map of the world");
        call_other(map, "set_weight", 30);
        call_other(map, "set_value", 2000);
        call_other(map, "set_long",
"The map looks roughly like this:\n\n" +
"      + *\n" +
"      + +\n" +
"      ++++\n" +
"       +++\n" +
"   +++++++++\n" +
"       |||\n" +
"       +++*      *+ +\n" +
" +      |         |+++  +   *\n" +
" +      +         | |   |   |\n" +
" +-+-+--+-+-*-+-+-+-+---+-+-+-*\n" +
"   +    |           |   |\n" +
" ++++   +*          |   +\n" +
" | |    +          +*++\n" +
" +++    +           +\n" +
" +     +++\n" +
" *      *\n\n" +
"The *'s refer to other maps, most of which are not here\n");
        move_object(map, this_object());
    }
}
コード例 #23
0
OBJECT_PTR eval_make_array(OBJECT_PTR size, OBJECT_PTR default_value)
{
  int sz = get_int_value(size);

  uintptr_t *raw_ptr;

  uintptr_t ptr;

  int i;

  assert(IS_INTEGER_OBJECT(size));

  //see comment in main.c for why we're not using object_alloc()
  //posix_memalign((void **)&raw_ptr, 16, sizeof(unsigned int *));
  //*((int *)raw_ptr) = sz;

  ptr = object_alloc(sz+1, ARRAY_TAG);

  //set_heap(ptr, 0, size);
  //set_heap(ptr, 0, (uintptr_t)raw_ptr + INTEGER_TAG);
  *((uintptr_t *)ptr) = sz;

  for(i=0; i<sz; i++)
    set_heap(ptr, i + 1, clone_object(default_value));

  return ptr + ARRAY_TAG;
}
コード例 #24
0
ファイル: cast.c プロジェクト: simonthoresen/viking
static int
main(string arg)
{
    object ply, env, wpn, obj;
    if (!objectp(ply = this_player()) ||
        !objectp(wpn = ART_C_WEAPON->get_instance(ply)) ||
        wpn->is_suspended())
    {
        write("You have no physical form.\n");
        return 1;
    }
    if (!objectp(env = wpn->query_room())) {
        return notify_fail("You are not anywhere.");
    }
    if (!stringp(arg)) {
        return notify_fail("Cast what spell?");
    }
    if (!objectp(obj = ART_D_SLIVER->query_spell(arg))) {
        return notify_fail("There is no such spell.");
    }
    if (ply->query_busy_next_round()) {
        return notify_fail("You are too busy to do that right now.");
    }
    if (!wpn->can_add(obj)) {
        return notify_fail(wpn->query_failure_msg());
    }
    if (env->query_property("no_magic")) {
        return notify_fail("The area prevents it.");
    }
    ply->set_busy_next_round();
    write("You cast " + obj->query_name() + "!\n");
    clone_object(obj)->move(wpn);
    return 1;
}
コード例 #25
0
ファイル: d_source_pikestream.c プロジェクト: pikelang/Pike
struct source *source_pikestream_make( struct svalue *s,
				       INT64 start, INT64 len )
{
  struct pf_source *res;

  if( (TYPEOF(*s) != PIKE_T_OBJECT) ||
      (find_identifier("set_read_callback",s->u.object->prog)==-1) )
    return 0;

  res = calloc( 1, sizeof( struct pf_source ) );
  if( !res ) return NULL;

  res->len = len;
  res->skip = start;

  res->s.get_data = get_data;
  res->s.free_source = free_source;
  res->s.set_callback = set_callback;
  res->s.setup_callbacks = setup_callbacks;
  res->s.remove_callbacks = remove_callbacks;
  res->obj = s->u.object;
  add_ref(res->obj);

  res->cb_obj = clone_object( callback_program, 0 );
  ((struct callback_prog *)res->cb_obj->storage)->s = res;

  return (struct source *)res;
}
コード例 #26
0
ファイル: lroom.c プロジェクト: ClockworkSoul/MortalRemains
int search (string str) {
    object pipe;

    if (!str) {
	/*  Very nice!   But I would do this SLIGHTLY differently...
		write ("Search what?\n");
		return 1;
	If we let it return 0, the 'search' will continue, so we can
	search other things, too...
	*/
	return 0;
    }

    pipe = clone_object(M_OBJ+"crackpipe.c");

    // This line checks if str=="couch" AND that pipe exists.
    if (str=="couch" && pipe) {
	write ("You rummage through the couch and find a pipe.\n");
	say(wrap(TPN+" rummages through the couch and finds something."));
	pipe->move( this_player() );   
    } else {
	write ("You search around but find nothing of intrest.\n");
    }
    return 1;
}
コード例 #27
0
extra_reset() {
    if (!mirror) {
        mirror = clone_object("players/morgar/mirror");
        call_other(mirror, "roomset", this_object());
        move_object(mirror, "players/morgar/mazeworld/entry");
    }
}
コード例 #28
0
ファイル: animate_pumpkin.c プロジェクト: shentino/simud
varargs int on_cast(mapping param) {
    object jack, ai;
    int bonus = param["caster"]->skill_check("magic.mana.fire",50,60,70,80,90,100);

    set_actor(param["caster"]);
    set_target(param["target"]);
    param["caster"]->msg_local("~[030~Subt ~verttake on a life of ~post own and ~vertbegin to float next to ~name.~CDEF");
    destruct(param["target"]);

    jack = clone_object("/monsters/summon/jackolantern");
    jack->move(environment(param["caster"]));
    jack->validate_position();
    // heal pumpkin man
    jack->set_stat("con",jack->query_stat("con")+(bonus/2));
    jack->set_stat("int",jack->query_stat("int")+(bonus/2));
    jack->set_stat("spd",jack->query_stat("spd")+bonus);
    jack->set_stat("wil",jack->query_stat("wil")+bonus);

    jack->set_hp(jack->query_max_hp());
    jack->set_mana(jack->query_max_mana());
    jack->set_endurance(jack->query_max_endurance());

    // unfortunately, on_hire is a bit flaky right now and only works if the caster is
    // set to this_player()
    ai = present_clone("/ai/worker",jack);
    ai->on_hire();

    command("follow "+(param["caster"]->query_name()),jack);

    jack->set_time_to_live( max(20,param["caster"]->get_skill_roll("magic.faith.blessing")/2) );

    return 1;
}
コード例 #29
0
ファイル: page.c プロジェクト: drlaforge/gurbalib
void main(string str) {
   object ob;

   string page;

   page = this_player()->query_name() + "s page";
   ob = this_player()->query_environment()->present(page);

   if (sscanf(str, "-%s", str)) {
      usage();
      return;
   }

   if (ob) {
      ob->parse(str);
   } else {
      ob = clone_object(DOMAINS_DIR + "/gurba/guilds/fighter/monsters/page.c");
      if (ob) {
	 ob->move(this_player()->query_environment());
	 ob->set_master(this_player());
	 ob->setup();
	 this_player()->simple_action("$N $vyell for $p page.");
      } else {
	 this_player()->simple_action("$N $vyell for $p page, " +
            "but he can't be yelling loud enough.");
      }
   }
}
コード例 #30
0
ファイル: cairopath.c プロジェクト: Rosuav/PiCairo
/*! @decl int value()
 *! Return the current path element that the iterator is pointing at.
 */
static void f_path_iterator_value(INT32 args)
{
  struct cairo_mod_path* pw;
  struct object* o;
  struct cairo_mod_path_element* pew;
  cairo_path_t* path;
  cairo_path_data_t* data = NULL;
  int j,i;

  pw = (struct cairo_mod_path*)get_storage(THIS->path_obj, cairo_mod_path_program);
  path = pw->path;

  for (i=0, j=0; i<path->num_data; i+= path->data[i].header.length, j++)
    {
      if (j == THIS->idx)
        {
          data = &path->data[i];
          break;
        }
    }

  if (!data)
    {
      
    }
    
  o = clone_object(cairo_mod_path_element_program, 0);
  pew = (struct cairo_mod_path_element*)get_storage(o, cairo_mod_path_element_program);
  pew->path_obj = THIS->path_obj;
  add_ref(THIS->path_obj);
  pew->element = data;
  ref_push_object(o);
}