Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**************************************************************************
- Updated 12/5/04 by Torvald.
- Room is Portal-enabled to show construct.gif as room picture,
- and displays tv1.gif or tv2.gif based on tv knob in television_look().
- **************************************************************************/
- inherit "/room/room";
- object *sitting = ({});
- int television = 0;
- int television_look()
- {
- string mcode;
- if(!television)
- {
- if(mcode = this_player()->query("3klient_code"))
- {
- set("picture","tv1.gif");
- }
- write("An old 1950's receiver with a knob you can turn.\n");
- }
- else
- {
- if(mcode = this_player()->query("3klient_code"))
- {
- set("picture","tv2.gif");
- }
- write(
- "Peering into the screen you see dark, towering fields where Mystic's\n"+
- "programmers grow players as crops and harvest them for energy.\n");
- }
- return 1;
- }
- int armchairs_look()
- {
- int i = sizeof(sitting = filter(sitting,(: $1 :)));
- write("Burgundy leather armchairs with quilted backs. They were once\n"+
- "of fine quality but have been tarnished by years of use.\n");
- if(i == 0) write("Both chairs are currently empty.\n");
- else if(i == 1)
- write(sitting[0]->query_name()+" is sitting in an armchair.\n");
- else
- {
- while(i--)
- {
- if(i>1) write(sitting[i]->query_name()+", ");
- else if(i == 1) write(sitting[i]->query_name()+" and ");
- else write(sitting[i]->query_name()+" are sitting in the armchairs.\n");
- } // End of while loop.
- } // End of else statement.
- return 1;
- } // End of armchairs_look fcn.
- void reset()
- {
- room::reset();
- set("picture","construct.gif");
- if(television)
- {
- television = 0;
- tell_room(this_object(), "The tv screen flickers, then shuts off.\n");
- }
- }
- void create()
- {
- seteuid("torvald");
- room::create();
- set("picture","construct.gif");
- set_light(1);
- set_short("The Construct");
- set_long(
- "This is the Construct, where the program you call 'reality' is loaded.\n"+
- "It is a brilliant white void that lacks boundaries, echoes, and other\n"+
- "familiar properties of existence. In striking contrast, there are two\n"+
- "armchairs and a vintage television present.\n");
- add_item(({"construct"}),
- "The Construct is merely loading space for a computer program");
- add_item(({"knob"}),
- "A small knob on the television. Try turning it and see what happens");
- add_item(({"void", "white void"}),
- "You are surrounded by empty, white expanse in all directions");
- add_item(({"armchair", "armchairs", "chair", "chairs"}),
- (: armchairs_look :));
- add_item(({"television", "screen", "tv", "tv screen"}),
- (: television_look :));
- add_exit("/cont1/room/docks", "aloria");
- add_exit("/cont3/room/town/jetty", "nador");
- add_exit("/w/claw/island/rooms/pier2", "isle");
- add_exit("/w/annihilator/boat/rooms/valgaria_dock", "valg");
- add_exit("/cont2/village/dock", "rura");
- }
- void init()
- {
- room::init();
- if(filter(query_shadows(this_player()),
- (:function_exists("move",$1):)) != ({}))
- destruct(filter(query_shadows(this_player()),
- (:function_exists("move",$1):))[0]);
- add_action("turn_knob","turn");
- add_action("sit_down","sit");
- add_action("stand_up","stand");
- }
- int turn_knob(string str)
- {
- if(!str || str != "knob") return 0;
- if(!television) {
- write("You turn on the television.\n");
- say(this_player()->query_name()+" turns on the television.\n");
- television = 1;
- return 1;
- }
- else
- {
- write("You turn off the television.\n");
- say(this_player()->query_name()+" turns off the television.\n");
- television = 0;
- return 1;
- } // End of else statement.
- } // End of turn_knob fcn.
- int sit_down(string str)
- {
- int i = sizeof(sitting=filter(sitting,(: $1 :)));
- if(query_sitting(this_player()))
- {
- notify_fail("You are already seated!\n");
- return 0;
- }
- if(i == 2)
- {
- write("Get off my lap! These chairs are already taken!\n");
- say(this_player()->query_name()+" tries to sit on your lap!\n");
- return 1;
- }
- else
- {
- write("You settle into an armchair.\n");
- say(this_player()->query_name()+" settles into one of the chairs.\n");
- sitting += ({this_player()});
- return 1;
- } // End of else statement.
- } // End of sit_down fcn.
- int stand_up(string str)
- {
- if(str && str != "up") return 0;
- if(!query_sitting(this_player()))
- {
- notify_fail("You are already standing.\n");
- return 0;
- }
- write("You stand up from the chair.\n");
- say(this_player()->query_name()+" stands up from the chair.\n");
- sitting -= ({this_player()});
- return 1;
- }
- int query_sitting(object who) { return (member_array(who,sitting) >= 0); }
- int exit(object ob)
- {
- object who = (ob || previous_object());
- if(query_sitting(who)) sitting -= ({who});
- return 0;
- }
- query_trans_in_shield() { return 1; }
- query_trans_out_shield() { return 1; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement