generic weapon #82

Parent #517Owner Flags Source rpg_march_2006/weapon.txt

Aliases: generic weapon, weapon

46 verbs · 40 properties · 5 children

Verbs

VerbSpecFlagsDefinerLines
wield weild ready drawthis none nonerxd#8257
sheathe unwield sling rem*ovethis none nonerxd#8228
look_selfthis none this#8230
name christen dub entitlethis as anyrxd#8223
usedthis none this#8213
titlethis none this#821
dodgable parryable slowness length skill hands special_damage con max_str_bonus disarmablethis none this#8220
intimidate bully impress threatenany with thisrxd#8226
critical_missthis none thisrx#827
critical_hitthis none thisrx#8210
notify_clangthis none thisrx#829
has_own_hitthis none this#822
notify_parrythis none this#828
damthis none thisrx#8213
penthis none thisrx#8212
attackthis none thisrx#8214
check_degradethis none this#8236
breakthis none this#8219
set_titlethis none this#8210
piercethis none this#824
may_wieldthis none this#8212
do_wieldthis none this#8210
may_unwieldthis none this#8211
do_movethis none this#8211
parrythis none this#823
announce_swingthis none thisrx#827
announce_parrythis none thisrx#829
announce_killthis none thisrx#826
announce_missthis none thisrx#826
announce_hitthis none thisrx#8214
announce_dodgethis none thisrx#826
used_titlethis none this#821
contractthis none this#824
stare gazenone to this#8217
do_unwieldthis none this#823
hit_special_effectthis none this#822
hit killany with thisrxd#8261
is_naturalthis none this#823
conditionthis none this#826
hidden_verbsthis none this#8218
hit(old)any with thisrxd#8259
can_degradethis none this#821
attack_encumbrancethis none this#821
track_usagethis none this#827
_wieldthis none this#8213
_unwieldthis none this#8213

Properties

PropertyDefinerFlagsOwnerValue
dodgable#82not readable (E_PERM)
parryable#82not readable (E_PERM)
title#82r0
oswing#82r"swings"
swing#82r"swing"
owield#82r"wields"
wield#82r"wield"
osheathe#82r"sheathes"
sheathe#82r"sheathe"
slowness#82not readable (E_PERM)
length#82r0
parry#82not readable (E_PERM)
attack#82not readable (E_PERM)
pen#82not readable (E_PERM)
dam#82not readable (E_PERM)
skill#82not readable (E_PERM)
hands#82r1
bully_msg#82r"%N %<%(oswing)> %p %t menacingly at %d."
special_damage#82r0
wooden#82r0
blunt#82r0
pierce#82not readable (E_PERM)
con#82r30
max_str_bonus#82not readable (E_PERM)
disarmable#82r1
materialize#82r0
natural#82rc0
can_degrade#82not readable (E_PERM)
track_usage#82not readable (E_PERM)
no_dub#82r0
handles_death_msg#82r0
worth#82-1
condition#82100
odrop_failed_msg#82"%<tries> to drop %t but fails!"
odrop_succeeded_msg#82"%<drops> %t."
otake_succeeded_msg#82"%<picks> up %t."
key#82not readable (E_PERM)
aliases#82{"generic weapon", "weapon"}
description#82"A generic implement of destruction."
object_size#82{49733, 1141286558}

Ancestry

Ancestors (nearest first): #517 Generic LRPG Thing

Children: #2521 generic hand-and-a-half weapon, #3451 generic shield, #10898 Generic Thrown Weapon, #50181 generic natural weapon, #59933 Generic Weapon Spell Focus

Call graph

calls n82_0 #82:wield n82_20 #82:may_wield n82_0->n82_20 n82_5 #82:title n82_0->n82_5 n82_44 #82:_wield n82_0->n82_44 n82_21 #82:do_wield n82_44->n82_21 n82_1 #82:sheathe n82_1->n82_5 n82_22 #82:may_unwield n82_1->n82_22 n82_45 #82:_unwield n82_1->n82_45 n82_34 #82:do_unwield n82_45->n82_34 n82_2 #82:look_self n517_14 #517:look_self n82_2->n517_14 n82_10 #82:notify_clang n82_16 #82:check_degrade n82_10->n82_16 n82_12 #82:notify_parry n82_12->n82_16 n82_13 #82:dam n82_38 #82:condition n82_13->n82_38 n517_11 #517:condition n82_38->n517_11 n82_14 #82:pen n82_14->n82_38 n82_15 #82:attack n82_15->n82_38 n82_17 #82:break n517_20 #517:unclaim_for n82_17->n517_20 n517_30 #517:moveto n82_17->n517_30 n517_32 #517:do_update n82_21->n517_32 n82_23 #82:do_move n82_23->n82_34 n517_24 #517:do_move n82_23->n517_24 n82_34->n517_32 n82_35 #82:hit_special_effect n82_35->n517_32 n82_39 #82:hidden_verbs n517_29 #517:hidden_verbs n82_39->n517_29

Source

wield weild ready draw

Spec this none noneFlags rxdDefiner #82

Referenced by

Source

