ID:145194
 
Code:
    proc
stoptsuki(mob/m) //The proc
hurt
if(src.stop == 0)
var/times = round(m.gen*0.9) //damage dealt to be 90% of my "gen"
src.health -= times //victims health is to decrease
src<<"<font size=1><font color=blue><I>[m]'s Tsukiyomi does [times] damage."
m<<"<font size=1><font color=blue><I>Tsukiyomi does [times] damage to [src]"
if(src.health <= 0)
m.freezer=0 //the var for the user having used the attack or not
src.stop=1
src.Death(usr)
sleep(20)
goto hurt
verb
Tsukiyomi(mob/m in oview(1)) // Verb used for firing the beam
set category = "Doujutsu"
set name = "Tsukiyomi"
if(usr.firing)
return
if(m.froze)//stops use on a person already frozen by this move
return
if(usr.freezer)//stops use if youre currently using on someone
return
else
usr.freezer=1
var/Sleeptime = round(usr.gen -m.gen*1)
if(Sleeptime <= 55)
Sleeptime = 55
m.Frozen = 1
m.froze = 1
stoptsuki()
usr.firing=1
sleep(55) // delay before any other kind of move can be used
usr.firing=0
sleep(Sleeptime-55) //time the victim is frozen
m.stop=1 //supposed to be the trigger for the victim being free
m.move=1
m<<"<font size=1><font color=blue><b>You break out of [usr]'s Tsukiyomi."
usr<<"<font size=1><font color=blue><b>[m] is free from your Tsukiyomi!"
m.froze = 0
m.Frozen=0
m.firing=0
sleep(30)//after this you can use attack again


Problem description:
As you can see I'm making a Naruto game o_o
But I cannot get this Tsukiyomi proc to work. Ive spent ages fiddling with m/usr/src, but nothing seems to work...
I'm assuming it's a matter of putting m/usr/src in and in the right places... But I really can't be sure.

First: Always close your HTML tags.

Second: What is the verb and proc supposed to do? What does Tsukiyomi mean? Your description hardly tells us anything. Add more details of what you would like it to happen and we'll set you on the path of getting there.

Third: The so called "loop" you made in the proc is oh so inefficient. I would sugest using spawn() while(1) instead of the hurt and goto hurt.

Fourth: Don't use usr in procs.

Fifth: boolean variables shouldn't be if(var == 1) or if(var == 0) but instead if(var) and if(!var).

In response to Crzylme
OK, I probably should have explained my code more :)

Bascially, what this is meant to do, is allow someone to use "Tsukiyomi" on another combatant and it will stop the victim from being able to move for a specified time (dependant on user & victim's power). And do damage to the victim every 2/3 seconds, until the freeze time is over or the victim dies.

Mhmm is see about the spawn() bit. I wasn't aware of a while(1) command.
Is it telling the proc to keep repeating as long as stop=1?
I only began coding last week. :|

The boolean variables thing... Good point.