generic clothing #111

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

Aliases: generic clothing

26 verbs · 51 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
wear equipthis none nonerxd#1117
rem*ovethis none nonerxd#11112
movetothis none thisrxd#1116
take_damagethis none thisrxd#11117
deterioratethis none thisrxd#11111
disintegratethis none thisrxd#1116
try_wieldthis none thisrxd#1118
resist_drugthis none thisrxd#11115
on_wear on_removethis none thisrxd#11115
tell_healththis none thisrxd#11115
look_selfthis none thisrxd#1112
_repairthis none thisrxd#1115
is_brokenthis none thisrxd#1113
_repair_checkthis none thisrxd#11112
tree_tagthis none thisrxd#1117
armor_ratingthis none thisrxd#11124
can_globthis none thisrxd#1114
teasethis any anyrxd#11111
remove_msgthis none thisrxd#1111
wear_msgthis none thisrxd#1111
weight_oldthis none thisrx#11116
@setupthis none nonerxd#11146
weightthis none thisrx#11121
bling_valuethis none thisrxd#1110
try_wearthis none thisrxd#11135
persuade_modthis none thisrxd#1115

Properties

PropertyDefinerFlagsOwnerValue
covers#111rc#361{#301, #303}
wear_msg#111rc#361"%N puts on %p %t."
remove_msg#111rc#361"%N takes off %p %t."
armor#111rc#361{}
help_msg#111rc#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#111rc#361{"%N's %t is shredded beyond repair."}
deteriorate_msg#111rc#361"A few bits and pieces fly off your %t."
thickness#111rc#3615
deterioration#111rc#3610
resists#111rc#361{}
worn_msg#111rc#361""
breakdown_chance#111rc#3611.0
dodge_mod#111rc#3610.0
dress_msg#111rc#361"%DN puts a %t on %dl."
worn_visible#111rc#3611
wear_on_skin#111rc#3610
gender#111rc#361""
water_weight_increase_coefficient#111rc#3613
fuel_value#111rc#3615
condition_msg#111rc#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#111rc#3610
handed#5rc#3611
wield_msg#5rc#361"%DN gets out %p %t."
unwield_msg#5rc#361"%DN puts away %p %t."
size#5rc#3610
look_place_msg#5rc#361""
value#5rc#3610
get_msg#5rc#361""
drop_msg#5rc#361""
get_fail_msg#5rc#361"it seems to be fastened down"
junk_ok#5rc#3610
floats#5rc#3611
long_name_msg#5rc#361""
article#5rc#3610
setup_list#5rc#361{"weight,weight in grams (500g = 1 lb),100", "value,dollar value,0", "description,description"}
health#5rc#36110
health_max#5rc#36110
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic clothing"}
description#1rc#361""
object_size#1r#29{20789, 1298433815}
hidden_verbs#1rc#361{"hold", "stow", "@setup"}
phelp_msg#1rc#361{"It's clothing -- you can wear it. See 'help armor' for more detailed information."}
weight#1rc#361800
owner_verbs#1rc#361{}
plural_name#1rc#361""
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

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

Children: none

Call graph

calls n111_0 #111:wear n107_43 #107:tell n111_0->n107_43 n92_2 #92:queue_action n111_0->n92_2 n111_1 #111:rem*ove n111_1->n107_43 n111_1->n92_2 n1_31 #1:dname n111_1->n1_31 n107_12 #107:wearing_on n111_1->n107_12 n111_2 #111:moveto n111_8 #111:on_wear n111_2->n111_8 n1_13 #1:moveto n111_2->n1_13 n111_3 #111:take_damage n111_4 #111:deteriorate n111_3->n111_4 n20_34 #20:pronoun_sub n111_4->n20_34 n111_5 #111:disintegrate n111_4->n111_5 n111_5->n20_34 n20_81 #20:msg n111_5->n20_81 n57_1 #57:_recycle n111_5->n57_1 n111_6 #111:try_wield n5_2 #5:try_wield n111_6->n5_2 n111_9 #111:tell_health n111_9->n107_43 n111_9->n20_34 n47_11 #47:reverse n111_9->n47_11 n111_10 #111:look_self n111_10->n111_9 n1_9 #1:look_self n111_10->n1_9 n111_13 #111:_repair_check n111_13->n111_4 n5_9 #5:iname n111_13->n5_9 n111_14 #111:tree_tag n20_2 #20:right n111_14->n20_2 n5_18 #5:tree_tag n111_14->n5_18 n111_16 #111:can_glob n5_21 #5:can_glob n111_16->n5_21 n111_17 #111:tease n111_17->n107_43 n111_17->n1_31 n111_17->n20_34 n111_17->n20_81 n1_66 #1:announce_action_text n111_17->n1_66 n111_20 #111:weight_old n48_8 #48:suspend_if_needed n111_20->n48_8 n111_21 #111:@setup n111_21->n107_43 n5_11 #5:@setup n111_21->n5_11 n48_4 #48:yes_or_no n111_21->n48_4 n20_6 #20:english_list n111_21->n20_6 n45_23 #45:leaves n111_21->n45_23 n48_2 #48:read n111_21->n48_2 n20_38 #20:explode n111_21->n20_38 n20_47 #20:from_value n111_21->n20_47 n44_0 #44:match n111_21->n44_0 n111_22 #111:weight n111_22->n48_8 n111_24 #111:try_wear n111_24->n1_31 n111_24->n5_9

Source

wear equip

Spec this none noneFlags rxdOwner #361Definer #111

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

Spec this none noneFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

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

_repair

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

1if (this.health < this.health_max)
2return 1;
3endif

_repair_check

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #29Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

1if ((this.health_max != parent(this).health_max) || (this.health != parent(this).health))
2return 0;
3endif
4return pass(@args);

tease

Spec this any anyFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

1return this.(verb);

wear_msg

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

1return this.(verb);

weight_old

Spec this none thisFlags rxOwner #361Definer #111

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

Spec this none noneFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

No program (verb defined but unprogrammed).

try_wear

Spec this none thisFlags rxdOwner #361Definer #111

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

Spec this none thisFlags rxdOwner #361Definer #111

Referenced by

none

Source

1if (this.persuade_mod)
2return this.persuade_mod;
3elseif (!this.armor)
4return max(0, min(3, this.value / 1000));
5endif