generic weapon #95

Parent #255Owner #29Flags read, fertileSource hellcore/hellcore.db

Aliases: generic weapon

36 verbs · 63 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
at*tack kill shoot stab hit smash breakthis none thisrxd#9531
speedthis none thisrxd#9526
inflict_damagethis none thisrxd#9550
damagethis none thisrxd#9530
hit_msg miss_msgthis none thisrxd#9510
start_attackthis none thisrxd#9515
tell_statthis none thisrxd#9520
can_parrythis none thisrxd#953
acceptablethis none thisrxd#951
suicide_attackthis none thisrxd#956
messagesthis none thisrxd#951
@setupthis none nonerxd#9542
descriptionthis none thisrxd#9513
can_attackthis none thisrxd#951
smash_msgthis none thisrxd#959
edpsthis none thisrxd#9534
tree_tagthis none thisrxd#9516
gurps_damagethis none thisrxd#9540
brandishthis at/to anyrxd#9510
_brandishthis none thisrxd#9510
hold wield draw w*ieldthis none nonerxd#954
finish_attackthis none thisrxd#950
can_globthis none thisrxd#954
change_targetthis none thisrxd#951
mod_difficultythis none thisrxd#956
repair_difficultythis none thisrxd#9519
maybe_degradethis none thisrxd#959
degradethis none thisrxd#955
accuracythis none thisrxd#959
weightthis none thisrxd#955
try_wieldthis none thisrxd#9517
grind_ceilingthis none thisrxd#951
tohitthis none thisrxd#9510
thrown_atthis none thisrxd#9528
_repair_checkthis none thisrxd#958
flail_damagethis none thisrxd#9529

Properties

PropertyDefinerFlagsOwnerValue
base_speed#95rc#295.0
attack_action#95rc#29#222
damage#95rc#29{{#268, 1, 1, 10}}
accuracy#95rc#290
messages#95rc#29#533
damage_from_brawn#95rc#290.0
damage_from_skill#95rc#290.0
parry_class#95rc#290
mods#95rc#29{}
incompatible_mods#95rc#29{}
parry_bonus#95rc#290
melee_defense_mod#95rc#290
brandish_msg#95rc#29"%DN shakes %p %t at %dd."
room_brandish_msg#95rc#29"%DN waves %p %t menacingly."
can_cut_meat#95rc#290
mod_difficulty#95rc#290
noise#95rc#29#101390
antidodge_mod#95rc#291.0
unarmed_visible#95rc#291
taunt_msg#95rc#29{}
grind_ceiling#95rc#292
max_mods#95rc#294
throwability#95rc#2950
min_speed#95rc#291.0
break_msg#255rc#29"%DT breaks apart into useless junk."
repair_difficulty#255rc#29<clear>
junk_on_break#255rc#291
rename_on_break#255rc#29""
smashable#255rc#29<clear>
repairable#255rc#29<clear>
armor#255rc#29<clear>
held_break_msg#255rc#29"Your %t breaks apart in your hands."
oheld_break_msg#255rc#29"%DN's %t breaks apart in %p hands."
handed#5rc#291
wield_msg#5rc#29"%DN gets out %p %t."
unwield_msg#5rc#29"%DN puts away %p %t."
size#5rc#290
look_place_msg#5rc#29""
value#5rc#29<clear>
get_msg#5rc#29<clear>
drop_msg#5rc#29<clear>
get_fail_msg#5rc#29<clear>
junk_ok#5rc#29<clear>
floats#5rc#29<clear>
long_name_msg#5rc#29<clear>
article#5rc#29<clear>
setup_list#5rc#29
list of 10{"weight,weight in grams (500g = 1 lb)", "value,dollar value", "description,description", "base_speed,base speed in seconds", "accuracy,accuracy bonus to attack", "damage_from_brawn,extra damage per brawn point above 10", "damage_from_skill,extra damage per skillcheck result above 0", "parry_class,parry class (0=fists/small knives 1=one-handed clubs and swords 2=heavy two-hand)", "handed,handedness (1 or 2)", "wield_msg,wield message"}
health#5rc#29<clear>
health_max#5rc#29<clear>
min_skill#5rc#291
skill#5rc#29<clear>
recipe_for#5rc#29<clear>
carried_msg#5rc#29<clear>
aliases#1rc#29{"generic weapon"}
description#1rc#29""
object_size#1r#29{31674, 1298433815}
hidden_verbs#1rc#29{"@setup", "clean"}
phelp_msg#1rc#29
list of 5{"It's a weapon -- that's right, you can kill people with it. If you're holding it (try 'hold <name of weapon>'), you'll be using it when you attack someone with 'attack <person/creature/helpless orphan'. Note that if you're NOT holding it, you WON'T be using it when you attack -- you'll be using your fists or, god forbid, that fluffy pillow you were holding. You can find out what you're holding with 'inventory' (or just 'i') -- held things are marked as such.", "", "Curious which weapons are better than others? Try 'gear', you'll get all kinds of statistics about the weapons in your inventory.", "", "Some weapons can be 'dual wielded', that is, you can hold two of them. You can tell which by, again, looking at 'gear'. This will give you a penalty to hit, but you'll be dealing out more attacks faster."}
weight#1rc#291500
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

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

