generic clothing #111
Aliases: generic clothing
26 verbs · 51 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
wear equip | this none none | rxd | #111 | 7 |
rem*ove | this none none | rxd | #111 | 12 |
moveto | this none this | rxd | #111 | 6 |
take_damage | this none this | rxd | #111 | 17 |
deteriorate | this none this | rxd | #111 | 11 |
disintegrate | this none this | rxd | #111 | 6 |
try_wield | this none this | rxd | #111 | 8 |
resist_drug | this none this | rxd | #111 | 15 |
on_wear on_remove | this none this | rxd | #111 | 15 |
tell_health | this none this | rxd | #111 | 15 |
look_self | this none this | rxd | #111 | 2 |
_repair | this none this | rxd | #111 | 5 |
is_broken | this none this | rxd | #111 | 3 |
_repair_check | this none this | rxd | #111 | 12 |
tree_tag | this none this | rxd | #111 | 7 |
armor_rating | this none this | rxd | #111 | 24 |
can_glob | this none this | rxd | #111 | 4 |
tease | this any any | rxd | #111 | 11 |
remove_msg | this none this | rxd | #111 | 1 |
wear_msg | this none this | rxd | #111 | 1 |
weight_old | this none this | rx | #111 | 16 |
@setup | this none none | rxd | #111 | 46 |
weight | this none this | rx | #111 | 21 |
bling_value | this none this | rxd | #111 | 0 |
try_wear | this none this | rxd | #111 | 35 |
persuade_mod | this none this | rxd | #111 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
covers | #111 | rc | #361 | {#301, #303} |
wear_msg | #111 | rc | #361 | "%N puts on %p %t." |
remove_msg | #111 | rc | #361 | "%N takes off %p %t." |
armor | #111 | rc | #361 | {} |
help_msg | #111 | rc | #361 | list of 5{"Creating custom clothing:", "", " $clothing.covers = a list of body locations (kids of $bodypart) covered by this item.", " $clothing.armor = a list of damage reductions, of the form {{OBJ damagetype, INT min-reduction, INT max-reduction}, {...}}", " $clothing.breakdown_chance = chance on each attack that this clothing will lose one point of armor protection, if any"} |
disintegrate_msg | #111 | rc | #361 | {"%N's %t is shredded beyond repair."} |
deteriorate_msg | #111 | rc | #361 | "A few bits and pieces fly off your %t." |
thickness | #111 | rc | #361 | 5 |
deterioration | #111 | rc | #361 | 0 |
resists | #111 | rc | #361 | {} |
worn_msg | #111 | rc | #361 | "" |
breakdown_chance | #111 | rc | #361 | 1.0 |
dodge_mod | #111 | rc | #361 | 0.0 |
dress_msg | #111 | rc | #361 | "%DN puts a %t on %dl." |
worn_visible | #111 | rc | #361 | 1 |
wear_on_skin | #111 | rc | #361 | 0 |
gender | #111 | rc | #361 | "" |
water_weight_increase_coefficient | #111 | rc | #361 | 3 |
fuel_value | #111 | rc | #361 | 5 |
condition_msg | #111 | rc | #361 | list of 6{"", "A few visibly-repaired seams mark this as slightly used.", "It's got a few patches.", "Numerous patches and glue-sealed seams mar its surface.", "The garment is mostly patchwork and glued seams; it's clearly been repaired innumerable times.", "It's a mess of patchwork repairs and restitching, near the end of its useful life."} |
wear_outermost | #111 | rc | #361 | 0 |
handed | #5 | rc | #361 | 1 |
wield_msg | #5 | rc | #361 | "%DN gets out %p %t." |
unwield_msg | #5 | rc | #361 | "%DN puts away %p %t." |
size | #5 | rc | #361 | 0 |
look_place_msg | #5 | rc | #361 | "" |
value | #5 | rc | #361 | 0 |
get_msg | #5 | rc | #361 | "" |
drop_msg | #5 | rc | #361 | "" |
get_fail_msg | #5 | rc | #361 | "it seems to be fastened down" |
junk_ok | #5 | rc | #361 | 0 |
floats | #5 | rc | #361 | 1 |
long_name_msg | #5 | rc | #361 | "" |
article | #5 | rc | #361 | 0 |
setup_list | #5 | rc | #361 | {"weight,weight in grams (500g = 1 lb),100", "value,dollar value,0", "description,description"} |
health | #5 | rc | #361 | 10 |
health_max | #5 | rc | #361 | 10 |
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 clothing"} |
description | #1 | rc | #361 | "" |
object_size | #1 | r | #29 | {20789, 1298433815} |
hidden_verbs | #1 | rc | #361 | {"hold", "stow", "@setup"} |
phelp_msg | #1 | rc | #361 | {"It's clothing -- you can wear it. See 'help armor' for more detailed information."} |
weight | #1 | rc | #361 | 800 |
owner_verbs | #1 | rc | #361 | {} |
plural_name | #1 | rc | #361 | "" |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #1 root
Children: none
Call graph
Source
wear equip
Referenced by
none
Source
1if (this in player.wearing) 2player:tell("You're already wearing it."); 3elseif (this.location != player) 4player:tell("You're not carrying it."); 5else 6player:queue_action($actions.wear, {this}, 1, "wear " + this.name); 7endif
rem*ove
Referenced by
none
Source
1if (!(this in player.wearing)) 2player:tell("You're not wearing ", this:dname(), "."); 3else 4for x in (this.covers) 5w = player:wearing_on(x); 6if (w[1] != this) 7player:tell("You'll have to remove your ", w[1].name, " first."); 8return; 9endif 10endfor 11player:queue_action($actions.remove, {this}, 1, "remove " + this.name); 12endif
moveto
Referenced by
none
Source
1if (is_a(this.location, $creature) && (this in this.location.wearing)) 2this.location.wearing = setremove(this.location.wearing, this); 3$skills.cool:flush(this.location); 4this:on_remove(this.location); 5endif 6return pass(@args);
take_damage
Referenced by
none
Source
1type = args[1]; 2amount = args[2]; 3absorbed = 0; 4for x in (this.armor) 5if (is_a(type, x[1])) 6rand = (x[3] <= x[2]) ? 0 | random(x[3] - x[2]); 7abx = max(0, (x[2] + rand) - ((this.health_max - this.health) / 3)); 8absorbed = absorbed + abx; 9endif 10endfor 11absorbed = min(absorbed, amount); 12if (absorbed < amount) 13if ((this.breakdown_chance && (!this.f)) && (random(100) <= toint(tofloat(this.breakdown_chance) * tofloat(amount - absorbed)))) 14this:deteriorate(1); 15endif 16endif 17return amount - absorbed;
deteriorate
Referenced by
- #111:take_damage line 14:
this:deteriorate - #111:_repair_check line 10:
this:deteriorate
Source
1":deteriorate(INT points)"; 2"Reduce armor effectiveness by points. Disintegrate if completely degraded."; 3if (!this.f) 4this.health = this.health - args[1]; 5if (is_a(this.location, $creature)) 6this.location:tell($su:ps(this.deteriorate_msg, this.location, this)); 7endif 8if (this.health < 1) 9this:disintegrate(); 10endif 11endif
disintegrate
Referenced by
- #111:deteriorate line 9:
this:disintegrate
Source
1if (!this.f) 2if (is_a(this.location, $creature)) 3this.location:aat($su:ps($su:msg(this.disintegrate_msg), this.location, this)); 4endif 5$recycler:_recycle(this); 6endif
try_wield
Referenced by
none
Source
1who = args[1]; 2if (this in who.wearing) 3removed_ok = this:remove(player = who); 4if (!removed_ok) 5return 0; 6endif 7endif 8return pass(@args);
resist_drug
Referenced by
none
Source
1"Copied from generic clothing (#306):new_resist_drug by Gilmore (#98) Thu Mar 26 17:24:34 2009 CDT"; 2":resist_drug(OBJ who, OBJ drug, INT doses, OBJ vector)"; 3"Return the number doses we failed to resist."; 4{who, drug, doses, vector} = args; 5for x in (this.resists) 6x = (typeof(x) == OBJ) ? {x, 100} | x; 7if ((typeof(x) == LIST) && (is_a(drug, x[1]) || is_a(vector, x[1]))) 8for i in [1..doses] 9if (random(100) <= x[2]) 10doses = doses - 1; 11endif 12endfor 13endif 14endfor 15return doses;
on_wear on_remove
Referenced by
- #111:moveto line 4:
this:on_remove
Source
1who = args[1]; 2if ((this.full_set || (typeof(this.full_set) == OBJ)) && valid(this.full_set)) 3checklist = this.full_set.full_set; 4for item in (who.wearing) 5if (parent(item) in checklist) 6checklist = setremove(checklist, parent(item)); 7endif 8endfor 9if ((!checklist) && is_a(this.full_set, $quest)) 10if (!this.full_set:award_to(args[1])) 11who:tell("You feel an odd sensation."); 12endif 13endif 14endif 15`who:change_temperature() ! E_VERBNF';
tell_health
Referenced by
- #111:look_self line 2:
this:tell_health
Source
1"Copied from travelling cloak (#263940):tell_health by Gilmore (#98) Thu Jul 2 14:00:28 2009 CDT"; 2"Copied from concrete shoes (#74671):tell_health by Gilmore (#98) Thu Jul 2 13:56:39 2009 CDT"; 3"Copied from generic clothing (#306):tell_health by Gilmore (#98) Thu Jul 2 13:40:24 2009 CDT"; 4if (this.health < this.health_max) 5pct = 7 - toint(7.0 * (tofloat(this.health) / tofloat(this.health_max))); 6est = {"a little", "somewhat", "rather", "quite", "seriously", "very", "horribly"}[max(pct, 1)]; 7player:tell("It's ", est, " damaged."); 8else 9player:tell("It's undamaged."); 10endif 11top_max = parent(this).health_max; 12level = tofloat(this.health_max) / tofloat(top_max); 13if (msg = $su:ps($lu:reverse(this.condition_msg)[min($, max(1, toint(level * tofloat($))))])) 14player:tell(msg); 15endif
look_self
Referenced by
none
Source
1pass(@args); 2this:tell_health();
_repair
Referenced by
none
Source
1dam = this.health_max - this.health; 2if ((dam > 2) || (random(100) < 50)) 3this.health_max = this.health_max - 1; 4endif 5this.health = this.health_max;
is_broken
Referenced by
none
Source
1if (this.health < this.health_max) 2return 1; 3endif
_repair_check
Referenced by
none
Source
1who = args[1]; 2if (this.health_max < 2) 3who:tell("This patched-together mess of ", this:iname(), " is beyond any hope of repair."); 4return -99; 5endif 6worn = (this in who.wearing) ? -2 | 0; 7check = $skills.repair:check(who, max(-5, (worn + 3) - (this.value / 1000))); 8if (check < -6) 9who:tell("Dammit! You ended up making it even worse."); 10this:deteriorate(1); 11endif 12return check;
tree_tag
Referenced by
none
Source
1as = ""; 2for x in (this.armor) 3n = x[2] + ((x[3] - x[2]) / 2); 4as = n ? as + tostr(n, x[1].code, " ") | as; 5endfor 6as = tostr(" ", $ansi.red, $ansi.bold_on, $su:right(this.thickness, 2), " ", $ansi.cyan, as, $ansi.reset); 7return pass(@args) + as;
armor_rating
Referenced by
none
Source
1armin = 0; 2armax = 0; 3arvg = 0; 4aravgtot = 0; 5aravgtottot = 0; 6for arv in (this.armor) 7if (arv[1] == #308) 8continue; 9endif 10if (arv[1] in {#268, #277, #278, #279}) 11armin = armin + arv[2]; 12armax = armax + arv[3]; 13else 14armin = armin + (arv[2] / 2); 15armax = armax + (arv[3] / 2); 16endif 17aravg = ((armax - armin) / 2) + armin; 18aravgtot = aravgtot + aravg; 19armin = 0; 20armax = 0; 21aravg = 0; 22endfor 23aravgtot = toint(tofloat(aravgtot) * (tofloat(length(this.covers)) / tofloat(length($player.body_parts)))); 24return aravgtot / 3;
can_glob
Referenced by
none
Source
1if ((this.health_max != parent(this).health_max) || (this.health != parent(this).health)) 2return 0; 3endif 4return pass(@args);
tease
Referenced by
none
Source
1if (!(this in player.wearing)) 2player:tell("You're not wearing ", this:dname(), "."); 3else 4m = $su:ps($su:msg(this.tease_msg), player, this); 5if (prepstr == "at") 6if (is_a(iobj, $creature)) 7m = $su:ps($su:msg(this.tease_at_msg), player, this, iobj); 8endif 9endif 10player:aat(m); 11endif
remove_msg
Referenced by
none
Source
1return this.(verb);
wear_msg
Referenced by
none
Source
1return this.(verb);
weight_old
Referenced by
none
Source
1"Copied from tan chinos (#51247):weight by Gilmore (#98) Sun Nov 9 00:21:57 2008 CST"; 2w = this.weight; 3if (w == -1) 4return w; 5endif 6for x in (this.contents) 7$cu:sin(0); 8w = w + x:weight(); 9endfor 10for x in (player.wearing) 11if (is_a(x, #306)) 12w = w / 2; 13break; 14endif 15endfor 16return w;
@setup
Referenced by
none
Source
1if (!pass(@args)) 2return; 3endif 4covers = {}; 5body_parts = #134255.contents; 6for body_part in (body_parts) 7line = $cu:yes_or_no(("Enter y or n for coverage zone " + body_part.name) + ":"); 8if (line == 1) 9covers = {@covers, body_part}; 10player:tell("Covers now include:", $su:english_list(covers)); 11this.covers = covers; 12elseif (line == 0) 13player:tell("Ok, that zone is not covered."); 14player:tell("Covers now include:", $su:english_list(covers)); 15endif 16endfor 17armor = {}; 18player:tell("Enter armor data, one armor type per line."); 19player:tell("Format: damagetype,min,max"); 20player:tell("example: stab,1,5"); 21player:tell("Possible armor types are ", $su:english_list($lu:map_prop($ou:leaves($damage), "name")), "."); 22quit = 0; 23while (!quit) 24line = $cu:read("Enter damage data line, or . to finish"); 25if ((line == "") || (line == ".")) 26quit = 1; 27else 28ll = $su:explode(line, ","); 29player:tell($su:from_value(ll)); 30if (length(ll) < 3) 31player:tell("Wrong number of elements in list -- try again."); 32elseif (!valid(dtype = $match_utils:match(ll[1], $ou:leaves($damage)))) 33player:tell("Invalid damage type -- try again."); 34elseif (toint(ll[3]) < toint(ll[2])) 35player:tell("Max can't be less than min -- try again."); 36else 37armor = {@armor, {dtype, toint(ll[2]), toint(ll[3])}}; 38endif 39endif 40endwhile 41this.armor = armor; 42wwce = $cu:read("Enter a water weight increase coefficient (an integer greater than 0):"); 43wwce = this.water_weight_increase_coefficient; 44thk = $cu:read("Enter a value for thickness (an integer from 0 to 15):"); 45thk = this.thickness; 46player:tell("OK all done with the setup!");
weight
Referenced by
none
Source
1"Copied from bustled dress (#257374):weight by Gilmore (#98) Mon Nov 10 01:11:32 2008 CST"; 2w = this.weight; 3if (w == -1) 4return w; 5endif 6if (is_a(this.location.location, #1034) || is_a(this.location.location, #1047)) 7if (is_a(x, #306)) 8if (this.water_weight_increase_coefficient == 0) 9this.water_weight_increase_coefficient = 1; 10endif 11endif 12w = w * this.water_weight_increase_coefficient; 13endif 14for x in (this.contents) 15$cu:sin(0); 16w = w + x:weight(); 17endfor 18if (this in player.wearing) 19w = w / 2; 20endif 21return w;
bling_value
Referenced by
none
Source
No program (verb defined but unprogrammed).
try_wear
Referenced by
none
Source
1who = args[1]; 2what = this; 3if ($drugs.third_arm:doses_for(who)) 4if ($bodyparts.chest in what.covers) 5return ("You try to get " + what:dname()) + " on, but the damn third arm is making it impossible."; 6endif 7endif 8for x in (what.covers) 9thick = 0; 10t = 0; 11t2 = 0; 12for y in (who:wearing_on(x)) 13if (y.wear_outermost && what.thickness) 14return ("You can't wear anything on top of your " + y:name()) + "."; 15endif 16thick = thick + y.thickness; 17if (y.thickness) 18t = t + 1; 19endif 20t2 = t2 + 1; 21endfor 22if ((t > 3) || (t2 > 8)) 23return ("You can't fit that many layers over your " + x.name) + " at once."; 24endif 25if (thick && (what.wear_on_skin == 1)) 26return ("You need to uncover your " + x.name) + " in order to put this on."; 27endif 28if (thick > $skills.brawn:base_level(who)) 29return ((("You're not feeling brawny enough to wear " + what:iname()) + " on your ") + x.name) + "."; 30endif 31if (thick && ((thick + what.thickness) > min(15, $skills.brawn:total(who)))) 32return ((("You're not feeling brawny enough to wear " + what:iname()) + " on your ") + x.name) + "."; 33endif 34endfor 35return 0;
persuade_mod
Referenced by
none
Source
1if (this.persuade_mod) 2return this.persuade_mod; 3elseif (!this.armor) 4return max(0, min(3, this.value / 1000)); 5endif