generic smashable thing #255

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

Aliases: generic smashable thing, smash

11 verbs · 39 properties · 7 children

Verbs

VerbSpecFlagsDefinerLines
take_damagethis none thisrxd#25521
_breakthis none thisrxd#25520
look_selfthis none thisrxd#2552
is_brokenthis none thisrxd#2551
_repairthis none thisrxd#25517
_repair_checkthis none thisrxd#2557
repair_difficultythis none thisrxd#2551
tell_healththis none thisrxd#2553
chill_factorthis none thisrxd#2553
should_resetthis none thisrxd#2551
on_resetthis none thisrxd#2553

Properties

PropertyDefinerFlagsOwnerValue
break_msg#255rc#361""
repair_difficulty#255rc#3610
junk_on_break#255rc#3610
rename_on_break#255rc#361"smashed"
smashable#255rc#3611
repairable#255rc#3611
armor#255rc#361{{#172505, 999, 999}, {#308, 999, 999}}
held_break_msg#255rc#361""
oheld_break_msg#255rc#361""
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic smashable thing", "smash"}
description#1rc#361""
object_size#1r#29{6471, 1298434098}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rwc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: #54 generic container, #95 generic weapon, #135 grenade, #137 generic furniture, #203 generic powered thing, #267 generic trap, #338 generic liquid container

Call graph

calls n255_0 #255:take_damage n103_47 #103:valid n255_0->n103_47 n255_1 #255:_break n255_0->n255_1 n1_46 #1:room n255_1->n1_46 n20_34 #20:pronoun_sub n255_1->n20_34 n103_2 #103:junk n255_1->n103_2 n255_2 #255:look_self n1_9 #1:look_self n255_2->n1_9 n255_7 #255:tell_health n255_2->n255_7 n107_43 #107:tell n255_7->n107_43 n103_36 #103:damage_to_desc n255_7->n103_36 n255_4 #255:_repair n255_4->n255_0 n255_5 #255:_repair_check n255_6 #255:repair_difficulty n255_5->n255_6 n255_8 #255:chill_factor n1_51 #1:chill_factor n255_8->n1_51 n255_10 #255:on_reset n255_10->n255_4

Source

take_damage

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1{type, amount} = args[1..2];
2if (this.smashable)
3for x in (this.armor)
4if (is_a(type, x[1]))
5r = x[3] - x[2];
6abx = x[2] + (r ? random(x[3] - x[2]) | 0);
7amount = max(0, amount - abx);
8endif
9endfor
10oldhealth = this.health;
11this.health = max(0, this.health - amount);
12if ((this.health < 1) && oldhealth)
13fork (0)
14"Something else have recycled us if we take multiple kinds of damage that all would kill us.";
15if ($rpg:valid(this))
16this:_break();
17endif
18endfork
19endif
20return amount;
21endif

_break

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1if (valid(room = this:room()))
2if (is_a(this.location, $creature))
3if (this.held_break_msg && this.oheld_break_msg)
4this.location:tell($ansi.bold_on, $su:ps(this.held_break_msg, this.location, this), $ansi.reset);
5room:announce_all_but({this.location}, $ansi.bold_on, $su:ps(this.oheld_break_msg, this.location, this), $ansi.reset);
6elseif (this.oheld_break_msg)
7room:announce_all($ansi.bold_on, $su:ps(this.oheld_break_msg, this.location, this), $ansi.reset);
8endif
9elseif (this.break_msg)
10room:announce_all($su:ps(this.break_msg));
11endif
12endif
13if (this.junk_on_break && (this.weight > -1))
14$rpg:junk(this);
15elseif (prefix = this.rename_on_break)
16if ((length(this.name) < length(prefix)) || (this.name[1..length(prefix)] != prefix))
17this.name = (prefix + " ") + this.name;
18this.aliases = {@this.aliases, this.name};
19endif
20endif

look_self

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1pass(@args);
2this:tell_health();

is_broken

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

none

Source

1return this.repairable && (this.health < this.health_max);

_repair

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1who = args[1];
2check = args[2];
3if (check > 0)
4if ((!this.health) && (prefix = this.rename_on_break))
5if (index(this.name, prefix) == 1)
6this.aliases = setremove(this.aliases, this.name);
7this.name = strsub(this.name, prefix + " ", "");
8endif
9endif
10this.health = min(this.health + check, this.health_max);
11who:tell("You fixed ", (this.health < this.health_max) ? "some" | "all", " of the damage.");
12elseif (check < -4)
13who:tell("Ahhh shit.  You really messed it up on that one.");
14this:take_damage($damages.beating, random(3));
15else
16who:tell("Hm.  That didn't help at all.");
17endif

_repair_check

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

none

Source

1who = args[1];
2mod = this:repair_difficulty();
3if (this.health < 1)
4mod = mod * 2;
5endif
6check = $skills.repair:check(who, mod);
7return check;

repair_difficulty

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1return this.repair_difficulty;

tell_health

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1if (this.smashable && (this.health < this.health_max))
2player:tell("It's " + $rpg:damage_to_desc(this.health, this.health_max), ".");
3endif

chill_factor

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

Source

1if (this.health > 0)
2return pass(@args);
3endif

should_reset

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

none

Source

1return `this.repair_on_reset ! E_PROPNF => 0';

on_reset

Spec this none thisFlags rxdOwner #361Definer #255

Referenced by

none

Source

1if (`this.repair_on_reset ! E_PROPNF => 0')
2this:_repair(#2, 999);
3endif