Generic Weapon Spell Focus #59933
Aliases: Generic Weapon Spell Focus, weapon spell focus, spell focus, focus
14 verbs · 28 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
check_casting | this none this | | #59933 | 3 |
check_live_target | this none this | | #59933 | 3 |
check_object_target | this none this | | #59933 | 18 |
check_multiple_live_targets | this none this | | #59933 | 29 |
casting_msg | this none this | rx | #59933 | 32 |
check_casting_loc*ation | this none this | | #59933 | 0 |
may_cast | this none this | | #59933 | 6 |
pay_cost | this none this | | #59933 | 6 |
bonus | this none this | | #59933 | 2 |
sing_spell | this none this | | #59933 | 11 |
hidden_verbs | this none this | | #59933 | 17 |
spell | this none this | | #59933 | 76 |
check_live_target(obsolete) | this none this | | #59933 | 50 |
eggie | this none this | | #59933 | 3 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
default_cast_msg | #59933 | rc | — | "%N %<waves> %p arms and %<mutters> weird syllables." |
db | #59933 | r | — | #328 |
bonus | #59933 | | — | not readable (E_PERM) |
visible_spells | #59933 | | — | not readable (E_PERM) |
no_imp | #59933 | | — | not readable (E_PERM) |
dodgable | #59933 | | — | not readable (E_PERM) |
parryable | #59933 | | — | not readable (E_PERM) |
slowness | #59933 | | — | not readable (E_PERM) |
parry | #59933 | | — | not readable (E_PERM) |
attack | #59933 | | — | not readable (E_PERM) |
pen | #59933 | | — | not readable (E_PERM) |
dam | #59933 | | — | not readable (E_PERM) |
skill | #59933 | | — | not readable (E_PERM) |
pierce | #59933 | | — | 0 |
max_str_bonus | #59933 | | — | not readable (E_PERM) |
can_degrade | #59933 | | — | not readable (E_PERM) |
track_usage | #59933 | | — | not readable (E_PERM) |
manufactured | #59933 | | — | 820783482 |
worth | #59933 | | — | -1 |
condition | #59933 | | — | 100 |
use_spell_msg_db | #59933 | | — | 1 |
odrop_failed_msg | #59933 | | — | "%<tries> to drop %t but fails!" |
odrop_succeeded_msg | #59933 | | — | "%<drops> %t." |
otake_succeeded_msg | #59933 | | — | "%<picks> up %t." |
key | #59933 | | — | not readable (E_PERM) |
aliases | #59933 | | — | {"Generic Weapon Spell Focus", "weapon spell focus", "spell focus", "focus"} |
description | #59933 | | — | "A generic instrument of destuction, albiet one crackling with magickal potential." |
object_size | #59933 | | — | {19508, 1141286561} |
Ancestry
Ancestors (nearest first): #82 generic weapon → #517 Generic LRPG Thing
Children: #331 staff, #18754 generic light source
Call graph
Source
check_casting
Referenced by
- #331:heal line 1:
this:check_casting - #331:storm line 1:
this:check_casting - #331:unwall line 1:
this:check_casting - #331:forcewall line 1:
this:check_casting - #331:enchant line 1:
this:check_casting - #331:barkskin line 2:
this:check_casting - #331:biting_cloud line 1:
this:check_casting - #331:claim line 1:
this:check_casting - #331:unbark line 2:
this:check_casting - #331:shatter line 1:
this:check_casting - #331:harden line 1:
this:check_casting - #331:hail line 1:
this:check_casting - #331:iceshell line 1:
this:check_casting - #331:waterwhip line 2:
this:check_casting - #331:conjure line 3:
this:check_casting - #331:summon line 4:
this:check_casting - #331:acidrain line 1:
this:check_casting - #331:appraise line 2:
this:check_casting - #331:magicfist line 2:
this:check_casting - #331:firebolt line 3:
this:check_casting - #331:viper_bite line 2:
this:check_casting - #331:unviper line 2:
this:check_casting - #331:stoneflesh line 2:
this:check_casting - #331:parch line 1:
this:check_casting - #331:unstone line 1:
this:check_casting - #331:fortify line 3:
this:check_casting
Source
1":check_casting_location([OBJ caster character]) => return true if the caster is an acceptable location to cast spells (i.e. in an RPG-type room.)"; 2{?who = player} = args; 3return $local.rpg:is_rpg_room(who.location);
check_live_target
Referenced by
- #331:heal line 1:
this:check_live_target - #331:unwall line 1:
this:check_live_target - #331:forcewall line 1:
this:check_live_target - #331:biting_cloud line 1:
this:check_live_target - #331:shatter line 6:
this:check_live_target - #331:iceshell line 1:
this:check_live_target - #331:acidrain line 1:
this:check_live_target - #331:magicfist line 2:
this:check_live_target - #331:firebolt line 3:
this:check_live_target - #331:parch line 1:
this:check_live_target - #59933:check_multiple_live_targets line 10:
this:check_live_target - #59933:check_multiple_live_targets line 17:
this:check_live_target
Source
1":check_live_target(OBJ caster character, [OBJ target, OBJ spell, NUM boolean peaceful]) => doll of target || $nothing. For spells that want one living target."; 2return this.db:(verb)(@args); 3"THX (#105941) - Wed May 10, 2000 - Moved the guts of this verb to $local.rpg.magic_db.";
check_object_target
Referenced by
- #331:claim line 1:
this:check_object_target - #331:shatter line 1:
this:check_object_target - #331:harden line 1:
this:check_object_target - #331:appraise line 2:
this:check_object_target - #331:fortify line 3:
this:check_object_target
Source
1":check_object_target(OBJ caster character, [STR target]) => OBJ target. Designed for spells who take an inanimate object as a target."; 2{by, ?tstr = dobjstr, @rest} = args; 3(rpg = $local.rpg):secure(); 4stuff = rpg:trusted_verb(where = by.location, "visible") ? where:visible() | where.contents; 5target = $match_utils:match(tstr, stuff); 6if ($command_utils:object_match_failed(target, tstr)) 7elseif (!(where in {tloc = target.location, `tloc.location ! ANY => tloc'})) 8 rpg:playertell(player, "You can't affect ", target.name, " from where you are."); 9elseif (((tloc != where) && rpg:trusted_verb(tloc, "visible")) && (!(target in tloc:visible()))) 10 rpg:playertell(player, "The ", target:title(), " seems to be protected by its containment."); 11elseif (((!rpg.object_db:is_monster(target)) && (!$object_utils:isa(target, rpg.thing))) && (!((target.owner in rpg.gms) && $object_utils:has_verb(target, "receive_" + callers()[1][2])))) 12 rpg:playertell(player, "My God! ", target:titlec(), " seems to be immune to Illuminati magick."); 13else 14 return target; 15endif 16return $nothing; 17"Profane 22-DEC-95 2014EST -- Added."; 18"THX 20-MAR-1997 -- Added a hook to let gms hide equipment in containers and cleaned up a bit.";
check_multiple_live_targets
Referenced by
- #331:hail line 1:
this:check_multiple_live_targets
Source
1":check_multiple_live_targets(OBJ caster character, [STR target]) => LIST of dolls. For spells that want to affect more than one living character at once."; 2if ((rpg = $local.rpg):trusted(caller_perms())) 3 {by, ?tstr = dobjstr, ?spell = $nothing, ?peaceful = 0} = args; 4 words = setremove($list_utils:remove_duplicates($string_utils:words(tstr)), "and"); 5 targets = {}; 6 if ((!words) || (words == {"all"})) 7 targs = setremove(rpg:find_chars(by.location)[1], by); 8 targs = setremove(targs, rpg:get_doll(by).mounted); 9 for dude in (targs) 10 if (valid(arf = this:check_live_target(by, dude))) 11 targets = setadd(targets, arf); 12 endif 13 endfor 14 else 15 for try_ in (words) 16 try_ = (try_[length(try_)] == ",") ? try_[1..length(try_) - 1] | try_; 17 who = this:check_live_target(by, try_, spell, peaceful); 18 targets = valid(who) ? setadd(targets, who) | targets; 19 endfor 20 endif 21 if (!targets) 22 rpg:playertell(by, "Erm, you've managed to pick no living targets."); 23 endif 24 return targets; 25else 26 return E_PERM; 27endif 28"Profane 22-DEC-95 2022EST -- Added"; 29"Profane (#30788) - Wed Jan 10, 2001 - `all' does not include your mount.";
casting_msg
Referenced by
- #331:unbark line 8:
this:casting_msg - #59933:spell line 24:
this:casting_msg
Source
1":casting_msg(OBJ caster character, OBJ spell || STR property name, OBJ target) => STR message for casting spell."; 2"Targets can be characters, LRPG objects, or lists of characters. We check to see if we've been passed a character's doll, and convert target to the character in that case, otherwise leave it alone. Lists will get converted to title_list's down below"; 3{by, spell, target} = args; 4target = (typeof(target) != LIST) ? valid(`target.character ! E_PROPNF, E_INVIND') ? target.character | target | target; 5spell = (typeof(spell) == OBJ) ? spell.aliases[1] | spell; 6if ($local.rpg:is_monster(by)) 7 if (by in {target, target.character}) 8 mesgs = ((((by.(spell + "_cast_self_msg") || by.(spell + "_cast_msg")) || by.default_self_cast_msg) || by.default_cast_msg) || this.default_self_cast_msg) || this.default_cast_msg; 9 else 10 mesgs = (by.(spell + "_cast_msg") || by.default_cast_msg) || this.default_cast_msg; 11 endif 12else 13 if (by in {target, target.character}) 14 mesgs = ((this.(spell + "_cast_self_msg") || this.(spell + "_cast_msg")) || this.default_self_cast_msg) || this.default_cast_msg; 15 else 16 mesgs = this.(spell + "_cast_msg") || this.default_cast_msg; 17 endif 18endif 19msg = (typeof(mesgs) == LIST) ? $list_utils:random_element(mesgs) | mesgs; 20msg = strsub(msg, "%[focus]", this.name); 21if (typeof(target) != LIST) 22 names = target.name; 23else 24 dudes = `$list_utils:map_prop(target, "character") ! E_TYPE, E_PROPNF => target'; 25 names = $string_utils:title_list(dudes); 26endif 27msg = strsub(msg, "%[target]", names); 28return msg; 29"Profane 22-DEC-95 2026EST -- Added"; 30"StarDancer 24-DEC-95 -- removed call to pronoun_sub, 'cause it's in :say_action already."; 31"StarDancer 24-DEC-95 -- added code ta 'low for lists a strings inna `_msg' prop."; 32"StarDancer 31-JUL-96 -- replaced call to $string_utils:substitute with strsub, and set dobj = target in :spell";
check_casting_loc*ation
Referenced by
none
Source
No program (verb defined but unprogrammed).
may_cast
Referenced by
- #59933:spell line 19:
this:may_cast
Source
1":may_cast(doll, spell) => Allowed to cast the spell."; 2{doll, spell} = args; 3if (this in `doll.character.gaglist ! E_PROPNF, E_PERM => {}') 4 return 0; 5endif 6return 1;
pay_cost
Referenced by
- #331:pay_cost line 8:
pass( - #331:pay_cost line 28:
pass( - #59933:spell line 44:
this:pay_cost - #59933:spell line 46:
this:pay_cost - #59933:spell line 50:
this:pay_cost
Source
1":pay_cost(doll, spell, skillobj, costdiv) => Pay the cost of casting a spell. Separated from :spell to shrink the thing down a bit, and so we don have to maintain so many copies of :spell. -- Irin"; 2{doll, spell, skill, cost} = args; 3if (caller == this) 4 doll:check_ins(skill.sane / cost); 5 "args[1]:check_ins(args[3].sane / args[4]);"; 6endif
bonus
Referenced by
- #59933:spell line 18:
this:bonus
Source
1":bonus(by, target, spell) => bonus of this foci on casting."; 2return this.(verb);
sing_spell
Referenced by
- #59933:spell line 37:
this:sing_spell
Source
1{by, spell, target} = args; 2songs = `this.(spell + "_lyrics") ! ANY => 0'; 3if (songs && (song = songs[random($)])) 4 {rpg, loc} = {$local.rpg, by.location}; 5 for dude in (loc) 6 if (is_player(dude) && rpg.options:get(`rpg:get_doll(dude).rpg_options ! E_INVIND', "lyrics")) 7 rpg:playertell_lines(dude, song); 8 endif 9 endfor 10endif 11"Mooshie (#106469) - Fri Dec 12, 1997 - Let caster see lyrics.";
hidden_verbs
Referenced by
- #331:hidden_verbs line 3:
pass(
Source
1{who} = args; 2if (!valid(doll = (rpg = $local.rpg):get_doll(who))) 3 doll = rpg.doll; 4endif 5prev = pass(@args); 6for spell in (this.visible_spells) 7 try 8 {spellname, skillname, objdef} = spell; 9 `arglist = verb_args(objdef, spellname) ! ANY => {}'; 10 if ((arglist != {}) && (!doll.(skillname))) 11 prev = {@prev, {objdef, spellname, verb_args(objdef, spellname)}}; 12 endif 13 except v (ANY) 14 "Ignore 'em"; 15 endtry 16endfor 17return prev;
spell
Referenced by
- #331:heal line 7:
this:spell - #331:storm line 2:
this:spell - #331:unwall line 15:
this:spell - #331:forcewall line 2:
this:spell - #331:enchant line 5:
this:spell - #331:barkskin line 12:
this:spell - #331:biting_cloud line 2:
this:spell - #331:claim line 13:
this:spell - #331:shatter line 11:
this:spell - #331:harden line 7:
this:spell - #331:hail line 2:
this:spell - #331:iceshell line 5:
this:spell - #331:waterwhip line 17:
this:spell - #331:conjure line 22:
this:spell - #331:summon line 5:
this:spell - #331:acidrain line 8:
this:spell - #331:appraise line 12:
this:spell - #331:magicfist line 3:
this:spell - #331:firebolt line 4:
this:spell - #331:viper_bite line 6:
this:spell - #331:unviper line 7:
this:spell - #331:stoneflesh line 3:
this:spell - #331:parch line 2:
this:spell - #331:unstone line 2:
this:spell - #331:fortify line 11:
this:spell
Source
1":spell(OBJ caster character, OBJ|LIST target, OBJ spell, [NUM qual modifier, NUM (true|false) peaceful, OBJ skill object]"; 2"+ [ANY extra arguments to pass to spell verb on #328]) -- call spell on magic database if all is well."; 3(rpg = $local.rpg):secure(); 4{by, target, spell, ?mod = 0, ?peaceful = 0, ?skillobj = spell, @extra_args} = args; 5target = valid(x = rpg:get_doll(target)) ? x | target; 6if (typeof(spell) == OBJ) 7 spell = spell.aliases[1]; 8elseif (typeof(skillobj) != OBJ) 9 skillobj = rpg:match_skill(skillobj); 10 if (!valid(skillobj)) 11 raise(E_INVARG, "Spell focus was passed incorrect spell object: " + tostr(`args[6] ! E_RANGE => spell')); 12 endif 13endif 14loc = by.location; 15doll = rpg:get_doll(by); 16peaceful = peaceful ? peaceful | rpg.magic_db:is_peaceful_spell(doll, target, spell); 17self_cast = (`loc.peaceful ! ANY' || (doll == target)) && ((spell in rpg.magic_db.self_cast_difficult) ? random(3) - 1 | (!(spell in rpg.magic_db.self_cast_allowed))); 18mod = mod + this:bonus(by, target, spell); 19if (!this:may_cast(doll, spell)) 20 return; 21endif 22rpg:playertell(by, "You try to cast ", (spell in skillobj.aliases) ? skillobj:title() | $string_utils:capitalize(spell), "."); 23(dobj == $failed_match) && (dobj = `target.character ! ANY => $nothing'); 24rpg:say_action(`caller:casting_msg(by, spell, target) ! ANY => this:casting_msg(by, spell, target)', by); 25if ((!peaceful) && is_player(by)) 26 rpg.magic_db.sc_recovery_effect:add(doll); 27 doll:write_misc_note("spell recover", time() + ((2 * skillobj.slow) / 5)); 28endif 29qual = 0; 30if (rpg:trusted_verb(loc, "magic_effect")) 31 if (typeof(effect = `loc:magic_effects(doll, qual, skillobj, target) ! E_VERBNF, E_PERM => loc:magic_effect(doll, qual, skillobj, target)') != NUM) 32 return effect; 33 endif 34 qual = qual - effect; 35endif 36qual = qual + skillobj:resolve(by, (mod - skillobj.diff) - ((length(doll.aggressor) - 1) * 15), self_cast || `caller.no_imp ! ANY => this.no_imp'); 37this:sing_spell(by, spell, target); 38if (typeof(effect = doll:casting_effects(doll, target, qual, skillobj)) != NUM) 39 return effect; 40elseif ((qual = qual - effect) <= 0) 41 rpg:rpg_announce_all(loc, "Nothing happens."); 42 if (qual < -50) 43 rpg:playertell(by, "Disturbed demons buffet your mind. You feel like your soul is being put through the wringer."); 44 this:pay_cost(doll, spell, skillobj, 1); 45 else 46 this:pay_cost(doll, spell, skillobj, 3); 47 endif 48else 49 this.db:(spell)(doll, target, qual, skillobj, @extra_args); 50 this:pay_cost(doll, spell, skillobj, 1); 51endif 52if (!peaceful) 53 "Target/targets become aggressors. Then they get a chance to nail caster. No more hail freebies."; 54 targets = (typeof(target) == LIST) ? target | {target}; 55 for t in (targets) 56 if ((parent(t) == rpg.doll) && (t != doll)) 57 if (is_player(char = t.character)) 58 add = t in rpg.pcs; 59 else 60 char:set_last_attacker(by); 61 add = char.alive; 62 endif 63 if (add) 64 (t in doll.aggressor) || doll:first_blood(by, char); 65 t.aggressor = setadd(t.aggressor, by); 66 doll.aggressor = setadd(doll.aggressor, char); 67 endif 68 endif 69 endfor 70 (by.location == loc) && (`loc.peaceful ! ANY' || doll:invite(skillobj.slow)); 71endif 72"Profane (#30788) - Sat Aug 1, 1998 - Add bit for self_cast -- casting spells on yourself == no improvement of skills"; 73"Profane (#30788) - Mon Aug 24, 1998 - No skill improve for casting in `peaceful' rooms."; 74"Mooshie (#106469) - Wed Feb 10, 1999 - I moved the location's :magic_effect check before the :resolve. This way rooms that disallow spells won't let people macro away casting spells in them."; 75"THX (#105941) - Mon Jun 26, 2000 - Check that by.location == loc before even thinking about calling doll:invite()."; 76"THX (#105941) - Sat Apr 14, 2001 - Put an explicit check into the loop that adds targets into the aggressors property after the spell runs. If the thing has died, we really don't want to add it to aggressors or it'll screw up first_blood stuff.";
check_live_target(obsolete)
Referenced by
none
Source
1":check_live_target(OBJ caster character, [OBJ target, OBJ spell, NUM boolean peaceful]) => doll of target || $nothing. For spells that want one living target."; 2{by, ?tstr = dobjstr, ?spell = $nothing, ?peaceful = 0} = args; 3(rpg = $local.rpg):secure(); 4"by = args[1];"; 5"tstr = (length(args) > 1) ? tostr(args[2]) | dobjstr;"; 6"peaceful = (length(args) > 3) ? args[4] | 0;"; 7tstr = tostr(tstr); 8target = valid(x = by:my_match_object(tstr)) ? x | dobj; 9{loc, mdb, odb} = {by.location, rpg.magic_db, rpg.object_db}; 10no_target = ((!valid(target)) || (target.location != loc)) && (target != loc); 11if (no_target && (spell in mdb.range_spells)) 12 exits = loc:exits(); 13 what = {}; 14 for x in (exits) 15 while (`valid(x.succ_exit) ! ANY') 16 x = x.succ_exit; 17 endwhile 18 if (odb:is_missile_exit(x)) 19 what = {@what, @x.dest.contents}; 20 endif 21 endfor 22 target = $match_utils:match(tstr, what); 23 if (target in what) 24 no_target = 0; 25 endif 26elseif (no_target && valid(`target = loc:match_for_spell(by, tstr, spell, peaceful) ! ANY => $nothing')) 27 (loc.owner in rpg.gms) && (no_target = 0); 28endif 29caster = rpg:get_doll(by); 30doll = rpg:get_doll(target); 31peaceful = peaceful ? peaceful | mdb:is_peaceful_spell(caster, doll, spell); 32if (no_target) 33 rpg:playertell(by, "I don't see any `", tstr, "' here."); 34elseif (!valid(doll)) 35 verbname = "receive_" + spell.aliases[1]; 36 (`rpg:trusted_verb(target, verbname) ! E_INVIND => 0' && target:(verbname)(dobj, spell)) || rpg:playertell(by, "My God! ", target.name, " seems to be immune to Illuminati magic."); 37elseif (((!peaceful) && is_player(target)) && ((!$object_utils:connected(target)) || ((idle_seconds(target) > rpg.idle_threshold) && ((time() - doll.last_attack) > rpg.idle_threshold)))) 38 rpg:playertell(by, "Hold your magic! By the edict of the great wizard, bystanders must not be molested."); 39elseif (((((!peaceful) && is_player(target)) && (target != player)) && (!(target in caster.aggressor))) && rpg.rpg_options:get(caster.rpg_options, "peacenik")) 40 rpg:playertell(by, "Whoa! You don't really want to commit violence upon your fellow human beings, do you? Even if it is ", target:title(), ". After all, love is the most powerful weapon. Play nice, now."); 41else 42 return doll; 43endif 44return $nothing; 45"Profane 22-DEC-95 2008EST -- Added."; 46"THX (#105941) - Sun May 31, 1998 - Scatter assignment. Checking for custom receive_\"spell\" on !alive targets too."; 47"Profane (#30788) - Mon Jul 6, 1998 - uncommented the bit about setting tstr- a plain scatter dun hack it. Also error trap receive_* call"; 48"Profane (#30788) - Wed Apr 21, 1999 - check new peacenik option"; 49"THX (#105941) - Mon Jan 3, 2000 - Commented the tstr length(args) stuff and replaced with a tostr(). Put in some stuff to check peaceful for the peacenik stuff."; 50"THX (#105941) - Tue Mar 7, 2000 - Added a check for \"range_spells\" ... maybe we can make some spells work through missile-transmitting exits.";
eggie
Referenced by
none
Source
1if (this == #14197) 2 this:set_aliases({"rotten egg", "egg"}); 3endif