LRPG Illuminated Room #16070

Parent #258Owner Flags Source rpg_march_2006/Misc/illuminatedroom.txt

Aliases: LRPG Illuminated Room, RPX Light Room, Lighted Room, Light Room

16 verbs · 25 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
enterfuncthis none this#1607010
illuminatethis none this#1607016
darkenthis none this#1607015
exitfuncthis none this#1607011
illumination_checkthis none this#1607015
descriptionthis none this#1607013
visiblethis none this#1607012
dark_descriptionthis none this#160701
sayany any anyrxd#160708
look_selfthis none this#160709
l*ookany any anyrxd#160700
pare*_listthis none this#1607016
emote thinkany any anyrxd#160708
tell_contentsthis none this#160702
announce_allthis none this#1607011
obvious_exits obvious_entrancesthis none this#160704

Properties

PropertyDefinerFlagsOwnerValue
illumination#16070rc{}
lightlevel#16070rc0
totally_dark_msg#16070rc"It's pitch black in here."
adjacent#16070rc{}
fully_lit#16070rc100
illumination_msg#16070rc
value (298 chars){"Shadows are cast about %T from the pitiful light source.", "%T is slightly illuminated by the flickering light source.", "You can almost see %T clearly in the light.", "%T is well lit by the strong light source.", "%T is flooded with the blinding light emanating from the powerful light source."}
light_enabled#16070r0
dark_description#16070rc"Sure is some dark in here, boy."
misc_notes#16070not readable (E_PERM)
magic_effects#16070not readable (E_PERM)
combat_effects#16070not readable (E_PERM)
unannounced#16070not readable (E_PERM)
allowed_exits#16070not readable (E_PERM)
dawn_msg#16070""
night_msg#16070""
dusk_msg#16070""
day_msg#16070""
free_entry#160700
entrances#16070not readable (E_PERM)
exits#16070not readable (E_PERM)
ctype#160705
key#16070not readable (E_PERM)
aliases#16070{"LRPG Illuminated Room", "RPX Light Room", "Lighted Room", "Light Room"}
description#16070"Woo, pretty dark in here ... but there is that dimmer switch on the wall."
object_size#16070{11110, 1141286561}

Ancestry

Ancestors (nearest first): #258 Generic Dungeon Room#1610 RPG RDB room#364 outside room#6792 Generic Integrating Description Room#3879 Matching Room#27777 Self-Cleaning Room

Children: none

Call graph

calls n16070_0 #16070:enterfunc n16070_1 #16070:illuminate n16070_0->n16070_1 n258_2 #258:enterfunc n16070_0->n258_2 n16070_3 #16070:exitfunc n258_6 #258:exitfunc n16070_3->n258_6 n16070_2 #16070:darken n16070_3->n16070_2 n16070_4 #16070:illumination_check n258_11 #258:announce_all_but n16070_4->n258_11 n16070_9 #16070:look_self n16070_4->n16070_9 n16070_14 #16070:announce_all n16070_4->n16070_14 n258_30 #258:look_self n16070_9->n258_30 n258_18 #258:contents n16070_14->n258_18 n16070_5 #16070:description n16070_7 #16070:dark_description n16070_5->n16070_7 n1610_6 #1610:description n16070_5->n1610_6 n16070_6 #16070:visible n258_7 #258:exits n16070_6->n258_7 n16070_8 #16070:say n258_67 #258:announce n16070_8->n258_67 n16070_12 #16070:emote n16070_12->n16070_14 n16070_13 #16070:tell_contents n258_5 #258:tell_contents n16070_13->n258_5 n16070_15 #16070:obvious_exits n258_26 #258:obvious_exits n16070_15->n258_26

Source

enterfunc

Spec this none thisDefiner #16070

Referenced by

none

Source

1"enterfunc ( victim ) =>";
2"In addition to normal functions, make a call to see if the";
3"lightlevel of the room needs adjusting.";
4{what} = args;
5if ((this.light_enabled && (what.location == this)) && (what in $local.rpg.pcs))
6  this:illuminate(what);
7endif
8pass(what);
9"THX1138 13-MAR-1997 -- Added.";
10player:tell("Room illuminances: ", toliteral(this.illumination));

illuminate

Spec this none thisDefiner #16070

Referenced by

Source

