generic light source #18754

Parent #59933Owner Flags Source rpg_march_2006/lightsrc.txt

Aliases: generic light source, light, source

22 verbs · 34 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
descriptionthis none this#187545
douse ex*tinguishthis none nonerx#1875417
tell_conditionthis none thisrx#1875415
possible_glimmerthis none thisrx#187545
conditionthis none thisrx#187549
destroythis none this#1875420
cprthis none thisrx#187546
pulsethis none this#187547
moveto(obsolete)this none this#1875426
locate(obsolete)this none this#187549
location(obsolete)this none this#187545
titlethis none this#187543
do_unwieldthis none this#187547
do_dousethis none thisrx#1875412
lightthis none nonerxd#1875426
lumensthis none this#187548
do_movethis none this#1875427
rechargethis none this#187543
do_move(obsolete)this none this#1875417
do_douse(obsolete)this none thisrx#1875414
light(obsolete)this none nonerxd#1875434
do_lightthis none nonerxd#1875414

Properties

PropertyDefinerFlagsOwnerValue
fuel_packets#18754r8
home#18754rc#16020
burning_desc#18754rc"A small translucent orb, furiously shedding light on the scene."
burning#18754r0
max_charges#18754not readable (E_PERM)
heart#18754rc#48923
lumens#18754r12
bonus#18754not readable (E_PERM)
visible_spells#18754not readable (E_PERM)
no_imp#18754not readable (E_PERM)
dodgable#18754not readable (E_PERM)
parryable#18754not readable (E_PERM)
slowness#18754not readable (E_PERM)
parry#18754not readable (E_PERM)
attack#18754not readable (E_PERM)
pen#18754not readable (E_PERM)
dam#18754not readable (E_PERM)
skill#18754not readable (E_PERM)
pierce#187540
max_str_bonus#18754not readable (E_PERM)
can_degrade#18754not readable (E_PERM)
track_usage#18754not readable (E_PERM)
encumbrance#187541
manufactured#18754820783482
worth#18754-1
condition#18754100
use_spell_msg_db#187541
odrop_failed_msg#18754"%<tries> to drop %t but fails!"
odrop_succeeded_msg#18754"%<drops> %t."
otake_succeeded_msg#18754"%<picks> up %t."
key#18754not readable (E_PERM)
aliases#18754{"generic light source", "light", "source"}
description#18754"A small translucent orb."
object_size#18754{17479, 1141286561}

Ancestry

Ancestors (nearest first): #59933 Generic Weapon Spell Focus#82 generic weapon#517 Generic LRPG Thing

Children: none

Call graph

calls n18754_0 #18754:description n517_35 #517:description n18754_0->n517_35 n18754_1 #18754:douse n18754_13 #18754:do_douse n18754_1->n18754_13 n18754_7 #18754:pulse n18754_3 #18754:possible_glimmer n18754_7->n18754_3 n517_30 #517:moveto n18754_7->n517_30 n18754_12 #18754:do_unwield n18754_12->n18754_1 n82_34 #82:do_unwield n18754_12->n82_34 n18754_14 #18754:light n82_20 #82:may_wield n18754_14->n82_20 n82_0 #82:wield n18754_14->n82_0 n18754_21 #18754:do_light n18754_14->n18754_21 n18754_16 #18754:do_move n18754_16->n82_0 n82_23 #82:do_move n18754_16->n82_23 n18754_15 #18754:lumens n18754_16->n18754_15 n18754_18 #18754:do_move(obsolete) n18754_18->n82_0 n18754_18->n18754_15 n18754_20 #18754:light(obsolete) n18754_20->n82_0

Source

description

Spec this none thisDefiner #18754

Referenced by

none

Source

1if (this.burning)
2  return this.burning_desc;
3else
4  return pass(@args);
5endif

douse ex*tinguish

Spec this none noneFlags rxDefiner #18754

Referenced by

Source

1rpg = $local.rpg;
2if (!rpg:trusted())
3  return E_PERM;
4elseif ((player.location != this.location) && (this.location != player))
5  player:tell("You cannot reach ", this.name, " from there.");
6elseif (!this.burning)
7  player:tell("The ", this.name, " is not lit.");
8else
9  "OK, actually do the dousing.";
10  rpg:say_action("%N %<extinguishes> %t.", player, this);
11  this:do_douse();
12endif
13"DR 22-MAR-94 -- Fixed permissions check bug and added location check, cleaned up the logic for better readability.";
14"DR 06-AUG-94 -- Added heart functionality.";
15"Profane 28-FEB-95 -- s/$object_utils:has_verb/rpg:trusted_verb/1-$";
16"Profane 4-MAR-95 -- changed message announcing to rpg:say_action. Maybe others will actually SEE the message now.";
17"Profane 7-JAN-96 1908PST -- moved actual douse bit to :do_douse";