Children: #259 generic melee weapon

Call graph

calls n95_0 #95:at*tack n1_33 #1:area n95_0->n1_33 n45_0 #45:has_property n95_0->n45_0 n107_43 #107:tell n95_0->n107_43 n5_9 #5:iname n95_0->n5_9 n92_2 #92:queue_action n95_0->n92_2 n95_20 #95:hold n95_0->n95_20 n6_80 #6:start_fighting n95_0->n6_80 n5_1 #5:hold n95_20->n5_1 n95_2 #95:inflict_damage n95_3 #95:damage n95_2->n95_3 n95_26 #95:maybe_degrade n95_2->n95_26 n20_34 #20:pronoun_sub n95_2->n20_34 n95_4 #95:hit_msg n45_2 #45:has_verb n95_4->n45_2 n95_10 #95:messages n95_4->n95_10 n95_5 #95:start_attack n95_5->n20_34 n95_5->n95_10 n95_6 #95:tell_stat n95_6->n107_43 n5_5 #5:tell_stat n95_6->n5_5 n95_8 #95:acceptable n45_5 #45:isa n95_8->n45_5 n95_9 #95:suicide_attack n95_9->n95_3 n95_9->n20_34 n95_11 #95:@setup n95_11->n107_43 n5_11 #5:@setup n95_11->n5_11 n45_23 #45:leaves n95_11->n45_23 n20_1 #20:left n95_11->n20_1 n48_2 #48:read n95_11->n48_2 n45_22 #45:descendants n95_11->n45_22 n20_6 #20:english_list n95_11->n20_6 n20_38 #20:explode n95_11->n20_38 n20_47 #20:from_value n95_11->n20_47 n44_0 #44:match n95_11->n44_0 n95_12 #95:description n95_12->n20_6 n5_4 #5:description n95_12->n5_4 n20_15 #20:capitalize n95_12->n20_15 n95_14 #95:smash_msg n95_14->n95_10 n95_15 #95:edps n95_15->n107_43 n95_15->n95_3 n48_8 #48:suspend_if_needed n95_15->n48_8 n20_59 #20:name_and_number n95_15->n20_59 n95_1 #95:speed n95_15->n95_1 n95_16 #95:tree_tag n95_16->n20_1 n95_16->n48_8 n45_27 #45:branches_suspended n95_16->n45_27 n20_2 #20:right n95_16->n20_2 n5_18 #5:tree_tag n95_16->n5_18 n95_18 #95:brandish n95_18->n107_43 n95_18->n92_2 n107_15 #107:weapon n95_18->n107_15 n95_19 #95:_brandish n95_19->n20_34 n95_22 #95:can_glob

Showing 48 of 63 verbs; 15 not shown.

Source

