generic weapon #95
Aliases: generic weapon
36 verbs · 63 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
at*tack kill shoot stab hit smash break | this none this | rxd | #95 | 31 |
speed | this none this | rxd | #95 | 26 |
inflict_damage | this none this | rxd | #95 | 50 |
damage | this none this | rxd | #95 | 30 |
hit_msg miss_msg | this none this | rxd | #95 | 10 |
start_attack | this none this | rxd | #95 | 15 |
tell_stat | this none this | rxd | #95 | 20 |
can_parry | this none this | rxd | #95 | 3 |
acceptable | this none this | rxd | #95 | 1 |
suicide_attack | this none this | rxd | #95 | 6 |
messages | this none this | rxd | #95 | 1 |
@setup | this none none | rxd | #95 | 42 |
description | this none this | rxd | #95 | 13 |
can_attack | this none this | rxd | #95 | 1 |
smash_msg | this none this | rxd | #95 | 9 |
edps | this none this | rxd | #95 | 34 |
tree_tag | this none this | rxd | #95 | 16 |
gurps_damage | this none this | rxd | #95 | 40 |
brandish | this at/to any | rxd | #95 | 10 |
_brandish | this none this | rxd | #95 | 10 |
hold wield draw w*ield | this none none | rxd | #95 | 4 |
finish_attack | this none this | rxd | #95 | 0 |
can_glob | this none this | rxd | #95 | 4 |
change_target | this none this | rxd | #95 | 1 |
mod_difficulty | this none this | rxd | #95 | 6 |
repair_difficulty | this none this | rxd | #95 | 19 |
maybe_degrade | this none this | rxd | #95 | 9 |
degrade | this none this | rxd | #95 | 5 |
accuracy | this none this | rxd | #95 | 9 |
weight | this none this | rxd | #95 | 5 |
try_wield | this none this | rxd | #95 | 17 |
grind_ceiling | this none this | rxd | #95 | 1 |
tohit | this none this | rxd | #95 | 10 |
thrown_at | this none this | rxd | #95 | 28 |
_repair_check | this none this | rxd | #95 | 8 |
flail_damage | this none this | rxd | #95 | 29 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
base_speed | #95 | rc | #29 | 5.0 |
attack_action | #95 | rc | #29 | #222 |
damage | #95 | rc | #29 | {{#268, 1, 1, 10}} |
accuracy | #95 | rc | #29 | 0 |
messages | #95 | rc | #29 | #533 |
damage_from_brawn | #95 | rc | #29 | 0.0 |
damage_from_skill | #95 | rc | #29 | 0.0 |
parry_class | #95 | rc | #29 | 0 |
mods | #95 | rc | #29 | {} |
incompatible_mods | #95 | rc | #29 | {} |
parry_bonus | #95 | rc | #29 | 0 |
melee_defense_mod | #95 | rc | #29 | 0 |
brandish_msg | #95 | rc | #29 | "%DN shakes %p %t at %dd." |
room_brandish_msg | #95 | rc | #29 | "%DN waves %p %t menacingly." |
can_cut_meat | #95 | rc | #29 | 0 |
mod_difficulty | #95 | rc | #29 | 0 |
noise | #95 | rc | #29 | #101390 |
antidodge_mod | #95 | rc | #29 | 1.0 |
unarmed_visible | #95 | rc | #29 | 1 |
taunt_msg | #95 | rc | #29 | {} |
grind_ceiling | #95 | rc | #29 | 2 |
max_mods | #95 | rc | #29 | 4 |
throwability | #95 | rc | #29 | 50 |
min_speed | #95 | rc | #29 | 1.0 |
break_msg | #255 | rc | #29 | "%DT breaks apart into useless junk." |
repair_difficulty | #255 | rc | #29 | <clear> |
junk_on_break | #255 | rc | #29 | 1 |
rename_on_break | #255 | rc | #29 | "" |
smashable | #255 | rc | #29 | <clear> |
repairable | #255 | rc | #29 | <clear> |
armor | #255 | rc | #29 | <clear> |
held_break_msg | #255 | rc | #29 | "Your %t breaks apart in your hands." |
oheld_break_msg | #255 | rc | #29 | "%DN's %t breaks apart in %p hands." |
handed | #5 | rc | #29 | 1 |
wield_msg | #5 | rc | #29 | "%DN gets out %p %t." |
unwield_msg | #5 | rc | #29 | "%DN puts away %p %t." |
size | #5 | rc | #29 | 0 |
look_place_msg | #5 | rc | #29 | "" |
value | #5 | rc | #29 | <clear> |
get_msg | #5 | rc | #29 | <clear> |
drop_msg | #5 | rc | #29 | <clear> |
get_fail_msg | #5 | rc | #29 | <clear> |
junk_ok | #5 | rc | #29 | <clear> |
floats | #5 | rc | #29 | <clear> |
long_name_msg | #5 | rc | #29 | <clear> |
article | #5 | rc | #29 | <clear> |
setup_list | #5 | rc | #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 | #5 | rc | #29 | <clear> |
health_max | #5 | rc | #29 | <clear> |
min_skill | #5 | rc | #29 | 1 |
skill | #5 | rc | #29 | <clear> |
recipe_for | #5 | rc | #29 | <clear> |
carried_msg | #5 | rc | #29 | <clear> |
aliases | #1 | rc | #29 | {"generic weapon"} |
description | #1 | rc | #29 | "" |
object_size | #1 | r | #29 | {31674, 1298433815} |
hidden_verbs | #1 | rc | #29 | {"@setup", "clean"} |
phelp_msg | #1 | rc | #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 | #1 | rc | #29 | 1500 |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #255 generic smashable thing → #5 generic thing → #1 root
Children: #259 generic melee weapon
Call graph
Showing 48 of 63 verbs; 15 not shown.
Source
at*tack kill shoot stab hit smash break
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
Referenced by
- #95:edps line 33:
w:speed
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
Referenced by
- #95:thrown_at line 28:
this:inflict_damage
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
Referenced by
- #95:inflict_damage line 9:
this:damage - #95:suicide_attack line 3:
this:damage - #95:edps line 4:
w:damage - #95:edps line 5:
w:damage
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
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
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
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
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
Referenced by
none
Source
1return $ou:isa(args[1], $ammo);
suicide_attack
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
Referenced by
- #95:hit_msg line 6:
this:messages - #95:hit_msg line 8:
this:messages - #95:start_attack line 8:
this:messages - #95:smash_msg line 9:
this:messages
Source
1return this.messages;
@setup
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
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
Referenced by
none
Source
1return 1;
smash_msg
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
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
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
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
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
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
Referenced by
- #95:at*tack line 23:
this:hold
Source
1if (is_a(this, $player)) 2player.default_weapon = this; 3endif 4return pass(@args);
finish_attack
Referenced by
none
Source
No program (verb defined but unprogrammed).
can_glob
Referenced by
none
Source
1if (this.mods) 2return 0; 3endif 4return pass(@args);
change_target
Referenced by
none
Source
1return 1;
mod_difficulty
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
Referenced by
- #95:_repair_check line 2:
this:repair_difficulty
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
Referenced by
- #95:inflict_damage line 31:
this:maybe_degrade
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
Referenced by
- #95:maybe_degrade line 7:
this:degrade
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
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
Referenced by
none
Source
1w = pass(@args); 2for x in (this.mods) 3w = w + `x.add_weight ! ANY => 0'; 4endfor 5return w;
try_wield
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
Referenced by
- #95:try_wield line 14:
this:grind_ceiling
Source
1return this.min_skill + this.grind_ceiling;
tohit
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
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
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
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};