generic smashable thing #255
Aliases: generic smashable thing, smash
11 verbs · 39 properties · 7 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
take_damage | this none this | rxd | #255 | 21 |
_break | this none this | rxd | #255 | 20 |
look_self | this none this | rxd | #255 | 2 |
is_broken | this none this | rxd | #255 | 1 |
_repair | this none this | rxd | #255 | 17 |
_repair_check | this none this | rxd | #255 | 7 |
repair_difficulty | this none this | rxd | #255 | 1 |
tell_health | this none this | rxd | #255 | 3 |
chill_factor | this none this | rxd | #255 | 3 |
should_reset | this none this | rxd | #255 | 1 |
on_reset | this none this | rxd | #255 | 3 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
break_msg | #255 | rc | #361 | "" |
repair_difficulty | #255 | rc | #361 | 0 |
junk_on_break | #255 | rc | #361 | 0 |
rename_on_break | #255 | rc | #361 | "smashed" |
smashable | #255 | rc | #361 | 1 |
repairable | #255 | rc | #361 | 1 |
armor | #255 | rc | #361 | {{#172505, 999, 999}, {#308, 999, 999}} |
held_break_msg | #255 | rc | #361 | "" |
oheld_break_msg | #255 | rc | #361 | "" |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic smashable thing", "smash"} |
description | #1 | rc | #361 | "" |
object_size | #1 | r | #29 | {6471, 1298434098} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rwc | #361 | <clear> |
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): #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
Source
take_damage
Referenced by
- #95:degrade line 2:
this:take_damage - #255:_repair line 14:
this:take_damage
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
Referenced by
- #54:_break line 32:
pass( - #255:take_damage line 16:
this:_break - #338:_break line 2:
pass( - #338:_break line 12:
pass(
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
Referenced by
- #54:look_self line 1:
pass( - #203:look_self line 1:
pass( - #338:look_self line 1:
pass(
Source
1pass(@args); 2this:tell_health();
is_broken
Referenced by
none
Source
1return this.repairable && (this.health < this.health_max);
_repair
Referenced by
- #146:_repair line 1:
pass( - #203:_repair line 1:
pass( - #255:on_reset line 2:
this:_repair
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
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
Referenced by
- #255:_repair_check line 2:
this:repair_difficulty
Source
1return this.repair_difficulty;
tell_health
Referenced by
- #255:look_self line 2:
this:tell_health
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
Referenced by
- #203:chill_factor line 2:
pass(
Source
1if (this.health > 0) 2return pass(@args); 3endif
should_reset
Referenced by
none
Source
1return `this.repair_on_reset ! E_PROPNF => 0';
on_reset
Referenced by
none
Source
1if (`this.repair_on_reset ! E_PROPNF => 0') 2this:_repair(#2, 999); 3endif