mob/Spell
verb
Vado_Calx()
set category = "Spells"
if(wandout == 1)
if(usr.pertr==0)
if(confound == 1)
usr.random=rand(1,2)
if(random == 1)
view(usr) << "<font color = teal><b><u>[usr]</b></u><font color = teal>:<i><font color = green> Vado Calx!"
new /obj/projectile/Calx(get_step(src, src.dir), src.dir, src, 3)
if(random == 2)
usr << "You raise your wand, only to find the spell leave your grasp"
return
else
view(usr) << "<font color = teal><b><u>[usr]</b></u><font color = teal>:<i><font color = green> Vado Calx!"
new /obj/projectile/Calx(get_step(src, src.dir), src.dir, src, 3)
else
usr<<"You cannot cast spells"
else
usr << "You must have your wand out!"
obj/projectile // Using a projectile subtype so
// similar objects like bullets,
// arrows, or darts can be added easily.
Calx
icon='attacks.dmi'
icon_state="calx"
density=1
New(start_loc, direction, shooter, delay)
src.shooter=shooter
if(!Move(start_loc, direction)) del src // The initial move is here in case someone is on the first tile.
spawn(delay)
while(step(src, direction))
sleep(delay)
del src
Bump(atom/A)
if(ismob(A))
var/mob/victim=A
view(A)<<"[shooter] hit [victim]!"
victim.hp -= 15
else
view(A)<<"[shooter]'s spell missed their intended target and hit [A]!"
How can I make it os the object will stop where it is after hitting the victim?
Also, you should use if(prob(50)) instead of defining a variable called 'random' like that.
-- Data