"A dump of #82 on Sun Dec 17 13:02:11 1995 PST @create #517 named generic weapon:generic weapon,weapon @prop #82."dodgable" 0 "" @prop #82."parryable" 0 "" @prop #82."title" 0 r @prop #82."oswing" "swings" rc @prop #82."swing" "swing" rc @prop #82."owield" "wields" rc @prop #82."wield" "wield" rc @prop #82."osheathe" "sheathes" rc @prop #82."sheathe" "sheathe" rc @prop #82."slowness" 10 "" @prop #82."length" 0 r @prop #82."parry" 0 "" @prop #82."attack" 0 "" @prop #82."pen" 0 "" @prop #82."dam" 0 "" @prop #82."skill" #-1 "" @prop #82."hands" 1 r @prop #82."bully_msg" "%N %<%(oswing)> %p %t menacingly at %d." rc @prop #82."special_damage" 0 r ;;#82.("condition") = 100 ;;#82.("odrop_failed_msg") = "% to drop %t but fails!" ;;#82.("odrop_succeeded_msg") = "% %t." ;;#82.("otake_succeeded_msg") = "% up %t." ;;#82.("key") = 0 ;;#82.("aliases") = {"generic weapon", "weapon"} ;;#82.("description") = "A generic implement of destruction." ;;#82.("object_size") = {25163, 819192199} @verb #82:"wield" this none none rxd @program #82:wield "wield weapon -- Wield the weapon, first making sure player has enough hands, or enough hands free."; if (!$local.rpg:trust($nothing, player)) return E_PERM; elseif (this.location != player) player:tell("You don't have ", this.name, "."); return; elseif (!valid(doll = $local.rpg:get_doll(player))) player:tell("It wouldn't do you much good, you don't know how to use it. Check out the Bovine Illuminati for some instruction."); return; elseif (this in (wielding = doll.wielding)) player:tell("You're already wielding it."); return; elseif ((handsreq = this.hands) > doll.hands) player:tell("You don't have enough appendages to wield ", this.name, "."); return; elseif ((handsfree = doll:hands_free()) < handsreq) player:tell("Your hands are full."); while (wielding && (handsfree < handsreq)) thing = wielding[1]; player:tell("You ", thing.sheathe, " your ", thing.name, "."); handsfree = handsfree + thing.hands; wielding = listdelete(wielding, 1); endwhile endif doll.wielding = listappend(wielding, this); player:tell("You ", this.wield, " your ", this.name, "."); player.location:announce($string_utils:pronoun_sub(("%n %<" + this.owield) + "> %p %t.")); "Comment out this invite call, due to current lag conditions."; "doll:invite((doll.slowness + weapon.slowness) / 3, {2, w});"; "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."; "Quinn 10-AUG-93 0116: Fixed bug where someone without enough hands (doll.hands) could wield a weapon anyway."; . @verb #82:"sheathe unwield sling rem*ove" this none none rxd @program #82:sheathe if (!#46:trust($nothing, player)) return E_PERM; elseif (this.location != player) player:tell("You're not carrying ", this.name, "."); return; endif if (!valid(doll = #46:get_doll(player))) player:tell("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."); return; endif if (this in doll.wielding) doll.wielding = setremove(doll.wielding, this); player:tell("You ", this.sheathe, " your ", this.name, "."); player.location:announce($string_utils:pronoun_sub(("%n %<" + this.osheathe) + "> %p %t.")); else player:tell("You aren't wielding your ", this.name, "."); endif . @verb #82:"look_self" this none this @program #82:look_self pass(@args); pc = this.location; if (typeof(this.title) == STR) player:tell("The name \"", this.title, "\" is written in ornate, flowing letters across the ", this.name, "."); endif if (!valid(doll = #46:get_doll(pc))) return; endif wloc = this in doll.wielding; if (wloc == 1) if ((this.hands == 2) && (doll:hands_free() == 0)) player:tell($string_utils:capitalize(this.name), " is wielded with both hands."); else player:tell($string_utils:capitalize(this.name), " is wielded in the primary hand."); endif elseif (wloc == 2) player:tell($string_utils:capitalize(this.name), " is wielded in the secondary hand."); elseif (wloc) player:tell($string_utils:capitalize(this.name), " is wielded."); endif "Ogwul:Mon Apr 25 18:29:16 MDT 1994:Capitalized the sentence stating handedness."; "Ogwul:Mon Apr 25 18:38:50 MDT 1994:Added new message for two-handed weapons."; . @verb #82:"name christen dub entitle" this as any rxd @program #82:name "dub this as -- Add the alias 'title' to this weapon, allowing the player to refer to multiple weapons of the same name."; if (valid(cp = caller_perms()) && (player != cp)) return E_PERM; elseif (this.location != player) player:tell("Wouldn't it be more dramatic if you were holding ", this.name, "?"); elseif ((this.unique || children(this)) && (!$perm_utils:controls(player, this))) player:tell("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."); elseif (iobjstr) this:set_aliases(setadd(parent(this).aliases, this.title = iobjstr)); player:tell(this.name, " now bears the name \"", iobjstr, "\""); else clear_property(this, "title"); player:tell("You scratch off the title of ", this.name, "."); endif "Quinn 28-FEB-93: Must be holding weapon in order to dub it; fixed the screwy use of :set_name; clear property if !iobjstr."; "Quinn 07-JUN-93: Hacked to disallow dubbing of unique weapons by nonowners."; "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."; "Quinn 21-NOV-93: Okay let's try this again. Now just set aliases to {@parent(this).aliases, title}."; . @verb #82:"used" this none this @program #82:used ":used(by, target)"; "Return a number modifying the attack, or a non-numeric value meaning the weapon is unusable."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (valid(doll = $local.rpg:get_doll(args[1]))) if (($perm_utils:caller()[2] == "attack") && (z = this in doll.wielding)) return 15 * (1 - z); endif "doll:check_fatigue(this.encumbrance);"; else return -200; endif "Profane 1/29/95 10:20 EST -- Chnaged reference to `this.location' to `args[1]' in line 5."; . @verb #82:"title" this none this @program #82:title return this.title ? ((this.name + " named \"") + this.title) + "\"" | this.name; . @verb #82:"dodgable parryable slowness length parry skill hands special_damage" this none this @program #82:dodgable ":(property)(by, targ) => Default returns the value of this weapon's `verb' property."; "(both by and targ are characters, not dolls)"; "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."; "Explanations of each property follow. (Quinn 03-JAN-93)"; " dodgable -- Modifier when dodging the weapon."; " parryable -- Modifier when parrying against the weapon."; " slowness -- Speed of the weapon. The lower the better. Average is 10."; " length -- Length of weapon in ~5cm units, tho more a measure of bulk."; " parry -- Modifier when parrying with the weapon."; " attack -- Modifier when attacking with the weapon."; " pen -- Weapon's ability to penetrate armor. The lower the better."; " dam -- How much damage the weapon does."; " skill -- Object number of skill governing the weapon's use."; " hands -- How many hands required to wield the weapon."; " special_damage -- Any damage that gets added directly to inj on a hit, for example, damage as a result of the weapon being poisoned."; return this.(verb); "DR APR-24-94 -- Added special_damage."; . @verb #82:"hit kill" any with this rx @program #82:hit if (!$local.rpg:trust($nothing, player)) return E_PERM; endif target = player.location:match_object(args[1]); if (!valid(doll = $local.rpg:get_doll(player))) player:tell("You flail innefectively about with your ", this.name, ". Perhaps some training at the Bovine Illuminati is in order."); return; endif if (target == $failed_match) player:tell("I can't see \"", args[1], "\" anywhere."); elseif (target == $ambiguous_match) player:tell("You'll have to be more specific than that."); elseif (!(this in doll.wielding)) player:tell("It's still in the scabbard, you'd better wield it first."); elseif ((args[1] == "") || (args[3] == "")) player:tell("You have to hit <target> with <weapon>."); elseif (target.location != player.location) player:tell("I can't see \"", args[1], "\" here."); elseif (this.location != player) player:tell("You don't have ", this.name, "."); elseif (!(vloc = $object_utils:has_verb(player.location, "attack"))) "...just check for attack, so speciality verbs on weapons like 'shoot'"; "...aren't disallowed."; player:tell("Are you kidding? These are horrible fighting conditions. Go to a real battleground."); elseif (!$local.rpg:trusted_verb(vloc[1], "attack")) player:tell("Your host's status belies the apparent acceptability of this battlefield."); else if (doll:long_enough()) doll:set_att("last_attack", time()); doll:attack(target, this); else doll.character:tell("You try to force an extra attack and fail."); return E_NACC; endif endif "Ogwul:Sat Apr 23 16:22:15 MDT 1994:Rewritten to allow for direct calls from code."; "StarDancer 16-NOV-95 -- Moved the line defining `target' from 8 to 4, thanx Bradley!"; "Profane 1-DEC-95 1223EST - changed flail message to avoid `type mismatch' etc."; . @verb #82:"intimidate bully impress" any with this rxd @program #82:intimidate "intimidate any with this -- Show that you'll use that thing."; "Set messages using normal pronoun subs (see 'help pronouns'), plus verb subs."; "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:"; "to me: You crack your whip at AcidHorse."; "to AH: Quinn cracks his whip at you."; "to room: Quinn cracks his whip at AcidHorse."; if (!$local.rpg:trust($nothing, player)) return E_PERM; elseif (this.location != player) player:tell("You don't have ", this.name, "."); return; elseif (!valid(doll = $local.rpg:get_doll(player))) player:tell("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."); return; else $you:say_action(strsub(this.bully_msg, "%(oswing)", this.oswing)); endif "Quinn 31-JUL-93 0243-ET: Added in conjunction with new :set_message."; . @verb #82:"wield(old)" this none none rxd @program #82:wield(old) if (!#46:trust($nothing, player)) return E_PERM; endif wobj = {}; if (this.location != player) player:tell("Pick it up first."); else if (!valid(doll = #46:get_doll(player))) player:tell("It wouldn't do you much good, you don't know how to use it. Check out the Bovine Illuminati for some instruction."); return; endif if (this in doll.wielding) player:tell("You're already wielding it."); return; endif handsfree = doll.hands; for thing in (doll.wielding) handsfree = handsfree - thing.hands; endfor if (handsfree >= this.hands) doll.wielding = listappend(doll.wielding, this); else player:tell("Your hands are full."); for thing in (doll.wielding) player:tell("You ", thing.sheathe, " your ", thing.name, "."); endfor doll.wielding = {this}; endif player:tell("You ", this.wield, " your ", this.name, "."); player.location:announce($string_utils:pronoun_sub(("%n %<" + this.owield) + "> %p %t.")); return; wlist = {}; for k in [1..length(doll.wielding)] name = doll.wielding[k].name; if (k == 1) name = name + " (in primary hand)"; elseif (k == 2) name = name + " (in secondary hand)"; endif wlist = listappend(wlist, name); endfor text = $string_utils:english_list(wlist); player:tell("You are now wielding ", text); doll:invite((doll.slowness + weapon.slowness) / 3, {2, w}); endif . @verb #82:"used(old)" this none this @program #82:used(old) ":used(by, target)"; "Return a number modifying the attack, or a non-numeric value meaning the weapon is unusable."; if (valid(doll = #46:get_doll(this.location))) if (($perm_utils:caller()[2] == "attack") && (z = this in doll.wielding)) return 15 * (1 - z); endif else return -200; endif . @verb #82:"critical_miss" this none this rx @program #82:critical_miss ":critical_miss(OBJ attacker, OBJ target, NUM atk)"; "attacker -- who attacked"; "target -- who was hit."; "atk -- actual attack roll."; "By default, do nothing. Provided for possible special weapon effects."; "Attacker is assumed to be the wielder of the weapon (this.location)."; "If a TRUE value is returned, the weapon is assumed to have done something."; . @verb #82:"critical_hit" this none this rx @program #82:critical_hit ":critical_hit(OBJ attacker, OBJ target, NUM atk, OBJ loc, NUM dam)"; "Caller should always be the damaged doll."; "attacker -- who attacked"; "target -- who was hit."; "loc -- body area hit by the attack."; "dam -- damage applied to the character."; "atk -- actual attack roll."; "By default, do nothing. Provided for possible special weapon effects."; "Attacker is assumed to be the wielder of the weapon (this.location)."; "If a TRUE value is returned, the weapon is assumed to have handled all damage effects. :receive_damage will NOT be called."; . @verb #82:"announce_swing" this none this rx @program #82:announce_swing ":announce_swing(attacker, target)"; "Announce that `attacker' has swung at `target' with this weapon."; who = args[1]; target = args[2]; weapon = this.name; who:tell("You ", this.swing, " your ", weapon, " at ", tname = target.name, "."); target:tell(whon = who.name, " ", oswing = this.oswing, " ", whopp = who.pp, " ", weapon, " at you."); $local.rpg:rpg_announce_all_but(who.location, {who, target}, whon, " ", oswing, " ", whopp, " ", weapon, " at ", tname, "."); . @verb #82:"announce_miss" this none this rx @program #82:announce_miss ":announce_miss(attacker, target)"; "Announce that `attacker' has missed `target' with this weapon."; who = args[1]; who:tell("You miss."); $local.rpg:rpg_announce_all_but(who.location, {who}, who.psc, " misses."); . @verb #82:"announce_hit" this none this rx @program #82:announce_hit ":announce_hit(attacker, target, location-string, severity-string, stunned)"; "'location-string' is a string describing where the target was hit. For example; `left arm' or `left arm and right shoulder'."; "'severity-string' is probably one of `scratched', `slightly wounded', `hit', `seriously wounded'. See :announce_kill for death messages."; "'stunned' is true if the target was stunned by the attack."; who = args[2]; severity = args[4]; rpg = $local.rpg; subargs = {@args[1..4], this}; stunned = args[5] ? " and stunned." | "."; msg = rpg:combat_sub("You are %b in the %w", @subargs); omsg = rpg:combat_sub(who.name + " is %b in the %w", @subargs); who:tell(msg + stunned); $local.rpg:rpg_announce_all_but(who.location, {who}, omsg + stunned); . @verb #82:"announce_kill" this none this rx @program #82:announce_kill ":announce_hit(attacker, target, location-string)"; "Announce that `attacker' has killed `target' with a blow to the `location-string' from this weapon."; by = args[1]; corpse = args[2]; corpse:tell(by.name + " has killed you! Your soul is returned to the cycle of transmigrations."); $local.rpg:rpg_announce_all_but(corpse.location, {corpse}, ((by.name + " killed ") + corpse.name) + "!"); . @verb #82:"announce_dodge" this none this rx @program #82:announce_dodge ":announce_dodge(attacker, target, location-string)"; "Announce that `target' has dodged a blow by `attacker' wielding this weapon aimed for `location-string'."; who = args[2]; who:tell("You dodge."); $local.rpg:rpg_announce_all_but(who.location, {who}, who.name + " dodges."); . @verb #82:"announce_parry" this none this rx @program #82:announce_parry ":announce_parry(attacker, defender, location-string, weapon, qual of attack)"; "Announce that `defender' has used this weapon to parry an attack by `attacker' with `weapon' aimed at `location-string'."; who = args[2]; who:tell(("You parry with your " + this.name) + "."); $local.rpg:rpg_announce_all_but(who.location, {who}, ((((who.name + " parries with ") + who.pp) + " ") + this.name) + "."); "this:check_degrade(@args)"; "StarDancer 11-19-95 comment out the degrade check, 'cause we're *always* runnin outa ticks."; "Profane 2-18-95 00:18EST - Added weapon degrading check."; . @verb #82:"notify_clang" this none this rx @program #82:notify_clang ":notify_clang(OBJ attacker,OBJ victim,NUM hit_location,OBJ armour hit,NUM quality)"; "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)."; "Quality is the final attack roll, some indication of the quality of the hit."; this:check_degrade(@args); "Profane 2-17-95 00:13EST - Added check for weapon degrading."; . @verb #82:"has_own_hit" this none this @program #82:has_own_hit ":has_own_hit() => returns 1 iff the weapon has its own ''hit kill'' verb defined."; return (x = $object_utils:has_callable_verb(this, "hit")) && (x[1] != #82); . @verb #82:"hit(old)" any with this rx @program #82:hit(old) if (!$local.rpg:trust($nothing, player)) return E_PERM; endif target = dobj; if (!valid(doll = $local.rpg:get_doll(player))) player:tell("You flail ineffectively at ", dobjstr, ". Perhaps some training at the Bovine Illuminati is in order."); return; endif if (!(this in doll.wielding)) player:tell("It's still in the scabbard, you'd better wield it first."); elseif (dobj == $failed_match) player:tell("I can't see \"", dobjstr, "\" anywhere."); elseif (dobj == $ambiguous_match) player:tell("You'll have to be more specific than that."); elseif ((dobjstr == "") || (iobjstr == "")) player:tell("You have to hit <target> with <weapon>."); elseif (dobj.location != player.location) player:tell("I can't see \"", dobjstr, "\" here."); elseif (iobj.location != player) player:tell("You don't have ", iobj.name, "."); elseif (!(vloc = $object_utils:has_verb(player.location, "attack"))) "...just check for attack, so speciality verbs on weapons like 'shoot'"; "...aren't disallowed."; player:tell("Are you kidding? These are horrible fighting conditions. Go to a real battleground."); elseif (!$local.rpg:trusted(verb_info(vloc[1], "attack")[1])) player:tell("Your host's status belies the apparent acceptability of this battlefield."); else if (doll:long_enough()) doll:set_att("last_attack", time()); doll:attack(dobj, iobj); else doll.character:tell("You try to force an extra attack and fail."); return E_NACC; endif endif . @verb #82:"notify_parry" this none this rx @program #82:notify_parry ":notify_parry(OBJ attacker,OBJ victim,STR hit_location,OBJ armour hit,NUM quality, NUM try of parry)"; "Hook for weapons damage and other special combat effects. Called on the ``attacking'' weapon when the defender manages to parry the attack."; "Quality is the final attack roll, some indication of the quality of the hit."; "Try is the `attack' roll made by the defender when parrying."; this:check_degrade(@args); "Profane 2-13-95 20:52EST - Added."; "Profane 2-18-95 00:08EST - Added check for weapon degrading."; . @verb #82:"is_blunt" this none this rx @program #82:is_blunt ":is_blunt() => true or false; Is this weapon a blunt weapon?"; return (((this in (arf = $local.rpg.blunt_weapons)) || (parent(this) in arf)) || (parent(parent(this)) in arf)) || 0; . @verb #82:"is_wooden" this none this rx @program #82:is_wooden ":is_wooden() => true or false; Is this weapon a wooden weapon?"; return (((this in (arf = $local.rpg.wooden_weapons)) || (parent(this) in arf)) || (parent(parent(this)) in arf)) || 0; . @verb #82:"dam" this none this rx @program #82:dam ":dam(by, targ) => NUM modified damage of weapon due to its condition."; dam = this.dam; mod = (100 - (this.condition || 100)) / 10; mod = this:is_blunt() ? mod / 2 | mod; return max(dam - mod, dam / 2); "Profane 2/17/95 23:14EST - Added."; . @verb #82:"pen" this none this rx @program #82:pen ":pen(by, targ) => NUM modified penetration of weapon due to its condition."; pen = this.pen; pen = this:is_blunt() ? pen | (pen + ((100 - (this.condition || 100)) / 5)); return pen; "Profane 2/17/95 23:14EST - Added."; . @verb #82:"attack" this none this rx @program #82:attack ":attack(by, targ) => NUM modified attack modifier of weapon due to its condition."; att = this.attack; return ((att * this.condition) / 100) || att; "Profane 2/17/95 23:14EST - Added."; . @verb #82:"check_degrade" this none this @program #82:check_degrade ":check_degrade(OBJ attacker, OBJ victim, location, OBJ other weapon/armour, NUM qual of attack)"; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif (typeof(condition = this.condition) == NUM) "Chance of breaking: 1% for every 5 condition points we are below 50. e.g. .condition 40 == 2% chance of breaking."; break_chance = max((50 - condition) / 5, 0); if (random(100) <= break_chance) this:break(); else if (callers()[1][2] == "announce_parry") by = args[2]; target = args[1]; else by = args[1]; target = args[2]; endif chance = (5 + (5 * this:is_wooden())) + ((qual = args[5]) / 100); "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)."; if (random(1000) <= chance) if (this.unique || children(this)) return; endif "Alright, real simple formula since old one was tick-intensive and people whined it did too much damage."; amt = (5 * qual) / 100; amt = random(max(amt, 1)); this.condition = max(condition - amt, 0); by:tell("Your ", this.name, " seems a little worse for wear."); endif endif endif "Profane 2-17-95 23:33EST - Added."; . @verb #82:"break" this none this @program #82:break ":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."; if (!$local.rpg:trusted(caller_perms())) return E_PERM; elseif ((((this.owner != $local.rpg.owner) || this.unique) || (typeof(condition = this.condition) != NUM)) || children(this)) return E_NACC; else if (valid(doll = $local.rpg:get_doll(who = this.location)) && (this in doll.wielding)) who:tell("Your ", this.name, " shatters from the abuse it has taken!"); who:room_announce(who.name, "'s ", this.name, " shatters from the abuse it has taken!"); doll.wielding = setremove(doll.wielding, this); endif this:moveto($local.rpg.cemetery); endif "Profane 2-17-95 23:42EST - Added."; . "***finished***