generic decal #141

Parent #1Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic decal

17 verbs · 28 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
look_place_msgthis none thisrxd#14122
hear_event_movethis none thisrxd#1413
_dispersethis none thisrx#1417
look_selfthis none thisrxd#1414
_exclude_bythis none thisrxd#1416
tell_personthis none thisrxd#1419
wipe clean mopthis none nonerxd#14124
creature_heartbeatthis none thisrxd#14125
lick taste eatthis none nonerxd#14130
hear_event_arrivethis none thisrxd#1411
_accumulatedthis none thisrxd#1410
add_tothis none thisrxd#14147
tree_tagthis none thisrxd#14113
movetothis none thisrxd#14133
reduce_bythis none thisrxd#1417
accumulation_onthis none thisrxd#1413
_check_dispersethis none thisrxd#14113

Properties

PropertyDefinerFlagsOwnerValue
exclusive_to#141rc#361#-1
look_place_msg#141rc#361{{#489, "A decal is stuck to the wall."}, {#3, "A decal is stuck to the ground."}}
stick_time#141r#3611335055046
lifespan#141rc#36160
accumulation#141r#3611
junk_ok#141rc#3611
look_person_msg#141rc#361{"A decal is stuck to %dn.", "A couple of decals are stuck to %dn.", "%DN is covered with decals."}
wipeable#141rc#3610
clean_msg#141rc#361"%DN wipes up some of the mess."
clean_last_msg#141rc#361"%DN wipes up the last of the mess."
disperse_msg#141rc#361""
blood#141rc#361{}
infect_chance#141rc#3615
max_accumulation#141rc#36110
nutrition#141rc#361#-1
lick_self_msg#141rc#361"%DN licks at %dt on %oself."
look_place_air_msg#141rc#361"A faint mist hangs in the air."
falls#141rc#3611
aliases#1rc#361{"generic decal"}
description#1rc#361""
object_size#1r#29{11715, 1298433821}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361-1
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: #225 generic liquid, #256 generic gas

Call graph

calls n141_0 #141:look_place_msg n6_54 #6:check_pref n141_0->n6_54 n20_15 #20:capitalize n141_0->n20_15 n141_1 #141:hear_event_move n141_16 #141:_check_disperse n141_1->n141_16 n141_2 #141:_disperse n141_16->n141_2 n20_34 #20:pronoun_sub n141_2->n20_34 n57_1 #57:_recycle n141_2->n57_1 n141_3 #141:look_self n141_3->n141_0 n107_43 #107:tell n141_3->n107_43 n1_9 #1:look_self n141_3->n1_9 n141_4 #141:_exclude_by n141_4->n57_1 n141_5 #141:tell_person n141_5->n20_34 n141_5->n107_43 n103_2 #103:junk n141_5->n103_2 n141_6 #141:wipe n141_6->n20_34 n141_6->n57_1 n141_6->n107_43 n1_66 #1:announce_action_text n141_6->n1_66 n6_169 #6:dnamec n141_6->n6_169 n1_31 #1:dname n141_6->n1_31 n20_81 #20:msg n141_6->n20_81 n141_7 #141:creature_heartbeat n141_7->n103_2 n141_8 #141:lick n141_8->n20_34 n141_8->n57_1 n141_8->n107_43 n141_8->n1_66 n141_8->n20_81 n107_39 #107:ingest n141_8->n107_39 n141_9 #141:hear_event_arrive n141_9->n141_16 n141_11 #141:add_to n103_1 #103:spawn n141_11->n103_1 n141_12 #141:tree_tag n20_59 #20:name_and_number n141_12->n20_59 n20_9 #20:trim n141_12->n20_9 n1_47 #1:tree_tag n141_12->n1_47 n141_13 #141:moveto n141_13->n103_2 n141_10 #141:_accumulated n141_13->n141_10 n1_13 #1:moveto n141_13->n1_13 n141_14 #141:reduce_by n141_14->n57_1

Source

look_place_msg

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

none

Source

1if (!args[1])
2this:_check_disperse(1);
3endif

_disperse

Spec this none thisFlags rxOwner #361Definer #141

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

none

Source

1if (m = this:look_place_msg())
2player:tell(m, $ansi.reset);
3endif
4return pass(@args);

_exclude_by

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none noneFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none noneFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

none

Source

1this:_check_disperse();

_accumulated

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

Source

No program (verb defined but unprogrammed).

add_to

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

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

Spec this none thisFlags rxdOwner #361Definer #141

Referenced by

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;