1(rpg = $local.rpg):secure();
2if (this.light_enabled)
3  {what} = args;
4  lightlevel = this.lightlevel;
5  if (valid(doll = rpg:get_doll(what)))
6    for t in (doll.lights)
7      this.illumination = setadd(this.illumination, t);
8      this.lightlevel = this.lightlevel + t:candlefeet();
9    endfor
10    player:tell("Doll illuminations: ", toliteral(doll.lights), " on ", #20:nn(doll));
11  elseif (rpg:trusted_verb(what, "candlefeet"))
12    this.illumination = setadd(this.illumination, what);
13    this.lightlevel = this.lightlevel + what:candlefeet();
14  endif
15endif
16"THX1138 13-MAR-1997 -- Added.";

darken

Spec this none thisDefiner #16070

Referenced by

Source

1(rpg = $local.rpg):secure();
2if (this.light_enabled)
3  {what} = args;
4  lightlevel = this.lightlevel;
5  if (valid(doll = rpg:get_doll(what)))
6    for t in (doll.lights)
7      this.illumination = setremove(this.illumination, t);
8      this.lightlevel = this.lightlevel - t:candlefeet();
9    endfor
10  elseif (rpg:trusted_verb(what, "candlefeet"))
11    this.illumination = setremove(this.illumination, what);
12    this.lightlevel = this.lightlevel - what:candlefeet();
13  endif
14endif
15"THX1138 13-MAR-1997 -- Added.";

exitfunc

Spec this none thisDefiner #16070

Referenced by

none

Source

1"exitfunc ( victim ) =>";
2"In addition to normal functions, make a call to see if the lightlevel of the room needs adjusting.";
3{what} = args;
4if (!(rpg = $local.rpg):trusted_efunc())
5  return E_PERM;
6endif
7pass(what);
8if ((this.light_enabled && (what.location != this)) && (what in rpg.pcs))
9  this:darken(what);
10endif
11"THX1138 13-MAR-1997 -- Added.";

illumination_check

Spec this none thisDefiner #16070

Referenced by

none

Source

1{?lightlevel} = args;
2if (this.illumination)
3  if (lightlevel < 1)
4    this:announce_all_but({player}, this.name, " is flooded with light.");
5    " ... show the person who walked in the room.";
6    if ("light" in $list_utils:slice(callers(), 2))
7      this:look_self();
8    endif
9  endif
10else
11  if (lightlevel > 0)
12    this.lightlevel = 0;
13    this:announce_all(this.name, " is cast into darkness.");
14  endif
15endif

description

Spec this none thisDefiner #16070

Referenced by

none

Source

1"description() ... returns the regular integrating room description unless the lightlevel in the room is less than one, in which case it returns :dark_description().";
2if ((!this.illumination) || (this.lightlevel < 1))
3  return this:dark_description();
4else
5  if (typeof(desc = pass(@args)) != LIST)
6    desc = {desc};
7  endif
8  if (desc = this:pare_list(desc))
9    return desc;
10  else
11    return {"The light in here is very dim and you have difficulty making out details."};
12  endif
13endif

visible

Spec this none thisDefiner #16070

Referenced by

none

Source

1who = (args == {}) ? player | args[1];
2firstlist = setremove({@who.contents, @this.contents, @this:exits()}, who);
3for each_room in (this.adjacent)
4  if (each_room in this.visible_from_here)
5    if (each_room.lightlevel > 4)
6      for each_thing in (each_room.contents)
7        firstlist = setadd(firstlist, each_thing);
8      endfor
9    endif
10  endif
11endfor
12return firstlist;

dark_description

Spec this none thisDefiner #16070

Referenced by

Source

1return this.dark_description || "It is too dark to see.";

say

Spec any any anyFlags rxdDefiner #16070

Referenced by

none

Source

1attrib = ((this.lightlevel * 15) / this.fully_lit) ? player.name | "Somebody";
2try
3  player:tell("You say, \"", argstr, "\"");
4  "If light greater than 7 percent of fully, players can figure out who is saying what.";
5  this:announce(attrib, " ", $gender_utils:get_conj("says", player), ", \"", argstr, "\"");
6except (ANY)
7  "Don't really need to do anything but ignore the idiot who has a bad :tell";
8endtry

look_self

Spec this none thisDefiner #16070

Referenced by

Source

1if (!this.lightlevel)
2  if (this.totally_dark_msg)
3    player:tell(this.totally_dark_msg);
4  else
5    player:tell("You can't see anything.");
6  endif
7else
8  pass(@args);
9endif

l*ook

Spec any any anyFlags rxdDefiner #16070

Referenced by

none

Source

No program (verb defined but unprogrammed).

pare*_list

Spec this none thisDefiner #16070

Referenced by

none

Source

1"pare_list(incoming LIST) => outgoing list pared down by room lighting.";
2{incoming} = args;
3if (((lightlevel = this.lightlevel) < 1) || (!incoming))
4  return {};
5elseif ((fully = this.fully_lit) <= lightlevel)
6  return incoming;
7else
8  outgoing = {};
9  for t in (incoming)
10    if (random(fully) <= lightlevel)
11      outgoing = setadd(outgoing, t);
12    endif
13  endfor
14  return outgoing;
15endif
16"THX1138 15-MAR-1997 -- Added.";

emote think

Spec any any anyFlags rxdDefiner #16070

Referenced by

none

Source

1attrib = ((this.lightlevel * 15) / this.fully_lit) ? player.name | "Somebody";
2if (verb == "think")
3  this:announce_all(attrib, " . o O ( ", argstr[1..length(argstr)], " )");
4elseif ((argstr != "") && (argstr[1] == ":"))
5  this:announce_all(attrib, argstr[2..length(argstr)]);
6else
7  this:announce_all(attrib, " ", argstr);
8endif

tell_contents

Spec this none thisDefiner #16070

Referenced by

none

Source

1{contents, ctype} = args;
2pass(this:pare_list(contents), ctype);

announce_all

Spec this none thisDefiner #16070

Referenced by

Source

1if (args[1] == player.name)
2  args[1] = ((this.lightlevel * 15) / this.fully_lit) ? player.name | "Somebody";
3endif
4for dude in (this:contents())
5  try
6    dude:tell(@args);
7  except (ANY)
8    "Just ignore the dude with the stupid :tell";
9    continue dude;
10  endtry
11endfor

obvious_exits obvious_entrances

Spec this none thisDefiner #16070

Referenced by

none

Source

1if ((!this.light_enabled) || (player in $local.rpg.gms))
2  return pass(@args);
3endif
4return this:pare_list(pass(@args));