void setup( void ) { set_id( "board" ); set_adj( "message", "large" ); set_long( "" ); set_in_room_desc( "A huge message board." ); set_board_id( "main" ); query_environment()->subscribe_event( "body_look" ); query_environment()->subscribe_event( "body_look_at" ); }
mapping save() { ACCESS_CHECK(GAME()); return ([ "archetypes": query_archetypes(), "capacity": query_capacity(), "density": query_density(), "environment": query_environment(), "flexible": query_flexible(), "id": query_id(), "inventory": query_inventory(), "mass": query_mass(), "max_mass": query_max_mass(), "name": query_object_name(), "properties": query_local_properties(), "virtual": query_virtual() ]); }
static void xyz_move_notify(object old_env) { mixed nx, ny, nz; object common; object new_env; new_env = query_environment(); if (!old_env || !new_env) { return; } common = THING_SUBD->query_common_container(old_env, new_env); if (!common) { nx = 0; ny = 0; nz = 0; } else { nx = query_x_position(); ny = query_y_position(); nz = query_z_position(); for (; old_env != common; old_env = old_env->query_environment()) { nx += old_env->query_x_position(); ny += old_env->query_y_position(); nz += old_env->query_z_position(); } for (; new_env != common; new_env = new_env->query_environment()) { nx -= new_env->query_x_position(); ny -= new_env->query_y_position(); nz -= new_env->query_z_position(); } } set_x_position(nx); set_y_position(ny); set_z_position(nz); }
static nomask void thing_destruct() { int sz; int index; object env; object *children; destructing = 1; children = query_inventory(); env = query_environment(); sz = sizeof(children); for (index = 0; index < sz; index++) { children[index]->move(env); } if (env) { env->bulk_invalidate(); } clear_archetypes(); }
int apply(string str) { object obj; string what; if (!str) { return 0; } if (query_environment() != this_player()) { write("You must have the stethoscope on you to use it.\n"); return 1; } obj = this_player()->query_environment()->present(str); if (!obj) { if (sscanf(str, "stethoscope to %s", what) != 1) { write("On what?\n"); return 1; } obj = this_player()->query_environment()->present(str); if (!obj) { write("On what?\n"); return 1; } } write("You listen to the " + obj->query_name() + "\n"); this_player()->query_environment()->tell_room(this_player(), this_player()->query_Name() + " uses a stethoscope to listen to " + obj->query_name() + "\n"); if (obj->is_living()) { write("Thub Whub\n"); } else { write("You hear nothing.\n"); } return 1; }
int cmd_put_relic_in_orb(string str) { string what, msg; object *inv; object potion; int i, dim; if (empty_str(str)) { return 0; } sscanf(str, "%s in orb", what); inv = this_player()->query_inventory(); dim = sizeof(inv); for (i = 0; i < dim; i++) { if (inv[i]->is_id(what) && inv[i]->property(ANCIENT_RELIC_PROP) == 1) { potion = clone_object(NOKICLIFFS_REJUV_POTION); potion->setup(); msg = "$N $vput an ancient relic into the " + "orb. The orb's activity increases dramatically " + "for a moment as it accepts the offering. " + "A moment before the orb settles and returns " + "to normal a rejuvination potion pops out and " + "settles gently on the pedestal."; this_player()->targeted_action(msg, this_player()); inv[i]->destruct(); potion->move(query_environment()); return 1; } } this_player()->message_orig( "That is not an appropriate offering to the Ancient One.\n"); return 1; }
void follow_master(void) { object *objs; int i; int nMasterHere; nMasterHere = 0; objs = query_environment()->query_inventory(); for (i = 0; i < sizeof(objs); i++) { if (objs[i] == master) { nMasterHere = 1; } } if (nMasterHere == 0) { if (!master) { remove_call_out(nFollow); respond("say It seems " + master_name + " no longer has a need for me."); die(); destruct_object(this_object()); return; } if (query_environment() != master->query_environment()) { switch (random(10)) { case 0: query_environment()->tell_room(nil, my_name + " leaves."); break; case 1: query_environment()->tell_room(nil, my_name + " tries to follow his master."); break; case 2: query_environment()->tell_room(nil, my_name + " follows his master."); break; case 3: query_environment()->tell_room(nil, my_name + " disappears in a cloud of smoke."); break; case 4: query_environment()->tell_room(nil, my_name + " suddenly vanishes."); break; case 5: query_environment()->tell_room(nil, my_name + " fades out of view."); break; case 6: query_environment()->tell_room(nil, my_name + " runs off after his master."); break; case 7: query_environment()->tell_room(nil, my_name + " suddenly notices that his master has left, and runs off."); break; case 8: query_environment()->tell_room(nil, my_name + " fades into the shadows, and is gone."); break; case 9: query_environment()->tell_room(nil, my_name + " snaps his fingers, and is gone."); break; } move(master->query_environment()->base_name()); switch (random(10)) { case 0: query_environment()->tell_room(nil, my_name + " follows the light of his life."); break; case 1: query_environment()->tell_room(nil, my_name + " follows in his masters footsteps."); break; case 2: query_environment()->tell_room(nil, my_name + " appears next to his master in a cloud of smoke."); break; case 3: query_environment()->tell_room(nil, my_name + " enters."); break; case 4: query_environment()->tell_room(nil, my_name + " appears."); break; case 5: query_environment()->tell_room(nil, my_name + " arrives shortly after his master."); break; case 6: query_environment()->tell_room(nil, my_name + " comes running, tying to keep up with his master."); break; case 7: query_environment()->tell_room(nil, "A humble page enters."); break; case 8: query_environment()->tell_room(nil, "A humble person wearing a robe enters."); break; case 9: query_environment()->tell_room(nil, my_name + " catches up with his master."); break; } } } nFollow = call_out("follow_master", 2); }
void notify(string str) { query_environment()->tell_room(this_object(), str); }
void destruct( void ) { query_environment()->unsubscribe_event( "body_look" ); query_environment()->unsubscribe_event( "body_look_at" ); ::destruct(); }