ID:918880
 
(See the best response by Neimo.)
Code:
mob
verb
Flame_Punch(mob/M as mob in get_step(src,src.dir))
set category="Ninjutsu"
icon = 'Flare.dmi'
if(istype(M,/mob/))
var/damage=round(usr.str-M.def/2)
if(damage <= 0)
damage = 1
M.hp-=damage
range()<<"[usr] uses a flare like punch on [M] inflicting <font color=red>[damage]</font> damage!"/// tell the people in ranged M's being attacked.
usr.DeathCheck(M)
else
return


Problem description:
I need help making a icon go back to it's original state after the verb is used.

Also I need help making a projectile attack that wont disappear till it hits something, any takers?

Best response
You can use the flick() proc to show the animation with it changing back to its original state.
Question, why would you define M as mob/M then check if it is a mob with if(istype(M,/mob/))?
var/damage=round(usr.str-M.def/2)
// this says usr.str - 1/2 of M's def
// remember your order of operations
// multiplication and division are first
// if you want it to divide usr.str - M.def by two then
// it should read:
var/damage=round((usr.str-M.def) /2)


In response to Neimo
Neimo wrote:
You can use the flick() proc to show the animation with it changing back to its original state.

How would I put Flick() without completely messing it up
flick(the icon state, the object that is attached to the icon)

In this case it might be something like this:
flick(fire, M)


The placement of the code depends on you.
Depends wat you want to flick
if its the user
flick("icon_state",usr)

if its the mob
flick("Icon_state",M)