1"wield weapon -- Wield the weapon, first making sure player has enough hands, or enough hands free.";
2if (!(rpg = $local.rpg):trust($nothing, player))
3  return E_PERM;
4elseif (this.location != player)
5  rpg:playertell(player, "You don't have ", this.name, ".");
6  return;
7elseif (!valid(doll = rpg:get_doll(player)))
8  rpg:playertell(player, "It wouldn't do you much good, you don't know how to use it. Check out the Bovine Illuminati for some instruction.");
9  return;
10elseif (`player.location:sleeping(player) ! E_VERBNF')
11  return rpg:playertell(player, "You are snoozing.  Your weapons are 'unavailable for comment'.");
12elseif (p = doll.paralyzed)
13  return rpg:playertell(player, (typeof(p) == STR) ? p | "You're paralyzed.  It's hard to wield weapons in this state.");
14elseif (rpg.magic_db.en_combat_effect in doll.combat_effects)
15  return rpg:playertell(player, "The vines entangling you make that just a wee bit difficult.");
16elseif (this in (wielding = doll.wielding))
17  rpg:playertell(player, "You're already wielding it.");
18  return;
19elseif ((handsreq = this.hands) > doll.hands)
20  rpg:playertell(player, "You don't have enough appendages to wield ", this.name, ".");
21  return;
22elseif (!this:may_wield(player))
23  return;
24elseif ((handsfree = doll:hands_free()) < handsreq)
25  rpg:playertell(player, "Your hands are full.");
26  for thing in ($list_utils:reverse(wielding))
27    if (((handsfree < handsreq) && thing:may_unwield(player)) && thing.hands)
28      "doll.wielding = setremove(doll.wielding, thing);";
29      "thing:do_unwield(player);";
30      "rpg:playertell(player, \"You \", thing.sheathe, \" your \", thing.name, \".\");";
31      thing:_unwield(doll);
32      handsfree = doll:hands_free();
33      rpg:playertell(player, "You ", this.sheathe, " your ", thing:title(), ".");
34      player.location:announce($string_utils:pronoun_sub(((("%n %<" + thing.osheathe) + "> %p ") + thing:title()) + "."));
35    endif
36  endfor
37endif
38if (doll:hands_free() >= handsreq)
39  "doll.wielding = listappend(doll.wielding, this);";
40  "this:do_wield(player);";
41  "rpg:playertell(player, \"You \", this.wield, \" your \", this.name, \".\");";
42  rpg:playertell(player, "You ", this.wield, " your ", this:title(), ".");
43  "rpg:rpg_announce_all_but(player.location, {player}, $string_utils:pronoun_sub((\"%n %<\" + this.owield) + \"> %p %[tname].\"));";
44  rpg:rpg_announce_all_but(player.location, {player}, $string_utils:pronoun_sub(((("%n %<" + this.owield) + "> %p ") + this:title()) + "."));
45  this:_wield(doll);
46endif
47"Comment out this invite call, due to current lag conditions.";
48"doll:invite((doll.slowness + weapon.slowness) / 3, {2, w});";
49"Quinn 30-JUL-93 2219: Re-written and modified for dynamic unwielding when hands are full; added call to :look_gear after wielding; restored :invite call.";
50"Quinn 10-AUG-93 0116: Fixed bug where someone without enough hands (doll.hands) could wield a weapon anyway.";
51"Profane 15-AUG-96 1506PDT -- added dousing for light sources in auto-unwield.";
52"Irin Sat Sep 28 12:04:07 1996 PDT -- Added call to :do_wield and :may_wield.  Removed dousing of light_sources, because it's in the light_source :do_unwield.";
53"THX1138 28-Mar-1997 -- Changed the while-loop to a for-loop in the auto-unwield code.  Auto-unwield changed to go in the reverse of how the player originally wielded the stuff.  An additional check is then made for enough hands required before doing the listappend to doll.wielding.";
54"Hydros (#106189) - Sun Jul 3, 2005 - Changed active messaging to use :title() instead of .name, to support Cervantes' new dual weapons. Old lines commented.";
55"Hydros (#106189) - Tue Jul 5, 2005 - Nuts to that. Commented everything and moved the grunt work into this:_wield(). The same will be done for :unwield().";
56"                                   - In the case of an already wielded weapon, turned the hard-coded unwielding into :_unwield().";
57"Hydros(#106189) - Sat Jul 9, 2005 - Moved messaging from :_wield back into this verb. Not all wielding is voluntary.";

sheathe unwield sling rem*ove

Spec this none noneFlags rxdDefiner #82

Referenced by

none

Source

1if (!(rpg = $local.rpg):trust($nothing, player))
2  return E_PERM;
3elseif (this.location != player)
4  rpg:playertell(player, "You're not carrying ", this.name, ".");
5elseif (!valid(doll = rpg:get_doll(player)))
6  rpg:playertell(player, "You fumble around with the ", this.name, " and realize you don't know what to do with it. Perhaps some training at the Bovine Illuminati would help.");
7elseif (p = doll.paralyzed)
8  rpg:playertell(player, (typeof(p) == STR) ? p | "It's hard to unwield weapons when you're paralyzed.");
9elseif (rpg.magic_db.en_combat_effect in doll.combat_effects)
10  return rpg:playertell(player, "The vines entangling you make that just a wee bit difficult.");
11elseif (!this:may_unwield(player))
12  return;
13elseif (`player.location:sleeping(player) ! ANY => 0')
14  return rpg:playertell(player, "You dream of unwielding your ", this.name, ".");
15elseif (this in doll.wielding)
16  "doll.wielding = setremove(doll.wielding, this);";
17  "this:do_unwield(player);";
18  "rpg:playertell(player, \"You \", this.sheathe, \" your \", this.name, \".\");";
19  rpg:playertell(player, "You ", this.sheathe, " your ", this:title(), ".");
20  "player.location:announce($string_utils:pronoun_sub((\"%n %<\" + this.osheathe) + \"> %p %[tname].\"));";
21  player.location:announce($string_utils:pronoun_sub(((("%n %<" + this.osheathe) + "> %p ") + this:title()) + "."));
22  this:_unwield(doll);
23else
24  rpg:playertell(player, "You aren't wielding your ", this.name, ".");
25endif
26"Hydros (#106189) - Sun Jul 3, 2005 - Changed active messaging to use :title() instead of .name, to support Cervantes' new dual weapons. Old lines commented.";
27"Hydros (#106189) - Tue Jul 5, 2005 - Nuts to that. Commented everything and moved the grunt work into this:_unwield(). The same is done in :wield().";
28"Hydros(#106189) - Sat Jul 9, 2005 - Moved messaging from :_unwield back into this verb. Not all unwielding is voluntary.";

look_self

Spec this none thisDefiner #82

Referenced by

Source

1{rpg, s_u} = {$local.rpg, $string_utils};
2if (player in `player.location:sleeping() ! E_VERBNF => {}')
3  return rpg:playertell(player, "You dream about examining some implement of destruction.");
4endif
5pass(@args);
6if (typeof(this.title) == STR)
7  rpg:playertell(player, "The name \"", this.title, "\" is written in ornate, flowing letters across the ", this.name, ".");
8endif
9if (!valid(doll = rpg:get_doll(this.location)))
10  return;
11endif
12if (wloc = this in doll.wielding)
13  mark = rpg.death_db.temple:mark(player);
14  if (mark && (!this.blunt))
15    rpg:playertell(player, "As you stare at the blade, you see the phantom ", (length(mark) > 1) ? "forms" | "form", " of ", s_u:nn(mark), ".");
16  endif
17endif
18if (wloc == 1)
19  if ((this.hands == 2) && (doll:hands_free() == 0))
20    rpg:playertell(player, s_u:_cap_property(this, "name"), " is wielded with both hands.");
21  else
22    rpg:playertell(player, s_u:_cap_property(this, "name"), " is wielded in the primary hand.");
23  endif
24elseif (wloc == 2)
25  rpg:playertell(player, s_u:_cap_property(this, "name"), " is wielded in the secondary hand.");
26elseif (wloc)
27  rpg:playertell(player, s_u:_cap_property(this, "name"), " is wielded.");
28endif
29"Ogwul:Mon Apr 25 18:29:16 MDT 1994:Capitalized the sentence stating handedness.";
30"Ogwul:Mon Apr 25 18:38:50 MDT 1994:Added new message for two-handed weapons.";

name christen dub entitle

Spec this as anyFlags rxdDefiner #82

Referenced by

none

Source

1"dub this as <title> -- Add the alias 'title' to this weapon, allowing the player to refer to multiple weapons of the same name.";
2rpg = $local.rpg;
3if ((valid(cp = caller_perms()) && (player != cp)) && (!rpg:is_monster(player)))
4  return rpg:playertell(player, E_PERM);
5elseif (this.location != player)
6  rpg:playertell(player, "Wouldn't it be more dramatic if you were holding ", this.name, "?");
7elseif (((this.no_dub || this.unique) || children(this)) && (!$perm_utils:controls(player, this)))
8  rpg:playertell(player, "You are shocked by some mystic force.  The voice of what could only be the Sacred COW echoes in your naughty mind: \"MOO!\"  Well now you certainly won't try THAT again.");
9elseif (iobjstr)
10  this:set_aliases(setadd(setadd({@parent(this).aliases, @`this.crest ? {this.crest} | {} ! ANY => {}'}, this.title = iobjstr), this.name));
11  rpg:playertell(player, this.name, " now bears the name \"", iobjstr, "\"");
12else
13  this:set_aliases(setremove(this.aliases, this.title));
14  clear_property(this, "title");
15  rpg:playertell(player, "You scratch off the title of ", this.name, ".");
16endif
17"Quinn 28-FEB-93: Must be holding weapon in order to dub it; fixed the screwy use of :set_name; clear property if !iobjstr.";
18"Quinn 07-JUN-93: Hacked to disallow dubbing of unique weapons by nonowners.";
19"Quinn 02-AUG-93: @chmod +x so players could take advantage of ordinal matching in the instance they'd most need it-- dubbing multiple weapons.";
20"Quinn 21-NOV-93: Okay let's try this again.  Now just set aliases to {@parent(this).aliases, title}.";
21"StarDancer 9-APR-96: Added :is_monster check so's monsters can dub weapons.";
22"Irin Nuke Day '97 -- Dubbed objects now keep eir name in eir aliases.  They still lose any other special aliases.";
23"Hydros (#106189) - Thu Apr 7, 2005 - When clearing a title, we also now remove the title from the aliases. (I can't believe my name has any place below these gods of LRPG lore.)";

used

Spec this none thisDefiner #82

Referenced by

Source

1":used(by, target)";
2"Return a number modifying the attack, or a non-numeric value meaning the weapon is unusable.";
3(rpg = $local.rpg):secure();
4{by, target} = args;
5if (valid(doll = rpg:get_doll(by)))
6  if (($perm_utils:caller()[2] == "attack") && (z = this in doll.wielding))
7    return 15 * (1 - z);
8  endif
9  "doll:check_fatigue(this.encumbrance);";
10else
11  return -200;
12endif
13"Profane 1/29/95 10:20 EST -- Changed reference to `this.location' to `by' in line 5.";

title

Spec this none thisDefiner #82

Referenced by

Source

1return this.title ? ((this.name + " named \"") + this.title) + "\"" | this.name;

dodgable parryable slowness length skill hands special_damage con max_str_bonus disarmable

Spec this none thisDefiner #82

Referenced by

Source

1":(property)(by, targ) => Default returns the value of this weapon's `verb' property.";
2"(both by and targ are characters, not dolls)";
3"This hack will greatly enhance the versatility of the system, cleaning up the way hand/half weapons are handled, and allowing for things such as variable damages (pistol whipping, autofire), etcetera.";
4"Explanations of each property follow. (Quinn 03-JAN-93)";
5" dodgable  -- Modifier when dodging the weapon.";
6" parryable -- Modifier when parrying against the weapon.";
7" slowness  -- Speed of the weapon.  The lower the better.  Average is 10.";
8" length    -- Length of weapon in ~5cm units, tho more a measure of bulk.";
9" attack    -- Modifier when attacking with the weapon.";
10" pen       -- Weapon's ability to penetrate armor. The lower the better.";
11" dam       -- How much damage the weapon does.";
12" skill     -- Object number of skill governing the weapon's use.";
13" hands     -- How many hands required to wield the weapon.";
14" special_damage -- Any damage that gets added directly to inj on a hit, for example, damage as a result of the weapon being poisoned.";
15" pierce -- Ability of weapon to find holes in armour.  Daggers and other long narrow weapons should be > 0, clubs and blunt weapons < 0.";
16" con    -- How good the weapon is at bashing through armour with the force of it's blows.  2 is a really good club.  3 is a mace.  4 for a heavy sword.  Use 1 only in exceptional circumstances.  5+ for most weapons.";
17"max_str_bonus  -- How much damage the weapon would do if wielded by a person of high strength.  (i.e. str 25).  A person of str 12 would get half that bonus.  Clubs and such should have a low dam relative to this.  A dagger or rapier would have a very high dam, relative to this.";
18return this.(verb);
19"DR APR-24-94 -- Added special_damage.";
20"Irin -- Wed Sep  4 21:37:48 1996 PDT added pierce.";

intimidate bully impress threaten

Spec any with thisFlags rxdDefiner #82

Referenced by

none

Source

1"intimidate any with this -- Show that you'll use that thing.";
2"Set messages using normal pronoun subs (see 'help pronouns'), plus verb subs.";
3"For example; if I type '@bully whip is \"%N %<cracks> %p whip at %d.\"' and then 'bully AcidHorse with whip', the following messages would be displayed:";
4"to   me: You crack your whip at AcidHorse.";
5"to   AH: Quinn cracks his whip at you.";
6"to room: Quinn cracks his whip at AcidHorse.";
7rpg = $local.rpg;
8if (!rpg:trust($nothing, player))
9  return E_PERM;
10elseif (this.location != player)
11  rpg:playertell(player, "You don't have ", this.name, ".");
12elseif (!valid(doll = rpg:get_doll(player)))
13  rpg:playertell(player, "Ha.  You think you'd know how to brandish that thing?  Maybe you should get some training so the bullies don't kick sand in your face anymore.  I hear Charles Atlas recommends the Bovine Illuminati 'Thug' plan.");
14elseif (doll:cannot_attack(1))
15elseif (dobj == $failed_match)
16  player:tell("Bully *who*?");
17elseif (!(this in doll:wielding()))
18  rpg:playertell(player, "It's a bit difficult to intimidate ", dobj.name, " with a weapon you aren't even wielding.");
19else
20  rpg:say_action(strsub(this.bully_msg, "%(oswing)", this.oswing));
21  if (rpg.object_db:is_monster(dobj))
22    dobj:notify_bully(player, dobj, this);
23  endif
24endif
25"Quinn 31-JUL-93 0243-ET: Added in conjunction with new :set_message.";
26"Profane (#30788) - Sun Oct 19 14:44:05 1997 PDT - Added new call to monster's notify_bully.";

critical_miss

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":critical_miss(OBJ attacker, OBJ target, NUM atk)";
2"attacker -- who attacked";
3"target -- who was hit.";
4"atk    -- actual attack roll.";
5"By default, do nothing.  Provided for possible special weapon effects.";
6"Attacker is assumed to be the wielder of the weapon (this.location).";
7"If a TRUE value is returned, the weapon is assumed to have done something.";

critical_hit

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":critical_hit(OBJ attacker, OBJ target, NUM atk, OBJ loc, NUM dam)";
2"Caller should always be the damaged doll.";
3"attacker -- who attacked";
4"target   -- who was hit.";
5"loc      -- body area hit by the attack.";
6"dam      -- damage applied to the character.";
7"atk      -- actual attack roll.";
8"By default, do nothing.  Provided for possible special weapon effects.";
9"Attacker is assumed to be the wielder of the weapon (this.location).";
10"If a TRUE value is returned, the weapon is assumed to have handled all damage effects.  :receive_damage will NOT be called.";

notify_clang

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":notify_clang(OBJ attacker, OBJ victim, NUM hit_location, OBJ armour_hit, NUM quality)";
2"Hook for weapons damage and other special combat effects.  Called when armour and weapon contact without any damage being done to the victim (armour absorbed the hit).";
3"Quality is the final attack roll, some indication of the quality of the hit.";
4{attacker, victim, loc, armour, qual} = args;
5$local.rpg:secure();
6this:check_degrade(attacker, victim, loc, armour, qual);
7`armour:check_degrade(attacker, victim, loc, this, qual) ! ANY';
8"Profane 2-17-95 00:13EST - Added check for weapon degrading.";
9"THX (#105941) - Tue Dec 21, 1999 - Re-introducing armour degradation.";

has_own_hit

Spec this none thisDefiner #82

Referenced by

none

Source

1":has_own_hit() => returns 1 iff the weapon has its own ''hit kill'' verb defined.";
2return ({x} = $object_utils:has_callable_verb(this, "hit")) && (x != $local.rpg.weapon);

notify_parry

Spec this none thisDefiner #82

Referenced by

none

Source

1":notify_parry(OBJ attacker, OBJ victim, STR hit_location, OBJ weapon_doing_the_parrying, NUM quality, NUM try_of_parry)";
2"Hook for weapons damage and other special combat effects. Called on the ``attacking'' weapon when the defender manages to parry the attack.";
3"Quality is the final attack roll, some indication of the quality of the hit.";
4"Try is the `attack' roll made by the defender when parrying.";
5$local.rpg:secure();
6this:check_degrade(@args);
7"Profane 2-13-95 20:52EST - Added.";
8"Profane 2-18-95 00:08EST - Added check for weapon degrading.";

dam

Spec this none thisFlags rxDefiner #82

Referenced by

Source

1":dam(by, targ) => NUM modified damage of weapon due to its condition.";
2{by, targ} = args;
3dam = this.dam;
4cond = this:condition(by, targ) || 100;
5mod = (100 - cond) / 10;
6"if (cond <= 100)";
7"  mod = (100 - cond) / 10;";
8"else";
9"  mod = -toint(tofloat(cond) ^ (1.0 / 1.1) / 10.0);";
10"endif";
11mod = this.blunt ? mod / 2 | mod;
12return max(dam - mod, dam / 2);
13"Profane 2/17/95 23:14EST - Added.";

pen

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":pen(by, targ) => NUM modified penetration of weapon due to its condition.";
2{?by = player, ?targ = player} = args;
3pen = this.pen;
4if (this.blunt || (pen < 2))
5elseif ((typeof(cond = this:condition(by, targ)) == 3) || (cond < 101))
6  pen = max(pen + ((100 - (this:condition(by, targ) || 100)) / 5), 2);
7else
8  pen = max((pen * 100) / this:condition(by, targ), 2);
9endif
10return pen;
11"Profane 2/17/95 23:14EST - Added.";
12"dalton (#116601) - Sun Oct  6, 2002 - added separate computation for condition over 100.";

attack

Spec this none thisFlags rxDefiner #82

Referenced by

Source

1":attack(by, targ) => NUM modified attack modifier of weapon due to its condition.";
2{by, targ} = args;
3att = this.attack;
4cond = this:condition(by, targ) || 100;
5if (att < 0)
6  return att * ((cond <= 0) ? abs(cond) + 100 | (100 / cond));
7elseif (att == 0)
8  return att + ((cond - 100) / 10);
9endif
10return (att * cond) / 100;
11"Profane 2/17/95 23:14EST - Added.";
12"THX (#105941) - Mon Jan 22, 2001 - Check special case of attack < 0.";
13"Profane (#30788) - Fri Mar  2, 2001 - now weapons with a default 0 bonus get an effect.";
14"dalton (#116601) - Wed Sep 11, 2002 - added check for negative condition to handle unique weapons.";

check_degrade

Spec this none thisDefiner #82

Referenced by

Source

1":check_degrade(OBJ attacker, OBJ victim, location, OBJ other weapon/armour, NUM qual of attack, NUM try of parry)";
2{attacker, victim, location, anvil, qual, ?parry_qual = 0} = args;
3if ((typeof(condition = this.condition) == NUM) && ((!valid(anvil)) || `anvil:can_degrade(this) ! ANY => 1'))
4  if (this.unique || children(this))
5    return;
6  endif
7  "Chance of breaking: 1% for every 5 condition points we are below 50. e.g. .condition 40 == 2% chance of breaking.";
8  break_chance = max((50 - condition) / 5, 0);
9  if (random(100) <= break_chance)
10    $local.rpg:secure();
11    this:("break")();
12    kill_task(task_id());
13  else
14    if (callers()[1][2] == "announce_parry")
15      by = victim;
16      target = attacker;
17    else
18      by = attacker;
19      target = victim;
20    endif
21    chance = (5 + (5 * this.wooden)) + (qual / 100);
22    "Chance of degrading = .5%, 1% if this is a blunt weapon. Modified by the quality of the attack expressed as a percentage. For yer average attack, this works out to be ~ .8% (1.3% for blunt weapons).";
23    if (random(499) <= chance)
24      "Alright, real simple formula since old one was tick-intensive and people whined it did too much damage.";
25      amt = (5 * qual) / 100;
26      amt = random(max(amt, 1));
27      (rpg = $local.rpg):secure();
28      this.condition = max(condition - amt, 0);
29      rpg:playertell(by, "Your ", this.name, " seems a little worse for wear.");
30    endif
31  endif
32endif
33"Profane 2-17-95 23:33EST - Added.";
34"THX (#105941) 18-FEB-1997 - Scatter assignments <incl. accounting for different numbers of args from notify_clang and notify_parry>.";
35"THX (#105941) - Tue Dec 21, 1999 - Put security in place _only_ if the weapon degrades or breaks.";
36"Hydros (#106189) - Mon Oct 17, 2005 - subst /999/499/23. 2% chance of degrade instead of 1%.";

break

Spec this none thisDefiner #82

Referenced by

Source

1":break() -- Make the weapon break. Instead of recycling it, we just move it to the cemetary and let the regular reaping take care of it.";
2if (!(rpg = $local.rpg):trusted(caller_perms()))
3  return E_PERM;
4  "elseif (this.owner != rpg.owner || this.unique || typeof(condition = this.condition) != NUM || children(this))";
5  "rpg:rpg_announce(this.location.location, this:titlec(), \" resists the final dissolution!\");";
6  "return E_NACC;";
7else
8  if (valid(doll = rpg:get_doll(who = this.location)) && (this in doll.wielding))
9    rpg:playertell(who, "Your ", this.name, " shatters from the abuse it has taken!");
10    this:room_announce_all_but({who}, who.name, "'s ", this.name, " shatters from the abuse it has taken!");
11    doll.wielding = setremove(doll.wielding, this);
12  else
13    this:room_announce_all(this:titlec(), " shatters into slivers!");
14  endif
15  this:unclaim_for(this.claimed_by);
16  this:moveto(rpg.cemetery);
17endif
18"Profane 2-17-95 23:42EST - Added.";
19"Profane 6-AUG-96 1607PDT -- commented out E_NACC check-- since this check is done by the reap task anyway, and the point of this verb is to remove the weapon from a person/place.";

set_title

Spec this none thisDefiner #82

Referenced by

none

Source

1":set_title(STR) => STR title -- Set the .title of the object.";
2if (!$local.rpg:trusted(caller_perms()))
3  return E_PERM;
4elseif (children(this))
5  return E_NACC;
6elseif (typeof(title = args[1]) != STR)
7  return E_INVARG;
8else
9  return this:set_aliases(setadd(parent(this).aliases, this.title = title));
10endif

pierce

Spec this none thisDefiner #82

Referenced by

none

Source

1"qual = (length(args) > 2) ? args[3] | 0;";
2{attacker, me, ?qual = 0} = args;
3return (this.pierce * (100 + qual)) / 100;
4"THX1138 18-FEB-1997 - Scatter assignment to reduce ticks.  Commented old code.";

may_wield

Spec this none thisDefiner #82

Referenced by

Source

1":may_wield(who) => Who is allowed to wield this.  Verb for additional checks of wielding being allowed.";
2{who} = args;
3"if ((is_player(who) && (!index($string_utils.alphabet, who.name[$]))) && ($string_utils:match_player(who.name[1..$ - 1]) != who))";
4"  who:tell(\"Grand_Master does not support the use of aliases which consist of another player's name with a non-alphabetic alphanumeric character on the end.  Social reform through coercion.  Wow.\");";
5if (valid(doll = (rpg = $local.rpg):get_doll(who)))
6  if (msg = doll:immobilized())
7    rpg:playertell(player, msg);
8    return 0;
9  endif
10  return 1;
11endif
12return 0;

do_wield

Spec this none thisDefiner #82

Referenced by

Source

1":do_wield(who) => Perform whatever tasks need to be done when weapon is wielded.";
2rpg = $local.rpg;
3if ((!(this.owner in rpg.gms)) && `verb_info(this, "0") ! E_VERBNF')
4  {who} = args;
5  `rpg:get_doll(who):setremove_att("wielding", this) ! ANY';
6  (this.owner in rpg.ex_gms) ? kill_task(task_id()) | raise(E_PERM, "Sorry, but non-gms may not own weapon objects.  Thanks for playing.");
7else
8  this.last_action && this:do_update();
9  return 1;
10endif

may_unwield

Spec this none thisDefiner #82

Referenced by

Source

1":may_unwield(who) => Determine if anything would prevent them from unwielding the item.";
2{who} = args;
3if (valid(doll = (rpg = $local.rpg):get_doll(who)))
4  if (msg = doll:cannot_move(1))
5    "rpg:playertell(who, msg);";
6    return 0;
7  endif
8  return 1;
9else
10  return 0;
11endif

do_move

Spec this none thisDefiner #82

Referenced by

Source

1":do_move(oldloc, newloc) => Remove this from oldloc.wielding.";
2(rpg = $local.rpg):secure();
3{oldloc, newloc} = args;
4"if (valid(doll = rpg:get_doll(oldloc)))";
5if (valid(doll = rpg:get_doll(oldloc)) && (this in (wielding = doll.wielding)))
6  "doll.wielding = setremove(doll.wielding, this);";
7  doll.wielding = setremove(wielding, this);
8  this:do_unwield(oldloc);
9endif
10pass(oldloc, newloc);
11"Hydros (#106189) - Fri Mar 4, 2005 - Commented out the old check for valid doll, and re-added it with a check to see if this is even being wielded before unwielding it.";

parry

Spec this none thisDefiner #82

Referenced by

Source

1":parry(by, targ, weapon) => how good is the weapon at parrying.";
2"Irin -- moved this off from the other verbs, to add a weapon check.";
3return this.(verb);

announce_swing

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_swing(attacker, target)";
2"Announce that `attacker' has swung at `target' with this weapon.";
3{who, target} = args;
4(rpg = $local.rpg):playertell(who, "You ", this.swing, " your ", weapon = this.name, " at ", tname = target.name, ".");
5rpg:playertell(target, @string = {who.name, " ", this.oswing, " ", who.pp, " ", weapon, " at "}, "you.");
6rpg:rpg_announce_all_but(who.location, {who, target}, @string, tname, ".");
7"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";

announce_parry

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_parry(attacker, defender, location-string, weapon, qual of attack, quality of parry)";
2"Announce that `defender' has used this weapon to parry an attack by `attacker' with `weapon' aimed at `location-string'.";
3{attacker, who, locstr, weapon, qual, best} = args;
4(rpg = $local.rpg):playertell(who, "You parry with your ", this.name, ".");
5rpg:rpg_announce_all_but(who.location, {who}, who.name, " parries with ", who.pp, " ", this.name, ".");
6"this:check_degrade(@args)";
7"StarDancer 11-19-95 comment out the degrade check, 'cause we're *always* runnin outa ticks.";
8"Profane 2-18-95 00:18EST - Added weapon degrading check.";
9"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";

announce_kill

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_kill(attacker, target, location-string)";
2"Announce that `attacker' has killed `target' with a blow to the `location-string' from this weapon.";
3{by, dead, locstr} = args;
4(rpg = $local.rpg):playertell(dead, by.name, " has killed you! Your soul is returned to the cycle of transmigrations.");
5rpg:rpg_announce_all_but(dead.location, {dead}, dead.name, " is slain by a blow to the ", locstr, ".");
6"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";

announce_miss

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_miss(attacker, target, quality of attack)";
2"Announce that `attacker' has missed `target' with this weapon.";
3{by, target, qual} = args;
4(rpg = $local.rpg):playertell(by, "You miss.");
5rpg:rpg_announce_all_but(by.location, {by}, by.psc, " misses.");
6"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";

announce_hit

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_hit(attacker, target, location-string, severity-string, stunned)";
2"'location-string' is a string describing where the target was hit.  For example; `left arm' or `left arm and right shoulder'.";
3"'severity-string' is probably one of `scratched', `slightly wounded', `hit', `seriously wounded'.  See :announce_kill for death messages.";
4"'stunned' is true if the target was stunned by the attack.";
5{by, who, locstr, severity, stun} = args;
6subargs = {by, who, locstr, severity, this};
7stunned = stun ? " and stunned." | ".";
8msg = (rpg = $local.rpg):combat_sub("You are %b in the %w", @subargs);
9omsg = rpg:combat_sub(who.name + " is %b in the %w", @subargs);
10rpg:tell_damage(who, msg, stunned);
11rpg:rpg_announce_all_but(who.location, {who}, omsg, stunned);
12"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";
13"Profane (#30788) - Sat Dec 27, 1997 - check new option package for filter";
14"Mooshie (#106469) - Mon Dec 28, 1998 - Got rid of hard-coded highlighting. Go through $local.rpg:tell_damage.";

announce_dodge

Spec this none thisFlags rxDefiner #82

Referenced by

none

Source

1":announce_dodge(attacker, target, location-string)";
2"Announce that `target' has dodged a blow by `attacker' wielding this weapon aimed for `location-string'.";
3{attacker, who, locstr} = args;
4(rpg = $local.rpg):playertell(who, "You dodge.");
5rpg:rpg_announce_all_but(who.location, {who}, who.name, " dodges.");
6"THX1138 2-15-97 2:00EST - Version 1.8.0 update.  De-ticked.";

used_title

Spec this none thisDefiner #82

Referenced by

none

Source

1return this.name;

contract

Spec this none thisDefiner #82

Referenced by

none

Source

1(rpg = $local.rpg):secure();
2if ((!this.blunt) && (mark = rpg.death_db.temple:mark(player)))
3  rpg:playertell(player, "As you stare at the blade, you see the phantom ", (length(mark) > 1) ? "forms" | "form", " of ", $string_utils:nn(mark), ".");
4endif

stare gaze

Spec none to thisDefiner #82

Referenced by

none

Source

1rpg = $local.rpg;
2if (this.location != player)
3  return rpg:playertell(player, "You aren't close enough to stare at the ", this.name, ".");
4endif
5if (this.blunt)
6  rpg:playertell(player, "You don't notice anything unusual about the ", this.name, ".");
7elseif ((mark = rpg.death_db.temple:mark(player)) && (mark != $nothing))
8  marx = {};
9  for t in (mark)
10    marx = setadd(marx, t.name);
11  endfor
12  rpg:playertell(player, "You see the phantom ", (length(marx) > 1) ? "forms" | "form", " of ", $string_utils:english_list(marx), ".");
13elseif (rpg:exp(player) > 5000)
14  rpg:playertell(player, "You feel repulsed by random images of brutal murder and a jackal-headed demon.");
15else
16  rpg:playertell(player, "You feel vaguely uneasy about something, but you aren't sure what.");
17endif

do_unwield

Spec this none thisDefiner #82

Referenced by

Source

1":do_unwield(who) => perform tasks needed to unwield the item.";
2this.last_action && this:do_update();
3return 1;

hit_special_effect

Spec this none thisDefiner #82

Referenced by

none

Source

1this.last_action && this:do_update();
2return 1;

hit kill

Spec any with thisFlags rxdDefiner #82

Referenced by

none

Source

1rpg = $local.rpg;
2if (rpg:trusted(valid(cp = caller_perms()) ? cp | this.owner) || (caller in rpg.vacuum.monsters))
3  "if (rpg:trusted(valid(cp = caller_perms()) ? cp | this.owner) || (caller in {$match_utils, @rpg.vacuum.monsters}))";
4  {whatstr, prep, weapstr, ?weaps = {}, ?where = ""} = args;
5  target = (ploc = player.location):match(whatstr);
6  if (valid(doll = rpg:get_doll(player)))
7    if (target == $failed_match)
8      rpg:playertell(player, "I can't see \"", whatstr, "\" anywhere.");
9      return target;
10    elseif (target == $ambiguous_match)
11      rpg:playertell(player, "I don't know which \"", whatstr, "\" you mean.");
12      return target;
13    elseif (`target.location ! E_INVIND' != ploc)
14      rpg:playertell(player, "I can't see \"", whatstr, "\" here.");
15      return $nothing;
16    elseif (is_player(player) && (`idle_seconds(player) ! ANY => 301' > 300))
17      raise(E_NACC, "You're comatose.  Try attacking while you're actually at the keyboard.");
18    else
19      if (this in doll:wielding())
20        if (rpg:trusted_verb(ploc, "attack"))
21          if (doll:long_enough())
22            send = {target, {this, @weaps}};
23            if (where && valid(tdoll = rpg:get_doll(target)))
24              if (valid(area = tdoll:match_body_area(where)))
25                send = {@send, area:attack_mod(target, player, this), area};
26                rpg:playertell(player, "You take aim for ", target.name, "'s ", where, ".");
27              elseif (area == $ambiguous_match)
28                rpg:playertell(player, target.name, " has more than one ", where, ".  You'll have to be more specific.");
29                return area;
30              else
31                rpg:playertell(player, "You can't find anything resembling a \"", where, "\" on ", target.name, ".");
32                return area;
33              endif
34            endif
35            if (rpg.rpg_options:get(doll.rpg_options, "defend"))
36              rpg.option_feature:set_rpg_option(doll, "defend", 0);
37              rpg:playertell(player, "You actively choose to swing your weapon at the enemy again.");
38            endif
39            doll.last_attack = time();
40            {target, weapons, ?bmods = 0, ?barea = 0, ?no_invite = `ploc.peaceful ! ANY => 0'} = send;
41            doll:attack(target, weapons, bmods, barea, no_invite);
42          else
43            rpg:playertell(player, "You'll need at least ", tostr(max(1, (doll.last_attack - time()) + rpg.gm_lag)), " seconds to recover from your last attack.");
44            return E_NACC;
45          endif
46        else
47          rpg:playertell(player, "Are you kidding?  These are horrible fighting conditions.  Go to a real battleground.");
48          return E_RECMOVE;
49        endif
50      else
51        rpg:playertell(player, "It's still ", index(this.name, "sword") ? "in the scabbard" | "packed away", ", you'd better wield it first.");
52        return E_INVIND;
53      endif
54    endif
55  else
56    rpg:playertell(player, "You flail ineffectively about with your ", this.name, ". Perhaps some training at the Bovine Illuminati is in order.");
57    return E_INVARG;
58  endif
59else
60  raise(E_PERM);
61endif

is_natural

Spec this none thisDefiner #82

Referenced by

none

Source

1"Usage: is_natural() => Boolean true/false.";
2"Natural weapons should be ones in which the user does not actually have to be carrying the weapon-object to use it. Such as with fists.";
3return this.natural;

condition

Spec this none thisDefiner #82

Referenced by

Source

1{?by = player, ?who = player} = args;
2if ((is_player(by) && is_player(who)) && `(callers()[2][4] == $local.rpg.doll) && (callers()[2][2] in {"attack", "respond"}) ! ANY')
3  return min(100, pass(by, who) || 0);
4else
5  return pass(by, who);
6endif

hidden_verbs

Spec this none thisDefiner #82

Referenced by

Source

1{who} = args;
2prev = pass(who);
3weapon = (rpg = $local.rpg).weapon;
4if (((!valid(doll = rpg:get_doll(who))) || (this in doll.wielding)) || (who != this.location))
5  prev = {@prev, {weapon, "wield weild", {"this", "none", "none"}}};
6endif
7if (((!valid(doll)) || (!(this in doll.wielding))) || (who != this.location))
8  prev = {@prev, {weapon, "sheathe unwield sling rem*ove", {"this", "none", "none"}}};
9  prev = {@prev, {weapon, "hit kill", {"any", "with/using", "this"}}};
10  prev = {@prev, {weapon, "intimidate bully impress threaten", {"any", "with/using", "this"}}};
11endif
12if (who != this.location)
13  prev = {@prev, {weapon, "name christen dub entitle", {"this", "as", "any"}}};
14endif
15if (this.blunt || (!rpg.death_db.temple:mark(who)))
16  prev = {@prev, {weapon, "stare gaze", {"none", "at/to", "this"}}};
17endif
18return prev;

hit(old)

Spec any with thisFlags rxdDefiner #82

Referenced by

none

Source

1rpg = $local.rpg;
2if (rpg:trusted(valid(cp = caller_perms()) ? cp | this.owner) || (caller in rpg.vacuum.monsters))
3  {whatstr, prep, weapstr, ?weaps = {}, ?where = ""} = args;
4  target = (ploc = player.location):match(whatstr);
5  if (valid(doll = rpg:get_doll(player)))
6    if (target == $failed_match)
7      rpg:playertell(player, "I can't see \"", whatstr, "\" anywhere.");
8      return target;
9    elseif (target == $ambiguous_match)
10      rpg:playertell(player, "I don't know which \"", whatstr, "\" you mean.");
11      return target;
12    elseif (`target.location ! E_INVIND' != ploc)
13      rpg:playertell(player, "I can't see \"", whatstr, "\" here.");
14      return $nothing;
15    elseif (is_player(player) && (`idle_seconds(player) ! ANY => 301' > 300))
16      raise(E_NACC, "You're comatose.  Try attacking while you're actually at the keyboard.");
17    else
18      if (this in doll:wielding())
19        if (rpg:trusted_verb(ploc, "attack"))
20          if (doll:long_enough())
21            send = {target, {this, @weaps}};
22            if (where && valid(tdoll = rpg:get_doll(target)))
23              if (valid(area = tdoll:match_body_area(where)))
24                send = {@send, area:attack_mod(target, player, this), area};
25                rpg:playertell(player, "You take aim for ", target.name, "'s ", where, ".");
26              elseif (area == $ambiguous_match)
27                rpg:playertell(player, target.name, " has more than one ", where, ".  You'll have to be more specific.");
28                return area;
29              else
30                rpg:playertell(player, "You can't find anything resembling a \"", where, "\" on ", target.name, ".");
31                return area;
32              endif
33            endif
34            if (rpg.rpg_options:get(doll.rpg_options, "defend"))
35              rpg.option_feature:set_rpg_option(doll, "defend", 0);
36              rpg:playertell(player, "You actively choose to swing your weapon at the enemy again.");
37            endif
38            doll.last_attack = time();
39            doll:attack(@send);
40          else
41            rpg:playertell(player, "You'll need at least ", tostr(max(1, (doll.last_attack - time()) + rpg.gm_lag)), " seconds to recover from your last attack.");
42            return E_NACC;
43          endif
44        else
45          rpg:playertell(player, "Are you kidding?  These are horrible fighting conditions.  Go to a real battleground.");
46          return E_RECMOVE;
47        endif
48      else
49        rpg:playertell(player, "It's still ", index(this.name, "sword") ? "in the scabbard" | "packed away", ", you'd better wield it first.");
50        return E_INVIND;
51      endif
52    endif
53  else
54    rpg:playertell(player, "You flail ineffectively about with your ", this.name, ". Perhaps some training at the Bovine Illuminati is in order.");
55    return E_INVARG;
56  endif
57else
58  raise(E_PERM);
59endif

can_degrade

Spec this none thisDefiner #82

Referenced by

none

Source

1return this.(verb);

attack_encumbrance

Spec this none thisDefiner #82

Referenced by

none

Source

1return this.encumbrance;

track_usage

Spec this none thisDefiner #82

Referenced by

none

Source

1if ((prop = this.(verb)) && (parent(caller) == $local.rpg.doll))
2  {indx} = args;
3  prop[indx] = prop[indx] + 1;
4  prop[$].(verb) = prop;
5endif
6"The property holds {swings, parries, dodges, strikes, kills, weapon} where weapon is the parent object held responsible.";
7"THX (#105941) - Mon Feb  5, 2001 - Added";

_wield

Spec this none thisDefiner #82

Referenced by

Source

1"This handles the grunt work of :wield.";
2(rpg = $local.rpg):secure();
3{doll} = args;
4who = doll.character;
5doll.wielding = listappend(doll.wielding, this);
6this:do_wield(who);
7for eq in (setremove({@doll.wielding, @doll.wearing}, this))
8  fork (0)
9    `rpg:trusted_verb(eq, "notify_equip") ! E_VERBNF => 0' && eq:notify_equip(doll, this);
10  endfork
11endfor
12"Hydros (#106189) - Tue Jul 5, 2005 - Added, including a check of all your current equipment for :notify_equip.";
13"Hydros(#106189) - Sat Jul 9, 2005 - Moved messaging back into :wield. Not all wielding is voluntary.";

_unwield

Spec this none thisDefiner #82

Referenced by

Source

1"This does the grunt work of :unwield.";
2(rpg = $local.rpg):secure();
3{doll} = args;
4who = doll.character;
5doll.wielding = setremove(doll.wielding, this);
6this:do_unwield(who);
7for eq in (setremove({@doll.wielding, @doll.wearing}, this))
8  fork (0)
9    `rpg:trusted_verb(eq, "notify_unequip") ! E_VERBNF => 0' && eq:notify_unequip(doll, this);
10  endfork
11endfor
12"Hydros (#106189) - Tue Jul 5, 2005 - Added, including a check of all your current equipment for :notify_unequip.";
13"Hydros(#106189) - Sat Jul 9, 2005 - Moved messaging back into :unwield. Not all unwielding is voluntary.";