[...]

 

generic destructable, $destructable

$destructable.cond_max
highest 'condition' possible; < 0 for indestructable.
$destructable.condition
current condition; ≤ 0 for indestructable.
$destructable.cond_names
possible condition names and their condition sequences: list in the form of { {sequence, "name"} [, ...] }; (see :title).
$destructable.repairable
if it's possible to repair the object to increase its condition.
$destructable.decay_id
ID of the decay task, if the object automatically decays.
$destructable:title
altered to optionally display a condition name before the title, in the form "(condition) title"

@prop $destructable.cond_max 20 @prop $destructable.condition 20 r @prop $destructable.cond_names {} @prop $destructable.repairable 0 @prop $destructable.decay_id 0 r @verb $destructable:_repair tnt rxd @verb $destructable:_decay tnt rxd @verb $destructable:_ruin tnt rxd @verb $destructable:initialize tnt rxd @verb $destructable:title tnt rxd @program $destructable:title condition = ""; for c in (this.cond_names) if (`$seq_utils:contains(c[0], this.condition) ! E_TYPE => 0') condition = `c[1] ! E_RANGE => "<invalid>"'; break; endif endfor return (condition ? tostr("(", condition, ") ") | "") + pass(@args); .