generic voodoo doll #74
Aliases: PC, generic, voodoo, doll
100 verbs · 259 properties · 0 children
Verbs
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
storm | #74 | | — | not readable (E_PERM) |
total | #74 | | — | not readable (E_PERM) |
pick | #74 | | — | not readable (E_PERM) |
machete | #74 | | — | not readable (E_PERM) |
dagger_melee | #74 | | — | not readable (E_PERM) |
dagger_throw | #74 | | — | not readable (E_PERM) |
weight | #74 | | — | not readable (E_PERM) |
trick | #74 | | — | not readable (E_PERM) |
pray | #74 | | — | not readable (E_PERM) |
persuade | #74 | | — | not readable (E_PERM) |
convince | #74 | | — | not readable (E_PERM) |
star | #74 | | — | not readable (E_PERM) |
search | #74 | | — | not readable (E_PERM) |
notice | #74 | | — | not readable (E_PERM) |
observe | #74 | | — | not readable (E_PERM) |
javelin_melee | #74 | | — | not readable (E_PERM) |
javelin_throw | #74 | | — | not readable (E_PERM) |
longbow | #74 | | — | not readable (E_PERM) |
drawbow | #74 | | — | not readable (E_PERM) |
crossbow | #74 | | — | not readable (E_PERM) |
longarms | #74 | | — | not readable (E_PERM) |
missiles | #74 | | — | not readable (E_PERM) |
sai | #74 | | — | not readable (E_PERM) |
heal | #74 | | — | not readable (E_PERM) |
heat | #74 | | — | not readable (E_PERM) |
schedule | #74 | | — | not readable (E_PERM) |
baxe2 | #74 | | — | not readable (E_PERM) |
baxe1 | #74 | | — | not readable (E_PERM) |
baxe | #74 | | — | not readable (E_PERM) |
forcewall | #74 | | — | not readable (E_PERM) |
free_will | #74 | | — | not readable (E_PERM) |
slow | #74 | | — | not readable (E_PERM) |
knives | #74 | | — | not readable (E_PERM) |
tclimb | #74 | | — | not readable (E_PERM) |
kat2 | #74 | | — | not readable (E_PERM) |
kat1 | #74 | | — | not readable (E_PERM) |
teeth | #74 | | — | not readable (E_PERM) |
tenta | #74 | | — | not readable (E_PERM) |
claw | #74 | | — | not readable (E_PERM) |
natweap | #74 | | — | not readable (E_PERM) |
scim | #74 | | — | not readable (E_PERM) |
wclim | #74 | | — | not readable (E_PERM) |
last_action | #74 | r | — | 0 |
throw | #74 | | — | not readable (E_PERM) |
furn | #74 | | — | not readable (E_PERM) |
paralyzed | #74 | | — | not readable (E_PERM) |
scyth | #74 | | — | not readable (E_PERM) |
swim | #74 | | — | not readable (E_PERM) |
econf | #74 | | — | not readable (E_PERM) |
gadget | #74 | | — | not readable (E_PERM) |
sanity | #74 | | — | not readable (E_PERM) |
ins | #74 | | — | not readable (E_PERM) |
wearing | #74 | r | — | {} |
wielding | #74 | r | — | {} |
climb | #74 | | — | not readable (E_PERM) |
staff | #74 | | — | not readable (E_PERM) |
firebolt | #74 | | — | not readable (E_PERM) |
kites | #74 | | — | not readable (E_PERM) |
shield | #74 | | — | not readable (E_PERM) |
kat | #74 | | — | not readable (E_PERM) |
rap | #74 | | — | not readable (E_PERM) |
size | #74 | | — | not readable (E_PERM) |
tclub | #74 | | — | not readable (E_PERM) |
club | #74 | | — | not readable (E_PERM) |
character | #74 | r | — | 0 |
shock | #74 | | — | not readable (E_PERM) |
dodge | #74 | | — | not readable (E_PERM) |
slowness | #74 | | — | not readable (E_PERM) |
act | #74 | | — | not readable (E_PERM) |
aggressor | #74 | r | — | {} |
brswd | #74 | | — | not readable (E_PERM) |
melee | #74 | | — | not readable (E_PERM) |
pot | #74 | | — | not readable (E_PERM) |
inj | #74 | | — | not readable (E_PERM) |
app | #74 | | — | not readable (E_PERM) |
pcn | #74 | | — | not readable (E_PERM) |
wil | #74 | | — | not readable (E_PERM) |
emp | #74 | | — | not readable (E_PERM) |
int | #74 | | — | not readable (E_PERM) |
agl | #74 | | — | not readable (E_PERM) |
dex | #74 | | — | not readable (E_PERM) |
end | #74 | | — | not readable (E_PERM) |
str | #74 | | — | not readable (E_PERM) |
lockpick | #74 | | — | not readable (E_PERM) |
last_attack | #74 | | — | not readable (E_PERM) |
hands | #74 | r | — | 2 |
recall | #74 | | — | not readable (E_PERM) |
pacify | #74 | | — | not readable (E_PERM) |
fat | #74 | | — | not readable (E_PERM) |
stamina | #74 | | — | not readable (E_PERM) |
body_areas | #74 | r | — | {#39284, #60746, #61688, #61605, #9655, #51172, #75697, #38715, #52374, #47817, #33584, #54898} |
combat_effects | #74 | | — | not readable (E_PERM) |
death_effects | #74 | | — | not readable (E_PERM) |
longsword | #74 | | — | not readable (E_PERM) |
misc_notes | #74 | | — | not readable (E_PERM) |
thieving | #74 | | — | not readable (E_PERM) |
natural_weapons | #74 | r | — | {#9130} |
claimed_objects | #74 | r | — | {} |
max_claims | #74 | r | — | 21 |
brawl | #74 | | — | not readable (E_PERM) |
moofu | #74 | | — | not readable (E_PERM) |
magic_effects | #74 | | — | not readable (E_PERM) |
magic_theory | #74 | | — | not readable (E_PERM) |
creo | #74 | | — | not readable (E_PERM) |
intellego | #74 | | — | not readable (E_PERM) |
muto | #74 | | — | not readable (E_PERM) |
perdo | #74 | | — | not readable (E_PERM) |
rego | #74 | | — | not readable (E_PERM) |
corporem | #74 | | — | not readable (E_PERM) |
ignem | #74 | | — | not readable (E_PERM) |
vim | #74 | | — | not readable (E_PERM) |
animalem | #74 | | — | not readable (E_PERM) |
mentem | #74 | | — | not readable (E_PERM) |
aquam | #74 | | — | not readable (E_PERM) |
herbam | #74 | | — | not readable (E_PERM) |
imagonem | #74 | | — | not readable (E_PERM) |
terram | #74 | | — | not readable (E_PERM) |
depress | #74 | | — | not readable (E_PERM) |
calm_winds | #74 | | — | not readable (E_PERM) |
shatter | #74 | | — | not readable (E_PERM) |
rounds | #74 | | — | not readable (E_PERM) |
windwall | #74 | | — | not readable (E_PERM) |
stinkcloud | #74 | | — | not readable (E_PERM) |
predict | #74 | | — | not readable (E_PERM) |
whip | #74 | | — | not readable (E_PERM) |
harden | #74 | | — | not readable (E_PERM) |
enchant | #74 | | — | not readable (E_PERM) |
biting_cloud | #74 | | — | not readable (E_PERM) |
barkskin | #74 | | — | not readable (E_PERM) |
hail | #74 | | — | not readable (E_PERM) |
lifelink | #74 | | — | not readable (E_PERM) |
stealskill | #74 | | — | not readable (E_PERM) |
mindprobe | #74 | | — | not readable (E_PERM) |
waterwhip | #74 | | — | not readable (E_PERM) |
iceshell | #74 | | — | not readable (E_PERM) |
dispel | #74 | | — | not readable (E_PERM) |
claim | #74 | | — | not readable (E_PERM) |
auram | #74 | | — | not readable (E_PERM) |
shocking_grasp | #74 | | — | not readable (E_PERM) |
unarmed | #74 | | — | not readable (E_PERM) |
greatsword | #74 | | — | not readable (E_PERM) |
summon | #74 | | — | not readable (E_PERM) |
flail | #74 | | — | not readable (E_PERM) |
hafted | #74 | | — | not readable (E_PERM) |
sword | #74 | | — | not readable (E_PERM) |
weap1 | #74 | | — | not readable (E_PERM) |
weap2 | #74 | | — | not readable (E_PERM) |
flex | #74 | | — | not readable (E_PERM) |
proj | #74 | | — | not readable (E_PERM) |
current_armours | #74 | | — | not readable (E_PERM) |
CAPweap2 | #74 | | — | not readable (E_PERM) |
CAPweap1 | #74 | | — | not readable (E_PERM) |
CAPhafted | #74 | | — | not readable (E_PERM) |
CAPknives | #74 | | — | not readable (E_PERM) |
CAPflex | #74 | | — | not readable (E_PERM) |
CAPunarmed | #74 | | — | not readable (E_PERM) |
CAPmelee | #74 | | — | not readable (E_PERM) |
CAPkat | #74 | | — | not readable (E_PERM) |
CAPbaxe | #74 | | — | not readable (E_PERM) |
CAPmissiles | #74 | | — | not readable (E_PERM) |
CAPproj | #74 | | — | not readable (E_PERM) |
CAPcreo | #74 | | — | not readable (E_PERM) |
CAPintellego | #74 | | — | not readable (E_PERM) |
CAPmuto | #74 | | — | not readable (E_PERM) |
CAPrego | #74 | | — | not readable (E_PERM) |
CAPperdo | #74 | | — | not readable (E_PERM) |
CAPmagic_theory | #74 | | — | not readable (E_PERM) |
CAPcorporem | #74 | | — | not readable (E_PERM) |
CAPignem | #74 | | — | not readable (E_PERM) |
CAPvim | #74 | | — | not readable (E_PERM) |
CAPanimalem | #74 | | — | not readable (E_PERM) |
CAPmentem | #74 | | — | not readable (E_PERM) |
CAPaquam | #74 | | — | not readable (E_PERM) |
CAPherbam | #74 | | — | not readable (E_PERM) |
CAPimagonem | #74 | | — | not readable (E_PERM) |
CAPterram | #74 | | — | not readable (E_PERM) |
CAPauram | #74 | | — | not readable (E_PERM) |
CAPsword | #74 | | — | not readable (E_PERM) |
CAPthrow | #74 | | — | not readable (E_PERM) |
CAPshield | #74 | | — | not readable (E_PERM) |
CAPnatweap | #74 | | — | not readable (E_PERM) |
know | #74 | | — | not readable (E_PERM) |
athl | #74 | | — | not readable (E_PERM) |
CAPathl | #74 | | — | not readable (E_PERM) |
CAPknow | #74 | | — | not readable (E_PERM) |
conjure | #74 | | — | not readable (E_PERM) |
misc_effects | #74 | | — | not readable (E_PERM) |
shortbow | #74 | | — | not readable (E_PERM) |
ravenfear | #74 | | — | not readable (E_PERM) |
holdfoe | #74 | | — | not readable (E_PERM) |
charmfoe | #74 | | — | not readable (E_PERM) |
lights | #74 | r | — | {} |
bloom | #74 | | — | not readable (E_PERM) |
haste | #74 | | — | not readable (E_PERM) |
acidrain | #74 | | — | not readable (E_PERM) |
animate | #74 | | — | not readable (E_PERM) |
wound | #74 | | — | not readable (E_PERM) |
drain | #74 | | — | not readable (E_PERM) |
deathless | #74 | rc | — | 0 |
tangle | #74 | | — | not readable (E_PERM) |
appraise | #74 | | — | not readable (E_PERM) |
glyph | #74 | | — | not readable (E_PERM) |
rune | #74 | | — | not readable (E_PERM) |
teleport | #74 | | — | not readable (E_PERM) |
born | #74 | r | — | 0 |
spellsing | #74 | | — | not readable (E_PERM) |
rpg_options | #74 | r | — | {"lyrics", "APB", "auction"} |
light | #74 | r | — | 0 |
room_light | #74 | r | — | 0 |
slowness_mod | #74 | r | — | 1.0 |
att_schedule | #74 | | — | not readable (E_PERM) |
armour_effects | #74 | r | — | {} |
retrieve | #74 | | — | not readable (E_PERM) |
light_values | #74 | r | — | {} |
chemical_effects | #74 | | — | not readable (E_PERM) |
freeze_effects | #74 | | — | not readable (E_PERM) |
view_effects | #74 | | — | not readable (E_PERM) |
chill | #74 | | — | not readable (E_PERM) |
magic_fist | #74 | | — | not readable (E_PERM) |
reverser | #74 | | — | not readable (E_PERM) |
detect | #74 | | — | not readable (E_PERM) |
viper_bite | #74 | | — | not readable (E_PERM) |
casting_effects | #74 | | — | not readable (E_PERM) |
backfire | #74 | | — | not readable (E_PERM) |
lifelinked | #74 | | — | not readable (E_PERM) |
connect_effects | #74 | | — | not readable (E_PERM) |
rot | #74 | | — | not readable (E_PERM) |
mirrors | #74 | | — | not readable (E_PERM) |
hawthorn | #74 | | — | not readable (E_PERM) |
RESISTanimalem | #74 | | — | not readable (E_PERM) |
RESISTaquam | #74 | | — | not readable (E_PERM) |
RESISTauram | #74 | | — | not readable (E_PERM) |
RESISTcorporem | #74 | | — | not readable (E_PERM) |
RESISTherbam | #74 | | — | not readable (E_PERM) |
RESISTignem | #74 | | — | not readable (E_PERM) |
RESISTimagonem | #74 | | — | not readable (E_PERM) |
RESISTmentem | #74 | | — | not readable (E_PERM) |
RESISTterram | #74 | | — | not readable (E_PERM) |
RESISTvim | #74 | | — | not readable (E_PERM) |
beguile | #74 | | — | not readable (E_PERM) |
lifeseconds | #74 | | — | not readable (E_PERM) |
mounted | #74 | r | — | #-1 |
ride | #74 | | — | not readable (E_PERM) |
bladebarrier | #74 | | — | not readable (E_PERM) |
CAPride | #74 | | — | not readable (E_PERM) |
CAPthieving | #74 | | — | not readable (E_PERM) |
parch | #74 | | — | not readable (E_PERM) |
duelee | #74 | r | — | #-1 |
illuminance | #74 | r | — | 0 |
resurrected | #74 | r | — | 0 |
move_effects | #74 | | — | not readable (E_PERM) |
anima | #74 | | — | not readable (E_PERM) |
fishing | #74 | | — | not readable (E_PERM) |
valid_pkp_targets | #74 | rc | — | {} |
INvalid_pkp_targets | #74 | rc | — | {} |
key | #74 | | — | not readable (E_PERM) |
aliases | #74 | | — | {"PC", "generic", "voodoo", "doll"} |
description | #74 | | — | "A little humanoid doll hung from a peg on the wall. Every now and then it twitches feebly." |
object_size | #74 | | — | {155877, 1141286558} |
Ancestry
Ancestors (nearest first): none
Children: none
Call graph
Showing 48 of 55 verbs; 7 not shown.
Source
get
Referenced by
none
Source
1player:tell("As you approach the voodoo doll, a little hooded man shouts at you to leave it alone and starts beating you with a cane stick until you do.");
attack
Referenced by
- #74:attack line 84:
this:attack - #74:hit_aggressor line 38:
this:attack - #74:attack(old) line 95:
this:attack
Source
1":attack(OBJ target, LIST weapons[, NUM modifier, OBJ area, NUM no_invite])"; 2{target, weapons, ?bmods = 0, ?barea = 0, ?no_invite = 0} = args; 3(rpg = $local.rpg):secure(); 4location = (by = this.character).location; 5doll = rpg:get_doll(target); 6if (!this:legal_target(target, doll, caller)) 7 return; 8elseif (typeof(weapons) == LIST) 9 weapon = weapons[1]; 10else 11 weapon = weapons; 12 weapons = {weapons}; 13endif 14barea = (typeof(barea) == OBJ) ? barea | doll:random_hit_location(); 15if (typeof(effect = this:combat_effects(target, weapon)) != NUM) 16 return effect; 17endif 18bmods = (bmods + effect) - this:encumbrance(); 19try 20 if ((!valid(weapon)) || (typeof(use = weapon:used(by, target)) != NUM)) 21 "If :used returns a non-numeric value, the weapon is unusable."; 22 return; 23 elseif (weapon.owner in rpg.gms) 24 elseif (weapon.owner in rpg.ex_gms) 25 "Give a break until we can get it @disowned."; 26 elseif (`verb_info(weapon, "0") ! E_VERBNF') 27 "OK, only penalize them if it has verbs defined.."; 28 rpg:playertell(by, "You feel foolish!"); 29 this.int = max(this.int - 1, 1); 30 this.pot = 0; 31 return; 32 endif 33except (E_TYPE) 34 raise(E_TYPE, ((("Error: " + by.name) + " is passing invalid weapons list (") + $string_utils:from_list(weapons, ", ")) + ")"); 35except (E_VERBNF) 36 raise(E_VERBNF, ("Error: \"Weapon\" " + tostr(weapon)) + " does not define a :used verb."); 37endtry 38this:do_attack_notification(target, weapon); 39is_player(target) || target:set_last_attacker(by); 40weapon:announce_swing(by, target); 41weapon:track_usage(1); 42weap_dam = weapon:dam(by, target); 43attack_bonus = weapon:attack(by, target); 44mods = (bmods + use) - (length(weapons) * 10); 45str_bonus = (weapon:max_str_bonus(by, target) * this.str) / 25; 46squeeze = `max(0, weapon:length(by, target) - location.space) ! ANY => 0'; 47mods = mods - (3 * squeeze); 48damage = ((2 * weap_dam) + str_bonus) - squeeze; 49if (((squeeze > 3) && is_player(by)) && (random(25) == 1)) 50 rpg:playertell(by, "The room is a little small to ", weapon.swing, " your ", weapon.name, " properly."); 51endif 52"Damage will never be greater than 3 * base."; 53"damage = min(damage, 3 * weap_dam)"; 54"'y' is encumbrance penalty of the weapon. Wielding a heavy weapon with more than one hand reduces the total penalty."; 55"A weak person wielding a heavy weapon will be greatly penalized."; 56y = str_bonus - ((3 * (weap_enc = weapon:attack_encumbrance(this))) / (1 + weapon:hands(by, target))); 57"y = str_bonus - 3 * (weap_enc = weapon:encumbrance(this)) / 5 / (1 + weapon:hands(by, target));"; 58if (y < 0) 59 mods = mods + (5 * y); 60 damage = damage + (y / 2); 61endif 62foes = 0; 63for foe in (this.aggressor) 64 if (foe.location == location) 65 foes = foes + 1; 66 endif 67endfor 68mods = mods - (max(0, foes - 1) * 15); 69connects = ((qual = weapon:skill(by, target):resolve(by, mods)) + attack_bonus) > -25; 70if (connects) 71 doll:respond(by, qual, damage, weapon, barea); 72 this.connect_effects && this:connect_effects(by, target, barea, weapon, qual, 0, 99, 0); 73elseif (!weapon:critical_miss(by, target, qual)) 74 "No critical miss."; 75 weapon:announce_miss(by, target, qual); 76endif 77this:check_fatigue(weap_enc); 78weapons = listdelete(weapons, 1); 79"If we attack and die for some reason during the attack, no invitation will take place. Everybody stands around shocked. If the target dies, everything is fine."; 80if ((by in rpg.pcs) && (is_player(by) || by.alive)) 81 this.aggressor = setadd(this.aggressor, target); 82 if (weapons) 83 this.act = this.act - max(1, weapon:slowness(by, target)); 84 this:attack(target, weapons, bmods - 10, barea, 1); 85 endif 86 if (valid(doll) && (parent(doll) != $garbage)) 87 doll.aggressor = setadd(doll.aggressor, by); 88 endif 89 no_invite || this:invite(this.slowness, {1, by, target, weapon}); 90endif 91"Quinn 05-JAN-93: Use verbs for referencing weapon properties."; 92"Quinn 28-FEB-93: Won't fork notification if a fork is already pending."; 93"Quinn 11-AUG-93: Big re-write. Created :legal_target and :do_attack_notifica ion to do the mundane chore of checking and notifying targets; cut down the unwieldly verb size; added some minor comments."; 94"Quinn 11-AUG-93: Send weapon to :respond."; 95"Quinn 22-OCT-93: Added combat_effect."; 96"Quinn 19-NOV-93: Added body area support, :critical_miss. New args to :Respond."; 97"Ogwul 01-JAN-94: Allowed :attack to be called without adding the target to the aggressor list and without :invite via the no_invite parameter."; 98"Profane 29-DEC-95 1451EST -- Added windwall check thing."; 99"Irin Sun Nov 3 10:49:52 1996 PST -- Bwahaha, attack penalty if fighting more than one foe."; 100"Irin Thursday, January 30 -- Rewrite of the :invite section to correspond to changes. Don't use rpg:trusted."; 101"Profane 31-MAR-97 1341PST -- s/valid/$recycler:valid/85"; 102"Profane 15-APR-97 1518PST -- TRY statement for weapon:used"; 103"THX 18-May-1997 -- Fixed so that foe.location checks against by.location rather than this.location (one's doll is never in the same place as one's attackers). Added a weeny fatigue check after the (connects) conditional."; 104"Profane 3-OCT-97 -- added check for non-gm owned weapons."; 105"THX (#105941) - Wed Apr 8, 1998 - Removed this.paralyzed and entangled checks. this:legal_target now does the checks via this:cannot_move(). subst this.character -> by from line 4 onwards and changed the \"I'm still alive.\" check before the invite call since critters always return a valid doll."; 106"Profane (#30788) - Sun May 2, 1999 - add inelegant backfire check circa 90-92"; 107"Profane (#30788) - Sun May 23, 1999 - windwall moved off into armour_effect"; 108"THX (#105941) - Mon Feb 5, 2001 - Added a usage tracker call (argument == 1) for swings/attacks."; 109"Hydros (#106189) - Sat Jul 23, 2005 - Removed the `2 *' from line 48. Did you know that damage is (was) doubled THREE TIMES in combat code?"; 110"Hydros (#106189) - Fri Jul 29, 2005 - Change of plans. The system is built around this equation, so we're changing armour to be more effective instead."; 111"dalton (#116601) - Fri Oct 7, 2005 - Modified lines 44 & 69 to reduce effect of weapon's attack stat.";
invite
Referenced by
- #74:attack line 89:
this:invite - #74:attack(old) line 101:
this:invite
Source
1":invite(NUM slowness[LIST {NUM respond, OBJ attacker, OBJ target, OBJ weapon} which hasn't been used in a long time.]) => All dolls in this doll's character's location, + the target of the attack (wherever they are) get a chance to act."; 2{slow, @extra} = args; 3(rpg = $local.rpg):secure(); 4if (!valid(where = (by = this.character).location)) 5 return this.act = 0; 6endif 7"If invite has already been called, we just decrement .act and return. The first call to invite will take it from there. This saves repeating many tasks for each separate invite."; 8{rpgdoll, idle_threshold} = {rpg.doll, rpg.idle_threshold}; 9for c in (callers()) 10 {thing, verbname, progger, verbloc, typist} = c; 11 if ((verbname == "invite") && (verbloc == rpgdoll)) 12 this.act = this.act - slow; 13 return; 14 endif 15endfor 16"Hey, we're actually going to try to use those extra args"; 17{?respond = 1, ?attacker = this, ?target = $nothing, ?weapon = $nothing} = `extra[1] ! E_RANGE => extra'; 18dolls = rpg:find_chars(where)[2]; 19"In case target is in a different room from the attacker. This could conceivably allow the target free attacks if they're involved in melee, but hopefully getting shot at will negate the advantage here."; 20if (valid(target) && valid(d = rpg:get_doll(target))) 21 dolls = setadd(dolls, d); 22endif 23"Check schedules, and increment .act. Dolls that had left over act will get a bit of a bonus, dolls that were in the negative will lose some of that."; 24for doll in (dolls) 25 try 26 if ((is_player(char = doll.character) && (`idle_seconds(char) ! ANY => 181' > idle_threshold)) || `char.location.peaceful ! ANY => 0') 27 doll.aggressor = {}; 28 dolls = setremove(dolls, doll); 29 else 30 doll.act = ((doll.act / 2) + 60) - ((char == attacker) ? doll.slowness | 0); 31 (random(9) < 9) && doll:check_schedule(); 32 endif 33 except (E_PROPNF, E_INVIND) 34 dolls = setremove(dolls, doll); 35 endtry 36endfor 37this.act = this.act - slow; 38if ((!respond) || (length(dolls) <= 1)) 39 return; 40endif 41acts = short_of_time = 0; 42"Find the doll with the highest .act. Decrement the .act. call eir :act verb. Repeat until we run out of time, or all have acts of less than 0. If we run out of time, before at least 3 have acted, suspend, instead of quitting."; 43loops = 1; 44while (dolls && ((!short_of_time) || (acts < 3))) 45 max = -1; 46 fast_dolls = {}; 47 for doll in (dolls) 48 if (`doll.aggressor ! ANY => {}') 49 "Took out the 2 * doll.slowness for testing purposes ... put the 2 * back in if you like. - THX"; 50 doll_act = doll.act = doll.act - (loops * doll.slowness); 51 if (doll_act >= 0) 52 if (doll_act > max) 53 fast_dolls = {doll}; 54 max = doll_act; 55 elseif (doll_act == max) 56 fast_dolls = setadd(fast_dolls, doll); 57 endif 58 else 59 dolls = setremove(dolls, doll); 60 endif 61 else 62 dolls = setremove(dolls, doll); 63 endif 64 endfor 65 for doll in (fast_dolls) 66 if (`doll.character ! ANY' == 0) 67 return 0; 68 elseif (`doll.character.location.peaceful ! ANY => 0') 69 else 70 try 71 doll.act = doll.act - (loops * doll.slowness); 72 doll:act(); 73 acts = acts + 1; 74 except e (ANY) 75 return 0; 76 endtry 77 endif 78 endfor 79 if ((short_of_time = (ticks_left() < 8000) || (seconds_left() < 2)) && (acts < 3)) 80 rpg:s_i_n(); 81 endif 82 "loops = loops + 0.1;"; 83endwhile 84return 0; 85"Irin Thursday, Jan 30, 1997 -- complete rewrite and redesign. I think this is vaguely what it was supposed to do, before it got broken."; 86"Probably not the same implementation though. Now, the acting doll calls it's :invite(), rather than inviting the target."; 87"Profane 2-MAY-97 1539PDT -- $recycler:valid check line 54"; 88"Profane 7-MAY-97 1714PDT -- removed valid check, fixed scattering of extra, s/target/d/21"; 89"THX - 7-May-1997 -- De-ticked. Gave :invite() a way out if there is only one doll going into the while loop. Set idle check to idle_threshold. Stopped doing doll:schedule calls on idle/disconnected players. Removed dolls with no aggressors from the big while-loop ... it's up to hit aggressor to tell the damn doll that it's under attack. Made the first for-loop in the while-loop a little smarter thus reducing the number of iterations of the second for-loop. Seems to be working fine now."; 90"Profane 10-JUN-97 1855PDT -- Try statement in schedule checking loop, line 24-34"; 91"THX 17-Jul-1997 -- Put error-catching in doll.aggressor to catch recycled dolls without TBing. Not that it would happen alot, but it'll save G_M from having to look for an error (only happens with gursts)."; 92"THX (#105941) - Wed Nov 8, 2000 - Check for char.location.peaceful right in the loop that accumulates the dolls that matter _and_ just before the doll:act() is called in case the beggar has moved."; 93"Hannibal (#104762) - Tue July 31, 2001 - Make sure doll is valid before setting act, summonables hit this."; 94"Profane (#30788) - Wed Aug 1, 2001 - Refactor act reduction within one round. Now more loops reduce act more. effect: tone down haste.";
hit_aggressor
Referenced by
- #74:act line 8:
this:hit_aggressor - #74:act line 11:
this:hit_aggressor - #74:act(old) line 8:
this:hit_aggressor - #74:act(old) line 11:
this:hit_aggressor
Source
1rpg = $local.rpg; 2if (rpg.rpg_options:get(this.rpg_options, "defend")) 3 this.act = this.act - 1; 4elseif (this.aggressor = setremove(this.aggressor, me = this.character)) 5 rpg:secure(); 6 here = me.location; 7 if (0) 8 this:arm(); 9 return $failed_match; 10 else 11 try 12 weapon = (random(2) == 1) ? this:wielding()[1] | $list_utils:random_element(this:wielding()); 13 except (E_RANGE) 14 this:arm(); 15 return $failed_match; 16 endtry 17 if ((weapon.contents && rpg.object_db:is_missile_weapon(weapon)) && (random(100) <= weapon:speed())) 18 weapon = weapon.contents[1]; 19 endif 20 endif 21 if ((missile = rpg.object_db:is_missile_ammo(weapon)) && rpg:trusted_verb(here, "Missile_dests")) 22 locs = here:missile_dests(me); 23 else 24 locs = {here}; 25 endif 26 while (this.aggressor) 27 targ = (is_player(me) || (!$recycler:valid(me))) ? $nothing | me:pick_aggressor(); 28 if (!valid(targ)) 29 targ = this.aggressor[random($)]; 30 endif 31 "if (`targ.location.peaceful ! ANY => 0')"; 32 " this.aggressor = setremove(this.aggressor, targ);"; 33 if ((targ.location in locs) && ((`idle_seconds(targ) ! ANY => 181' < rpg.idle_threshold) || ((!is_player(targ)) && targ.alive))) 34 "if ((targ.location in locs) && (((!is_player(targ)) && targ.alive) || ((targ in connected_players()) && (`idle_seconds(targ) ! ANY => 181' < rpg.idle_threshold))))"; 35 if (missile) 36 weapon:deliver_payload(this, targ, weapon, 0, 0, 1); 37 elseif (weapon.owner in rpg.gms) 38 this:attack(targ, weapon); 39 else 40 this.wielding = setremove(this.wielding, weapon); 41 endif 42 return targ; 43 else 44 this.aggressor = setremove(this.aggressor, targ); 45 endif 46 endwhile 47endif 48return $nothing; 49"THX (#105941) - Thu Jul 29, 1999 - Changed missiles to call :deliver_payload() instead of this:attack() directly."; 50"THX (#105941) - Fri Feb 16, 2001 - Stuffed in an explicit .peaceful check and streamlined the valid target check."; 51"THX (#105941) - Wed Mar 21, 2001 - Decrement doll.act for those who are +defend. Otherwise they grab the invite loop and hold it all to themselves."; 52"Mooshie (#106469) - Sun Mar 3, 2002 - Commented out the explicit .peaceful check. The room's :combat_effect should handle this (to deliver messages, if needed, for example). A peaceful room-flag will be forthcoming to make this more generic.";
respond
Referenced by
none
Source
1":respond(attacker, quality, damage, weapon, loc)"; 2"attacker -> character initiating the attack"; 3"quality -> quality of the attack (final hit roll)"; 4"damage -> damage to be applied"; 5"weapon -> weapon used to attack"; 6"loc -> body area object of hit location"; 7{by, qual, dam, weapon, loc} = args; 8(rpg = $local.rpg):secure(); 9if (typeof(weapon) != OBJ) 10 return this:respond_passed_numbers(by, qual, dam, weapon, loc); 11endif 12if (!this.armour_effects) 13elseif (typeof(effect = this:armour_effects(by, qual, dam, weapon, loc)) == NUM) 14 qual = qual - effect; 15else 16 return effect; 17endif 18me = this.character; 19if (this:cannot_defend()) 20 return this:receive_damage(dam * (1 + random(3)), max(1, weapon:pen(by, me)), qual, loc, by, weapon); 21endif 22locstr = loc:title(me); 23penalty = -((max(0, length(this.aggressor) - 1) * 20) + this:encumbrance()); 24parryable = weapon:parryable(by, me) + loc:parry_mod(me, by, weapon); 25space = `by.location.space ! ANY'; 26gms = rpg.gms; 27for thing in (this:wielding()) 28 try 29 if (valid(thing)) 30 if (thing.owner in gms) 31 if ((typeof(u = thing:used(me, by)) == NUM) && (this.act > -11)) 32 mods = ((thing:parry(by, me, weapon) - qual) + parryable) + penalty; 33 length = thing:length(me, by); 34 mods = mods - `max(3 * space, 0) ! ANY => 0'; 35 mods = mods + 10; 36 if ((best = thing:skill(me, by):resolve(me, mods + u)) > 0) 37 this.act = this.act - max(1, (length + thing:slowness(me, by)) / 12); 38 thing:announce_parry(by, me, locstr, weapon, qual, best); 39 this:check_fatigue(thing:encumbrance()); 40 weapon:notify_parry(by, me, locstr, thing, qual, best); 41 weapon:track_usage(2); 42 this.connect_effects && this:connect_effects(by, me, loc, weapon, qual, 0, 99, 1); 43 (bydoll = rpg:get_doll(by)).connect_effects && bydoll:connect_effects(me, by, loc, thing, best, 0, 99, 1); 44 return; 45 endif 46 endif 47 elseif (thing.owner in rpg.ex_gms) 48 else 49 rpg:playertell(me, "You feel strangely weaker!"); 50 this.end = max(this.end - 1, 1); 51 this.pot = 0; 52 return; 53 endif 54 else 55 this.wielding = setremove(this.wielding, thing); 56 return; 57 endif 58 except (E_VERBNF) 59 "It's some non-weapon that's gotten in there somehow."; 60 this.wielding = setremove(this.wielding, thing); 61 endtry 62endfor 63dodgable = weapon:dodgable(by, me); 64mods = ((((this:hands_free() ? 25 | 0) + dodgable) + penalty) - qual) - `max(0, 50 - space) ! ANY => 0'; 65mods = mods + 10; 66if (rpg.skills.dodge:resolve(me, mods) > 0) 67 weapon:track_usage(3); 68 this.act = this.act - 1; 69 return weapon:announce_dodge(by, me, locstr); 70endif 71this:receive_damage(dam * (1 + random(3)), max(1, weapon:pen(by, me)), qual, loc, by, weapon); 72"Quinn 17-FEB-93: hacked to send attacker to :receive_damage."; 73"Quinn 11-AUG-93: Receive weapon (if any) from caller and send to :Receive_damage."; 74"Quinn 22-OCT-93: Receive and send hit location. Removed some literal dodge resolve."; 75"Quinn 19-NOV-93: Major re-write. Cut a lot of kruft. Redirect old-style calls to :respond_passed_numbers."; 76"Profane 9-FEB-95 23:06EST: Added 'qual' and 'try' to :announce_parry call in preparation for weapon degrading."; 77"Profane 2-13-95 20:47EST: Added call to weapon:notify_parry for weapon damage hook."; 78"Profane 2-9-96 1637EST- Added paralyzation check."; 79"Irin Sun Nov 3 10:56:34 1996 PST -- Added evil check for fighting lotsa people penalty thingie."; 80"THX 12-MAR-1997 -- Killed off a list indexing, reversed the order of the announce_parry and the notify_parry, and cleaned a wee bit."; 81"Profane 18-MAY-97 1541PDT -- added fatigue check to complement one in :attack"; 82"Profane 12-JUL-97 2147PDT -- TRY statement in the parry bit."; 83"Profane 3-OCT-97 -- added check for non-gm owned weapons."; 84"THX (#105941) - Mon Apr 6, 1998 - Sped things up by rearranging the conditional. Remember, set up your conditional path for the _most common_ route the code takes! Changed this.paralyzed check to this:cannot_move()."; 85"Irin Thu Jun 11 19:03:52 1998 PDT -- changed :cannot_move to :cannot_defend."; 86"Profane (#30788) - Sun May 2, 1999 - insert inelegant backfire checks circa line 38-42"; 87"THX (#105941) - Mon Nov 1, 1999 - Changed backfire effect to use connect_effects instead."; 88"THX (#105941) - Thu Feb 1, 2001 - Decrement this.act by parrying_weapon:slowness() if parry successful.";
set_att
Referenced by
- #74:mod_att line 16:
this:set_att - #74:setadd_att line 17:
this:set_att
Source
1":set_att(att, amt)"; 2"Sets the doll's `att' property to `amt'."; 3{att, amt} = args; 4(rpg = $local.rpg):secure(); 5if (this == rpg.doll) 6 "Grand_Master can set $local.rpg.doll stats manually."; 7 return E_NACC; 8elseif (caller == this) 9 "THX (#105941) - Sun Mar 7, 1999 - Dolls check rpg:approve_att_change() before calling this, so don't do it twice."; 10elseif (rpg:approve_att_change(player, {this, att, amt}, callers()) == E_PERM) 11 return E_PERM; 12endif 13if (att == "inj") 14 if (link = this.lifelinked) 15 return rpg.magic_db.ll_death_effect:do_lifelink(amt, link); 16 elseif (this.deathless && (amt < this.inj)) 17 return; 18 endif 19elseif (att == "slowness") 20 this.slowness_mod = rpg.slowness_mods[max(min(amt, 10), 1)]; 21elseif (att in {"ins", "fat"}) 22 this:track_callers(att, caller == this, callers = callers(1)); 23 (i = $list_utils:iassoc(#7970, callers, 4)) && ((callers[i + 1][3] in rpg.gms) || rpg:log_error((((("Possible hack: " + toliteral(callers)) + " ... Player: ") + #20:nn(player)) + " ... Victim: ") + #20:nn(this))); 24endif 25if (`parent(this).(att) ! ANY => E_RECMOVE' == amt) 26 clear_property(this, att); 27else 28 return `this.(att) = amt ! ANY'; 29endif 30return `this.(att) ! ANY';
die
Referenced by
- #74:receive_damage line 78:
this:die - #74:receive_damage_passed_messages line 78:
this:die - #74:hit_result line 59:
this:die - #74:receive_damage(old) line 76:
this:die
Source
1":die(whoby OBJ [, weapon OBJ])"; 2{whoby, ?weapon = $nothing} = args; 3(rpg = $local.rpg):secure(); 4victim = this.character; 5if (is_player(victim) && (typeof(`idle_seconds(victim) ! ANY') == ERR)) 6 return E_INVIND; 7 "elseif (this:incorporeal(weapon))"; 8 " return 0;"; 9elseif (typeof(effect = this:death_effects(whoby)) != NUM) 10 "If a :death_effect does not return a number, then abort the death."; 11 return effect; 12endif 13cp = caller_perms(); 14where = victim.location; 15contents = where:contents(); 16fork (rpg.gm_lag) 17 rpg:check_notification(contents, "notify_death", {victim, whoby}); 18 `this:murder_anima(whoby) ! E_VERBNF => 0'; 19endfork 20if (is_player(victim)) 21 (victim == victim.owner) && rpg.death_db:record_death(cp = valid(cp) ? cp | caller, whoby); 22 if (((!$object_utils:isa(victim, $guest)) && (this != rpg.object_db.suit_doll)) && (!(rpg.death_db.pkp_effect in this.view_effects))) 23 rpg:respawn_non_pkp_pc(this); 24 else 25 rpg:die(this); 26 endif 27else 28 victim.alive = 0; 29 victim:die(whoby); 30 `this.aggressor = {} ! ANY'; 31endif 32"Irin Tue Apr 22 11:21:43 1997 PDT -- Disconnected players don't die."; 33"THX - 23-Apr-1997 -- Set monster.alive to 0 before passing to monster:die() since they take so long sometimes."; 34"THX (#105941) - Wed Oct 13, 1999 - Commented out the explicit lifelink, poison, holdfoe, and iceshell checks and changed them all to use death_effect."; 35"Hydros (#106189) - Sun Oct 10, 2004 - Added a call to :murder_anima. Applies to killed (N)PCs."; 36"Hydros (#106189) - Sun Oct 16, 2005 - Added a hook to rpg:respawn_non_pkp_pc(), for folks that have volunteered into the playerkiller realm.";
receive_damage
Referenced by
- #74:respond line 20:
this:receive_damage - #74:respond line 71:
this:receive_damage - #74:respond(old) line 20:
this:receive_damage - #74:respond(old) line 67:
this:receive_damage
Source
1":receive_damage(dam, pen, qual, hitloc, attacker, weapon)"; 2"dam -> damage to be applied"; 3"pen -> penetration of the weapon"; 4"qual -> quality of the attack (final hit roll)"; 5"hitloc -> body area object of hit location"; 6"attacker -> character initiating the attack"; 7"weapon -> weapon used to attack"; 8(rpg = $local.rpg):secure(); 9try 10 {dam, pen, qual, loc, whoby, weapon} = args; 11except (E_ARGS) 12 return this:receive_damage_passed_messages(@args); 13endtry 14"if (this:incorporeal(weapon))"; 15" return 0;"; 16"endif"; 17me = this.character; 18effect = 0; 19if (this.connect_effects && (effect = this:connect_effects(whoby, me, loc, weapon, qual, dam, pen, 1))) 20 if (typeof(effect) == NUM) 21 dam = dam - effect; 22 else 23 return effect; 24 endif 25endif 26if (rpg.object_db:is_critical_hit(weapon) && weapon:critical_hit(whoby, me, qual, loc, dam)) 27 "weapon handled a critical hit"; 28 return; 29endif 30locstr = loc:title(me); 31protection = this:armour(pen, loc, whoby, weapon, dam, qual); 32size = this.size; 33if (((dam - protection) / size) <= 0) 34 armour = this.current_armours[2]; 35 absorbed = `max(armour:absorption(whoby, me, weapon, loc, dam), 1) ! ANY => 1'; 36 absorbed = absorbed * weapon:con(whoby, me); 37 if (rpg:trusted_property(me, "nat_prot")) 38 absorbed = absorbed * ((n = me.nat_prot) ? max(1, 2 + (n / 10)) | 1); 39 endif 40 if ((dam / max(1, size * absorbed)) > 0) 41 dam = dam / (size * absorbed); 42 sev = ((5 * dam) + (this.inj / 3)) / max(this.end, 5); 43 bad = {"slightly bruised", "slightly bruised", "bruised", "bruised", "bruised", "badly bruised"}[min(sev + 1, 6)]; 44 else 45 if (valid(armour = this.current_armours[1])) 46 armour:announce_clang(whoby, me, locstr, weapon, qual); 47 else 48 rpg:rpg_announce_all(me.location, me.name, " is unharmed by the blow."); 49 endif 50 weapon:notify_clang(whoby, me, loc, armour, qual); 51 return -1; 52 endif 53else 54 dam = (((dam - protection) / size) + weapon:special_damage(me, dam, pen, qual, loc, whoby)) || 0; 55 sev = ((2 * dam) + (this.inj / 3)) / max(this.end, 5); 56 bad = {"scratched", "slightly wounded", "hit", "hit", "hit", "severely wounded"}[min(sev + 1, 6)]; 57endif 58inj = this.inj; 59this:mod_att("inj", dam); 60shockmod = loc:shock_mod(me, whoby, weapon); 61stunmod = loc:stun_resistance(me, whoby, weapon); 62try_ = rpg:resolve(me, "shock", shockmod); 63if (try_ > (-2 * this.end)) 64 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 65 weapon:announce_hit(whoby, me, locstr, bad, 0); 66 weapon:hit_special_effect(whoby, me, qual, dam, loc); 67 return -2; 68elseif ((!inj) || (try_ > ((-2 * (this.end + (is_player(me) ? 20 | 10))) - stunmod))) 69 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 70 weapon:announce_hit(whoby, me, locstr, bad, 1); 71 weapon:track_usage(4); 72 this.act = max(this.act - 20, -20); 73 weapon:hit_special_effect(whoby, me, qual, dam, loc); 74 return -3; 75elseif (rpg:is_alive(this)) 76 weapon:announce_kill(whoby, me, locstr); 77 weapon:track_usage(5); 78 this:die(whoby, weapon); 79 weapon:hit_special_effect(whoby, me, qual, dam, loc); 80 return -9; 81endif 82"THX (#105941) - Mon Jul 20, 1998 - Made it programmatically impossible to die unless already injured."; 83"THX (#105941) - Wed Jan 6, 1999 - Re-added stunmod modifier and fixed the logic in line 64."; 84"THX (#105941) - Sun Jan 10, 1999 - Removed the ugly tangle receive_damage check/call and moved it to the tangle:armour_effect."; 85"Profane (#30788) - Sun May 2, 1999 - insert inelegant checks for backfire circa lines 46-48, 64-66, 73-75"; 86"Profane (#30788) - Sun May 23, 1999 - Moved iceshell off into an armour_effect"; 87"THX (#105941) - Mon Nov 1, 1999 - Moved the explicit backfire calls to :connect_effects."; 88"THX (#105941) - Mon May 29, 2000 - Added a rpg.object_db:is_critical_hit(weapon) check to allow Grand_Master to exclude poorly constructed critical_hit verbs."; 89"THX (#105941) - Thu May 17, 2001 - Put in an rpg:is_alive(this) check in before calling this:die() ... maybe we'll have fewer double corpses.";
act
Referenced by
none
Source
1(rpg = $local.rpg):secure(); 2if (this:cannot_cast()) 3 "Assume that the monster would hit somebody if they can't cast."; 4 "This could be wrong, but monsters don't yet check if they can cast? Maybe after talking with various monster owners? Things that block casting, but not attacking seem rare at the moment..."; 5 if (this:cannot_attack()) 6 return; 7 endif 8 return this:hit_aggressor(); 9endif 10if (is_player(who = this.character)) 11 this:hit_aggressor(); 12else 13 rpg:s_i_n(1); 14 "Assume that their act verb is trusted, if they're not a player and have a doll."; 15 who:act(); 16endif
protection
Referenced by
- #74:armour line 7:
this:protection - #74:armour(old) line 46:
this:protection
Source
1":protection(penetration, hit-location, attacker, weapon-used, dam, [qual])"; 2rpg = $local.rpg; 3{pen, loc, attacker, ?weapon = rpg.weapon, ?dam = 0, ?qual = 0} = args; 4me = this.character; 5pierce = `weapon:pierce(attacker, me, qual) ! ANY => 0'; 6r = `random(100) + pierce ! E_TYPE => random(100)'; 7max = 0; 8amax = 1; 9best_prot = best_abs = $nothing; 10for armour in (this:wearing()) 11 if (armour:cover(loc) > r) 12 protection = armour:protection(attacker, me, weapon, loc, pen, dam); 13 absorb = armour:absorption(attacker, me, weapon, loc, dam); 14 if (max < protection) 15 max = protection; 16 best_prot = armour; 17 endif 18 if (amax < absorb) 19 amax = absorb; 20 best_abs = armour; 21 endif 22 endif 23endfor 24this.current_armours = {best_prot, best_abs}; 25max = max + ((typeof(loc) == NUM) ? this.body_areas[loc]:nat_prot(me, attacker, weapon) | loc:nat_prot(me, attacker, weapon)); 26object_db = rpg.object_db; 27if (((loc == 4) && (max < 10)) && (r < 75)) 28 for q in (this.wielding) 29 if (object_db:is_shield(q)) 30 max = 10; 31 endif 32 endfor 33endif 34return max(pen * max, 0); 35"Quinn 11-AUG-93 1010: Re-written to send attacker and weapon (if given) to the new armour:protection() verb; changed literal shield reference to rpg.shield"; 36"Quinn 16-OCT-93 0115: Use armour:cover verb instead of propref."; 37"Profane 20-JAN-96 0939EST: Added nat_prot modifer for body areas."; 38"Irin Wed Sep 4 22:50:51 1996 PDT: Added piercing."; 39"Irin Mon Sep 16 18:58:46 1996 PDT -- Added check for absorption, added passing of armour used through .current_armours property. Nasty hack, but can't otherwise alter the return value."; 40"Irin Sun Sep 22 13:15:28 1996 PDT--added optional 'qual' argument, to pass through to :pierce."; 41"Irin Mon Sep 23 20:02:36 1996 PDT -- Changed to use call to new object_db for faster execution."; 42"THX1138 - 26-Apr-1997 -- Used a scatter assignment and reduced the number of assignments to reduce tickage.";
encumbrance
Referenced by
- #74:attack line 18:
this:encumbrance - #74:respond line 23:
this:encumbrance - #74:respond_passed_numbers line 36:
this:encumbrance - #74:respond(old) line 23:
this:encumbrance - #74:attack(old) line 18:
this:encumbrance
Source
1":encumbrance() -> Total encumbrance of this character. Usually [0..10]."; 2if (is_player(char = this.character)) 3elseif (load = `char:encumbrance() ! E_VERBNF, E_PERM') 4 return load; 5endif 6if (strength = this.str) 7 if (typeof(this.weight) == NUM) 8 return this.weight; 9 else 10 weight = this.weight = $local.rpg:weight(char, this) / max(1, strength + (this.size - 10)); 11 "((weight > 12) && is_player(char)) && $local.rpg.object_db.ol_effect:add(this);"; 12 return weight; 13 endif 14else 15 return 0; 16endif 17"Quinn 21-AUG-93 0706: Hacked to return character:encumbrance if exists and is owned by a GM."; 18"Profane 2/5/95 13:48EST - fixed use of `STR' as a variable name."; 19"StarDancer Oct 21 06:39 1995 PDT - took out call to $object_utils:has_callable_verb, made verb !d"; 20"Hydros (#106189) - Tue Jan 17, 2006 - I prefer penalizing stat resolves on a sliding scale than just paralyzing them for overload, so I removed it.";
get_att
Referenced by
none
Source
1"{att} = args; ... documentation only"; 2if (caller_perms() in $local.rpg.gms) 3 return `this.(args[1]) ! ANY'; 4 "THX (#105941) - Sun Mar 29, 1998 - The following is a nasty hack we used against loser hackers. Removed for speed."; 5 "programmers = $list_utils:slice(callers(), 3);"; 6 "for loser in ({@rpg.fishy, @rpg.macro_users})"; 7 " if (loser in programmers)"; 8 " raise(E_PERM);"; 9 " endif"; 10 "endfor"; 11else 12 return E_PERM; 13endif
schedule
Referenced by
none
Source
1":schedule(OBJ object, STR verb, NUM time, LIST args)"; 2"Schedule this doll to call object:(verb)(doll, @args) at time."; 3"The time is approximate, since the schedule is checked only when :invite is called."; 4$local.rpg:secure(); 5this.schedule = listappend(this.schedule, args);
cancel
Referenced by
- #74:armour(old) line 17:
this:cancel
Source
1":cancel(LIST schedule element)"; 2if ($local.rpg:trusted(caller_perms())) 3 this.schedule = setremove(this.schedule, @args); 4endif
get_schedule
Referenced by
none
Source
1{?item = 0} = args; 2$local.rpg:secure(); 3if (item) 4 r = {}; 5 for w in (this.schedule) 6 if (w[1] == item) 7 r = listappend(r, w); 8 endif 9 endfor 10 return r; 11endif 12return this.schedule; 13"THX (#105941) - Mon Jan 31, 2000 - Updated verb and added security.";
recycle
Referenced by
none
Source
1if ((caller == this) || $perm_utils:controls(caller_perms(), this)) 2 rpg = $local.rpg; 3 if (z = this in rpg.dolls) 4 rpg.pcs = listdelete(rpg.pcs, z); 5 rpg.dolls = listdelete(rpg.dolls, z); 6 endif 7 rpg.saved_dolls = setremove(rpg.saved_dolls, this); 8 pass(@args); 9else 10 return E_PERM; 11endif 12"Profane 28-MAR-97 1132PST -- added caller == this bit to line 1."; 13"Profane (#30788) - Sat Jan 2, 1999 - remove from saved_dolls too.";
arm
Referenced by
- #74:hit_aggressor line 8:
this:arm - #74:hit_aggressor line 14:
this:arm
Source
1"Grab a weapon and wield it. Called when an unarmed character is attacked."; 2(rpg = $local.rpg):secure(); 3me = this.character; 4if (this.wielding || (rpg:trusted_verb(me, verb) && me:(verb)())) 5 "Either character is already wielding a weapon, or"; 6 "The character's :arm verb has taken care of it."; 7 return E_NONE; 8endif 9weapon = rpg.weapon; 10for w in (me:contents()) 11 if ($object_utils:isa(w, weapon) && (this:hands_free() >= w.hands)) 12 this.wielding = {w}; 13 w:do_wield(me); 14 rpg:playertell(me, "You ", w.wield, " your ", w.name, "."); 15 me.location:announce_all_but({me}, $string_utils:pronoun_sub(((("%n %<" + w.owield) + "> %p ") + w:title()) + ".", me)); 16 " this:invite((this.slowness + w:slowness()) / 3, {2, w})"; 17 " w:wield() "; 18 return; 19 endif 20endfor 21this.act = 0; 22"DR 01-AUG-94 -- Just call weapon:wield instead of doing it manually."; 23"Profane 1/30/95 20:29EST - added trustworthiness check for custom :arm verbs.";
total
Referenced by
none
Source
1":total(skill) -> Total (percentage-based) rank for the given skill."; 2"Governing attributes are totaled and added to the raw rank for 'skill', then governing skills are each :totaled in turn and the final sum is returned."; 3if (caller_perms() in (rpg = $local.rpg).gms) 4 {att} = args; 5 att_obj = rpg:match_skill(att); 6 skill = 0; 7 for dep_att in (att_obj.dep_names) 8 try 9 skill = skill + this.(dep_att); 10 except (E_PROPNF) 11 "Some G_M's been adding skills the wrong way 'round again.."; 12 $mail_agent:send_message(this, {this.owner}, "E_PROPNF in :total", ("#74:total is giving a property not found for #74." + tostr(dep_att)) + "... fix it."); 13 except (E_TYPE) 14 "Stat got messed up somehow."; 15 $mail_agent:send_message(this.owner, {this.character.owner}, ("Your " + tostr(dep_att)) + " skill is messed up.", "The above mentioned skill was found set to a non-numeric value, and has been reset to zero. You might want to have a gm check into this, eh?"); 16 this.(dep_att) = 0; 17 endtry 18 endfor 19 return skill; 20else 21 return E_PERM; 22endif 23"Irin Fri Sep 6 19:07:10 1996 PDT -- changed to newtotal code. This should save around 100 ticks per call to :resolve."; 24"Profane (#30788) - Wed Dec 31, 1997 - added some error trapping";
improve
Referenced by
- #74:improve line 38:
this:improve
Source
1":improve(<skill>, [no dependant improvements]) Make a check for improvement of the given skill."; 2"Character has a 1 in skill.learn chance of improvement for each skill."; 3" Skills will not naturally raise higher than 30 (or the relevant skill cap, whichever is lower.)"; 4" If a skill is maxed, player has a chance of gaining potential; a chance decreasing with the amount e's been given thus far."; 5" If the player did not gain potential either, then e has a chance of raising eir skill cap in the relevant area."; 6"If 'skill' did not improve, the same process is repeated for one of the skills that control it, and so on, unless the `no dependent improvements' flag is given and true."; 7{skill, ?no_dep = 0, ?callers = 0} = args; 8(rpg = $local.rpg):secure(); 9callers = callers ? callers | callers(); 10if (callers()[$][2] == "eval") 11 rpg:log_error("Doll:improve() called with caller stack: " + toliteral(callers())); 12endif 13if (((ease = skill.learn) > 0) && (random(ease) == 1)) 14 skill_prop = skill.aliases[1]; 15 if (((skill_val = this.(skill_prop)) == 0) && (!`skill:improve_learn_ok() ! ANY')) 16 "This checks to see if the player's skill is going from 0 to 1 in a spell skill: which would imply from no knowledge to some knowledge. This shouldn't happen through skill improvement (which could happen in the deflection of the spell, were this check left out); it should only come through `learning' the spell in some specific way: scroll, teaching, etc,"; 17 return; 18 elseif (((real_val = this:get_unmod_att(skill_prop)) < `random(cap = skill:cap(this)) ! E_INVARG => 0') && rpg:approve_att_change(this.character, {this, skill_prop, real_val + 1}, callers)) 19 value = this.(skill_prop) = skill_val + 1; 20 this:maybe_tell_improve(skill, value); 21 elseif (random(600) > this.total) 22 this.total = this.total + 1; 23 this.pot = this.pot + 1; 24 "Added this last section to deal with the skill caps. A player with a low enough total and a skill cap of 10 or below has a chance to be charged potential here and raise the cap by 5."; 25 elseif (((skill_val + 2) > cap) && (random(585) > this.total)) 26 if (skill.cap_names) 27 boosted = $list_utils:random_element(skill.cap_names); 28 bskill = rpg:match_skill(boosted[4..$]); 29 if (this.(boosted) < 11) 30 this.total = this.total + (bskill.cap_boost_mult * ((this.(boosted) > 10) ? 2 | 1)); 31 this.(boosted) = this.(boosted) + 5; 32 endif 33 endif 34 "-----------End skill cap section----------"; 35 endif 36elseif ((!no_dep) && (deps = {@skill.dependant[1], @skill.dependant[2]})) 37 rpg:s_i_n(1); 38 this:improve(deps[random($)], 0, callers); 39endif 40"Quinn 11-AUG-93 0923: Added comments."; 41"Irin Fri Sep 6 20:31:00 1996 PDT -- added call to :cap."; 42"Irin Wed Oct 2 15:40:22 1996 PDT -- Allowed boosting of skill caps."; 43"THX1138 - 17-May-1997 -- Cleaned up a bit. Added a call to maybe_tell_improve so that players might get some feedback when their skills improve (only against monsters for combat/magick skills tho')."; 44"THX1138 - 18-May-1997 -- Put a :suspend_if_needed() call in before subsequent calls to improve in the last elseif conditional."; 45"Mooshie (#106469) - Mon Oct 6 09:55:24 1997 PDT - Added hook to catch rising stats on disconnected players."; 46"Profane (#30788) - Mon Oct 6 18:35:35 1997 PDT - Changed mooshie's hook to raise E_PERM after logging- let's try and stop these tasks, eh?"; 47"Profane (#30788) - Wed Oct 29 14:19:55 1997 PST - Added check to prevent raising spells from 0 to 1."; 48"Mooshie (#106469) - Fri Nov 28 20:27:46 1997 PST - Modified check to go through skill's :improve_learn_ok, thus giving us a little more control over what can be learned via :improve and what can't."; 49"Mooshie (#106469) - Fri Jan 23, 1998 - Snuck an :approve_att_change check in there."; 50"Profane (#30788) - Sun Oct 11, 1998 - s/15/10/20 and s/16/11/25 since we now have a limit on the number of 20's caps.";
moveto
Referenced by
none
Source
1if ($local.rpg:trusted(caller_perms())) 2 return pass(@args); 3else 4 player:tell("From ", this, " (#74:moveto). You have no business messing with the doll anyway, get a GM to move it for you if perchance it is bothering you."); 5endif
mod_att
Referenced by
- #74:receive_damage line 59:
this:mod_att - #74:receive_damage_passed_messages line 39:
this:mod_att - #74:hit_result line 35:
this:mod_att - #74:receive_damage(old) line 53:
this:mod_att
Source
1":mod_att(STR attribute, NUM value[, NUM min_value[, NUM max_value]])"; 2" Modifies the given attribute by `value', keeping it greater than or equal to min_value, and less than or equal to max_value. Default min_value is -$maxint. Default max_value is $maxint."; 3" => E_NACC, if this is the generic doll."; 4" => E_TYPE, if attribute is not numerical."; 5" => E_INVARG, if any argument 2.. isn't numerical."; 6" => new_value, if all was successful."; 7{att, mod, ?min = -$maxint, ?max = $maxint} = args; 8(rpg = $local.rpg):secure(); 9if ($code_utils:verb_loc() == this) 10 return E_NACC; 11elseif (typeof(old = this.(att)) != NUM) 12 return E_TYPE; 13elseif (typeof(mod) != NUM) 14 return E_INVARG; 15elseif (rpg:approve_att_change(player, {this, att, old + mod}, callers())) 16 return this:set_att(att, min(max(old + mod, min), max)); 17else 18 return E_PERM; 19endif 20"Profane 18-AUG-96 1404PDT -- hacked to call :set_att instead of directly setting att.. so's lifelinking crap will get checked."; 21"THX (#105941) - Sat Apr 4, 1998 - Made some hacks for speed. Saved old to #74:mod_att(old).";
long_enough
Referenced by
none
Source
1":long_enough() => Newer spiffier more dynamic :long enough. Tells whether we should allow an action, based on the doll's last action and the general lag of G_M's queue. -- Irin."; 2(rpg = $local.rpg):secure(); 3return (time() - this.last_attack) > rpg.gm_lag;
wearing
Referenced by
- #74:protection line 10:
this:wearing
Source
1":wearing([STR|OBJ body_area])"; 2"If a body area is given (either by object or name), return clothing worn on that area. Else, return the entire property value."; 3{?area = 0} = args; 4if (area == 0) 5 return this.wearing; 6else 7 area = (typeof(area) == OBJ) ? area | this:match_body_area(area); 8 duds = {}; 9 for dud in (this.wearing) 10 if (dud:cover(area)) 11 duds = {@duds, dud}; 12 endif 13 endfor 14 return duds; 15endif 16"Quinn 08-MAR-93 xxxx: Added."; 17"Quinn 18-NOV-93 0404: Use objects/strings instead of indices.";
hit_location_names
Referenced by
- #74:receive_damage_passed_messages line 8:
this:hit_location_names - #74:hit_result line 17:
this:hit_location_names
Source
1return `this.character.locations ! ANY => {"head", "left arm", "right arm", "chest", "neck", "abdomen", "right hand", "left hand", "right leg", "left leg", "left foot", "right foot"}'; 2"Returns hit location names of this doll -- either a property on the doll's character, or the hard-coded default. --Quinn (11-MAR-93) after the big crash...SIGH";
hands_free
Referenced by
- #74:respond line 64:
this:hands_free - #74:arm line 11:
this:hands_free - #74:respond(old) line 63:
this:hands_free
Source
1":hands_free() => How many hands this character has free, subtracting total hands from those required for all wielded weapons."; 2"Actually, this should be hacked even further, to count all unsheathed weapons as being carried, and thus in the character's hands. Realistic, but sticky with regards to monster setup, and the potential to be quite annoying."; 3hands = this.hands; 4for w in (this.wielding) 5 hands = hands - w.hands; 6endfor 7return max(hands, 0); 8"Quinn 29-JUL-93 0107-ET: Added.";
check_fat*igue
Referenced by
none
Source
1":check_fat(amount) -> Test the character's stamina."; 2{mod, ?announce = 1} = args; 3(rpg = $local.rpg):secure(); 4rpg.fat_callers = setadd(rpg.fat_callers, callers()[1][2..4]); 5if (is_player(by = this.character)) 6else 7 announce = (by.animal in {0, "humanoid"}) ? announce | 0; 8 mod = mod / 12; 9endif 10mod = toint(tofloat(mod) / this.slowness_mod); 11amt = (mod * random(3)) / ((((this.end * 7) + (this.wil * 3)) / 8) + random(5)); 12res = rpg:resolve(by, "stamina", 55 - mod); 13"old formula: this.fat = this.fat + mod * 3 / ((this.end * 7 + this.wil * 3) / (10 * random(3))) -- THX screwed up.;"; 14if (res < -80) 15 this.act = this.act - 50; 16 this.fat = (this.fat + 1) + (2 * amt); 17 announce && rpg:say_action("%N %<staggers> wearily, %p tongue wagging and knees buckling with weariness.", by); 18elseif (res < -20) 19 this.act = this.act - 20; 20 this.fat = (this.fat + 1) + ((3 * amt) / 2); 21 announce && rpg:say_action("%N %<wipes> %p brow and %<pants> heavily.", by); 22elseif (res <= 0) 23 this.act = this.act - 10; 24 this.fat = this.fat + amt; 25 announce && rpg:say_action("%N %<begins> to tire from such intense activity.", by); 26else 27 this.fat = this.fat + (amt / random(2)); 28endif 29"Profane 18-MAY-97 1604PDT - monsters never get fatigued. Lucky bastards."; 30"Profane (#30788) - Sat Feb 14, 1998 - Hasting yourself fatigues you much more easily."; 31"Irin Mar 15, 1998, Reduce haste slam"; 32"THX (#105941) - Sat Jan 15, 2000 - Made it always !announce unless 'by' is a player, a non-animal NPC, or a \"humanoid\" NPC.";
match_body_area
Referenced by
- #74:wearing line 7:
this:match_body_area
Source
1":match_body_area(STR name) -> OBJ body-area-object"; 2{namestr} = args; 3a = $string_utils:match(namestr, areas = this.body_areas, "aliases"); 4if (valid(a)) 5elseif (areas == (rpg = $local.rpg).doll.body_areas) 6 if (rpg:trusted_property(who = this.character, "locations")) 7 if (x = namestr in who.locations) 8 return areas[x]; 9 endif 10 endif 11endif 12return a; 13"Quinn 18-NOV-93 0201: Added."; 14"Irin Wed Sep 25 21:05:33 1996 PDT -- Added possibility of matching different body area names than those from the aliases."; 15"THX (#105941) - Thu Feb 3, 2000 - Don't match with .locations if the body_areas are different than that of rpg.doll's.";
random_hit_location
Referenced by
none
Source
1":random_hit_location() -> {OBJ body_area[, ...]}"; 2"Determine which body area the attack has hit."; 3areas = this.body_areas; 4if (is_player(c = this.character)) 5elseif (area = c:random_hit_location()) 6 return area; 7elseif (length(c.locations) < length(areas)) 8 areas = areas[1..length(c.locations)]; 9endif 10while (areas) 11 where = areas[random($)]; 12 if (random(100) <= `where.coverage ! E_PROPNF, E_TYPE => 0') 13 return where; 14 endif 15 areas = setremove(areas, where); 16endwhile 17return this.body_areas[1]; 18"Quinn 18-NOV-93 0201: Added."; 19"Profane (#30788) - Wed Jan 3, 2001 - HACK to truncate area list to the number defined in a monster's .locations; tho of course you all should still make your own custom body areas.";
respond_passed_numbers
Referenced by
- #74:respond line 10:
this:respond_passed_numbers - #74:respond(old) line 10:
this:respond_passed_numbers
Source
1if (!(rpg = $local.rpg):trusted(caller_perms())) 2 return E_PERM; 3endif 4by = args[1]; 5qual = args[2]; 6dam = args[3]; 7pen = args[4]; 8dodgable = args[5]; 9parryable = args[6]; 10"Quinn 11-AUG-93 0948: Receive weapon (if any) from caller."; 11weapon = (length(args) > 6) ? args[7] | $nothing; 12me = this.character; 13if (this:cannot_defend()) 14 return this:receive_damage_passed_messages(dam * (1 + random(3)), pen, "Your armoured %w deflects the blow.", ("The blow is stopped by the armour on " + me.name) + "'s %w.", "You are %b on the %w.", me.name + " is %b on the %w but keeps fighting.", "You are %b on the %w and briefly stunned.", me.name + " is %b on %p %w and stunned.", by.name + " has killed you! Your soul is returned to the cycle of transmigrations.", ((by.name + " killed ") + me.name) + "!", by, weapon); 15endif 16best = 0; 17hand = 0; 18for thing in (this:wielding()) 19 mods = (thing:parry(by, me) - qual) + parryable; 20 if ($object_utils:has_property(by.location, "space")) 21 if (by.location.space < (length = thing:length(me, by))) 22 mods = mods - (3 * (length - by.location.space)); 23 endif 24 endif 25 "try = (u = thing:used(by, me)) ? -1 | thing:skill(me, by):resolve(me, mods);"; 26 "Quinn 10-AUG-93 0111-ET: Replaced the above with the below. okay?"; 27 try_ = (typeof(u = thing:used(me, by)) != NUM) ? -1 | thing:skill(me, by):resolve(me, mods + u); 28 hand = hand + thing:hands(me, by); 29 if (try_ > best) 30 best = try_; 31 omsg = ((("parries with " + me.pp) + " ") + thing.name) + "."; 32 msg = ("You parry with your " + thing.name) + "."; 33 endif 34endfor 35if (hand < 3) 36 mods = ((((25 * (2 - hand)) - this.inj) - (2 * this:encumbrance())) - qual) + dodgable; 37 try_ = #19856:resolve(me, mods); 38 if (try_ > best) 39 best = try_; 40 omsg = "dodges."; 41 msg = "You dodge."; 42 endif 43endif 44if (best > 0) 45 rpg:rpg_announce_all_but(me.location, {me}, me.name, " ", omsg); 46 rpg:playertell(me, msg); 47else 48 "Quinn 17-FEB-93: hacked to send attacker"; 49 "Quinn 11-AUG-93: hacked to send weapon (if any)"; 50 this:receive_damage_passed_messages(dam * (1 + random(3)), pen, "Your armoured %w deflects the blow.", ("The blow is stopped by the armour on " + me.name) + "'s %w.", "You are %b on the %w.", me.name + " is %b on the %w but keeps fighting.", "You are %b on the %w and briefly stunned.", me.name + " is %b on %p %w and stunned.", by.name + " has killed you! Your soul is returned to the cycle of transmigrations.", ((by.name + " killed ") + me.name) + "!", by, weapon); 51endif 52"Profane 9-FEB-96 1648EST -- Added paralyzation stuff.";
receive_damage_passed_messages
Referenced by
- #74:receive_damage line 12:
this:receive_damage_passed_messages - #74:respond_passed_numbers line 14:
this:receive_damage_passed_messages - #74:respond_passed_numbers line 50:
this:receive_damage_passed_messages - #74:receive_damage(old) line 12:
this:receive_damage_passed_messages
Source
1(rpg = $local.rpg):secure(); 2{dam, pen, clang, oclang, wound, owound, stun, ostun, kill, okill, ?whoby = $nothing, ?weapon = rpg.weapon} = args; 3"if (this:incorporeal(weapon))"; 4" return 0;"; 5"endif"; 6me = this.character; 7"...hacked to use hit_location_names 11-MAR-93 quinn..."; 8places = (this.body_areas == rpg.doll.body_areas) ? this:hit_location_names() | $list_utils:map_verb(this.body_areas, "title"); 9loc = {1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7}[random(11)]; 10loc = (loc > length(places)) ? random(length(places)) | loc; 11locstr = places[loc]; 12effect = 0; 13if (this.connect_effects && (effect = this:connect_effects(whoby, me, this.body_areas[loc], weapon, random(33), dam, pen, 1))) 14 if (typeof(effect) == NUM) 15 dam = dam - effect; 16 else 17 return effect; 18 endif 19endif 20if (dam <= 0) 21 return 0; 22endif 23mess = {}; 24for indx in [3..10] 25 mess = {@mess, strsub(args[indx], "%w", places[loc])}; 26endfor 27{clang, oclang, wound, owound, stun, ostun, kill, okill} = mess; 28dam = (dam - this:armour(pen, loc, whoby, weapon, dam)) / this.size; 29if (dam <= 0) 30 if (clang) 31 is_player(me) && rpg:playertell(me, clang); 32 endif 33 if (oclang) 34 rpg:rpg_announce_all_but(me.location, {me}, $string_utils:pronoun_sub(oclang, me)); 35 endif 36 return -1; 37endif 38inj = this.inj; 39this:mod_att("inj", dam); 40if (!(bad = (3 * dam) / this.end)) 41 bad = "scratched"; 42elseif (bad == 1) 43 bad = "slightly wounded"; 44elseif (bad < 4) 45 bad = "hit"; 46else 47 bad = "seriously wounded"; 48endif 49try_ = rpg:resolve(me, "shock", -{0, 10, 0, 20, 20, 20, 20}[loc]); 50if ((!inj) || (try_ > (-2 * this.end))) 51 if (wound) 52 is_player(me) ? rpg:tell_damage(me, strsub(wound, "%b", bad)) | rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 53 endif 54 if (owound) 55 rpg:rpg_announce_all_but(me.location, {me}, $string_utils:pronoun_sub(strsub(owound, "%b", bad), me)); 56 endif 57 return -2; 58elseif ((!this.inj) || (try_ > ((-4 * this.end) - {20, 40, 50, 80, 80, 55, 55}[loc]))) 59 if (stun) 60 is_player(me) ? rpg:tell_damage(me, strsub(stun, "%b", bad)) | rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 61 endif 62 if (ostun) 63 rpg:rpg_announce_all_but(me.location, {me}, $string_utils:pronoun_sub(strsub(ostun, "%b", bad), me)); 64 endif 65 this.act = this.act - 20; 66 if (this.act < -20) 67 this.act = -20; 68 endif 69 return -3; 70else 71 if (kill) 72 is_player(me) && rpg:tell_damage(me, kill); 73 endif 74 if (okill) 75 "rpg:rpg_announce_all_but(me.location, {me}, $string_utils:pronoun_sub(okill, me));"; 76 rpg:rpg_announce_all_but(me.location, {me}, $string_utils:pronoun_sub(strsub(okill, "%b", bad), me)); 77 endif 78 this:die(whoby, weapon); 79 return -9; 80endif 81"THX (#105941) - Mon Jul 20, 1998 - Made it programmatically impossible to die unless already injured."; 82"Profane (#30788) - Sun May 23, 1999 - iceshell and tangle moved to armour_effects"; 83"Hydros (#106189) - Wed Oct 5, 2005 - `okill' wasn't being subbed to handle `bad'. Fixed.";
death_effects
Referenced by
- #74:die line 9:
this:death_effects - #74:die(old) line 12:
this:death_effects
Source
1":death_effect([killer])"; 2"Give the attacker's location, and any objects affecting em, a chance to influence eir death."; 3"The `death effects' property should be a list of objects whose :death_effect verb will be called with the args (corpse, killer). Killer may, in some cases, be $no_one."; 4"If a non-Numeric value is returned by any object, the death is cancelled. Any other value is, for now, discarded. It may apply to a shock check later, in case you'd like to return something."; 5"Keep in mind that the `%N has killed %d!' message has already been printed by the time the effect is called. Returning a non-numeric will prevent the recycling of the doll, but you'll have to announce your own explanations."; 6{?killer = $no_one} = args; 7corpse = this.character; 8(rpg = $local.rpg):secure(); 9if (rpg:trusted_verb(corpse.location, "death_effect") && (typeof(effect = corpse.location:death_effect(corpse, killer)) != NUM)) 10 "Room stopped the death."; 11 return effect; 12endif 13{death_db, trash, gms, o_u, s_u} = {rpg.death_db, $garbage, rpg.gms, $object_utils, $set_utils}; 14effect = 0; 15for effobj in (this.death_effects) 16 if ((!valid(effobj)) || (parent(effobj) == trash)) 17 this.death_effects = setremove(this.death_effects, effobj); 18 death_db.ok_death_effects = setremove(death_db.ok_death_effects, effobj); 19 elseif (s_u:intersection(o_u:has_verb(effobj, "death_effect"), death_db.ok_death_effects) || (corpse in gms)) 20 "... do nothing ..."; 21 else 22 this.death_effects = setremove(this.death_effects, effobj); 23 endif 24endfor 25for effobj in (this.death_effects) 26 if (typeof(e = effobj:death_effect(corpse, killer)) != NUM) 27 return e; 28 else 29 effect = effect + e; 30 endif 31endfor 32return effect;
initialize
Referenced by
none
Source
1if ((caller == this) || $perm_utils:controls(caller_perms(), this)) 2 pass(@args); 3 $quota_utils:object_bytes(this); 4 this.last_action = this.last_attack = this.born = time(); 5else 6 return E_PERM; 7endif 8"Quinn 16-DEC-93 1300-ET: $quota_utils:object_size."; 9"Mooshie (#106469) - Sun Dec 7 02:42:13 1997 PST - Added .born set."; 10"THX (#105941) - Sat Oct 28, 2000 - Set .last_attack and .last_action as well. What the heck.";
legal_target
Referenced by
- #74:attack line 6:
this:legal_target - #74:attack(old) line 6:
this:legal_target
Source
1":legal_target(target, doll, weapon)"; 2"=> True if this character may attack 'target'"; 3"=> Else explain the failure and return false."; 4rpg = $local.rpg; 5by = this.character; 6{target, ?doll = rpg:get_doll(target), ?weapon = this:wielding()[1]} = args; 7if (by == target) 8 rpg:playertell(by, "If you want to commit seppuku there are cleaner and neater ways."); 9elseif (paralysis = this:cannot_attack()) 10 callers = callers(1); 11 first = callers[1][2..4]; 12 if (first in rpg.legal_paralysis) 13 else 14 rpg.legal_paralysis = {@rpg.legal_paralysis, first}; 15 rpg:log_error(tostr("Paralysis caught by legal_target: ", $string_utils:nn(caller), " ", toliteral(callers))); 16 endif 17 string = (typeof(paralysis) == STR) ? paralysis | "You're paralyzed, you can't do that."; 18 (length(callers()) > 7) || rpg:playertell(by, string); 19elseif (!valid(doll)) 20 `target:no_strike(by, weapon) ! E_VERBNF => 0' || rpg:playertell(by, $string_utils:pronoun_sub("At the last moment, you realise %n isn't worth killing, and spare %p worthless life.", target)); 21elseif (is_player(target) && (`idle_seconds(target) ! ANY => 1000' > rpg.idle_threshold)) 22 rpg:playertell(by, "Attack a comatose player? Forget it, you evil swine."); 23elseif ((is_player(target) && (!(target in this.aggressor))) && rpg.rpg_options:get(this.rpg_options, "peacenik")) 24 rpg:playertell(by, "Whoa! You don't really want to commit violence upoon your fellow human beings, do you? Even if it is ", target:title(), ". After all, love is the most powerful weapon. Play nice, now."); 25elseif ((valid(other = doll.duelee) && (`rpg:get_doll(other).duelee ! E_INVIND' == target)) && (!((is_player(by) ? by | (valid(master = `by:master() ! E_VERBNF => target') ? master | target)) in {target, other}))) 26 rpg:playertell(by, target.name, " is involved in a duel with ", doll.duelee.name, "; do not interfere."); 27elseif (((valid(other = this.duelee) && (`rpg:get_doll(other).duelee ! E_INVIND' == by)) && is_player(target)) && (!(target in {by, other}))) 28 rpg:playertell(by, "You're busy duelling ", other.name, "; finish that fight first."); 29elseif (by.location != target.location) 30 if ((valid(weapon) && rpg.object_db:is_missile_ammo(weapon)) && ((dests = $code_utils:verb_or_property(by.location, "dests")) != E_PROPNF)) 31 "Allow players with missile weapons to shoot non-hated targets in rooms listed as valid target locations by other rooms with support for range weapons...(whew!)"; 32 for each_destination in (dests) 33 if (target.location == each_destination) 34 "Have to put a PKP check in here too. Some odd verb calls made it possible to kill protected players when both the attacker and defender were being bombarded by arrows from the Old Soldier. -Kagan"; 35 if (rpg.death_db.pkp_effect:check_for_PK(by, target, weapon)) 36 rpg:playertell(by, target.name, " appears to be under the aegis of His Eminence, whose wrath is not to be invoked."); 37 return 0; 38 else 39 return 1; 40 endif 41 endif 42 endfor 43 rpg:playertell(by, "You're not in the room with that."); 44 "elseif (!(target in this.aggressor))"; 45 "Old way. Allow attacks on hated targets. Probably bad."; 46 endif 47elseif (rpg.death_db.pkp_effect:check_for_PK(by, target, weapon)) 48 rpg:playertell(by, target.name, " appears to be under the aegis of His Eminence, whose wrath is not to be invoked."); 49else 50 return 1; 51endif 52return 0; 53"Quinn 11-AUG-93 0900: Added. Different message when attempting to attack an unconnected player."; 54"Quinn 22-AUG-93 1409: Use :contents instead of .location check, to provide for metaroom support."; 55"DR 16-MAY-94 -- Reinstated missile weapon support."; 56"Quinn Sep-20-94 1340: Forbid attacks on players idle more than 3 minutes as well as those not connected."; 57"Quinn Sep-23-94 0721: Figure in last attack when considering idleness."; 58"Profane (#30788) - Tue Mar 17, 1998 - munged the logic a bit, replaced contents() checks with .location checks"; 59"Irin Fri May 29 -- Change to use doll:cannot_attack. Eliminate out of date missile weapon check. Completely disallow attacks not in room, except with missile weapons."; 60"Profane (#30788) - Wed Apr 21, 1999 - check new `peacenik' option"; 61"Profane (#30788) - Thu May 31, 2001 - No 3rd party attacks during duels";
write_misc_note
Referenced by
- #74:first_blood line 28:
this:write_misc_note - #74:do_lifelink(old) line 35:
this:write_misc_note - #74:armour(old) line 11:
this:write_misc_note
Source
1":write_misc_note(name, value)"; 2"Store a miscellaneous note on the voodoo doll."; 3$local.rpg:secure(); 4{index, value} = args; 5notes = this.misc_notes; 6for i in [1..length(notes)] 7 if (notes[i][1] == index) 8 this.misc_notes[i][2] = value; 9 return i; 10 endif 11endfor 12if (index in {"temple_rank", "Mages_guild_info"}) 13 this.misc_notes = listinsert(notes, args); 14 return 1; 15else 16 this.misc_notes = listappend(notes, args); 17 return length(notes) + 1; 18endif
read_misc_note
Referenced by
- #74:first_blood line 6:
this:read_misc_note - #74:armour(old) line 5:
this:read_misc_note - #74:receive_damage(old) line 43:
this:read_misc_note - #74:receive_damage(old) line 61:
this:read_misc_note - #74:receive_damage(old) line 70:
this:read_misc_note - #74:respond(old) line 39:
this:read_misc_note - #74:attack(old) line 81:
this:read_misc_note - #74:drew_first_blood line 4:
this:read_misc_note
Source
1":read_misc_note(name)"; 2"View a miscellaneous note on the voodoo doll."; 3$local.rpg:secure(); 4{index} = args; 5for elm in (this.misc_notes) 6 {elm1, elm2} = elm; 7 if (elm1 == index) 8 return elm2; 9 endif 10endfor 11return E_PROPNF; 12"THX1138 16-DEC-1997 - Used a couple scatters to reduce the ticks.";
erase_misc_note
Referenced by
- #74:do_lifelink(old) line 7:
this:erase_misc_note - #74:do_lifelink(old) line 31:
this:erase_misc_note - #74:armour(old) line 20:
this:erase_misc_note
Source
1":erase_misc_note(name)"; 2"Remove a miscellaneous note from the voodoo doll."; 3if (!$local.rpg:trusted(caller_perms())) 4 return E_PERM; 5endif 6notes = this.misc_notes; 7index = args[1]; 8for i in [1..length(notes)] 9 if (notes[i][1] == index) 10 this.misc_notes = listdelete(notes, i); 11 size = length(notes) - 1; 12 if (size == 0) 13 clear_property(this, "misc_notes"); 14 endif 15 return size; 16 endif 17endfor 18return E_PROPNF; 19"Isagi 29-SEP-94: Use clear_property() to clear the list when it becomes empty.";
check_schedule
Referenced by
none
Source
1":check_schedule()"; 2"Check the items in the doll's schedule, firing those which need firing."; 3rpg = $local.rpg; 4if (valid(character = this.character) && (parent(character) != $garbage)) 5 toady = rpg.toady; 6else 7 rpg.recycler:_recycle(this); 8 return; 9endif 10if (schedule = this.att_schedule) 11 for line in (schedule) 12 {stat, time, mod, ?element = {}} = line; 13 if ((time() > time) && (time > 0)) 14 schedule = setremove(schedule, line); 15 cap = is_player(character) ? `rpg:match_skill(stat):cap(this) ! ANY => $maxint' | $maxint; 16 "Now check for other things affecting same stat."; 17 for line_two in (schedule) 18 rpg:s_i_f_i_n(); 19 if ((line_two[1] == stat) && (line_two != line)) 20 cap = cap + line_two[3]; 21 endif 22 endfor 23 this.(stat) = min(this.(stat) - mod, cap); 24 if (element) 25 toady:call_verb(element[1], element[2], {this, @element[4]}); 26 endif 27 if (schedule) 28 this.att_schedule = schedule; 29 else 30 clear_property(this, "att_schedule"); 31 endif 32 return 1; 33 elseif (!(mod || element)) 34 this.owner:tell(this); 35 endif 36 endfor 37endif 38if (this.schedule) 39 for line in (this.schedule) 40 {q1, q2, time, q4} = line; 41 "Extra (line in schedule) to be sure the element wasn't removed during a suspending call to toady."; 42 if ((line in this.schedule) && (time <= time())) 43 this.schedule = setremove(this.schedule, line); 44 result = (valid(q1) && (parent(q1) != $garbage)) ? `toady:call_verb(q1, q2, {this, @q4}) ! ANY' | 1; 45 if (typeof(result) == ERR) 46 raise(result, (((((((this.name + "'s schedule resulted in ") + tostr(result)) + " from a call to ") + $string_utils:nn(q1)) + ":") + q2) + " with args ") + $string_utils:from_list({this, @q4}, ", ")); 47 endif 48 return 1; 49 endif 50 endfor 51endif 52return 0; 53"THX1138 (#105941) - Tue Mar 24, 1998 - Added this verb to replace old system of att_scheduling. This now returns after servicing any one scheduled task. The next scheduled task can wait for the next clock/round, dammit."; 54"Hydros (#106189) - Wed Jan 26, 2004 - rpg:s_i_f_i_n() in line 18 as a quicksolve to tracebacks with Patch.";
wielding
Referenced by
- #74:hit_aggressor line 12:
this:wielding - #74:hit_aggressor line 12:
this:wielding - #74:respond line 27:
this:wielding - #74:respond_passed_numbers line 18:
this:wielding - #74:legal_target line 6:
this:wielding - #74:respond(old) line 27:
this:wielding
Source
1":wielding()"; 2"-> List of weapons this character is wielding,"; 3" or a list of natural weapons if wielding nothing."; 4return this.wielding || (this.hands ? this.natural_weapons | {}); 5"DR 17-AUG-94 -- Added hands check as per Isagi.";
add_claimed_object
Referenced by
none
Source
1":add_claimed_object(obj[, ignore_quota])"; 2"Add the given object to this.claimed_objects, keeping a record of all items claimed."; 3"If the total number of claimed objects is greater than or equal to this.max_claims, and ignore_quota is not given or false, E_QUOTA is returned."; 4rpg = $local.rpg; 5if (!rpg:trusted(caller_perms())) 6 return E_PERM; 7endif 8claimed_objs = this:claimed_objects(); 9ignore_quota = (length(args) > 1) && args[2]; 10if ((!ignore_quota) && (length(claimed_objs) >= this.max_claims)) 11 return E_QUOTA; 12else 13 this.claimed_objects = setadd(claimed_objs, args[1]); 14 return 1; 15endif 16"Profane 5-APR-95 20:03EST - s/.claimed_objects/:claimed_objects()/8";
remove_claimed_object
Referenced by
none
Source
1":remove_claimed_object(obj)"; 2"Remove the given object from this.claimed_objects."; 3rpg = $local.rpg; 4if (!rpg:trusted(caller_perms())) 5 return E_PERM; 6endif 7this.claimed_objects = setremove(this.claimed_objects, args[1]); 8return 1;
claimed_objects
Referenced by
- #74:add_claimed_object line 8:
this:claimed_objects
Source
1":claimed_objects()"; 2"Verify claimed objects list and return the clean result."; 3userobj = this.character; 4claimed = {}; 5for c in (this.claimed_objects) 6 if (`c.claimed_by ! ANY => $nothing' == userobj) 7 claimed = {@claimed, c}; 8 endif 9endfor 10return this.claimed_objects = claimed;
att_schedule
Referenced by
none
Source
1":att_schedule(STR attname, NUM time, NUM modifier, [LIST schedule element])"; 2" to be used in conjunction with :get_unmod_att() and :get_att_mod()"; 3" TIME is in the form of 'time()' plus a modifier. EX: 'time() + 3 * 60' means the change only lasts three minutes."; 4" => E_TYPE That attribute is not a number"; 5" => E_INVARG The modifier that you gave is not a number"; 6"<Schedule element> should be in the same form as a element for a doll's schedule: {OBJ Object on which verb is to be called, STR Name of verb, NUM dummy argument, LIST arguments to verb}/"; 7(rpg = $local.rpg):secure(); 8{att, time, mod, ?element = {}} = args; 9if (typeof(original = this.(att)) != NUM) 10 return E_TYPE; 11elseif (typeof(mod) != NUM) 12 return E_INVARG; 13elseif (!mod) 14 return E_NACC; 15elseif (rpg:approve_att_change(player, {this, att, newval = original + mod}, callers()) == E_PERM) 16 return E_PERM; 17endif 18schedule = this.att_schedule; 19if (typeof(schedule) != LIST) 20 schedule = {}; 21endif 22reset = {att, time, mod, element}; 23schedule = listappend(schedule, reset); 24this.att_schedule = schedule; 25this.(att) = newval; 26return {1, this.(att)}; 27"Mooshie (#106469) - Fri Jun 5, 1998 - Snuck in a check to $local.rpg:approve_att_change.";
get_unmod_att
Referenced by
- #74:improve line 18:
this:get_unmod_att
Source
1":get_unmod_att(STR attname) ==> NUM unmodified_attribute"; 2$local.rpg:secure(); 3{stat} = args; 4mod = this.(stat); 5try 6 for line in (this.att_schedule) 7 {what, dummy, plus, @rest} = line; 8 if (what == stat) 9 mod = mod - plus; 10 endif 11 endfor 12 return mod; 13except (ANY) 14 return mod; 15endtry 16"Mooshie (#106469) - Thu Feb 5, 1998 - Rewrote.";
magic_effects
Referenced by
none
Source
1":magic_effects(OBJ caster doll, OBJ target doll, NUM quality of spell, OBJ skill of spell) -- check objects affecting the target doll `magically' and give them a chance to influence/stop the spell."; 2{cdoll, doll, qual, spell, @extra} = args; 3(rpg = $local.rpg):secure(); 4effect = 0; 5ok_effect = $nothing; 6"Unlike :combat_effects(), we don't check the area's :magic_effect, since that's _offensive_, and this verb is _defensive_."; 7for effobj in (this.magic_effects) 8 if (`effobj.owner in rpg.gms ! ANY') 9 try 10 e = effobj:magic_effect(cdoll, doll, qual, spell); 11 ok_effect = effobj; 12 finally 13 if (ok_effect != effobj) 14 if (effobj in {this.character, rpg.monster}) 15 e = 0; 16 else 17 "If the verb on the _monster_ is broken, the monster is broken and we can just keep letting errors raise themselves."; 18 this.magic_effects = setremove(this.magic_effects, effobj); 19 e = E_NONE; 20 endif 21 endif 22 endtry 23 if (typeof(e) != NUM) 24 return e; 25 else 26 effect = effect + e; 27 endif 28 else 29 this.magic_effects = setremove(this.magic_effects, effobj); 30 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .magic_effects."; 31 rpg:log_error(msg); 32 endif 33endfor 34return effect; 35"Profane 18-MAY-97 -- Mail to magic_effect verb owner for errors."; 36"Mooshie (#106469) - Mon Nov 17 08:18:22 1997 PST - Get rid of effects that don't define a trusted :magic_effect verb"; 37"THX (#105941) - Thu Oct 14, 1999 - Removed all references to :magic_effect() calls and stopped checking magic_effect props on the dolls.";
hit_result
Referenced by
none
Source
1"(NUM dam, NUM pen, [OBJ whoby], [OBJ weapon])"; 2"returns 0 if there's no effect, or returns a list of the following values:"; 3"bad => a number from 0 (the attack bounced off this.character's armor) to 5 (he's dead, Jim)"; 4"place_name => a string indicating where this.character got hit."; 5"stun => 1 if this.character got stunned, 0 if not."; 6if (!(rpg = $local.rpg):trusted(caller_perms())) 7 return E_PERM; 8elseif (this.end <= 0) 9 return 0; 10endif 11{dam, pen, ?whoby = $nothing, ?weapon = $nothing} = args; 12me = this.character; 13bad = 0; 14stun = 0; 15shock = rpg.skills.shock; 16"...hacked to use hit_location_names 11-MAR-93 quinn..."; 17places = this:hit_location_names(); 18loc = {1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7}[random(11)]; 19loc = (loc > length(places)) ? random(length(places)) | loc; 20place_name = places[loc]; 21effect = 0; 22if (this.connect_effects && (effect = this:connect_effects(whoby, me, this.body_areas[loc], weapon, random(33), dam, pen, 1))) 23 if (typeof(effect) == NUM) 24 dam = dam - effect; 25 else 26 return 0; 27 endif 28endif 29"Quinn 11-AUG-93 0958: Hacked to send attacked and weapon to :armour."; 30dam = (dam - this:armour(pen, loc, whoby, weapon, dam)) / this.size; 31if (dam <= 0) 32 return {bad, place_name, stun}; 33endif 34inj = this.inj; 35this:mod_att("inj", dam); 36if (!(bad = (2 * dam) / this.end)) 37 bad = 1; 38elseif (bad == 1) 39 bad = 2; 40elseif (bad < 4) 41 bad = 3; 42else 43 bad = 4; 44endif 45try_ = rpg:resolve(me, shock, -{0, 10, 0, 20, 20, 20, 20}[loc]); 46if (try_ > (-2 * this.end)) 47 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, place_name, bad, dam}); 48 return {bad, place_name, stun}; 49elseif ((!inj) || (try_ > ((-4 * this.end) - {20, 40, 50, 80, 80, 55, 55}[loc]))) 50 this.act = this.act - 20; 51 if (this.act < -20) 52 this.act = -20; 53 endif 54 stun = 1; 55 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, place_name, bad, dam}); 56 return {bad, place_name, stun}; 57else 58 bad = 5; 59 this:die(whoby, weapon); 60 return {bad, place_name, stun}; 61endif 62"This verb is intended to eventually replace :receive_damage_passed_messages. As is, the aforementioned verb does not properly handle lightning or firebolts, strangulation, (as in 'fangs and crushing coils', object #906) cones of frost, (remember the wyverns?) or any other situation where one wishes to indicate severity and/or a stun result in an unconventional manner."; 63"THX1138 16-FEB-1997 - Scatter assignment and shot the heads off a few ticks."; 64"Profane (#30788) - Fri Oct 31 15:30:20 1997 PST - trap for the case of having less than 7 body areas.";
potential_total
Referenced by
- #74:potential_total line 12:
this:potential_total - #74:potential_total(old) line 13:
this:potential_total
Source
1":potential_total(skill) -> Total (percentage-based) possible rank for the given skill."; 2"Governing attributes are totaled and added to the raw rank for 'skill', then governing skills are each :potential_totaled in turn and the final sum is returned."; 3{stat} = args; 4(rpg = $local.rpg):secure(); 5att_obj = rpg:match_skill(stat); 6{deps1, deps2} = att_obj.dependant; 7skill = 25; 8for dep_att in (deps1) 9 skill = skill + 25; 10endfor 11for dep_att in (deps2) 12 skill = skill + this:potential_total(dep_att); 13endfor 14return skill;
get_atts
Referenced by
none
Source
1"Just like :get_att(), only returns multiple atts. Yum."; 2$local.rpg:secure(); 3stuff = {}; 4for att in (args) 5 stuff = {@stuff, this.(att)}; 6endfor 7return stuff; 8"Profane 31-AUG-96 1857PDT -- Added at Irin's suggestion. Save ticks from security check when getting big lists of a doll's atts.";
misc_effects
Referenced by
none
Source
1":misc_effect(<what>, [extra args....]) => returns a list of misc_effects on the doll, of the specified flag. The data is stored in .misc_effects, which is of the format (<object>, <effect>). The returned list is all return values of objects that have that particular effect."; 2rpg = $local.rpg; 3if (!rpg:trusted(caller_perms())) 4 return E_PERM; 5endif 6{eff_type, @extra_args} = args; 7results = {}; 8for effect in (this.misc_effects) 9 if (effect[2] == eff_type) 10 results = {@results, effect[1]:misc_effect(@extra_args)}; 11 endif 12endfor 13return results;
do_attack_notification
Referenced by
- #74:attack line 38:
this:do_attack_notification - #74:attack(old) line 35:
this:do_attack_notification
Source
1":do_attack_notification(target, weapon)"; 2"Do notification of this character attacking 'target' with 'weapon'."; 3(rpg = $local.rpg):secure(); 4{target, weapon} = args; 5"Notify both rooms if target is not in character's location."; 6folks_list = (by = this.character).location:contents(); 7if (target.location != by.location) 8 folks_list = {@folks_list, @target.location:contents()}; 9endif 10"Do an extra :notify_aggression if character is drawing first blood."; 11if (target in this.aggressor) 12 notlist = {"notify_attack"}; 13else 14 this:first_blood(by, target); 15 notlist = {"notify_aggression", "notify_attack"}; 16endif 17notargs = {setremove(folks_list, by), "", {by, target, weapon}}; 18for notverb in (notlist) 19 rpg.notifier:check_notification(@listset(notargs, notverb, 2)); 20endfor 21"Quinn 11-AUG-93 0902: Added. :notify_aggression is now called correctly."; 22"Froxx 4/11/94: suspend according to lag"; 23"Miles 6/16/94: $login:current_lag() => -1 so added abs() ..."; 24"... suggested fix by Dred ..."; 25"Irin -- Turned off to save ticks."; 26"THX 13-FEB-97: Version 1.8.0 update, de-ticked and re-added."; 27"THX 18-Jun-1997 -- s /$login:current_lag()/rpg.gm_lag/ in the :check_notification fork."; 28"Irin Tue Apr 14 22:23:33 1998 PDT -- Let $local.rpg.notifier handle the forking.";
maybe_tell_improve
Referenced by
- #74:improve line 20:
this:maybe_tell_improve
Source
1{skill, level} = args; 2rpg = $local.rpg; 3if ((parent(skill) == rpg.skill_object) || (skill.aliases[1] in rpg.magic_db.peaceful_spells)) 4 "elseif ((level < 6) || this:false_fight())"; 5elseif (this:false_fight()) 6 return; 7endif 8rpg:secure(); 9choices = {"proficient", "secure", "competent", "capable"}; 10rpg:tell_damage(this.character, "You feel more ", choices[random($)], " ", rpg.skills:skill_action_msg(skill), "."); 11"Mooshie (#106469) - Mon Oct 6 23:17:02 1997 PDT - Stream-lined a bit and hacked to use $local.rpg.skills:skill_action_msg"; 12"Profane (#30788) - Tue Jan 6, 1998 - added highlighting bit"; 13"Mooshie (#106469) - Mon Dec 28, 1998 - Highlighting through $local.rpg:tell_damage."; 14"Hydros (#106189) - Fri Mar 11, 2005 - Removed the bit about level < 6. Why shouldn't you be able to see yourself improving at low levels?";
false_fight
Referenced by
- #74:maybe_tell_improve line 5:
this:false_fight
Source
1"for t in (this.aggressor)"; 2" if (is_player(t))"; 3" \"THX (#105941) - Sun Mar 21, 1999 - If you're sparring with only a player, you get no messages. Why? Because macroers like to use second characters ... legal alts or otherwise.\";"; 4" else"; 5return 0; 6" endif"; 7"endfor"; 8"return 1;"; 9"Hydros (#106189) - Fri Mar 11, 2005 - While I don't condone or condemn the use of alts for sparring, I'd note that this change has not actually stopped the practice. Thus, it has been nullified.";
add_light(obsolete)
Referenced by
none
Source
1"Usage: add_light(OBJ light) => Adds object to this.lights"; 2" remove_light(ANY light) => Removes element from this.lights"; 3$local.rpg:secure(); 4{what} = args; 5where = what in this.lights; 6if (verb == "add_light") 7 if (where) 8 else 9 this.lights = {@this.lights, what}; 10 this.light_values = {@this.light_values, {0, 0}}; 11 this:update_light(what); 12 endif 13else 14 if (where) 15 this.lights = listdelete(this.lights, where); 16 this.light_values = listdelete(this.lights, where); 17 this:check_lights(); 18 endif 19endif 20return this.lights; 21"Mooshie (#106469) - Mon Jan 19, 1998 - Added.";
check_lights(obsolete)
Referenced by
none
Source
1if ($local.rpg:trusted(caller_perms())) 2 total = room_total = 0; 3 val = this.light_values; 4 for light in (lights = this.lights) 5 indx = light in lights; 6 {doll, room} = vals; 7 total = total + doll; 8 room_total = room_total + room; 9 endfor 10 this.room_light = room_total; 11 this.light = total; 12else 13 return E_PERM; 14endif
armour
Referenced by
- #74:receive_damage line 31:
this:armour - #74:receive_damage_passed_messages line 28:
this:armour - #74:hit_result line 30:
this:armour - #74:receive_damage(old) line 23:
this:armour
Source
1":armour(penetration, hit-location[, attacker, weapon-used, damage]) => NUM amount of protection this.character has at hit-location."; 2"{pen, loc, attacker, weapon, ?dam = 0, @useless_cruft} = args;"; 3(rpg = $local.rpg):secure(); 4if (rpg:trusted_verb(char = this.character, verb)) 5 return char:armour(@args); 6else 7 return this:protection(@args); 8endif
setadd_att setremove_att listappend_att listdelete_att listset_att
Referenced by
none
Source
1"Usage: *_att(STR att, @ARGS)"; 2"Attempts to set the given at to the value returned by:"; 3"BUILTIN(current att value, @ARGS) => Where `BUILTIN' is the beginning of whatever verb name is used."; 4""; 5"Example:"; 6";#doll.combat_effects"; 7"=> {#2}"; 8";#doll:setadd_att(\"combat_effects\", #3)"; 9"=> {#2, #3}"; 10(rpg = $local.rpg):secure(); 11{att, @rest} = args; 12try 13 result = call_function(verb[1..$ - 4], this.(att), @rest); 14except e (ANY) 15 return e[1]; 16endtry 17return (rpg:approve_att_change(player, {this, result}, callers()) == E_PERM) ? E_PERM | this:set_att(att, result); 18"Mooshie (#106469) - Sat Feb 14, 1998 - Added.";
immobilized immobilised
Referenced by
none
Source
1"Returns a string if the doll.character has been immobilized by some dastardly effect incl. old-style paralysis"; 2$local.rpg:secure(); 3return this:cannot_move(); 4"THX (#105941) - Wed Apr 8, 1998 - This verb is for gamemasters to call the (speedier) :cannot_move() that is used in the combat core.";
check_ins
Referenced by
none
Source
1"Copied from $local.rpg.doll (#1325):check_ins by Irin (#106049) Fri Feb 27 00:33:38 1998 PST"; 2":check_ins(INT amount) => Slam the poor schmuck with mental damage. amount should be 5-20 for minimal effect, 30-70 for moderate effect, and 100+ for major effect. Now we nail them with stat loss if they're too fatigued."; 3{val, ?announce = 1} = args; 4(rpg = $local.rpg):secure(); 5rpg.ins_callers = setadd(rpg.ins_callers, callers()[1][2..4]); 6by = this.character; 7amt = (val * 2) / this.wil; 8resolve = rpg:resolve(by, "sanity", 50 - val, callers()[1][4] == rpg.dungeon); 9if (resolve < (-(170 + this.sanity))) 10 this.ins = (this.ins + 3) + (3 * amt); 11 if (is_player(by) && (callers()[1][2] != "depress")) 12 this.act = (-$minint) / 2; 13 this.last_attack = time() + 900; 14 stat = {"int", "emp", "wil"}[random($)]; 15 if ((random(5) == 1) && (this.(stat) > (7 + random(7)))) 16 this.(stat) = this.(stat) - 1; 17 announce && rpg:playertell(by, ("Extreme mental stress has caused your " + rpg.skills.(stat):title()) + " to fade."); 18 endif 19 endif 20 announce && rpg:playertell(by, "You just can't take the stress anymore. You curl up in a ball and start to whimper."); 21 announce && rpg:rpg_announce_all_but(by.location, {by}, by.name, " just can't take it anymore. ", by.ps, " curls up in a ball and starts to whimper."); 22elseif (resolve < -50) 23 this.act = this.act - 30; 24 this.ins = (this.ins + 2) + (2 * amt); 25 announce && rpg:playertell(by, "Your vision blurs and you cannot help but start to gibber."); 26 announce && rpg:rpg_announce_all_but(by.location, {by}, by.name, "'s eyes glaze over, and ", by.ps, " begins to gibber."); 27elseif (resolve < 0) 28 this.act = this.act - 15; 29 this.ins = (this.ins + 1) + ((3 * amt) / 2); 30 announce && rpg:playertell(by, "You hold your head and scream in mental anguish."); 31 announce && rpg:rpg_announce_all_but(by.location, {by}, by.name, " holds ", by.pp, " head and screams in mental anguish."); 32else 33 this.ins = this.ins + amt; 34endif
chemical_effects
Referenced by
none
Source
1"Snagged from $local.rpg.doll (#1325):chemical_effects by Irin (#106049) Mon Mar 23 08:47:00 1998 PST"; 2":chemical_effects(OBJ source, OBJ chemical, INT qual) => Return a number that affects the quality. Negative decreases quality, positive increases. Or, a non INT value to cancel the chemical."; 3(rpg = $local.rpg):secure(); 4{source, chemical, qual} = args; 5effect = 0; 6ok_effect = $nothing; 7for effobj in (this.chemical_effects) 8 if (`effobj.owner in rpg.gms ! ANY') 9 try 10 e = effobj:chemical_effect(this, source, chemical, qual); 11 ok_effect = effobj; 12 finally 13 if (effobj != ok_effect) 14 this.chemical_effects = setremove(this.chemical_effects, effobj); 15 e = 0; 16 endif 17 endtry 18 if (typeof(e) != INT) 19 return e; 20 else 21 effect = effect + e; 22 endif 23 else 24 this.chemical_effects = setremove(this.chemical_effects, effobj); 25 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .chemical_effects."; 26 rpg:log_error(msg); 27 endif 28endfor 29return effect;
receive_damage_poison
Referenced by
none
Source
1"Copied from $local.rpg.doll (#1325):receive_damage_poison by Irin (#106049) Wed Mar 11 20:56:06 1998 PST"; 2":receive_damage_poison(OBJ source, OBJ poison, INT quality, LIST body areas)"; 3"Some random poison has affected the target. Nail em with it."; 4(rpg = $local.rpg):secure(); 5{source, poison, qual, areas} = args; 6target = this.character; 7for area in (areas) 8 if (!(area in this.body_areas)) 9 areas = setremove(areas, area); 10 endif 11endfor 12if (is_player(target)) 13 return poison:effect(this, source, qual, areas); 14else 15 return this.character:receive_damage_poison(@args); 16endif
acceptable
Referenced by
none
Source
1{thing} = args; 2for item in (callers()) 3 if (item[1..4] == {#1140, "new_direction", #2693, #1140}) 4 return 1; 5 endif 6endfor
combat_effects
Referenced by
- #74:attack line 15:
this:combat_effects - #74:attack(old) line 15:
this:combat_effects
Source
1"Snagged from $local.rpg.doll (#1325):combat_effects by Irin (#106049) Mon Mar 23 09:09:46 1998 PST"; 2":combat_effect(target[, weapon])"; 3"Give the attacker's location, and any objects affecting em, a chance to influence combat."; 4"The `combat effects' property should be a list of objects whose :combat_effect verb will be called with the args (by, target, weapon)."; 5"If a non-Numeric value is returned by any object, the attack is cancelled."; 6"Else, the sum of all effects is returned as a mod to the attack."; 7(rpg = $local.rpg):secure(); 8by = this.character; 9{target, ?weapon = rpg.weapon} = args; 10effect = 0; 11if (rpg:trusted_verb(by.location, "combat_effects") && (typeof(effect = by.location:combat_effects(by, target, weapon)) != NUM)) 12 "Room stopped the combat."; 13 return effect; 14endif 15ok_effect = $nothing; 16for effobj in (this.combat_effects) 17 if (`effobj.owner in rpg.gms ! ANY') 18 try 19 e = effobj:combat_effect(by, target, weapon); 20 ok_effect = effobj; 21 finally 22 if (effobj != ok_effect) 23 this.combat_effects = setremove(this.combat_effects, effobj); 24 e = 0; 25 endif 26 endtry 27 if (typeof(e) != INT) 28 return e; 29 else 30 effect = effect + e; 31 endif 32 else 33 this.combat_effects = setremove(this.combat_effects, effobj); 34 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .combat_effects."; 35 rpg:log_error(msg); 36 endif 37endfor 38return effect; 39"Profane 25-MAY-97 2306PDT -- mail errors to owner of effobj."; 40"Mooshie (#106469) - Mon Nov 17 08:21:03 1997 PST - Added check for trusted :combat_effect verb. Remove if effobj doesn't have one."; 41"Irin March-98 -- Let's try letting errors go through and make cute lil TBs."; 42"Mooshie (#106469) - Sun Mar 3, 2002 - The call to the room's :combat_effect had been misspelled as :combat_effects with an 's'. There don't appear to be any descendents of $local.rpg.dungeon that define :combat_effects verbs, though, so I've changed it back."; 43"Profane (#30788) - Wed Mar 6, 2002 - um no. you broke it, it should be calling :combat_effectS. changed back";
att_unschedule
Referenced by
none
Source
1":att_unschedule(STR attname, NUM time, NUM modifier, [LIST schedule element])"; 2" to be used in conjunction with :get_unmod_att() and :get_att_mod()"; 3" TIME is in the form of 'time()' plus a modifier. EX: 'time() + 3 * 60' means the change only lasts three minutes."; 4" => E_TYPE That attribute is not a number"; 5" => E_INVARG The modifier that you gave is not a number"; 6"<Schedule element> should be in the same form as a element for a doll's schedule: {OBJ Object on which verb is to be called, STR Name of verb, NUM dummy argument, LIST arguments to verb}/"; 7$local.rpg:secure(); 8{att, time, mod, ?element = {}} = args; 9if (typeof(this.(att)) != NUM) 10 return E_TYPE; 11elseif (typeof(mod) != NUM) 12 return E_INVARG; 13endif 14if (typeof(schedule = this.att_schedule) == LIST) 15 reset = {att, time, mod, element}; 16 for t in (schedule) 17 if (t == reset) 18 this.att_schedule = setremove(schedule, reset); 19 this.(att) = this.(att) - mod; 20 return {1, this.(att)}; 21 endif 22 endfor 23else 24 this.att_schedule = {}; 25endif 26return 0;
may_not_move cannot_cast cannot_attack cannot_defend cannot_move cannot_talk cannot_emote cannot_hear cannot_see cannot_smell cannot_walk cannot_wake cannot_stand cannot_rest cannot_sleep cannot_take cannot_resolve
Referenced by
- #74:respond line 19:
this:cannot_defend - #74:act line 2:
this:cannot_cast - #74:act line 5:
this:cannot_attack - #74:respond_passed_numbers line 13:
this:cannot_defend - #74:legal_target line 9:
this:cannot_attack - #74:immobilized line 3:
this:cannot_move - #74:respond(old) line 19:
this:cannot_defend - #74:act(old) line 2:
this:cannot_cast - #74:act(old) line 5:
this:cannot_attack
Source
1":cannot_*([FLAG announce]) => Is who allowed to do whatever. Consult all active .freeze_effects. If any freezing effect returns true, return true."; 2"If announce is true, the effect should tell this.character why they're paralyzed. Otherwise, don't."; 3"Freeze_effects should probably try to remove themselves if they're not in use, so as to be nice to the tickbeast."; 4for call in (callers()) 5 if (call[2] == "cannot_see") 6 return this.paralyzed; 7 endif 8endfor 9if (f = this.freeze_effects) 10 {?announce = 0} = args; 11 announce = announce && is_player(this.character); 12 $local.rpg:secure(); 13 type = verb[8..$]; 14 for effect in (f) 15 if (r = effect:frozen(this, type, announce)) 16 return r; 17 endif 18 endfor 19endif 20"-- Begin temporary hack that should be deleted as soon as paralysis is tranfered. --"; 21"for t in (this.combat_effects)"; 22" if (t in $local.rpg.object_db.immobilized_effects)"; 23" return t.paralyzed_msg;"; 24" endif"; 25"endfor"; 26"-- End cheap hack --"; 27return this.paralyzed; 28"THX (#105941) - Tue Feb 1, 2000 - Commented cheap hack.";
armour_effects
Referenced by
- #74:respond line 13:
this:armour_effects - #74:respond(old) line 13:
this:armour_effects
Source
1":armour_effects(OBJ attacker, NUM quality, NUM damage, OBJ weapon, OBJ loc) -- check objects affecting the target doll `armourally' and give them a chance to influence/stop the attack."; 2(rpg = $local.rpg):secure(); 3{by, qual, dam, weapon, loc} = args; 4"Unlike :combat_effects(), which is _offensive_, this verb is _defensive_."; 5effect = 0; 6ok_effect = $nothing; 7for effobj in (this.armour_effects) 8 if (`effobj.owner in rpg.gms ! ANY') 9 try 10 e = effobj:armour_effect(by, qual, dam, weapon, loc); 11 ok_effect = effobj; 12 finally 13 if (ok_effect != effobj) 14 if (effobj in {this.character, rpg.monster}) 15 e = 0; 16 else 17 "If the verb on the _monster_ is broken, the monster is broken and we can just keep letting errors raise themselves."; 18 this.armour_effects = setremove(this.armour_effects, effobj); 19 e = E_NONE; 20 endif 21 endif 22 endtry 23 if (typeof(e) == NUM) 24 effect = effect + e; 25 else 26 return e; 27 endif 28 else 29 this.armour_effects = setremove(this.armour_effects, effobj); 30 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .armour_effects."; 31 rpg:log_error(msg); 32 endif 33endfor 34return effect;
aggressor
Referenced by
none
Source
1":aggressor() => returns a list of foes who are in combat with this.character. Automatically cleans out the aggressor list of things not in room."; 2$local.rpg:secure(); 3loc = this.character.location; 4for n in (this.aggressor) 5 if (`n.location != loc ! ANY => 1') 6 this.aggressor = setremove(this.aggressor, n); 7 endif 8endfor 9this.aggressor = setremove(this.aggressor, this.character); 10return this.aggressor;
detect_magic_msg
Referenced by
none
Source
1"The default doll detect magic should just look at magic_effects and report anything that has a valid detect_magic_msg."; 2{bydoll, qual} = args; 3(rpg = $local.rpg):secure(); 4{rpgdoll, o_u, msg} = {rpg.doll, $object_utils, {}}; 5for d in ($set_utils:union(this.magic_effects, this.view_effects)) 6 if (parent(d) == rpgdoll) 7 "Remove teammates ... otherwise players will detect all the objects in Eir temmate's magic_effects too."; 8 elseif (o_u:has_callable_verb(d, "detect_magic_msg")) 9 msg = {@msg, @(typeof(f = d:detect_magic_msg(bydoll, qual)) == LIST) ? f | {f}}; 10 endif 11endfor 12"Could possibly scroll through doll's players contents for rpg objects, but that would be costly, plus we're not intending to have a target for Perceiving the Powers of Magic, so it would be painful to figure out if this is the caster's doll. Just make them drop stuff on the ground before casting detect!"; 13return msg; 14"Dred 2-12-99: Created new spell result."; 15"THX (#105941) - Sat May 27, 2000 - Changed the callers() slice check to just remove all rpg.doll kids from the doll's magic_effects for the purposes of detect."; 16"THX (#105941) - Fri May 18, 2001 - Changed to go through UNION of magic_effects and view_effects.";
casting_effects
Referenced by
none
Source
1":casting_effects(OBJ caster doll, OBJ target doll, NUM quality of spell, OBJ skill of spell) -- check objects affecting the caster doll `magickally' and give them a chance to influence/stop the spell."; 2(rpg = $local.rpg):secure(); 3{cdoll, doll, qual, spell} = args; 4ok_effect = $nothing; 5effect = 0; 6for effobj in (this.casting_effects) 7 if (`effobj.owner in rpg.gms ! ANY') 8 try 9 e = effobj:casting_effect(cdoll, doll, qual, spell); 10 ok_effect = effobj; 11 finally 12 (ok_effect == effobj) || (e = 0); 13 endtry 14 if (typeof(e) != NUM) 15 return e; 16 else 17 effect = effect + e; 18 endif 19 else 20 this.casting_effects = setremove(this.casting_effects, effobj); 21 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .casting_effects."; 22 rpg:log_error(msg); 23 endif 24endfor 25return effect;
encumbrance(old)
Referenced by
none
Source
1":encumbrance() -> Total encumbrance of this character. Usually [0..10]."; 2if ((!is_player(char = this.character)) && (load = `char:encumbrance() ! E_VERBNF, E_PERM')) 3 return load; 4endif 5if (strength = this.str) 6 if (typeof(this.weight) == NUM) 7 return this.weight / strength; 8 else 9 return (this.weight = ((rpg = $local.rpg):weight(char, this) + (strength / 2)) + ((rpg.magic_db.en_combat_effect in this.combat_effects) * 9)) / strength; 10 endif 11else 12 return 0; 13endif 14"Quinn 21-AUG-93 0706: Hacked to return character:encumbrance if exists and is owned by a GM."; 15"Profane 2/5/95 13:48EST - fixed use of `STR' as a variable name."; 16"StarDancer Oct 21 06:39 1995 PDT - took out call to $object_utils:has_callable_verb, made verb !d"; 17"THX1138 01-Jul-1997 -- added additional encumbrance due to entanglement ... broke it ... then made the verb +d.";
clear_good_spells
Referenced by
none
Source
1$local.rpg:secure(); 2n = 0; 3for t in (this.schedule) 4 {what, effect, time, various} = t; 5 n = n + 1; 6 if (effect in {"unwind", "unwall", "unbark", "unstone", "unreverse", "unbladebarrier", "unviper", "unbackfire"}) 7 this.schedule[n][3] = time(); 8 elseif (effect == "unspeed") 9 if (various[1] > this.slowness) 10 "They're hasted..."; 11 this.schedule[n][3] = time(); 12 endif 13 endif 14endfor
first_blood
Referenced by
- #74:do_attack_notification line 14:
this:first_blood
Source
1":first_blood(OBJ attacking character, OBJ target character)"; 2"Mark this doll (which should be the doll of BY, making that argument redundant, but whatever) with a `First Blood' note if BY has attacked TARGET first. Since this has no meaning for NPCs, call this verb only in PvP situations."; 3{by, target} = args; 4rpg = $local.rpg; 5if ((is_player(target) && is_player(by)) && (caller_perms() == rpg.owner)) 6 if ((note = this:read_misc_note(verb)) != E_PROPNF) 7 for t in (note) 8 {who, time} = t; 9 if ((time() > time) || (who == target)) 10 note = setremove(note, t); 11 endif 12 endfor 13 else 14 note = {}; 15 endif 16 "Check for teammates with first blood:"; 17 locations = setadd({by.location}, target.location); 18 tdoll = rpg:get_doll(target); 19 for item in ({tdoll, @tdoll.armour_effects}) 20 if (((parent(item) == rpg.doll) && (item.character.location in locations)) && item:drew_first_blood(by)) 21 return; 22 "i.e. If I'm hitting back at my attacker (who attacked me first and thus has first blood), I do not get first blood on anyone e's teamed with."; 23 endif 24 endfor 25 if ((this.duelee == target) && (tdoll.duelee == by)) 26 return; 27 endif 28 (by == target) || this:write_misc_note(verb, {@note, {target, time() + 9999}}); 29endif 30"Profane (#30788) - Sat May 19, 2001 - Add teammate checking to avoid 3rd party guilt-free pk-ing."; 31"Profane (#30788) - Thu May 31, 2001 - new bit for duels- no first blood marks."; 32"THX (#105941) - Wed Jun 6, 2001 - Added check for teammate location to prevent certain cases of exploitation of this new rule.";
add_teammate remove_teammate
Referenced by
none
Source
1":add_teammate(doll) - Adds (removes) 'this' to (from) doll's armour and magic effects."; 2{doll} = args; 3if ($local.rpg:is_grandmaster(caller_perms())) 4 if (index(verb, "re")) 5 doll.armour_effects = setremove(doll.armour_effects, this); 6 doll.magic_effects = setremove(doll.magic_effects, this); 7 else 8 parent = parent(this); 9 n = 1; 10 for t in (doll.armour_effects) 11 if (n) 12 if (this in doll.armour_effects) 13 n = 0; 14 elseif (parent(t) != parent) 15 doll.armour_effects = listinsert(doll.armour_effects, this, n); 16 n = 0; 17 endif 18 n && (n = n + 1); 19 endif 20 endfor 21 (this in doll.armour_effects) || (doll.armour_effects = setadd(doll.armour_effects, this)); 22 n = 1; 23 for t in (doll.magic_effects) 24 if (n) 25 if (this in doll.magic_effects) 26 n = 0; 27 elseif (parent(t) != parent) 28 doll.magic_effects = listinsert(doll.magic_effects, this, n); 29 n = 0; 30 endif 31 n && (n = n + 1); 32 endif 33 endfor 34 (this in doll.magic_effects) || (doll.magic_effects = setadd(doll.magic_effects, this)); 35 endif 36else 37 raise(E_PERM); 38endif
armour_effect
Referenced by
none
Source
1{char, teammate} = {this.character, caller.character}; 2if (char.location == teammate.location) 3 {by, qual, dam, weapon, loc} = args; 4 if (by == teammate) 5 return 0; 6 elseif (by == char) 7 (rpg = $local.rpg):secure(); 8 doll = rpg:get_doll(by); 9 doll:remove_teammate(caller); 10 caller:remove_teammate(doll); 11 return 0; 12 elseif (by in this.aggressor) 13 else 14 (rpg = $local.rpg):secure(); 15 if (valid(doll = rpg:get_doll(by)) && (doll:drew_first_blood(teammate) || ((!is_player(by)) && (!(by in caller.aggressor))))) 16 doll:first_blood(by, char); 17 this.aggressor = setadd(this.aggressor, by); 18 doll.aggressor = setadd(doll.aggressor, char); 19 else 20 return 0; 21 endif 22 endif 23 return this.melee / 12; 24endif 25return 0; 26"THX (#105941) - Sat Oct 9, 1999 - This is the teammate effect for the doll. Don't confuse this with doll:armour_effects.";
magic_effect
Referenced by
none
Source
1{char, teammate} = {this.character, caller.character}; 2if (char.location == teammate.location) 3 {doll, qual, skillobj, target_doll} = args; 4 by = doll.character; 5 if (by == teammate) 6 return 0; 7 elseif (by == char) 8 $local.rpg:secure(); 9 doll:remove_teammate(caller); 10 caller:remove_teammate(doll); 11 return 0; 12 elseif (by in this.aggressor) 13 else 14 (rpg = $local.rpg):secure(); 15 if (valid(doll) && (doll:drew_first_blood(teammate) || ((!is_player(by)) && (!(by in caller.aggressor))))) 16 doll:first_blood(by, char); 17 this.aggressor = setadd(this.aggressor, by); 18 doll.aggressor = setadd(doll.aggressor, char); 19 else 20 return 0; 21 endif 22 endif 23 return (this.melee + this.magic_theory) / 12; 24endif 25return 0; 26"THX (#105941) - Sat Oct 9, 1999 - This is the teammate effect for the doll. Don't confuse this with doll:magic_effects.";
do_lifelink(old)
Referenced by
none
Source
1"Do the injury distribution for a lifelink."; 2if ((rpg = $local.rpg):trusted(caller_perms())) 3 {inj, link} = args; 4 who = this.character; 5 {other, qual} = link; 6 if (!valid(doll = rpg:get_doll(other))) 7 this:erase_misc_note("lifelink"); 8 return; 9 endif 10 curr = this.inj; 11 amt = inj - curr; 12 amt1 = amt / 2; 13 amt2 = amt - amt1; 14 if (!(this.deathless && (amt2 < 0))) 15 this.inj = max(this.inj + amt2, 0); 16 endif 17 if (valid(doll) && (!(doll.deathless && (amt1 < 0)))) 18 doll.inj = max(doll.inj + amt1, 0); 19 endif 20 qual = qual - abs(amt); 21 rpg:playertell(who, "You feel some of your ", (amt2 > 0) ? "pain" | "health", " drain away through your lifelink with ", other.name, "."); 22 if (amt1 > 0) 23 rpg:playertell(other, "You scream in pain as wounds mystically appear on your body!"); 24 rpg:rpg_announce_all_but(other.location, {other}, $string_utils:pronoun_sub("%N %<screams> in pain as wounds mystically appear on %p body.", other)); 25 else 26 rpg:playertell(other, "Your wounds mystically heal!"); 27 rpg:rpg_announce_all_but(other.location, {other}, other.name, "'s wounds mystically heal!"); 28 endif 29 if (rpg.skills.lifelink:resolve(who, qual) < 1) 30 doll:erase_misc_note("lifelink"); 31 this:erase_misc_note("lifelink"); 32 rpg:playertell(who, "Your lifelink with ", other.name, " collapses from the strain!"); 33 rpg:playertell(other, "Your lifelink with ", who.name, " collapses from the strain!"); 34 else 35 this:write_misc_note("lifelink", {other, qual}); 36 doll:write_misc_note("lifelink", {who, qual}); 37 endif 38else 39 return E_PERM; 40endif 41"THX1138 16-FEB-1997 - Got rid of a couple list indexings with a scatter and vaporized a couple ticks.";
magic_effect(old)
Referenced by
none
Source
1":magic_effects(OBJ caster doll, OBJ target doll, NUM quality of spell, OBJ skill of spell) -- check objects affecting the target doll `magically' and give them a chance to influence/stop the spell."; 2{cdoll, doll, qual, spell, @extra} = args; 3(rpg = $local.rpg):secure(); 4effect = $object_utils:has_property(doll, "magic_effect") ? doll.magic_effect | 0; 5(parent(doll) == #74) || (rpg.owner.magic_effect_argdoll = setadd(rpg.owner.magic_effect_argdoll, doll)); 6"Unlike :combat_effects(), we don't check the area's :magic_effect, since that's _offensive_, and this verb is _defensive_."; 7ok_effect = $nothing; 8for effobj in (this.magic_effects) 9 if (`effobj.owner in rpg.gms ! ANY') 10 try 11 e = effobj:magic_effect(cdoll, doll, qual, spell); 12 ok_effect = effobj; 13 finally 14 if (ok_effect != effobj) 15 if (effobj in {this.character, rpg.monster}) 16 e = 0; 17 else 18 "If the verb on the _monster_ is broken, the monster is broken and we can just keep letting errors raise themselves."; 19 this.magic_effects = setremove(this.magic_effects, effobj); 20 e = E_NONE; 21 endif 22 endif 23 endtry 24 if (typeof(e) != NUM) 25 return (verb == "magic_effect") ? -200 | e; 26 else 27 effect = effect + e; 28 endif 29 else 30 this.magic_effects = setremove(this.magic_effects, effobj); 31 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .magic_effects."; 32 rpg:log_error(msg); 33 endif 34endfor 35if (verb == "magic_effect") 36 rpg.owner.magic_effect_callers = setadd(rpg.owner.magic_effect_callers, (parent(caller) == #74) ? #74 | caller); 37 return qual - effect; 38else 39 return effect; 40endif 41"Profane - 2/4/95 11:17EST - Added."; 42"Profane - 2/7/95 11:04EST - Added check for any .magic_effect prop on target doll (which shouldn't be there, but for backwards compatibility..)"; 43"Renamed verb to ``magic_effect*s'', if called as ``magic_effect'' will always return numeric value, again for backwards compatibility. Moved old :magic_effect to ``magic_effect(old)''."; 44"THX1138 16-FEB-1997 - Scatter assignment and killed a couple ticks."; 45"Profane 18-MAY-97 -- Mail to magic_effect verb owner for errors."; 46"Mooshie (#106469) - Mon Nov 17 08:18:22 1997 PST - Get rid of effects that don't define a trusted :magic_effect verb"; 47"Irin Wed Mar 25 15:18:06 1998 PST less ticks. Tastes great.";
die(old)
Referenced by
none
Source
1":die(whoby OBJ [, weapon OBJ])"; 2(rpg = $local.rpg):secure(); 3{whoby, ?weapon = $nothing} = args; 4cp = caller_perms(); 5if (is_player(this.character) && (typeof(`idle_seconds(this.character) ! ANY') == ERR)) 6 return E_INVIND; 7elseif (this:incorporeal(weapon)) 8 return 0; 9endif 10victim = this.character; 11where = victim.location; 12if (typeof(effect = this:death_effects(whoby)) != NUM) 13 "If a :death_effect does not return a number, then abort the death."; 14 return effect; 15endif 16contents = where:contents(); 17fork (2 * rpg.gm_lag) 18 rpg:check_notification(contents, "notify_death", {victim, whoby}); 19endfork 20"if (link = this:read_misc_note(\"lifelink\"))"; 21" {linkee, qual} = link;"; 22" doll = rpg:get_doll(linkee);"; 23" this:erase_misc_note(\"lifelink\");"; 24" doll:erase_misc_note(\"lifelink\");"; 25" rpg:say_action(\"%N %<collapses> to the ground, crying out in pain and anguish!\", linkee);"; 26" rpg:playertell(linkee, \"Your lifelink with \", this.character.name, \" collapses in a surge of negative energy -- \", this.character.name, \" has died!\");"; 27" if ((rpg.skills.shock:resolve(linkee, qual) < 1) && (doll.end > 1))"; 28" rpg:playertell(linkee, \"As the negative energies surge through you, you feel a portion of your vitality drain away!\");"; 29" doll:att_schedule(\"end\", time() + (((60 * 60) * 24) * 3), -1);"; 30" endif"; 31"endif"; 32"Check poisoning:"; 33"for item in (rpg.poison.data)"; 34" if (item[2] == this)"; 35" rpg.poison.data = setremove(rpg.poison.data, item);"; 36" endif"; 37"endfor"; 38"Un `freeze' 'em"; 39"rpg.magic_db.hf_combat_effect:remove_held(this);"; 40"rpg.magic_db.is_combat_effect:remove_shelled(this);"; 41if (is_player(victim)) 42 (victim == victim.owner) && rpg.death_db:record_death(cp = valid(cp) ? cp | caller, whoby); 43 rpg:die(this); 44else 45 victim.alive = 0; 46 victim:die(whoby); 47 `this.aggressor = {} ! ANY'; 48endif 49"Profane 27-JAN-96 1405EST -- Added lifelink bit."; 50"Irin Tue Apr 22 11:21:43 1997 PDT -- Disconnected players don't die."; 51"THX - 23-Apr-1997 -- Set monster.alive to 0 before passing to monster:die() since they take so long sometimes."; 52"Profane (#30788) - Wed Oct 7, 1998 - cancel delayed poisoning of dead people. what a mess this verb is becoming."; 53"Profane (#30788) - Sat Feb 13, 1999 - try calls to iceshell and holdfoe removes to see if that helps clean those objects up."; 54"THX (#105941) - Wed Oct 13, 1999 - Commented out the explicit lifelink, poison, holdfoe, and iceshell checks and changed them all to use death_effect.";
armour(old)
Referenced by
none
Source
1":armour(penetration, hit-location[, attacker, weapon-used, damage]) => NUM amount of protection this.character has at hit-location."; 2(rpg = $local.rpg):secure(); 3{pen, loc, attacker, weapon, ?dam = 0, @useless_cruft} = args; 4char = this.character; 5if (info = this:read_misc_note("force_wall")) 6 {c_doll, amount} = info; 7 caster = `c_doll.character ! E_PROPNF, E_INVIND => char'; 8 plus = rpg:resolve(caster, "forcewall", amount - (dam / 10), (!typeof(`connected_seconds(caster) ! ANY')) == INT); 9 caster = (is_player(caster) && (`idle_seconds(caster) ! ANY => 181' > rpg.idle_threshold)) ? char | caster; 10 c_doll = rpg:get_doll(caster); 11 this:write_misc_note("force_wall", {c_doll, amount - 1}); 12 if (plus < (random(5) + ((random(30) == 1) ? random(35) | 0))) 13 this.magic_effects = setremove(this.magic_effects, rpg.magic_db.fw_combat_effect); 14 this.combat_effects = setremove(this.combat_effects, rpg.magic_db.fw_combat_effect); 15 for n in (this.schedule) 16 if (n[2] == "unwall") 17 this:cancel(n); 18 endif 19 endfor 20 this:erase_misc_note("force_wall"); 21 rpg:say_action("The shield of magickal force around %n shatters from the blow. Tiny shimmering glasslike shards are hurled outward in an impressive, if harmless, display of magickal energies.", char); 22 rpg:playertell(caster, ("A backlash of magickal energies from your forcewall " + ((caster == char) ? "" | (("around " + char.name) + " "))) + "briefly distorts your senses."); 23 c_doll:check_ins(dam / 5); 24 plus = 0; 25 elseif (plus < 25) 26 if (random(5) == 1) 27 if (caster == char) 28 rpg:playertell(caster, "You struggle to maintain your wall of force."); 29 rpg:rpg_announce_all_but(char.location, {char}, "The shield of magickal force around ", char.name, " fluctuates with the force of the blow."); 30 else 31 rpg:playertell(caster, ("You struggle to maintain the wall of force around " + char.name) + "."); 32 rpg:say_action("The shield of magickal force around %n fluctuates with the force of the blow.", char); 33 endif 34 endif 35 c_doll:check_ins(dam / 10); 36 plus = plus / 3; 37 else 38 plus = min(dam / 2, plus); 39 endif 40else 41 plus = 0; 42endif 43if (rpg:trusted_verb(char, "armour")) 44 return char:armour(@args) + plus; 45else 46 return this:protection(@args) + plus; 47endif 48"Mooshie (#106469) - Sun Oct 26 23:43:35 1997 PST - Added check for being connected as a condition of an improve chance."; 49"Irin Thu Jan 22 22:03:56 1998 PST: Cleaned up and allowed forcewall to fail from an attack. Maybe this will take care of the 3 week forcewall problem. Who knows?";
connect_effects
Referenced by
- #74:attack line 72:
this:connect_effects - #74:respond line 42:
this:connect_effects - #74:receive_damage line 19:
this:connect_effects - #74:receive_damage_passed_messages line 13:
this:connect_effects - #74:hit_result line 22:
this:connect_effects
Source
1":connect_effects(OBJ attacker, OBJ target, OBJ loc, OBJ weapon, NUM quality, NUM damage, NUM pen, BOOL defending) -- check objects affecting the target doll `connectally' and give them a chance to influence/stop the attack."; 2{by, me, loc, weapon, qual, dam, pen, defending} = args; 3(rpg = $local.rpg):secure(); 4effect = 0; 5ok_effect = $nothing; 6for effobj in (this.connect_effects) 7 if (`effobj.owner in rpg.gms ! ANY') 8 try 9 e = effobj:connect_effect(by, me, loc, weapon, qual, dam, pen, defending); 10 ok_effect = effobj; 11 finally 12 if (ok_effect != effobj) 13 if (effobj in {this.character, rpg.monster}) 14 e = 0; 15 else 16 this.connect_effects = setremove(this.connect_effects, effobj); 17 e = E_NONE; 18 endif 19 endif 20 endtry 21 if (typeof(e) == NUM) 22 effect = effect + e; 23 else 24 return e; 25 endif 26 else 27 this.connect_effects = setremove(this.connect_effects, effobj); 28 msg = ((("[ " + $string_utils:nn(this)) + " ]: ") + $string_utils:nn(effobj)) + " was found in .connect_effects."; 29 rpg:log_error(msg); 30 endif 31endfor 32return effect;
receive_damage(old)
Referenced by
none
Source
1":receive_damage(dam, pen, qual, hitloc, attacker, weapon)"; 2"dam -> damage to be applied"; 3"pen -> penetration of the weapon"; 4"qual -> quality of the attack (final hit roll)"; 5"hitloc -> body area object of hit location"; 6"attacker -> character initiating the attack"; 7"weapon -> weapon used to attack"; 8(rpg = $local.rpg):secure(); 9try 10 {dam, pen, qual, loc, whoby, weapon} = args; 11except (E_ARGS) 12 return this:receive_damage_passed_messages(@args); 13endtry 14if (this:incorporeal(weapon)) 15 return 0; 16endif 17me = this.character; 18if (weapon:critical_hit(whoby, me, qual, loc, dam)) 19 "weapon handled a critical hit"; 20 return; 21endif 22locstr = loc:title(me); 23protection = this:armour(pen, loc, whoby, weapon, dam, qual); 24size = this.size; 25if (((dam - protection) / size) <= 0) 26 armour = this.current_armours[2]; 27 absorbed = `max(armour:absorption(whoby, me, weapon, loc, dam), 1) ! ANY => 1'; 28 absorbed = absorbed * weapon:con(whoby, me); 29 if (rpg:trusted_property(me, "nat_prot")) 30 absorbed = absorbed * ((n = me.nat_prot) ? max(1, 2 + (n / 10)) | 1); 31 endif 32 if ((dam / (size * absorbed)) > 0) 33 dam = dam / (size * absorbed); 34 sev = ((5 * dam) + (this.inj / 3)) / max(this.end, 5); 35 bad = {"slightly bruised", "slightly bruised", "bruised", "bruised", "bruised", "badly bruised"}[min(sev + 1, 6)]; 36 else 37 if (valid(armour = this.current_armours[1])) 38 armour:announce_clang(whoby, me, locstr, weapon, qual); 39 else 40 rpg:rpg_announce_all(me.location, me.name, " is unharmed by the blow."); 41 endif 42 weapon:notify_clang(whoby, me, loc, armour, qual); 43 if (this:read_misc_note("backfire")) 44 rpg.magic_db.bf_combat_effect:defensive_effect(whoby, me, loc, weapon, qual); 45 endif 46 return -1; 47 endif 48else 49 dam = (((dam - protection) / size) + weapon:special_damage(me, dam, pen, qual, loc, whoby)) || 0; 50 sev = ((2 * dam) + (this.inj / 3)) / max(this.end, 5); 51 bad = {"scratched", "slightly wounded", "hit", "hit", "hit", "severely wounded"}[min(sev + 1, 6)]; 52endif 53this:mod_att("inj", dam); 54shockmod = loc:shock_mod(me, whoby, weapon); 55stunmod = loc:stun_resistance(me, whoby, weapon); 56try_ = rpg:resolve(me, "shock", shockmod); 57if (try_ > (-2 * this.end)) 58 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 59 weapon:announce_hit(whoby, me, locstr, bad, 0); 60 weapon:hit_special_effect(whoby, me, qual, dam); 61 if (this:read_misc_note("backfire")) 62 rpg.magic_db.bf_combat_effect:defensive_effect(whoby, me, loc, weapon, qual); 63 endif 64 return -2; 65elseif ((!this.inj) || (try_ > ((-2 * (this.end + (is_player(me) ? 20 | 10))) - stunmod))) 66 rpg:check_notification(me, "notify_hit", {whoby, me, weapon, locstr, bad, dam}); 67 weapon:announce_hit(whoby, me, locstr, bad, 1); 68 this.act = max(this.act - 20, -20); 69 weapon:hit_special_effect(whoby, me, qual, dam); 70 if (this:read_misc_note("backfire")) 71 rpg.magic_db.bf_combat_effect:defensive_effect(whoby, me, loc, weapon, qual); 72 endif 73 return -3; 74else 75 weapon:announce_kill(whoby, me, locstr); 76 this:die(whoby, weapon); 77 weapon:hit_special_effect(whoby, me, qual, dam); 78 return -9; 79endif 80"THX (#105941) - Mon Jul 20, 1998 - Made it programmatically impossible to die unless already injured."; 81"THX (#105941) - Wed Jan 6, 1999 - Re-added stunmod modifier and fixed the logic in line 64."; 82"THX (#105941) - Sun Jan 10, 1999 - Removed the ugly tangle receive_damage check/call and moved it to the tangle:armour_effect."; 83"Profane (#30788) - Sun May 2, 1999 - insert inelegant checks for backfire circa lines 46-48, 64-66, 73-75"; 84"Profane (#30788) - Sun May 23, 1999 - Moved iceshell off into an armour_effect";
respond(old)
Referenced by
none
Source
1":respond(attacker, quality, damage, weapon, loc)"; 2"attacker -> character initiating the attack"; 3"quality -> quality of the attack (final hit roll)"; 4"damage -> damage to be applied"; 5"weapon -> weapon used to attack"; 6"loc -> body area object of hit location"; 7{by, qual, dam, weapon, loc} = args; 8(rpg = $local.rpg):secure(); 9if (typeof(weapon) != OBJ) 10 return this:respond_passed_numbers(by, qual, dam, weapon, loc); 11endif 12if (!this.armour_effects) 13elseif (typeof(effect = this:armour_effects(by, qual, dam, weapon, loc)) == NUM) 14 qual = qual - effect; 15else 16 return effect; 17endif 18me = this.character; 19if (this:cannot_defend()) 20 return this:receive_damage(dam * (1 + random(3)), max(1, weapon:pen(by, me)), qual, loc, by, weapon); 21endif 22locstr = loc:title(me); 23penalty = -((max(0, length(this.aggressor) - 1) * 20) + this:encumbrance()); 24parryable = weapon:parryable(by, me) + loc:parry_mod(me, by, weapon); 25space = `by.location.space ! ANY'; 26gms = rpg.gms; 27for thing in (this:wielding()) 28 try 29 if (valid(thing)) 30 if (thing.owner in gms) 31 if (typeof(u = thing:used(me, by)) == NUM) 32 mods = ((thing:parry(by, me, weapon) - qual) + parryable) + penalty; 33 length = thing:length(me, by); 34 mods = mods - `max(3 * space, 0) ! ANY => 0'; 35 if ((best = thing:skill(me, by):resolve(me, mods + u)) > 0) 36 thing:announce_parry(by, me, locstr, weapon, qual, best); 37 this:check_fatigue(thing:encumbrance()); 38 weapon:notify_parry(by, me, locstr, thing, qual, best); 39 if (this:read_misc_note("backfire")) 40 rpg.magic_db.bf_combat_effect:defensive_effect(by, me, loc, weapon, qual); 41 elseif (rpg:get_doll(by):read_misc_note("backfire")) 42 rpg.magic_db.bf_combat_effect:defensive_effect(me, by, loc, thing, best); 43 endif 44 return; 45 endif 46 endif 47 else 48 rpg:playertell(me, "You feel strangely weaker!"); 49 this.end = max(this.end - 1, 1); 50 this.pot = 0; 51 return; 52 endif 53 else 54 this.wielding = setremove(this.wielding, thing); 55 return; 56 endif 57 except (E_VERBNF) 58 "It's some non-weapon that's gotten in there somehow."; 59 this.wielding = setremove(this.wielding, thing); 60 endtry 61endfor 62dodgable = weapon:dodgable(by, me); 63mods = ((((this:hands_free() ? 25 | 0) + dodgable) + penalty) - qual) - `max(0, 50 - space) ! ANY => 0'; 64if (rpg.skills.dodge:resolve(me, mods) > 0) 65 return weapon:announce_dodge(by, me, locstr); 66endif 67this:receive_damage(dam * (1 + random(3)), max(1, weapon:pen(by, me)), qual, loc, by, weapon); 68"Quinn 17-FEB-93: hacked to send attacker to :receive_damage."; 69"Quinn 11-AUG-93: Receive weapon (if any) from caller and send to :Receive_damage."; 70"Quinn 22-OCT-93: Receive and send hit location. Removed some literal dodge resolve."; 71"Quinn 19-NOV-93: Major re-write. Cut a lot of kruft. Redirect old-style calls to :respond_passed_numbers."; 72"Profane 9-FEB-95 23:06EST: Added 'qual' and 'try' to :announce_parry call in preparation for weapon degrading."; 73"Profane 2-13-95 20:47EST: Added call to weapon:notify_parry for weapon damage hook."; 74"Profane 2-9-96 1637EST- Added paralyzation check."; 75"Irin Sun Nov 3 10:56:34 1996 PST -- Added evil check for fighting lotsa people penalty thingie."; 76"THX 12-MAR-1997 -- Killed off a list indexing, reversed the order of the announce_parry and the notify_parry, and cleaned a wee bit."; 77"Profane 18-MAY-97 1541PDT -- added fatigue check to complement one in :attack"; 78"Profane 12-JUL-97 2147PDT -- TRY statement in the parry bit."; 79"Profane 3-OCT-97 -- added check for non-gm owned weapons."; 80"THX (#105941) - Mon Apr 6, 1998 - Sped things up by rearranging the conditional. Remember, set up your conditional path for the _most common_ route the code takes! Changed this.paralyzed check to this:may_not_move()."; 81"Irin Thu Jun 11 19:03:52 1998 PDT -- changed :may_not_move to :cannot_defend."; 82"Profane (#30788) - Sun May 2, 1999 - insert inelegant backfire checks circa line 38-42";
attack(old)
Referenced by
none
Source
1":attack(OBJ target, LIST weapons[, NUM modifier, OBJ area, NUM no_invite])"; 2{target, weapons, ?bmods = 0, ?barea = 0, ?no_invite = 0} = args; 3(rpg = $local.rpg):secure(); 4location = (by = this.character).location; 5doll = rpg:get_doll(target); 6if (!this:legal_target(target, doll, caller)) 7 return; 8elseif (typeof(weapons) == LIST) 9 weapon = weapons[1]; 10else 11 weapon = weapons; 12 weapons = {weapons}; 13endif 14barea = (typeof(barea) == OBJ) ? barea | doll:random_hit_location(); 15if (typeof(effect = this:combat_effects(target, weapon)) != NUM) 16 return effect; 17endif 18bmods = (bmods + effect) - this:encumbrance(); 19try 20 if ((!valid(weapon)) || (typeof(use = weapon:used(by, target)) != NUM)) 21 "If :used returns a non-numeric value, the weapon is unusable."; 22 return; 23 elseif ((!(weapon.owner in rpg.gms)) && `verb_info(weapon, "0") ! E_VERBNF') 24 "OK, only penalize them if it has verbs defined.."; 25 rpg:playertell(by, "You feel foolish!"); 26 this.int = max(this.int - 1, 1); 27 this.pot = 0; 28 return; 29 endif 30except (E_TYPE) 31 raise(E_TYPE, ((("Error: " + by.name) + " is passing invalid weapons list (") + $string_utils:from_list(weapons, ", ")) + ")"); 32except (E_VERBNF) 33 raise(E_VERBNF, ("Error: \"Weapon\" " + tostr(weapon)) + " does not define a :used verb."); 34endtry 35this:do_attack_notification(target, weapon); 36is_player(target) || target:set_last_attacker(by); 37weap_slow = weapon:slowness(by, target); 38weapon:announce_swing(by, target); 39if (i_msg = doll:incorporeal(weapon)) 40 return rpg:say_action(i_msg, target, weapon, by.location); 41endif 42"if (doll.end <= 0)"; 43" if ((!(m_msg = weapon.materialize)) || rpg:trusted_property(target, \"incorporeal\"))"; 44" i_msg = (typeof(i = `target.incorporeal ! E_PROPNF, E_PERM => 0') == STR) ? i | \"The blow passes through %n without visible effect\";"; 45" return rpg:say_action(i_msg, target, weapon, by);"; 46" else"; 47" m_msg = (typeof(m_msg) == STR) ? m_msg | \"The %t forces %n to become tangible!\";"; 48" rpg:say_action(m_msg, target, weapon, by);"; 49" endif"; 50"endif"; 51weap_dam = weapon:dam(by, target); 52attack_bonus = weapon:attack(by, target); 53mods = ((bmods + use) + attack_bonus) - (length(weapons) * 10); 54str_bonus = (weapon:max_str_bonus(by, target) * this.str) / 25; 55squeeze = `max(0, weapon:length(by, target) - location.space) ! ANY => 0'; 56mods = mods - (3 * squeeze); 57damage = ((2 * weap_dam) + str_bonus) - squeeze; 58if (((squeeze > 3) && is_player(by)) && (random(25) == 1)) 59 rpg:playertell(by, "The room is a little small to ", weapon.swing, " your ", weapon.name, " properly."); 60endif 61"Damage will never be greater than 3 * base."; 62"damage = min(damage, 3 * weap_dam)"; 63"'y' is encumbrance penalty of the weapon. Wielding a heavy weapon with more than one hand reduces the total penalty."; 64"A weak person wielding a heavy weapon will be greatly penalized."; 65y = str_bonus - ((3 * (weap_enc = weapon:encumbrance(this))) / (1 + weapon:hands(by, target))); 66"y = str_bonus - 3 * (weap_enc = weapon:encumbrance(this)) / 5 / (1 + weapon:hands(by, target));"; 67if (y < 0) 68 mods = mods + (5 * y); 69 damage = damage + (y / 2); 70endif 71foes = 0; 72for foe in (this.aggressor) 73 if (foe.location == location) 74 foes = foes + 1; 75 endif 76endfor 77mods = mods - (max(0, foes - 1) * 15); 78connects = (qual = weapon:skill(by, target):resolve(by, mods)) > -25; 79if (connects) 80 doll:respond(by, qual, damage, weapon, barea); 81 if (this:read_misc_note("backfire")) 82 rpg.magic_db.bf_combat_effect:offensive_effect(by, target, weapon, barea, qual); 83 endif 84elseif (!weapon:critical_miss(by, target, qual)) 85 "No critical miss."; 86 weapon:announce_miss(by, target, qual); 87endif 88this:check_fatigue(weap_enc); 89weapons = listdelete(weapons, 1); 90"If we attack and die for some reason during the attack, no invitation will take place. Everybody stands around shocked. If the target dies, everything is fine."; 91if (`by.alive ! E_PROPNF' || (is_player(by) && valid(rpg:get_doll(by)))) 92 this.aggressor = setadd(this.aggressor, target); 93 if (weapons) 94 this.act = this.act - weap_slow; 95 this:attack(target, weapons, bmods - 10, barea, 1); 96 endif 97 if (valid(doll) && (parent(doll) != $garbage)) 98 doll.aggressor = setadd(doll.aggressor, by); 99 endif 100 if (!no_invite) 101 this:invite(this.slowness, {1, by, target, weapon}); 102 endif 103endif 104"Quinn 05-JAN-93: Use verbs for referencing weapon properties."; 105"Quinn 28-FEB-93: Won't fork notification if a fork is already pending."; 106"Quinn 11-AUG-93: Big re-write. Created :legal_target and :do_attack_notifica ion to do the mundane chore of checking and notifying targets; cut down the unwieldly verb size; added some minor comments."; 107"Quinn 11-AUG-93: Send weapon to :respond."; 108"Quinn 22-OCT-93: Added combat_effect."; 109"Quinn 19-NOV-93: Added body area support, :critical_miss. New args to :Respond."; 110"Ogwul 01-JAN-94: Allowed :attack to be called without adding the target to the aggressor list and without :invite via the no_invite parameter."; 111"Profane 29-DEC-95 1451EST -- Added windwall check thing."; 112"Irin Sun Nov 3 10:49:52 1996 PST -- Bwahaha, attack penalty if fighting more than one foe."; 113"Irin Thursday, January 30 -- Rewrite of the :invite section to correspond to changes. Don't use rpg:trusted."; 114"Profane 31-MAR-97 1341PST -- s/valid/$recycler:valid/85"; 115"Profane 15-APR-97 1518PST -- TRY statement for weapon:used"; 116"THX 18-May-1997 -- Fixed so that foe.location checks against by.location rather than this.location (one's doll is never in the same place as one's attackers). Added a weeny fatigue check after the (connects) conditional."; 117"Profane 3-OCT-97 -- added check for non-gm owned weapons."; 118"Mooshie (#106469) - Fri Feb 27, 1998 - Change how we handle .end == 0. Gory details found in `help incorporeality'."; 119"THX (#105941) - Wed Apr 8, 1998 - Removed this.paralyzed and entangled checks. this:legal_target now does the checks via this:may_not_move(). subst this.character -> by from line 4 onwards and changed the \"I'm still alive.\" check before the invite call since critters always return a valid doll."; 120"Profane (#30788) - Sun May 2, 1999 - add inelegant backfire check circa 90-92"; 121"Profane (#30788) - Sun May 23, 1999 - windwall moved off into armour_effect";
incorporeal(obsolete)
Referenced by
none
Source
1{weapon} = args; 2if (is_player(char = this.character) && (!this.end)) 3 return "The blow passes through %n without visible effect."; 4elseif ((char.owner in $local.rpg.gms) && (intangible = `char:incorporeal(weapon) ! ANY => ""')) 5 return intangible; 6else 7 return ""; 8endif
drew_first_blood
Referenced by
- #74:murder_anima line 22:
this:drew_first_blood - #74:murder_anima(old) line 46:
this:drew_first_blood
Source
1":drew_first_blood(OBJ Check_Player) => 1 or 0; did THIS.CHARACTER draw first blood on Check_Player first within the last 9999 seconds? Returns false if either party is an NPC."; 2{check} = args; 3result = 0; 4if ((note = this:read_misc_note("first_blood")) != E_PROPNF) 5 $local.rpg:secure(); 6 for t in (note) 7 {who, time} = t; 8 ((time > time()) && (check == who)) && (result = 1); 9 endfor 10endif 11return result; 12"THX (#105941) - Mon Feb 12, 2001 - Fixed logic. time must be GREATER THAN time() or the first_blooding has elapsed.";
get_schedule(old)
Referenced by
none
Source
1$local.rpg:secure(); 2if (args == {}) 3 return this.schedule; 4else 5 r = {}; 6 for w in (this.schedule) 7 if (w[1] == args[1]) 8 r = listappend(r, w); 9 endif 10 endfor 11 return r; 12endif
match_body_area(old)
Referenced by
none
Source
1":match_body_area(STR name) -> OBJ body-area-object"; 2{namestr} = args; 3a = $string_utils:match(namestr, this.body_areas, "aliases"); 4if (valid(a)) 5 return a; 6else 7 if ($local.rpg:trusted_property(who = this.character, "locations")) 8 if (x = namestr in who.locations) 9 return this.body_areas[x]; 10 else 11 return a; 12 endif 13 endif 14endif 15"Quinn 18-NOV-93 0201: Added."; 16"Irin Wed Sep 25 21:05:33 1996 PDT -- Added possibility of matching different body area names than those from the aliases.";
get_unmod_atts
Referenced by
none
Source
1":get_unmod_atts({STR att1, STR att2, ...}) ==> {NUM val1, NUM val2, ...}"; 2"just like :get_unmod_att() only returns multiple unmodified atts."; 3$local.rpg:secure(); 4stuff = {}; 5for stat in (args) 6 mod = this.(stat); 7 try 8 for line in (this.att_schedule) 9 {what, dummy, plus, @rest} = line; 10 if (what == stat) 11 mod = mod - plus; 12 endif 13 endfor 14 stuff = {@stuff, mod}; 15 except (ANY) 16 stuff = {@stuff, mod}; 17 endtry 18endfor 19return stuff; 20"Prui (#90864) - 02/15/2000 - Wrote from :get_unmod_att";
detect_magic_msg(old)
Referenced by
none
Source
1"Copied from Perceiving the Powers of Magic (#476):detect_magic_msg(doll) by Dred (#49925) Tue Feb 16 06:13:53 1999 PST"; 2"The default doll detect magic should just look at magic_effects and report anything that has a valid detect_magic_msg."; 3{bydoll, qual} = args; 4(rpg = $local.rpg):secure(); 5msg = {}; 6for d in ($set_utils:diff(this.magic_effects, $list_utils:slice(callers(), 1))) 7 if ($object_utils:has_callable_verb(d, "detect_magic_msg")) 8 msg = {@msg, @(typeof(f = d:detect_magic_msg(bydoll, qual)) == LIST) ? f | {f}}; 9 endif 10endfor 11"Could possibly scroll through doll's players contents for rpg objects, but that would be costly, plus we're not intending to have a target for Perceiving the Powers of Magic, so it would be painful to figure out if this is the caster's doll. Just make them drop stuff on the ground before casting detect!"; 12return msg; 13"Dred 2-12-99: Created new spell result."; 14"THX (#105941) - Sun Jan 2, 2000 - Changed to remove caller from the for-loop ... then had to remove all callers from the for-loop. Should be robust now.";
track_callers
Referenced by
- #74:set_att line 22:
this:track_callers
Source
1if (caller.owner in (rpg = $local.rpg).gms) 2 {att, self, callers} = args; 3 term = callers[1 + self][2..4]; 4 if (term in rpg.both_callers) 5 return; 6 endif 7 rpg.(att + "_callers") = setadd(rpg.(att + "_callers"), term); 8 if ((term in rpg.ins_callers) && (term in rpg.fat_callers)) 9 rpg.both_callers = setadd(rpg.both_callers, term); 10 rpg.ins_callers = setremove(rpg.ins_callers, term); 11 rpg.fat_callers = setremove(rpg.fat_callers, term); 12 endif 13endif
act(old)
Referenced by
none
Source
1(rpg = $local.rpg):secure(); 2if (this:cannot_cast()) 3 "Assume that the monster would hit somebody if they can't cast."; 4 "This could be wrong, but monsters don't yet check if they can cast? Maybe after talking with various monster owners? Things that block casting, but not attacking seem rare at the moment..."; 5 if (this:cannot_attack()) 6 return; 7 endif 8 return this:hit_aggressor(@args); 9endif 10if (is_player(who = this.character)) 11 this:hit_aggressor(@args); 12else 13 $command_utils:suspend_if_needed(1); 14 "Assume that their act verb is trusted, if they're not a player and have a doll."; 15 who:act(@args); 16endif
teammates
Referenced by
none
Source
1":teammates() => dolls of this doll's teammates"; 2(rpg = $local.rpg):secure(); 3teammates = {}; 4for t in (this.armour_effects) 5 (t in rpg.dolls) && (teammates = setadd(teammates, t)); 6endfor 7return teammates; 8"THX (#105941) - Wed Oct 4, 2000 - Added.";
invite(old)
Referenced by
none
Source
1":invite(NUM slowness[LIST {NUM respond, OBJ attacker, OBJ target, OBJ weapon} which hasn't been used in a long time.]) => All dolls in this doll's character's location, + the target of the attack (wherever they are) get a chance to act."; 2(rpg = $local.rpg):secure(); 3if (!valid(where = (by = this.character).location)) 4 return this.act = 0; 5elseif (`where.peaceful ! ANY => 0') 6 if (is_player(by)) 7 setremove(this.aggressor, by) && rpg:log_error(((#20:nn(this.character.location) + " (current character location) ") + (((((((#20:nn(this) + ":invite() called in a peaceful room with argstr: ") + argstr) + " ... aggressors: ") + #20:nn(this.aggressor)) + " ... and callers: ") + toliteral(callers(1))) + " ... by player: ")) + #20:nn(player)); 8 else 9 return; 10 endif 11endif 12{slow, @extra} = args; 13"Hey, we're actually going to try to use those extra args"; 14{?respond = 1, ?attacker = this, ?target = #-1, ?weapon = #-1} = `extra[1] ! E_RANGE => extra'; 15"If invite has already been called, we just decrement .act and return. The first call to invite will take it from there. This saves repeating many tasks for each separate invite."; 16for c in (callers()) 17 if ((c[2] == "invite") && (c[4] == rpg.doll)) 18 this.act = this.act - slow; 19 return; 20 endif 21endfor 22dolls = rpg:find_chars(where)[2]; 23"In case target is in a different room from the attacker. This could conceivably allow the target free attacks if they're involved in melee, but hopefully getting shot at will negate the advantage here."; 24if ((valid(target) && valid(d = rpg:get_doll(target))) && (!`target.location.peaceful ! ANY => 0')) 25 dolls = setadd(dolls, d); 26endif 27"Check schedules, and increment .act. Dolls that had left over act will get a bit of a bonus, dolls that were in the negative will lose some of that."; 28cp = connected_players(); 29for doll in (dolls) 30 try 31 if (is_player(char = doll.character) && ((!(char in cp)) || (idle_seconds(char) > rpg.idle_threshold))) 32 doll.aggressor = {}; 33 dolls = setremove(dolls, doll); 34 else 35 doll.act = ((doll.act / 2) + 60) - ((char == attacker) ? doll.slowness | 0); 36 doll:check_schedule(); 37 endif 38 except (E_PROPNF, E_INVIND) 39 dolls = setremove(dolls, doll); 40 endtry 41endfor 42this.act = this.act - slow; 43if ((!respond) || (length(dolls) <= 1)) 44 return; 45endif 46acts = short_of_time = 0; 47"Find the doll with the highest .act. Decrement the .act. call eir :act verb. Repeat until we run out of time, or all have acts of less than 0. If we run out of time, before at least 3 have acted, suspend, instead of quitting."; 48while (dolls && ((!short_of_time) || (acts < 3))) 49 max = -1; 50 fast_dolls = {}; 51 for doll in (dolls) 52 if (`doll.aggressor ! ANY => {}') 53 "Took out the 2 * doll.slowness for testing purposes ... put the 2 * back in if you like. - THX"; 54 doll_act = doll.act = doll.act - doll.slowness; 55 if (doll_act >= 0) 56 if (doll_act > max) 57 fast_dolls = {doll}; 58 max = doll_act; 59 elseif (doll_act == max) 60 fast_dolls = setadd(fast_dolls, doll); 61 endif 62 else 63 dolls = setremove(dolls, doll); 64 endif 65 else 66 dolls = setremove(dolls, doll); 67 endif 68 endfor 69 for doll in (fast_dolls) 70 if (parent(doll) == $garbage) 71 return 0; 72 endif 73 doll.act = doll.act - doll.slowness; 74 doll:act(); 75 acts = acts + 1; 76 endfor 77 if ((short_of_time = (ticks_left() < 8000) || (seconds_left() < 2)) && (acts < 3)) 78 rpg:s_i_n(); 79 endif 80endwhile 81return 0; 82"Irin Thursday, Jan 30, 1997 -- complete rewrite and redesign. I think this is vaguely what it was supposed to do, before it got broken."; 83"Probably not the same implementation though. Now, the acting doll calls it's :invite(), rather than inviting the target."; 84"Profane 2-MAY-97 1539PDT -- $recycler:valid check line 54"; 85"Profane 7-MAY-97 1714PDT -- removed valid check, fixed scattering of extra, s/target/d/21"; 86"THX - 7-May-1997 -- De-ticked. Gave :invite() a way out if there is only one doll going into the while loop. Set idle check to rpg.idle_threshold. Stopped doing doll:schedule calls on idle/disconnected players. Removed dolls with no aggressors from the big while-loop ... it's up to hit aggressor to tell the damn doll that it's under attack. Made the first for-loop in the while-loop a little smarter thus reducing the number of iterations of the second for-loop. Seems to be working fine now."; 87"Profane 10-JUN-97 1855PDT -- Try statement in schedule checking loop, line 24-34"; 88"THX 17-Jul-1997 -- Put error-catching in doll.aggressor to catch recycled dolls without TBing. Not that it would happen alot, but it'll save G_M from having to look for an error (only happens with gursts)."; 89"THX (#105941) - Mon Jun 5, 2000 - Added a check for room.peaceful to terminate the invitation. Will just log for now.";
death_effects(old)
Referenced by
none
Source
1":death_effect([killer])"; 2"Give the attacker's location, and any objects affecting em, a chance to influence eir death."; 3"The `death effects' property should be a list of objects whose :death_effect verb will be called with the args (corpse, killer). Killer may, in some cases, be $no_one."; 4"If a non-Numeric value is returned by any object, the death is cancelled. Any other value is, for now, discarded. It may apply to a shock check later, in case you'd like to return something."; 5"Keep in mind that the `%N has killed %d!' message has already been printed by the time the effect is called. Returning a non-numeric will prevent the recycling of the doll, but you'll have to announce your own explanations."; 6(rpg = $local.rpg):secure(); 7{?killer = $no_one} = args; 8corpse = this.character; 9{death_db, trash, gms} = {rpg.death_db, $garbage, rpg.gms}; 10if (rpg:trusted_verb(corpse.location, "death_effect") && (typeof(effect = corpse.location:death_effect(corpse, killer)) != NUM)) 11 "Room stopped the death."; 12 return effect; 13endif 14effect = 0; 15for effobj in (this.death_effects) 16 if ((!valid(effobj)) || (parent(effobj) == trash)) 17 this.death_effects = setremove(this.death_effects, effobj); 18 death_db.ok_death_effects = setremove(death_db.ok_death_effects, effobj); 19 elseif ((effobj in death_db.ok_death_effects) || (corpse in gms)) 20 "... do nothing ..."; 21 else 22 this.death_effects = setremove(this.death_effects, effobj); 23 endif 24endfor 25for effobj in (this.death_effects) 26 if (typeof(e = effobj:death_effect(corpse, killer)) != NUM) 27 return e; 28 else 29 effect = effect + e; 30 endif 31endfor 32return effect;
potential_total(old)
Referenced by
none
Source
1":potential_total(skill) -> Total (percentage-based) possible rank for the given skill."; 2"Governing attributes are totaled and added to the raw rank for 'skill', then governing skills are each :potential_totaled in turn and the final sum is returned."; 3if (!(caller_perms() in $local.rpg.gms)) 4 return E_PERM; 5endif 6att_obj = $local.rpg:match_skill(args[1]); 7skill = 25; 8deps = att_obj.dependant; 9for dep_att in (deps[1]) 10 skill = skill + 25; 11endfor 12for dep_att in (deps[2]) 13 skill = skill + this:potential_total(dep_att); 14endfor 15return skill;
stymied
Referenced by
none
Source
1who = this.character; 2if (is_player(who)) 3 (rpg = $local.rpg):secure(); 4 if (`who.sessile ! ANY => 1') 5 return 1; 6 endif 7 trusted = {who, $sysobj.owner, @rpg.gms}; 8 n = 1; 9 for t in (who.refused_origins) 10 if ((t in trusted) && ("move" in who.refused_actions[n])) 11 return n; 12 endif 13 n = n + 1; 14 endfor 15 ou = $object_utils; 16 for t in (rpg.epermed_hazards) 17 if ((where = ou:has_verb(who, t)) && (`verb_code(where[1], t) ! E_PERM => E_PERM' == E_PERM)) 18 return 1; 19 endif 20 endfor 21endif 22return 0;
lumens
Referenced by
none
Source
1lumens = infra = 0; 2loc = this.character.location; 3for t in (this.lights) 4 lumens = lumens + t:lumens(loc); 5 infra = infra + `t:infrared(loc) ! E_VERBNF => 0'; 6endfor 7this.illuminance = infra; 8return lumens; 9"THX (#105941) - Sat Mar 31, 2001 - Added."; 10"THX (#105941) - Thu Jun 28, 2001 - Added doll.illuminance to track \"light sources\" that are usable only by the doll (defined by :infrared() on the light object).";
relight
Referenced by
none
Source
1{what, add} = args; 2(rpg = $local.rpg):secure(); 3if (add) 4 if (what in this.lights) 5 return; 6 else 7 this.lights = setadd(this.lights, what); 8 endif 9 `this.character.location.lights = setadd(this.character.location.lights, this) ! ANY'; 10elseif (what in this.lights) 11 this.lights = setremove(this.lights, what); 12else 13 return; 14endif 15`this.character.location:recalc_illum() ! ANY'; 16`this.character.location:announce_light(what, add) ! ANY'; 17"THX (#105941) - Sat Mar 31, 2001 - Added.";
mod_anima
Referenced by
none
Source
1":mod_anima(NUM amount, [STR message]) ==> Adds the amt argument to the player's current .anima. Maximum of 1500; minimum of -1500. All alterations are logged. If supplied, and is a STRing, the message argument is broadcast to the player connected with the doll."; 2(rpg = $local.rpg):secure(); 3{amt, ?msg = 0} = args; 4max_log = 99; 5max_change = (caller_perms() in rpg.grand_masters) ? 1500 | 49; 6amt = min(max(amt, -max_change), max_change); 7this.anima = min(max(this.anima + amt, -1500), 1500); 8info = {this, amt, this.anima, time(), callers()[1][1..2]}; 9al = rpg.anima_log; 10rpg.anima_log = {info, @al}[1..min(length(al) + 1, max_log)]; 11return (typeof(msg) == STR) ? rpg:playertell(this.character, msg) | 0;
murder_anima
Referenced by
- #74:die line 18:
this:murder_anima
Source
1":murder_anima(OBJ killer) ==> Modifies the killer's .Anima by a modifier based on the current standing of the anima of both killer and victim. Generally speaking, killing `evil' slides you towards `good', and killing `good' slides you towards `evil'."; 2(rpg = $local.rpg):secure(); 3{killer} = args; 4if (!valid(kdoll = rpg:get_doll(killer))) 5 return; 6endif 7victim = this.character; 8if ((this == rpg.object_db.suit_doll) || (kdoll == rpg.object_db.suit_doll)) 9 return; 10endif 11va = this.anima; 12ka = kdoll.anima; 13mod = 0; 14mod = this:murder_anima_mod(ka, va); 15if ((is_player(victim) && ((vexp = rpg:exp(victim)) <= 5000)) && (vexp < rpg:exp(killer))) 16 "Killing a 5000 or less EXP newbie is `evil', but only if you're more experienced than they are."; 17 mod = mod - 10; 18endif 19if ($object_utils:isa(victim, $guest)) 20 "Guests don't count. You miserable, cheating scum."; 21 mod = 0; 22elseif (is_player(victim) && this:drew_first_blood(killer)) 23 "His Eminence considers Revenge a neutral act; your Anima won't change for it."; 24 mod = 0; 25elseif (victim in rpg.death_db.temple:mark(kdoll.character)) 26 "Assassinations are not precisely neutral, but the targets are essentially voluntary, so it doesn't count."; 27 mod = 0; 28endif 29if ((((goody = 1000 - ka) < 0) && (is_player(victim) || (!victim.animal))) && ((ka + va) > (goody / 10))) 30 "Once you're really `good', killing simply doesn't cut it. Save your animus for the really evil"; 31 mod = goody / 20; 32endif 33if (mod && (random(25) == 1)) 34 msg = (mod < 0) ? rpg.death_db.anima_slip_msgs[2] | rpg.death_db.anima_slip_msgs[1]; 35else 36 msg = 0; 37endif 38kdoll:mod_anima(mod, msg); 39"Hydros (#106189) - Sun Oct 10, 2004 - Added as a prototype of the new Good<->Evil system."; 40"Hydros (#106189) - Sun Oct 21, 2004 - Tacked on the lengthy middle splurge to take into account -both- killer and victim's Anima."; 41"Hydros (#106189) - Sun Nov 07, 2004 - Removed the aforementioned splurge in favour of reasonable, efficient code."; 42"Hydros (#106189) - Fri Nov 26, 2004 - Added an occasional message to let the player know to what side of the Force they're headed."; 43"Hydros (#106189) - Wed Dec 15, 2004 - Centralized the crucial formula in here to this:murder_anima_mod(), so if we need to call it elsewhere (like on #9334), the formula remains consistent."; 44"Hydros (#106189) - Sun Oct 23, 2005 - The Suit of Armour's doll doesn't count.";
murder_anima(old)
Referenced by
none
Source
1":murder_anima(OBJ killer) ==> Modifies the killer's .Anima by a modifier based on the current standing of the anima of both killer and victim. Generally speaking, killing `evil' slides you towards `good', and killing `good' slides you towards `evil'."; 2(rpg = $local.rpg):secure(); 3{killer} = args; 4kdoll = rpg:get_doll(killer); 5victim = this.character; 6va = this.anima; 7mod = va / 75; 8if (killer in rpg.user_utils.hydros.anima_testers) 9 if ((is_player(victim) && ((vexp = rpg:exp(victim)) <= 5000)) && (vexp < rpg:exp(killer))) 10 "Killing a 5000 or less EXP newbie is `evil', but only if you're more experienced than they are."; 11 mod = mod - 10; 12 endif 13 "We reverse negatives to positives and vice versa, so killing `evil' is `good' and killing `good' is `evil'."; 14 mod = -mod; 15 ka = kdoll.anima; 16 ex = 0; 17 if ((ka >= -250) && (ka <= 250)) 18 if (va > 250) 19 ex = -5; 20 elseif (va < -250) 21 ex = 5; 22 elseif ((va < 250) && (va > -250)) 23 ex = 0; 24 endif 25 elseif (ka > 250) 26 if (va > 250) 27 ex = -20; 28 elseif (va < -250) 29 ex = 10; 30 elseif ((va <= 250) && (va >= -250)) 31 ex = -10; 32 endif 33 elseif (ka < -250) 34 if (va > 250) 35 ex = -5; 36 elseif (va < -250) 37 ex = 20; 38 elseif ((va < 250) && (va > -250)) 39 ex = 5; 40 endif 41 endif 42 mod = mod + ex; 43 if ($object_utils:isa(victim, $guest)) 44 "Guests don't count. You miserable, cheating scum."; 45 mod = 0; 46 elseif (is_player(victim) && this:drew_first_blood(killer)) 47 "His Eminence considers Revenge a neutral act; your Anima won't change for it."; 48 mod = 0; 49 elseif (victim in rpg.death_db.temple:mark(kdoll.character)) 50 "Assassinations are not precisely neutral, but the targets are essentially voluntary, so it doesn't count."; 51 mod = 0; 52 endif 53 if (kdoll.anima > 1100) 54 "Once you're really `good', killing simply doesn't cut it. It can only bring you down. Even if it's a guest, or a newbie, or revenge, or Assassination."; 55 mod = -100; 56 endif 57 kdoll:mod_anima(mod); 58endif 59"Hydros (#106189) - Sun Oct 10, 2004 - Added as a prototype of the new Good<->Evil system."; 60"Hydros (#106189) - Sun Oct 21, 2004 - Tacked on the lengthy middle splurge to take into account -both- killer and victim's Anima.";
murder_anima_mod
Referenced by
- #74:murder_anima line 14:
this:murder_anima_mod
Source
1"The formula for :murder_anima, herein centralized so that when it's called elsewhere, (like #9334), it remains consistent."; 2(rpg = $local.rpg):secure(); 3{killer_anima, victim_anima} = args; 4"Copied from Kagan (#102427):anima at Sun Nov 7 23:41:52 2004 PST, then reformatted by Corwin_MacGregor (#122047)."; 5return `(-victim_anima) / abs(victim_anima) ! E_DIV => 0' * (6 - ((abs(killer_anima) - abs(victim_anima)) / 250));