mob
verb
FireBlast()
if (usr.MP <5)
usr << "You don't have enough MP to use this spell!"
else
var/obj/fireball/F = new(usr.loc)
walk(F,usr.dir,2)
usr.MP -= (5)
obj
fireball
density = 1
Bump(mob/M)
if(istype(M,/mob))
var/damage = (10)
M.HP -= damage
M.Death()
del(src)
else
del(src)
..()
verb
Reflect()
set src in oview(1)
loc = usr
walk(usr.dir,2)
Problem description:
I'm a beginner, sort of messing around making a game, and I wanted to be able to reflect a fireball. I thought I could simply make it it go in the Reflector's direction, but it only moves about one space and then continues forward. What could I do to change this so that it goes the other way (that the mob reflecting it is facing)? I was thinking of simply deleting the old one and making a new fireball, but I'd rather that it stays the same object.
And also, is there a way to cause the fireball to speed up after each reflection?
As for your second question, think about what you're trying to do - you're trying to keep track of the number of times the fireball has been reflected, and set the walking delay to a different number for each time.
So basically, you need a formula for turning 'number of times reflected' into a reasonable walking delay, and a count of 'number of times reflected' that goes up every time the fireball bounces off of something.
Keep in mind that you can't use delays less then 0 for walk.