at*tack kill shoot stab hit smash break

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1if (!player.programmer)
2if ((!(a = player:area()).combat_ok) || ($ou:has_property(player.location, "combat_ok") && (!player.location.combat_ok)))
3player:tell(a.combat_fail_msg);
4return;
5endif
6endif
7what = args[1];
8if (what == player)
9if (!`this.suicide_msg ! E_PROPNF => 0')
10player:tell("You can't figure out how to kill yourself with ", this:iname(), ".");
11else
12player:queue_action($actions.verb, {this, "suicide_attack", {player}}, 1, "suicide");
13endif
14return;
15endif
16uw = (typeof(player.unarmed_weapon) == OBJ) ? {player.unarmed_weapon} | player.unarmed_weapon;
17if (!(this in player.wielding))
18if (!(this in uw))
19if (this.location != player)
20return player:tell("You're not carrying ", this.name, ".");
21endif
22if (!(this in player.wielding))
23this:hold();
24endif
25endif
26endif
27if (is_a(what, $creature))
28player:start_fighting(what);
29else
30player:queue_action($actions.smash, {what, this}, 1, "smash " + what.name);
31endif

speed

Spec this none thisFlags rxdOwner #29Definer #95

Referenced by

Source

1"Number of seconds an attack round takes, when wielded by args[1].";
2who = args[1];
3ref_bonus = tofloat($skills.reflexes:total(who) - 10) / 9.0;
4ref_bonus = min(ref_bonus, 3.0);
5base = this.base_speed - ref_bonus;
6base = max(base, 2.0);
7if (is_a(who, $player))
8"base = base + $rpg.fight_styles_speed[who.fight_style];";
9if (this in who.wielding)
10if (((length(who.wielding) > 1) && is_a(who.wielding[1], $weapon)) && is_a(who.wielding[2], $weapon))
11base = base * $rpg.dual_wield_speed;
12endif
13endif
14endif
15base = base * $rpg.combat_speed;
16if (this.health < 10)
17base = base + 1.0;
18endif
19if (is_a(who:room(), #1047))
20swim_bonus = tofloat($skills.swim:total(who) - 10) / 10.0;
21swim_bonus = min(swim_bonus, this.underwater_speed_modifier);
22base = base + this.underwater_speed_modifier;
23base = base - swim_bonus;
24endif
25floor = max(1.0, this.min_speed);
26return max(base, floor);

inflict_damage

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1":inflict_damage(OBJ target, INT accuracy, OBJ bodypart, OBJ attacker)";
2"Return total actually inflicted, or an absorb message.";
3target = args[1];
4acc = args[2];
5bodypart = args[3];
6attacker = args[4];
7power = (length(args) > 4) ? args[5] | 0;
8total = 0;
9if ((typeof(d = this:damage(attacker, acc)) == STR) || (!d))
10return d;
11endif
12damage = {};
13for x in (d)
14amount = max(0, x[2]) + random(max(1, x[3] - max(0, x[2])));
15if (power)
16amount = (amount * 2) + 3;
17elseif (is_player(attacker) && (random(100) < (x[4] + (acc * 2))))
18amount = toint(tofloat(amount) * 1.5);
19endif
20damage = {@damage, {x[1], amount}};
21endfor
22if (typeof(sm = has_callable_verb(target, "shield_check") ? target:shield_check(bodypart, attacker, total, damage) | 0) == STR)
23return sm;
24endif
25damage = sm ? sm | damage;
26total = 0;
27for x in (damage)
28{type, amount} = x;
29total = total + target:take_damage(type, amount, bodypart, attacker);
30endfor
31this:maybe_degrade();
32if (total > 0)
33if (power && is_a(target, $creature))
34target:ingest($drugs.stunned, 5);
35endif
36is_a(attacker, $npc) && (attacker.did_damage = attacker.did_damage + total);
37return total;
38elseif (bodypart == $thing)
39return 0;
40else
41w = target:wearing_on(bodypart);
42if (w)
43w = w[1].name;
44else
45w = target.skin_name_msg;
46endif
47m = strsub(d[1][1].absorb_msg, "%armor", w);
48m = strsub(m, "%bounces", this.messages.bounces_msg);
49return $su:ps(m, attacker, this, bodypart, target);
50endif

damage

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1":damage([OBJ attacker, INT attack_quality])";
2"Return all damage types we inflict, in a list of the form:";
3"{{OBJ type, min, max, crit_chance}, {...}}";
4if (!args)
5return this.damage;
6else
7who = args[1];
8attack = min(max(args[2] - 3, 0), 8);
9bonus = tofloat($skills.brawn:total(args[1]) - 10) * this.damage_from_brawn;
10bonus2 = tofloat(max(min(attack, 10), 0)) * this.damage_from_skill;
11total_bonus = toint(bonus + bonus2);
12x = this.damage[1];
13dmin = x[2];
14dmax = max(x[2], x[3] + total_bonus);
15if (this.health < 1)
16dmax = dmax / 2;
17endif
18d = {{x[1], dmin, dmax, x[4]}};
19if (length(this.damage) > 1)
20d = {@d, @this.damage[2..$]};
21endif
22if (0)
23if ((torture = $skills.torture:total(who)) >= 15)
24for i in [1..length(d)]
25d[4] = min(100, d[4] + toint(tofloat(torture) * $skills.torture.crit_modifier));
26endfor
27endif
28endif
29return d;
30endif

hit_msg miss_msg

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1":hit_msg(OBJ who, OBJ victim, INT result, INT damage, OBJ bodypart)";
2dthit = (args[3] > -1) ? " hit " | " missed ";
3$ou:has_verb(args[1], "debug_tell") && args[1]:debug_tell("combat", "You", dthit, args[2].name, " by ", args[3], " for ", args[4], " in the ", args[5].name);
4$ou:has_verb(args[2], "debug_tell") && args[2]:debug_tell("combat", args[1].name, dthit, "you by ", args[3], " for ", args[4], " in the ", args[5].name);
5if (args[3] < 0)
6m = this:messages():select("misses", -args[3], args[5]);
7else
8m = this:messages():select("hits", args[4] * (100 / args[2].health_max), args[5]);
9endif
10return m;

start_attack

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1"Do what we need to do when an attack is started with me.";
2"Return 1 if attack can proceed, otherwise print a message and return 0.";
3who = args[1];
4dobj = args[2];
5check = args[3];
6bodypart = args[4];
7if ((dobj != who.last_swing_message[2]) || ((time() - who.last_swing_message[1]) > 10))
8msg = this:messages():select("swings", check, bodypart);
9who:aat($su:ps(msg, who, this, bodypart, dobj));
10endif
11who.last_swing_message = {time(), dobj};
12if ((who.wielding && (who.wielding[$] != this)) && (this in who.wielding))
13who.wielding = {@setremove(who.wielding, this), this};
14endif
15return 1;

tell_stat

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1pass(@args);
2player:tell("  Skill:     ", this.skill.name, " (", (this.accuracy > 0) ? "+" | "", this.accuracy, (" acc) (" + this.messages.name) + ")");
3first = 1;
4dp = "";
5if (this.damage_from_brawn)
6dp = ("+" + tostr(this.damage_from_brawn)) + " brawn  ";
7endif
8if (this.damage_from_skill)
9dp = ((dp + "+") + tostr(this.damage_from_skill)) + " skill";
10endif
11for x in (this.damage)
12d = ((((((tostr(x[2]) + "-") + tostr(x[3])) + " ") + x[1].name) + " (") + tostr(x[4])) + "% crit)";
13if (first)
14player:tell("  Damage:    ", d, "  ", dp);
15else
16player:tell("             ", d);
17endif
18first = 0;
19endfor
20player:tell("  Speed:     ", this.base_speed, " sec");

can_parry

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1":can_parry(OBJ weapon)";
2"Can this weapon parry the given weapon?";
3return this.parry_class >= `args[1].parry_class ! ANY => 0';

acceptable

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1return $ou:isa(args[1], $ammo);

suicide_attack

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1who = args[1];
2who:aat($su:ps(this.suicide_msg, who, this));
3d = this:damage()[1];
4dam = (10 + (d[3] * 4)) + random(20);
5who:take_damage(d[1], dam, this.suicide_bodypart, who);
6return 1;

messages

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1return this.messages;

@setup

Spec this none noneFlags rxdOwner #361Definer #95

Referenced by

none

Source

1if (!pass(@args))
2return;
3endif
4msets = $ou:leaves(#2193);
5for x in [1..length(msets)]
6player:tell(x, ". ", $su:left(msets[x].name, -25), " ", $su:left(msets[x].hits[1], -52));
7endfor
8mn = tonum($cu:read("Pick a message set"));
9this.messages = msets[mn];
10skills = $ou:descendants(#1409);
11for x in [1..length(skills)]
12player:tell(x, ". ", skills[x].name);
13endfor
14mn = tonum($cu:read("Pick a skill"));
15this.skill = skills[mn];
16damage = {};
17player:tell("Enter damage data, one damage type per line.");
18player:tell("Format:  damagetype,min,max,crit-chance");
19player:tell("example: stab,1,5,30");
20player:tell("Possible damage types are ", $su:english_list($lu:map_prop($ou:leaves($damage), "name")), ".");
21quit = 0;
22while (!quit)
23line = $cu:read("enter damage data line, or . to finish");
24if ((line == "") || (line == "."))
25quit = 1;
26else
27ll = $su:explode(line, ",");
28player:tell($su:from_value(ll));
29if (length(ll) < 4)
30player:tell("Wrong number of elements in list -- try again.");
31elseif (!valid(dtype = $match_utils:match(ll[1], $ou:leaves($damage))))
32player:tell("Invalid damage type -- try again.");
33elseif (toint(ll[3]) < toint(ll[2]))
34player:tell("Max can't be less than min -- try again.");
35elseif (toint(ll[4]) > 100)
36player:tell("Crit chance can't be more than 100 -- try again.");
37else
38damage = {@damage, {dtype, toint(ll[2]), toint(ll[3]), toint(ll[4])}};
39endif
40endif
41endwhile
42this.damage = damage;

description

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1d = pass(@args);
2if (this.mods)
3d = (typeof(d) == LIST) ? d | {d};
4if (length(this.mods) == 1)
5m = $su:capitalize(this.mods[1].look_weapon_msg) + ".";
6elseif (length(this.mods) == 2)
7m = $su:capitalize(((this.mods[1].look_weapon_msg + " and ") + this.mods[2].look_weapon_msg) + ".");
8else
9m = ("It's heavily modified -- " + $su:english_list($lu:map_prop(this.mods, "look_weapon_msg"))) + ".";
10endif
11d = {@d, m};
12endif
13return d;

can_attack

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1return 1;

smash_msg

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1":smash_msg(OBJ who, OBJ victim, INT result, INT damage)";
2if (args[2].health > 0)
3if ((dmg = args[4]) > 0)
4dmg = toint(tofloat(dmg) * (100.0 / tofloat(args[2].health)));
5endif
6else
7dmg = 10;
8endif
9return this:messages():select("smashes", max(dmg, 0), $bodypart);

edps

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1who = args[1];
2versus = args[2];
3w = this;
4dmg = w:damage();
5edmg = w:damage(who, w.skill:total(who) - 10);
6first = 1;
7dc = 0;
8dps = 0.0;
9for d in (dmg)
10dc = dc + 1;
11ed = edmg[dc];
12bdps = tofloat(ed[2]) + (tofloat(ed[3] - ed[2]) / 2.0);
13bdps = bdps * (tofloat(100 + d[4]) / 100.0);
14for p in (versus.body_parts)
15for a in (versus:wearing_on(p))
16for a2 in (a.armor)
17if (a2[1] == d[1])
18prot = tofloat(a2[2]) + (tofloat(a2[3] - a2[2]) / 2.0);
19prot = prot * (tofloat(p.size) / 100.0);
20bdps = max(0.0, bdps - prot);
21endif
22endfor
23endfor
24$cu:sin(0);
25endfor
26dps = dps + bdps;
27endfor
28player:tell("Base damage per round with ", $su:nn(w), ": ", dps);
29tohit = who:base_dodge(who:base_attack(w.skill:total(who), w), w);
30player:tell(who.name, "'s base TOHIT: ", tohit);
31tohit = max(1, min(tohit, 20));
32dps = dps * $rpg.skill_to_fraction[tohit];
33dps = dps / w:speed(who);
34return dps;

tree_tag

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1dmin = dmax = 0;
2dt = "";
3if (!valid(what = `this.default_ammo ! ANY => #-1'))
4what = this;
5endif
6for ammo in (`$ou:branches_suspended(this.default_ammo) ! ANY => {what}')
7for x in (ammo.damage)
8dmin = dmin + x[2];
9dmax = dmax + x[3];
10"dt = dt ? dt | x[1].abbrev";
11endfor
12$cu:sin(1);
13endfor
14grindrange = (("skill " + tostr(this.min_skill)) + "-") + tostr(this.min_skill + this.grind_ceiling);
15dt = dt ? dt | "    ";
16return (grindrange + " ") + tostr(pass(@args), " ", $ansi.cyan, $su:left(tostr(dmin, "-", dmax), 6), " ", dt, " ", $su:right(tostr(this.base_speed), 4), $ansi.reset, " acc", this.accuracy);

gurps_damage

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1total = 0;
2max = 0;
3type = #-1;
4for x in (this.damage)
5tt = x[2] + ((x[3] - x[2]) / 2);
6total = total + tt;
7if (tt > max)
8type = x[1];
9endif
10endfor
11total = toint(tofloat(total) * 1.5);
12if (is_a(this, #102))
13total = total - 3;
14endif
15d = total / 3;
16rem = total - (d * 3);
17if (d && rem)
18ds = (tostr(d) + "d+") + tostr(rem);
19elseif (d)
20ds = tostr(d) + "d";
21else
22ds = tostr(rem);
23endif
24if (is_a(this, #102))
25if (ds[1] == "-")
26ds = "swing" + ds;
27else
28ds = "swing+" + ds;
29endif
30endif
31if (type in {#268})
32ds = ds + " crush";
33elseif (type in {#277})
34ds = ds + " cut";
35elseif (type in {#278, #279})
36ds = ds + " imp";
37else
38ds = ds + " spec";
39endif
40return ds;

brandish

Spec this at/to anyFlags rxdOwner #29Definer #95

Referenced by

none

Source

1"Wave this weapon in someone's face.   Let them know you mean BUSINESS!";
2if ((iobj == #-2) || (iobj == #-3))
3player:tell("Brandish at what now?");
4return;
5endif
6if (this != player:weapon())
7player:tell("You must be wielding a weapon to brandish it.");
8return;
9endif
10player:queue_action($actions.verb, {this, "_brandish", {player, iobj}}, 1, "brandish " + this.name);

_brandish

Spec this none thisFlags rxdOwner #29Definer #95

Referenced by

none

Source

1agg = args[1];
2vic = args[2];
3msg = "";
4if (is_a(vic, $room) || (!valid(vic)))
5msg = this.room_brandish_msg;
6else
7msg = this.brandish_msg;
8endif
9agg.location:announce_all($su:ps(msg, agg, this, agg.location, vic));
10agg.location:broadcast_event(1, $actions.brandish, agg, {vic});

hold wield draw w*ield

Spec this none noneFlags rxdOwner #361Definer #95

Referenced by

Source

1if (is_a(this, $player))
2player.default_weapon = this;
3endif
4return pass(@args);

finish_attack

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

No program (verb defined but unprogrammed).

can_glob

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1if (this.mods)
2return 0;
3endif
4return pass(@args);

change_target

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1return 1;

mod_difficulty

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1diff = this.mod_difficulty;
2diff = diff - (length(this.mods) * 3);
3if (length(this.mods) > 3)
4diff = diff - 2;
5endif
6return diff;

repair_difficulty

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1if (this.value < 1)
2d = -3;
3elseif (this.value < 100)
4d = 1;
5elseif (this.value < 500)
6d = 0;
7elseif (this.value < 3000)
8d = -1;
9elseif (this.value < 6000)
10d = -2;
11elseif (this.value < 20000)
12d = -3;
13elseif (this.value < 60000)
14d = -4;
15else
16d = -5;
17endif
18d = d - length(this.mods);
19return d;

maybe_degrade

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1if (!this.f)
2if ((!is_a(where = this.location, $living)) || (!(this in where.wielding)))
3return;
4endif
5chance = 1 + length(this.mods);
6if (random($rpg.weapon_degrade_rate) <= chance)
7this:degrade();
8endif
9endif

degrade

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1oh = this.health;
2this:take_damage($damages.beating, 1);
3if ((oh >= 10) && (this.health < 10))
4this.location:tell("Your ", this.name, " is getting pretty worn out.  Better repair it soon.");
5endif

accuracy

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1a = this.accuracy;
2if (this.health < 1)
3a = a - 4;
4elseif (this.health < 7)
5a = a - 2;
6elseif (this.health < 15)
7a = a - 1;
8endif
9return a;

weight

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1w = pass(@args);
2for x in (this.mods)
3w = w + `x.add_weight ! ANY => 0';
4endfor
5return w;

try_wield

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1who = args[1];
2r = pass(@args);
3if (is_player(who) && `this.full_set ! ANY => 0')
4quest = this.full_set[1];
5set = this.full_set[2];
6has = {};
7for w in (who.wearing)
8if (parent(w) in set)
9has = setadd(has, parent(w));
10endif
11endfor
12$lu:same_sets(set, has) && quest:award_to(who);
13endif
14if ((is_player(who) && ((raw = this.skill:raw(who)) < $rpg.max_grind_raw)) && (raw > this:grind_ceiling()))
15who:tell("You don't think you'll be able to learn anything by using this.");
16endif
17return r;

grind_ceiling

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

Source

1return this.min_skill + this.grind_ceiling;

tohit

Spec this none thisFlags rxdOwner #29Definer #95

Referenced by

none

Source

1"Copied from testingpknife (#442870):tohit by Method (#521943) Sat Apr  3 19:15:38 2010 CDT";
2who = args[1];
3mod = this.accuracy;
4if ((raw = this.skill:raw(who)) < this.min_skill)
5mod = mod + ((raw - this.min_skill) * 4);
6endif
7if (is_player(who))
8"mod = mod + $rpg.fight_styles_attack[who.fight_style];";
9endif
10return this.skill:total(who) + mod;

thrown_at

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

1target = args[1];
2thrower = args[2];
3if (is_a(this, #285))
4return pass(@args);
5endif
6sharpside = 0;
7hitchance = `this.throwability ! ANY => 50';
8if (random(100) <= hitchance)
9sharpside = 1;
10endif
11if (is_a(target, $creature))
12body = target:random_bodypart();
13target:aat(this:dnamec(), " hits ", target:dname(), " ", sharpside ? "directly " | "a glancing blow ", "in ", body:dname(), ".");
14else
15body = $bodypart;
16target.location:announce_all(this:dnamec(), " hits ", target:dname(), ".");
17endif
18dmax = this.weight / 400;
19if (sharpside)
20dmax = dmax * 2;
21endif
22this:moveto(target.location);
23if (dmax < 2)
24return;
25endif
26dmax = min(10, dmax);
27damage = random(dmax);
28this:inflict_damage(target, damage, body, thrower);

_repair_check

Spec this none thisFlags rxdOwner #361Definer #95

Referenced by

none

Source

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

flail_damage

Spec this none thisFlags rxdOwner #29Definer #95

Referenced by

none

Source

1if (is_a(this, #284))
2return {};
3endif
4bs = {};
5beatless = 0;
6for x in (this.damage)
7for y in (this.mods)
8if (y.damage_add && (y.damage_add == x))
9x = {};
10break;
11endif
12endfor
13if (!x)
14continue;
15endif
16if ((x[1] != $damages.beating) && (!beatless))
17beatless = 1;
18elseif ((x[1] == $damages.beating) && (!beatless))
19beatless = 2;
20elseif ((x[1] == $damages.beating) && (beatless != 2))
21beatless = 2;
22endif
23if (length(x) < 1)
24bs = bs;
25else
26bs = {@bs, {x[1], x[2] / 2, x[3] / 2, (x[3] > 10) ? random(10) | x[3]}};
27endif
28endfor
29return {beatless, @bs};