ID:269285
 
How do you restrict movement so that a player can't just hold an arrow key down and move across the map quickly?
You can delay any action by having a variable that determines whether you are already performing some action.
mob
var/moving=0
Move()
if(moving)return 0
moving=1
.=..()
sleep(4)
moving=0

You can easily make variable delays by making a delay variable and setting it to whatever you want for each object.

You can also easily have checks for multiple action types using bit flags.
#define WALKING 1
#define NONMOVE_ACT 2
#define MENTAL 4
#define UNCONCIOUS 8
#define FROZEN 16

mob
var/action = 0
Move()
if(action&(WALKING|UNCONCIOUS|FROZEN))return 0
action |= WALKING
.=..()
sleep(4)
action &= ~WALKING
verb
attack()
if(action&(NONMOVE_ACT|UNCONCIOUS|FROZEN))return 0
action |= NONMOVE_ACT
src<<"You use your weapon."
sleep(5)
action &= ~NONMOVE_ACT
telepathy(T as text)
if(action&(MENTAL|UNCONCIOUS))return 0
action |= MENTAL
view()<<"You recieve telepathic message: [T]"
sleep(2)
action &= ~MENTAL
proc/die()
action |= UNCONCIOUS
sleep(100)
action &= ~UNCONCIOUS

You could even use bit flags for a delay variable so that each player can perform different actions at different speeds.