ID:178444
 
I'm having a weird problem with the sleep proc. I'm trying to get rid of the use of macros in my game. So what I'm doing is creating a proc that will make your actions slower depending on what your speed is. So check this out:

proc/ActionDelay()
if(player_race == "Saiya-Jin")
if(spd == 1)
sleep(40)
then in my attack verb I have:

verb
attack(mob/M in oview(1))
ActionDelay()
var/D = str/2
if(M == ctarg)
usr << "You attack [M]!"
M << "You're under attack by [usr]!"
M.hp = M.hp - rand((D-clvl),(D+clvl))
M.DeathCheck()
usr.LvlCheck()
else
usr << "You must select a target first."

it works at first but then it's like it just skips the ActionDelay proc when I use a macro it stops for 4 secs then it just floods the console. Plz I would like some help on this thx

mob/var/Sleeping
mob/verb/Attack(mob/M in oview(1))
if(usr.Sleeping == 1)
usr << "Wait!"
else
//code goes here


In response to Thief Jack
Thief jack wrote:
mob/var/Sleeping
> mob/verb/Attack(mob/M in oview(1))
> if(usr.Sleeping == 1)
> usr << "Wait!"
> else
> //code goes here

no what I want it to wait a certain amount of time before they can do something and that time is checked by a proc to see what their speed stat is and then determine how long they should wait

eg: if their speed was 1 is would take 4 seconds(or 40 tenths) and if their speed was 2 it would take 3 seconds and so on

I have the right proc but it's like after the first 4 seconds of sleep it just runs like normal. Like lets say I hold down the macro for attack, it will take 4 seconds for the first one to work but then the others will go right away.
In response to Jinks
mob/var/Sleeping = 0

mob/proc/CheckSleep()
if(usr.sleeping == 1)
usr <<"WAIT!"
else
..()

mob/verb/Attack()
usr.CheckSleep()
//rest of code here


Hope that helps

-Kappa the Imp
In response to Kappa the Imp
Kappa the Imp wrote:
> 
> mob/var/Sleeping = 0
>
> mob/proc/CheckSleep()
> if(usr.sleeping == 1)
> usr <<"WAIT!"
> else
> ..()
>
> mob/verb/Attack()
> usr.CheckSleep()
> //rest of code here
>

Hope that helps

-Kappa the Imp

it didn't work, I'm not sure why it would because then I would have to go through all my delay procs and add set sleeping + 1 to all of them and there are like 40.