ID:266478
 
Ok,
mob
verb
Chaos_Control(mob/M in view())
set category = "Power Spells"

/* How do you do this?:
M is frozen in place
M Hp - 1
sleep 1 second
M Hp - 1
sleep 1 second
M Hp - 1
sleep 1 second
M Hp - 1
sleep 1 second
M Hp - 1
sleep 1 second
Un Freeze
This is how you do that. Modify your current Move() proc accordingly, but you'll have to figure out what goes where without screwing up your own stuff.

mob/verb/Chaos_Control(mob/M as mob in view())
set category = "Power Squeegees"
view() << "[M] is frozen in place!"
M.mobile = 0
for(countdown=5, countdown > 0, countdown--)
M.Hp--
sleep(1)
M.mobile = 1

mob/var/mobile = 1
mob/Move()
if(mobile)
..()
else return
You'd first need to add in an override for the player's Move() proc... That should look something like the following (but can be altered in any way you see fit):

mob
var/lock
Move()
if(src.lock == 1)
src << "You are locked in place!"
else
..()

If the player's lock variable is ever equal to 1...they will not be able to move... If it isn't equal to 1...they can move as normal...

So we use the Chaos_Control() verb to set that player's lock variable to 1 and use a loop to do the damage...

mob
verb
Chaos_Control(mob/M in view())
set category = "Power Spells"
var/looplife = 0
M.lock = 1
while(looplife < 5)
M.HP -= 1
sleep(10)
looplife++
M.lock = 0

The while() command executes whatever code is indented beneath it in a loop that continues for as long as the condition in parentheses is met... So since looplife starts out at 0, it is already less than 5... So the loop continues... During the loop, we add 1 to looplife (looplife++) each time it runs through the loop... We also subtract the 1 HP from M.HP and throw in the sleep(10) so it sleeps for a second between each time...

Since loplife is still less than 5...the loop starts over from the beginning again... looplife gets one more added to it this time... But since it's still less than 5...the loop goes through again...

After it goes through 5 times...looplife is now equal to 5...and the loop breaks and moves on to whatever's after it in the verb...and that's where we turn M.lock off...
In response to Foomer
A perfect example of why we always say that there isn't "the code" for anything...

Foomer's answer, while very similar to mine, is still different from mine... And both of them will work just as well...

The same can be said of any "code"... There are almost as many ways of doing something as there are coders out there...
In response to SuperSaiyanGokuX
Mine's better, it uses two lines less :o)
In response to Foomer
I suppose you're right...
In response to SuperSaiyanGokuX
Length of the code doesn't determine which code is "better".
In response to Nadrew
Sure it does :oD
In response to Foomer
His has more nice documentation though. So if I get Cable and decide to see if I can't use Xooxer's fancy people with some additionals, I'll host a nice little non-smiley, roleplaying based version of Ensya with a nice garden and a fountain, and a library with nonsense and lots of it - and programming help, too.
In response to Foomer
Ummm... Yeah, sure... You do that...

lol