Now look what you've done. Hope I did this right.

This commit is contained in:
Pidgey
2021-04-20 22:04:37 +10:00
parent ba3536a20c
commit a15a20b8e1
3 changed files with 45 additions and 17 deletions
@@ -448,12 +448,12 @@
if("spin", "spins")
if(!restrained() && !lying)
if(prob(5))
INVOKE_ASYNC(src, .proc/spin, 30, 1)
spin(30, 1, spin_direction = 2)
message = "<B>[src]</B> spins too much!"
Dizzy(12)
Confused(12)
else
INVOKE_ASYNC(src, .proc/spin, 20, 1)
spin(20, 1, spin_direction = 2)
message = "<B>[src]</B> spins!"
if("aflap", "aflaps")
@@ -160,7 +160,7 @@
src.SpinAnimation(5,1)
if("spin","spins")
INVOKE_ASYNC(src, .proc/spin, 20, 1)
spin(20, 1, spin_direction = 2)
message = "<B>[src]</B> spins!"
if("help")
+42 -14
View File
@@ -1343,24 +1343,52 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
/mob/proc/can_resist()
return FALSE //overridden in living.dm
/mob/proc/spin(spintime, speed)
#define SPIN_DIRECTION_CLOCKWISE 0
#define SPIN_DIRECTION_COUNTERCLOCKWISE 1
#define SPIN_DIRECTION_RANDOM 2
/mob/proc/spin(spintime, speed, spin_direction = SPIN_DIRECTION_CLOCKWISE)
set waitfor = 0
if(!spintime || !speed || spintime > 100)
CRASH("Aborted attempted call of /mob/proc/spin with invalid args ([spintime],[speed]) which could have frozen the server.")
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
setDir(D)
spintime -= speed
var/S
if(spin_direction == SPIN_DIRECTION_CLOCKWISE || spin_direction == SPIN_DIRECTION_COUNTERCLOCKWISE)
S = spin_direction
else
S = pick(SPIN_DIRECTION_CLOCKWISE,SPIN_DIRECTION_COUNTERCLOCKWISE)
if(S == SPIN_DIRECTION_CLOCKWISE)
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
setDir(D)
spintime -= speed
else
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = WEST
if(SOUTH)
D = EAST
if(EAST)
D = NORTH
if(WEST)
D = SOUTH
setDir(D)
spintime -= speed
#undef SPIN_DIRECTION_CLOCKWISE
#undef SPIN_DIRECTION_COUNTERCLOCKWISE
#undef SPIN_DIRECTION_RANDOM
/mob/proc/is_literate()
return FALSE