E.E I have a few problems. 2, actually. On the first one, the game won't loop through the rest code, the latter wont respond to me at all(not even an error...)
Heres the first...
proc
Rester()
var/wait = rand(20,65)
if(src.rest == 1)
src<<"You are resting!"
return
if(src.medi == 1)
src<<"Not while resting!"
return
else
if(src.ST == 100)
src<<"You don't need to rest"
return
else
src.rest = 1
while(src.ST<100)
sleep(wait)
src.ST += rand(4,9)
if(src.ST>=100)
src.ST = 100
src.rest = 0
break
if(src.Move)
src.rest = 0
break
And the latter...
Transform()
set category = "Skills"
if(usr.PL>=3500)
usr.SSJ = 1
usr.Super.Add("Super Saiyan")
if(usr.PL>=8000)
usr.SSJ2 = 1
usr.Super.Add("Super Saiyan 2")
if(usr.PL>=19000)
usr.SSJ3 = 1
usr.Super.Add("Super Saiyan 3")
if(usr.PL>=60000)
usr.SSJ4 = 1
usr.Super.Add("Super Saiyan 4")
var/trans = input(src,"What level of Super Saiyan would you like to go to?","Transform")in usr.Super
switch(trans)
if("Super Saiyan")
usr<<"You transform into Super Saiyan 1"
if("Super Saiyan 2")
usr<<"You transform into Super Saiyan 2"
if("Super Saiyan 3")
usr<<"You transform into Super Saiyan 3"
if("Super Saiyan 4")
usr<<"You transform into Super Saiyan 4"
Okay. A few things here. Your first two if statements can be cut down quite a bit, because they check boolean variables. Boolean variables are ones that can be either true or false and hold no other information. DM has boolean operators to make these statements easier for you. Instead of:
if(src.rest == 1)
if(src.rest)
if(!src.rest)
The block of code:
if(src.ST >= 100)
Once again, the next else statement is not required, for the aforementioned reason. Put the loop on the same tree level as the if statements.
Your loop looks fine to me, but I would recommend putting sleep() at the end of the loop, as opposed to the beginning. Put some debug messages in to make sure it's looping. Perhaps the loop condition has been met? To check, make the first line inside the while statement:
Let me know how that turns out.
In your second block of code, I saw that you're not nulling the list at the start of the procedure. That's something you'll want to do - otherwise, everytime they use it, the different levels of Super Saiyan will be added to their list, creating multiple occurances. What if their PL goes down? They'll still be able to go to their highest state from before. To prevent that, just renew the list at the start of the procedure:
usr.Super = new/list
I also do not understand your need for the booleans SSJ 1-4. Where ever you check them, why not just use:
Of course, that segment of the procedure could be simplified to look a whole lot prettier:
As for why the procedure does not respond, I'd assume the problem is your PL is too low to be affected by any of the conditions. To be sure that's the problem, or even to see if the procedure is being called, add this line to the start:
That was pretty long-winded, but I hope you benefit from it. If you have any further questions, just ask.