tell_condition

Spec this none thisFlags rxDefiner #18754

Referenced by

none

Source

1if (this.fuel_packets == 0)
2  player:tell(("The " + this.name) + " is on its last legs!");
3elseif (this.fuel_packets == this.max_charges)
4  player:tell("The ", this.name, " is spiffy and new!");
5  return;
6else
7  factor = this.max_charges / this.fuel_packets;
8  if (factor > 1)
9    if (factor > 2)
10      player:tell(("The " + this.name) + " is looking quite exhausted.");
11    else
12      player:tell(("The " + this.name) + " is starting to look a bit tired.");
13    endif
14  endif
15endif

possible_glimmer

Spec this none thisFlags rxDefiner #18754

Referenced by

Source

1if (#46:trust())
2  if ((random(100) > 95) && $object_utils:has_callable_verb(args[1], "echo"))
3    args[1]:echo("You notice a glimmer of light from somewhere nearby.  Watch for more.");
4  endif
5endif

condition

Spec this none thisFlags rxDefiner #18754

Referenced by

none

Source

1factor = 0;
2if (this.max_charges)
3  factor = 100 / this.max_charges;
4endif
5if (!factor)
6  factor = 1;
7endif
8return this.fuel_packets * factor;
9"DR 22-MAR-94 - Originated.  Sort of a stopgap, since max_charges>100 is not well handled.";

destroy

Spec this none thisDefiner #18754

Referenced by

none

Source

1(rpg = $local.rpg):secure();
2doll = rpg:get_doll(loc = this.location);
3if (valid(doll))
4  doll:relight(this, 0);
5else
6  `loc:relight(this, 0) ! ANY';
7endif
8rpg.recycler:_recycle(this);
9return;
10if (rpg:trusted_verb(loc, "illumination_check"))
11  loc:illumination_check();
12else
13  if (rpg:trusted_verb(ploc = loc.location, "illumination_check") && (loc in rpg.pcs))
14    ploc:illumination_check();
15  endif
16endif
17"DR 18-MAY-94 Moved from throwable to light source, where it belongs, added security check.";
18"Profane 2-MAR-95 13:33EST - s/rpg:trusted()/rpg:trust()/1 &&  s/$object_utils:has_verb/rpg:trusted_verb/1-$ -- make security actually work";
19"THX1138 23-FEB-1997 -- Tossed the messaging.  Will use Profane's trusted checks here for all kids instead.  Messaging on the kids.";
20"THX (#105941) - Sun Apr  1, 2001 - Started changing over to the new lighting system.";

cpr

Spec this none thisFlags rxDefiner #18754

Referenced by

none

Source

1"then modified to do traditional RPG security check.";
2"Recompute order, then jump-start the heart.";
3if (!$local.rpg:trust())
4  return E_PERM;
5endif
6this.heart:add(this);

pulse

Spec this none thisDefiner #18754

Referenced by

none

Source

1if (!(rpg = $local.rpg):trust())
2  return E_PERM;
3endif
4if (this.burning)
5  `this:possible_glimmer(this.location.location) ! E_PROPNF, E_INVIND => this:moveto(rpg.cemetery)';
6endif
7"Mooshie (#106469) - Fri Oct 10 21:16:55 1997 PDT - Added error catching if this is stuck in #-1.";

moveto(obsolete)

Spec this none thisDefiner #18754

Referenced by

none

Source

1db = $local.rpg;
2dest = args[1];
3doll = db:get_doll(place = this.location);
4if ((valid(dest) && (valid(doll) && (dest.location == place))) && (!(dest.owner in db.gms)))
5  return E_PERM;
6elseif ((!valid(place = this.location)) || (!valid(dest)))
7  ok = db:trust();
8elseif (place.location in {dest, dest.location})
9  ok = db:trust(place.owner, place);
10elseif (place == dest.location)
11  ok = db:trust(dest);
12else
13  ok = db:trust();
14endif
15if (!ok)
16  return E_PERM;
17else
18  pass(dest);
19  if ((((!valid(where = this.location)) || (where == place)) || $code_utils:verb_or_property(where, "opaque")) || 0)
20  elseif ($local.rpg:trusted_verb(where, "illumination_check"))
21    where:illumination_check();
22  elseif (valid(where = this.location.location) && $local.rpg:trusted_verb(where, "illumination_check"))
23    where:illumination_check();
24  endif
25endif
26"Profane 4-MAR-95 13:00EST -- Added.";

locate(obsolete)

Spec this none thisDefiner #18754

Referenced by

none

Source

1"Copied from rpx throwable adventure gear (#9296):locate by UndergroundsKeeper (#77500) Thu Aug 15 12:30:35 1996 PDT";
2target = args[1];
3if ($object_utils:has_verb(target, "location"))
4  return target:location();
5endif
6if ($object_utils:has_verb(target.location, "get_location"))
7  return target.location:get_location(target);
8endif
9return target.location;

location(obsolete)

Spec this none thisDefiner #18754

Referenced by

none

Source

1"Copied from rpx throwable adventure gear (#9296):location by UndergroundsKeeper (#77500) Thu Aug 15 12:30:39 1996 PDT";
2if ($object_utils:has_verb(this.location, "get_location"))
3  return this.location:get_location(this);
4endif
5return this.location;

title

Spec this none thisDefiner #18754

Referenced by

none

Source

1name = (this.burning ? "lit " | "") + this.name;
2prefix = $list_utils:iassoc("tell_contents", callers(), 2) ? $string_utils:a_or_an(name) + " " | "";
3return prefix + name;

do_unwield

Spec this none thisDefiner #18754

Referenced by

none

Source

1rpg = $local.rpg;
2if (rpg:trusted(caller_perms()))
3  this.burning ? this:douse() | 0;
4  return pass(@args);
5else
6  return E_PERM;
7endif

do_douse

Spec this none thisFlags rxDefiner #18754

Referenced by

Source

1if (!this.burning)
2  return E_NONE;
3endif
4(rpg = $local.rpg):secure();
5this.burning = 0;
6doll = rpg:get_doll(loc = this.location);
7if (valid(doll))
8  doll:relight(this, 0);
9else
10  `loc:relight(this, 0) ! ANY';
11endif
12this.heart:remove(this);

light

Spec this none noneFlags rxdDefiner #18754

Referenced by

none

Source

1rpg = $local.rpg;
2if (callers() && (!rpg:trusted(caller_perms())))
3  return E_PERM;
4elseif ((player.location != (loc = this.location)) && (loc != player))
5  player:tell("You can't reach ", this.name, " from there.");
6elseif (this.burning)
7  player:tell("The ", this.name, " is already lit.");
8elseif (this.fuel_packets < 1)
9  player:tell("The damn thing needs to be recharged.  It doesn't work!");
10elseif (!valid(doll = rpg:get_doll(player)))
11  player:tell("You can't figure out how.  Haven't been drinking your milk lately, eh?");
12elseif (!this:may_wield(player))
13else
14  if ((loc == player) && (!(this in doll.wielding)))
15    this:wield();
16  endif
17  rpg:say_action("%N %<lights> %t.", player, this);
18  this:do_light(doll);
19endif
20"DR 22-MAR-94  - Added location check, rewrote for clarity.";
21"Miles 21-MAY-94 -- made both .burning and .fuel_packets !c";
22"DR 06-AUG-94 -- Added functionality for the heart.";
23"DR 14-SEP-94 -- Fixed permissions bug.";
24"Profane 28-FEB-95 -- s/$object_utils:has_verb/rpg:trusted_verb/1-$";
25"Profane 4-MAR-95 -- changed message announcing to a rpg:say_action. Maybe others will actually SEE the message now.";
26"THX (#105941) - Sun Apr  1, 2001 - Started changing for the new lighting system.  Including spawning guts off to :do_light().";

lumens

Spec this none thisDefiner #18754

Referenced by

Source

1":lumens(OBJ lighted location) => luminous flux from this object in <lighted location>.";
2"Generate a luminous flux from the lightsource in lumens.  Do this relative to. let's say, a candle:";
3"e.g., a candle has a luminous intensity of about 1 candela.  Through all the region surrounding this intensity source we'd have 4 x pi solid angles.   This is approximately 12 lumens, then, in the case of the candle.   This will be fed into an approximation of room size to generate an illuminance.  Someone else can do the ray tracing (BWAH!!!)";
4if (this.burning)
5  return this.(verb);
6else
7  return 0;
8endif

do_move

Spec this none thisDefiner #18754

Referenced by

none

Source

1{oldloc, newloc} = args;
2if (oldloc == newloc)
3  return 0;
4endif
5(rpg = $local.rpg):secure();
6pass(oldloc, newloc);
7olddoll = rpg:get_doll(oldloc);
8newdoll = rpg:get_doll(newloc);
9if (valid(olddoll))
10  olddoll:relight(this, 0);
11  olddoll.lights || `oldloc.location:relight(olddoll, 0) ! ANY';
12else
13  `oldloc:relight(this, 0) ! ANY';
14endif
15if (valid(newdoll) && this:lumens(loc = newloc.location))
16  newdoll.lights = setadd(newdoll.lights, this);
17  loc:relight(newdoll, 1);
18  fork (0)
19    if (this in newdoll.wielding)
20    elseif (this:lumens(newloc.location))
21      this:wield(this);
22    endif
23  endfork
24elseif (this:lumens(newloc))
25  `newloc:relight(this, 1) ! ANY';
26endif
27"THX (#105941) - Sun Apr  1, 2001 - Started converting over to the new lighting system.";

recharge

Spec this none thisDefiner #18754

Referenced by

none

Source

1{amount} = args;
2$local.rpg:secure();
3this.fuel_packets = this.fuel_packets + amount;

do_move(obsolete)

Spec this none thisDefiner #18754

Referenced by

none

Source

1{oldloc, newloc} = args;
2(rpg = $local.rpg):secure();
3pass(oldloc, newloc);
4if (this:lumens() && valid(doll = rpg:get_doll(newloc)))
5  fork (0)
6    if (this in doll.wielding)
7    elseif (this:lumens())
8      this:wield(this);
9    endif
10  endfork
11endif
12if ((((!valid(newloc)) || (newloc == oldloc)) || $code_utils:verb_or_property(newloc, "opaque")) || 0)
13elseif (rpg:trusted_verb(newloc, "illumination_check"))
14  newloc:illumination_check();
15elseif (valid(newloc = newloc.location) && rpg:trusted_verb(newloc, "illumination_check"))
16  newloc:illumination_check();
17endif

do_douse(obsolete)

Spec this none thisFlags rxDefiner #18754

Referenced by

none

Source

1if (!$local.rpg:trusted(caller_perms()))
2  return E_PERM;
3elseif (!this.burning)
4  return E_NONE;
5else
6  this.burning = 0;
7  if ($local.rpg:trusted_verb(this.location, "illumination_check"))
8    this.location:illumination_check();
9  endif
10  if ($local.rpg:trusted_verb(this.location.location, "illumination_check"))
11    this.location.location:illumination_check();
12  endif
13  this.heart:remove(this);
14endif

light(obsolete)

Spec this none noneFlags rxdDefiner #18754

Referenced by

none

Source

1"Copied from Project Planner (#797):light by THX1138 (#105941) Sat Feb 15 07:44:01 1997 PST";
2rpg = $local.rpg;
3if (callers() && (!rpg:trusted(caller_perms())))
4  return E_PERM;
5elseif ((player.location != (loc = this.location)) && (loc != player))
6  player:tell("You can't reach ", this.name, " from there.");
7elseif (this.burning)
8  player:tell("The ", this.name, " is already lit.");
9elseif (this.fuel_packets < 1)
10  player:tell("The damn thing needs to be recharged.  It doesn't work!");
11elseif (!valid(doll = rpg:get_doll(player)))
12  player:tell("You can't figure out how.  Haven't been drinking your milk lately, eh?");
13else
14  if ((loc == player) && (!(this in doll.wielding)))
15    this:wield();
16  endif
17  rpg:say_action("%N %<lights> %t.", player, this);
18  this.fuel_packets = this.fuel_packets - 1;
19  this.burning = 1;
20  if ((!$object_utils:isa(loc, $room)) && valid(loc.location))
21    if (rpg:trusted_verb(loc.location, "illumination_check"))
22      loc.location:illumination_check();
23    endif
24  elseif (rpg:trusted_verb(loc, "illumination_check"))
25    loc:illumination_check();
26  endif
27  this.heart:add(this);
28endif
29"DR 22-MAR-94  - Added location check, rewrote for clarity.";
30"Miles 21-MAY-94 -- made both .burning and .fuel_packets !c";
31"DR 06-AUG-94 -- Added functionality for the heart.";
32"DR 14-SEP-94 -- Fixed permissions bug.";
33"Profane 28-FEB-95 -- s/$object_utils:has_verb/rpg:trusted_verb/1-$";
34"Profane 4-MAR-95 -- changed message announcing to a rpg:say_action. Maybe others will actually SEE the message now.";

do_light

Spec this none noneFlags rxdDefiner #18754

Referenced by

Source

1{doll} = args;
2if (this.burning)
3  return E_NONE;
4endif
5(rpg = $local.rpg):secure();
6this.fuel_packets = this.fuel_packets - 1;
7this.burning = 1;
8if (valid(doll) && (this.location == doll.character))
9  doll:relight(this, 1);
10else
11  `this.location:relight(this, 1) ! ANY';
12endif
13this.heart:add(this);
14"THX (#105941) - Mon Apr  2, 2001 - Added.";