Fireball Spell #86

Parent #49Owner #10Flags read, writeSource MurpgCore-0.4/MurpgCore-0.4.db

1 verbs · 16 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
invokethis none thisrwxd#8654

Properties

PropertyDefinerFlagsOwnerValue
endurance_cost#49rw#1050
focus_cost#49rw#1050
description#1rw#10<clear>
aliases#1rw#10<clear>
home#1rw#10<clear>
short_desc#1rw#10<clear>
core#1rw#10<clear>
handedness#1rw#10<clear>
base_enc#1rw#10<clear>
base_weight#1rw#10<clear>
capacity#1rw#10<clear>
max_fit#1rw#10<clear>
pprep#1rw#10"The"
gprep#1rw#10"a"
generic_name#1rw#10"fireball"
age#1rw#10<clear>

Ancestry

Ancestors (nearest first): #49 Spell Class#1 Root Class

Children: none

Source

invoke

Spec this none thisFlags rwxdOwner #10Definer #86

Referenced by

none

Source

1"fireball:invoke()";
2{caster, target} = args;
3if (caster.current_spell != 0)
4return {0, "You are currently casting a spell already!"};
5elseif (!valid(target))
6return {0, "You need to specify a target."};
7elseif (!target:is_a($animate))
8return {0, "You can only cast this spell at an animate."};
9else
10caster:sees(3, {"You wave your hands in a circular motion, and flames flicker from your fingertips."});
11viewers = caster.location:get_animates();
12viewers = setremove(viewers, caster);
13for each in (viewers)
14each:sees(3, {((((caster:known_to(each)[2] + " waves ") + #0.(caster.gender)[5]) + " hands in a circular motion, and flames flicker from ") + #0.(caster.gender)[5]) + " fingertips.%w"});
15endfor
16fork cur_spell ($combat.round_length)
17victims = caster.location.contents;
18temp_victims = {};
19for each in (victims)
20if (each:is_a($animate))
21temp_victims = {@temp_victims, each};
22endif
23endfor
24victims = temp_victims;
25victims = setremove(victims, caster);
26victims = setremove(victims, target);
27"calculate and deal target damage";
28targ_dam = (((((random(10) + random(10)) + random(10)) + random(10)) + random(10)) + random(10)) + random(10);
29caster:sees(3, {((("%RYou blast " + target:known_to(caster)[2]) + " with your Fireball spell (") + tostr(targ_dam)) + ")!%w"});
30target:sees(3, {((((("%R" + caster:known_to(target)[2]) + " blasts you with ") + #0.(caster.gender)[5]) + " Fireball spell (") + tostr(targ_dam)) + ").%w"});
31viewers = caster.location:get_animates();
32viewers = setremove(viewers, target);
33viewers = setremove(viewers, caster);
34for each in (viewers)
35each:sees(3, {((((("%R" + caster:known_to(each)[2]) + " blasts ") + target:known_to(each)[2]) + " with ") + #0.(caster.gender)[5]) + " Fireball spell!%w"});
36endfor
37target:damage("fire", targ_dam);
38"calculate and deal misc victims damage";
39for each in (victims)
40dam = random(6);
41caster:sees(3, {((("%RYou blast " + each:known_to(caster)[2]) + " with your Fireball spell (") + tostr(dam)) + ")!%w"});
42each:sees(3, {((((("%R" + caster:known_to(target)[2]) + " blasts you with ") + #0.(caster.gender)[5]) + " Fireball spell (") + tostr(dam)) + ").%w"});
43viewers = caster.location:get_animates();
44viewers = setremove(viewers, each);
45viewers = setremove(viewers, caster);
46for viewer in (viewers)
47viewer:sees(3, {((((("%R" + caster:known_to(viewer)[2]) + " blasts ") + each:known_to(viewer)[2]) + " with ") + #0.(caster.gender)[5]) + " Fireball spell!%w"});
48endfor
49each:damage("fire", dam);
50endfor
51caster.current_spell = 0;
52endfork
53caster.current_spell = cur_spell;
54endif