generic decal #141
Aliases: generic decal
17 verbs · 28 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
look_place_msg | this none this | rxd | #141 | 22 |
hear_event_move | this none this | rxd | #141 | 3 |
_disperse | this none this | rx | #141 | 7 |
look_self | this none this | rxd | #141 | 4 |
_exclude_by | this none this | rxd | #141 | 6 |
tell_person | this none this | rxd | #141 | 9 |
wipe clean mop | this none none | rxd | #141 | 24 |
creature_heartbeat | this none this | rxd | #141 | 25 |
lick taste eat | this none none | rxd | #141 | 30 |
hear_event_arrive | this none this | rxd | #141 | 1 |
_accumulated | this none this | rxd | #141 | 0 |
add_to | this none this | rxd | #141 | 47 |
tree_tag | this none this | rxd | #141 | 13 |
moveto | this none this | rxd | #141 | 33 |
reduce_by | this none this | rxd | #141 | 7 |
accumulation_on | this none this | rxd | #141 | 3 |
_check_disperse | this none this | rxd | #141 | 13 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
exclusive_to | #141 | rc | #361 | #-1 |
look_place_msg | #141 | rc | #361 | {{#489, "A decal is stuck to the wall."}, {#3, "A decal is stuck to the ground."}} |
stick_time | #141 | r | #361 | 1335055046 |
lifespan | #141 | rc | #361 | 60 |
accumulation | #141 | r | #361 | 1 |
junk_ok | #141 | rc | #361 | 1 |
look_person_msg | #141 | rc | #361 | {"A decal is stuck to %dn.", "A couple of decals are stuck to %dn.", "%DN is covered with decals."} |
wipeable | #141 | rc | #361 | 0 |
clean_msg | #141 | rc | #361 | "%DN wipes up some of the mess." |
clean_last_msg | #141 | rc | #361 | "%DN wipes up the last of the mess." |
disperse_msg | #141 | rc | #361 | "" |
blood | #141 | rc | #361 | {} |
infect_chance | #141 | rc | #361 | 5 |
max_accumulation | #141 | rc | #361 | 10 |
nutrition | #141 | rc | #361 | #-1 |
lick_self_msg | #141 | rc | #361 | "%DN licks at %dt on %oself." |
look_place_air_msg | #141 | rc | #361 | "A faint mist hangs in the air." |
falls | #141 | rc | #361 | 1 |
aliases | #1 | rc | #361 | {"generic decal"} |
description | #1 | rc | #361 | "" |
object_size | #1 | r | #29 | {11715, 1298433821} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | -1 |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #225 generic liquid, #256 generic gas
Call graph
Source
look_place_msg
Referenced by
- #141:look_self line 1:
this:look_place_msg
Source
1m = ""; 2if (is_a(this.location, #761)) 3m = this.look_place_air_msg; 4elseif (typeof(this.(verb)) == STR) 5m = this.(verb); 6else 7for x in (this.(verb)) 8if (is_a(this.location, x[1])) 9m = x[max(2, min(length(x), this.accumulation + 1))]; 10m = strsub(m, "%t", this.name); 11if (player:check_pref("boldnames")) 12m = strsub(m, this.name, ($ansi.bold_on + this.name) + $ansi.bold_off); 13endif 14return $su:capitalize(m); 15endif 16endfor 17endif 18m = strsub(m, "%t", this.name); 19if (player:check_pref("boldnames")) 20m = strsub(m, this.name, ($ansi.bold_on + this.name) + $ansi.bold_off); 21endif 22return $su:capitalize(m);
hear_event_move
Referenced by
none
Source
1if (!args[1]) 2this:_check_disperse(1); 3endif
_disperse
Referenced by
- #141:_check_disperse line 10:
this:_disperse
Source
1"Our lifespan ran out. Recycle."; 2if (!this.f) 3if (m = this.disperse_msg) 4`this.location:announce_all($su:ps(m, this, this, this.location)) ! ANY => 0'; 5endif 6`$recycler:_recycle(this) ! ANY => 0'; 7endif
look_self
Referenced by
none
Source
1if (m = this:look_place_msg()) 2player:tell(m, $ansi.reset); 3endif 4return pass(@args);
_exclude_by
Referenced by
none
Source
1":_exclude_by(OBJ excluder) => A new decal is coming in to supercede us. We go away."; 2fork (0) 3if (!this.f) 4$recycler:_recycle(this); 5endif 6endfork
tell_person
Referenced by
none
Source
1who = args[1]; 2if (!this.accumulation) 3$rpg:junk(this); 4return; 5endif 6l = max(1, min(this.accumulation, length(this.look_person_msg))); 7m = this.look_person_msg[l]; 8m = $su:ps(m, who, this); 9player:tell(m);
wipe clean mop
Referenced by
none
Source
1if (!this.wipeable) 2player:tell("You can't just wipe that up."); 3return; 4endif 5if (this.location == player) 6player:tell("You don't think you'll be able to get it off by just wiping."); 7return; 8endif 9if (is_a(this.location, #1034) || is_a(this.location, #1047)) 10player:aat(player:dnamec(), " swirls ", this:dname(), " around in the water with ", player.pp, " hand."); 11return; 12endif 13this.accumulation = min(this.accumulation, this.max_accumulation); 14if (this.accumulation > 1) 15this.accumulation = this.accumulation / 3; 16else 17this.accumulation = this.accumulation - 1; 18endif 19if (this.accumulation > 0) 20player:aat($su:ps($su:msg(this.clean_msg), player)); 21else 22player:aat($su:ps($su:msg(this.clean_last_msg), player)); 23$recycler:_recycle(this); 24endif
creature_heartbeat
Referenced by
none
Source
1if (this.f || (!this.blood)) 2return; 3endif 4who = args[1]; 5blood = this.blood; 6for drug in (blood) 7if ((!drug.blood_splash_transmissible) || (drug:doses_for(who) >= drug.max_doses)) 8blood = setremove(blood, drug); 9endif 10endfor 11if (!blood) 12return; 13endif 14if (this.location == who) 15if (random(100) < this.infect_chance) 16which = blood[random($)]; 17if (which.blood_splash_transmissible) 18who:ingest(which, random(2) + 1, 0); 19endif 20this.accumulation = this.accumulation - 1; 21endif 22if (this.accumulation < 1) 23$rpg:junk(this); 24endif 25endif
lick taste eat
Referenced by
none
Source
1if (!this.wipeable) 2player:tell("You can't just lick that up."); 3return; 4endif 5if (this.location == player) 6if (this.self_lick_ok) 7player:aat($su:ps($su:msg(this.lick_self_msg), player, this)); 8else 9player:tell("You can't lick that off yourself. Maybe you can't reach it, or it's soaked into your clothes or something. Whatever; the point is that you can't."); 10return; 11endif 12elseif (this.accumulation > 1) 13player:aat($su:ps($su:msg(this.lick_msg), player)); 14else 15player:aat($su:ps($su:msg(this.lick_last_msg), player)); 16endif 17this.accumulation = this.accumulation - 1; 18if (valid(this.nutrition) && (random(100) < 5)) 19player:ingest(this.nutrition, 1); 20endif 21if (this.blood) 22for x in (this.blood) 23if (random(100) < this.lick_infect_chance) 24player:ingest(x, 1); 25endif 26endfor 27endif 28if (!this.accumulation) 29$recycler:_recycle(this); 30endif
hear_event_arrive
Referenced by
none
Source
1this:_check_disperse();
_accumulated
Referenced by
- #141:moveto line 28:
this:_accumulated
Source
No program (verb defined but unprogrammed).
add_to
Referenced by
none
Source
1"$decal:add_to(OBJ dest, INT amount, LIST blood) => OBJ decal."; 2"Adds the amount and blood items to this type of decal if it already exists at dest. If this decal doesn't exist at dest, create a new one and assign the args to it."; 3{dest, ?amount = 1, ?blood = {}} = args; 4if (!valid(dest)) 5return; 6endif 7if (typeof(blood) != LIST) 8raise(E_INVARG); 9endif 10excluder = this.exclusive_to; 11if (valid(excluder)) 12"minor optimization here -- newly added decals will always be at the back of .contents"; 13contents = dest.contents; 14i = length(contents); 15while (i >= 1) 16o = contents[i]; 17if (is_a(o, excluder)) 18new_acc = min(o.accumulation + amount, o.max_accumulation); 19o.lifespan = (o.lifespan / 2) + this.lifespan; 20o.stick_time = time(); 21for b in (o.blood) 22if (!(b in blood)) 23blood = {@blood, b}; 24endif 25endfor 26o.accumulation = new_acc; 27o.blood = blood; 28o:_accumulated(new_acc, dest); 29return o; 30endif 31i = i - 1; 32yield 0; 33endwhile 34endif 35"if we get here, we need a new one"; 36if (dest:acceptable(this)) 37o = $rpg:spawn(this); 38if (!valid(o)) 39raise(E_INVARG, tostr("Unable to spawn new decal ", this)); 40endif 41o.blood = blood; 42o.accumulation = amount; 43o:_accumulated(amount, dest); 44o:moveto(dest); 45return o; 46endif 47return #-1;
tree_tag
Referenced by
none
Source
1r = ""; 2if (this.wipeable) 3r = r + " wipeable"; 4endif 5if (valid(this.exclusive_to)) 6r = (r + " ") + $su:nn(this.exclusive_to); 7endif 8r = $su:trim(r); 9s = pass(@args); 10if (s) 11return (s + " ") + r; 12endif 13return r;
moveto
Referenced by
none
Source
1if (valid(args[1])) 2total = 0; 3excl = this.exclusive_to; 4if (valid(excl)) 5for x in (args[1].contents) 6if (is_a(x, excl)) 7current = this.accumulation; 8this.accumulation = this.accumulation + x.accumulation; 9this.accumulation = min(this.accumulation, this.max_accumulation); 10total = total + (this.accumulation - current); 11this.lifespan = this.lifespan + (x.lifespan / 2); 12if (is_a(x, $creature)) 13for b in (x.blood) 14if (!(b in this.blood)) 15this.blood = {@this.blood, b}; 16endif 17endfor 18endif 19$rpg:junk(x); 20endif 21endfor 22if (!is_a(this, $decal)) 23return; 24endif 25endif 26this.stick_time = time(); 27if (total) 28this:_accumulated(total, args[1]); 29endif 30return pass(@args); 31else 32$rpg:junk(this); 33endif
reduce_by
Referenced by
none
Source
1x = args[1]; 2this.accumulation = max(this.accumulation - x, 0); 3if (this.accumulation < 1) 4if (!this.f) 5$recycler:_recycle(this); 6endif 7endif
accumulation_on
Referenced by
none
Source
1":accumulation_on(what) => Return the accumulation of this kind of decal on 'what'."; 2{what} = args; 3return `what:occupants(this)[1].accumulation ! E_RANGE => 0';
_check_disperse
Referenced by
- #141:hear_event_move line 2:
this:_check_disperse - #141:hear_event_arrive line 1:
this:_check_disperse
Source
1{?player_check = 0} = args; 2if ((time() - this.stick_time) > this.lifespan) 3if (player_check) 4for x in (this.location.contents) 5if (is_player(x)) 6return 0; 7endif 8endfor 9endif 10this:_disperse(); 11return 1; 12endif 13return 0;