generic light #127
Aliases: generic light, light
6 verbs · 33 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
turn switch | any any any | rd | #127 | 22 |
_ignite | this none this | rxd | #127 | 18 |
title | this none this | rxd | #127 | 13 |
light ignite extinguish kill | this none none | rxd | #127 | 18 |
init_for_core | this none this | rxd | #127 | 8 |
replicate | this none this | rxd | #127 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
light_on | #127 | rc | #36 | 0 |
power_units | #127 | rc | #36 | 3 |
burn_task | #127 | r | #36 | 2095205351 |
rechargable | #127 | rc | #36 | 0 |
shows_units | #127 | rc | #36 | 1 |
turn_on_msg | #127 | rc | #36 | "%N %<ignites> %p light." |
turn_off_msg | #127 | rc | #36 | "%N %<extinguishes> %p light." |
returning | #108 | rc | #36 | <clear> |
how_long | #108 | rc | #36 | <clear> |
been_told | #108 | rc | #36 | <clear> |
home | #108 | rc | #36 | <clear> |
child_limit | #108 | rc | #36 | 8 |
recycle_at_death | #108 | rc | #36 | <clear> |
drop_failed_msg | #5 | rc | #36 | <clear> |
drop_succeeded_msg | #5 | rc | #36 | <clear> |
odrop_failed_msg | #5 | rc | #36 | <clear> |
odrop_succeeded_msg | #5 | rc | #36 | <clear> |
otake_succeeded_msg | #5 | rc | #36 | <clear> |
otake_failed_msg | #5 | rc | #36 | <clear> |
take_succeeded_msg | #5 | rc | #36 | <clear> |
take_failed_msg | #5 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | 1 |
y_loc | #102 | r | #36 | 0 |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | list of 8{"@set these properties:", " .power_units => integer, one per 10-minute interval", " 1 = 10 min.; 2 = 20 mins.; 3 = 30 mins.; etc.", " .recycle_at_death => 0 or 1", " .shows_units => 0 or 1", "MESSAGES:", "@turn_on light is \"____\" (sets .turn_on_msg)", "@turn_off light is \"____\" (sets .turn_off_msg)"} |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"generic light", "light"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {5561, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #108 generic replicating & returning thing → #5 generic thing → #102 subthing → #1 Root Class
Children: #156 a torch
Call graph
Source
turn switch
Referenced by
none
Source
1if ((this in {iobj, dobj}) && (prepstr in {"on", "off"})) 2if (prepstr == "on") 3if (this.light_on) 4player:tell(this:titlec(), " is already shining."); 5else 6this:_ignite(); 7$you:say_action(this.turn_on_msg); 8endif 9else 10if (!this.light_on) 11player:tell(this:titlec(), " is already off."); 12else 13if ($scheduler:valid_task(this.burn_task)) 14$scheduler:kill_task(this.burn_task); 15endif 16this.light_on = 0; 17$you:say_action(this.turn_off_msg); 18endif 19endif 20else 21player:tell("That doesn't seem to work."); 22endif
_ignite
Referenced by
- #127:turn line 6:
this:_ignite - #127:light line 5:
this:_ignite
Source
1"Burns a power_unit every 15 minutes."; 2if ($scheduler:valid_task(this.burn_task)) 3$scheduler:kill_task(this.burn_task); 4endif 5this.power_units = this.power_units - 1; 6if (this.power_units > -1) 7this.light_on = 1; 8return this.burn_task = $scheduler:schedule(600, this, "_ignite"); 9elseif (is_player(this.location)) 10this.location.location:announce_all(this:titlec(), " goes dark."); 11elseif ($object_utils:isa(this.location, $room)) 12this.location:announce_all(this:titlec(), " goes dark."); 13endif 14this.light_on = 0; 15if (this.rechargable || this.f) 16return; 17endif 18$recycler:_recycle(this);
title
Referenced by
none
Source
1if (!this.shows_units) 2return pass(@args); 3else 4title = pass(@args); 5if (is_player(this.location) && this.shows_units) 6onoff = this.light_on ? "ON: " | "OFF: "; 7blurb = this.power_units ? tostr(onoff, "energy < ", this.power_units * 10, " min.") | "dead"; 8else 9blurb = this.light_on ? "on" | "off"; 10endif 11title = tostr(title, "(", blurb, ")"); 12return title; 13endif
light ignite extinguish kill
Referenced by
none
Source
1if (verb in {"light", "ignite"}) 2if (this.light_on) 3player:tell(this:titlec(), " is already shining."); 4else 5this:_ignite(); 6$you:say_action(this.turn_on_msg); 7endif 8else 9if (!this.light_on) 10player:tell(this:titlec(), " is already off."); 11else 12if ($scheduler:valid_task(this.burn_task)) 13$scheduler:kill_task(this.burn_task); 14endif 15this.light_on = 0; 16$you:say_action(this.turn_off_msg); 17endif 18endif
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2if (this == $subthing) 3this.burn_task = 0; 4this.rechargable = 0; 5this.power_units = 30; 6endif 7return pass(@args); 8endif
replicate
Referenced by
none
Source
1newone = pass(@args); 2if (valid(newone)) 3newone.light_on = 0; 4endif 5return newone;