diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8168a34f0c..80a70d5c04 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -130,6 +130,8 @@ else if(!istype(src, /turf/space)) M:inertia_dir = 0 + var/mob/M1 = M + M1.make_floating(0) ..() var/objects = 0 for(var/atom/A as mob|obj|turf|area in range(1)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index feee1b00f4..419973a956 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -679,6 +679,27 @@ note dizziness decrements automatically in the mob's Life() proc. pixel_x = old_x pixel_y = old_y + +//handles up-down floaty effect in space +/mob/proc/make_floating(var/n) + + floatiness = n // store what will be new value + + if(floatiness && !is_floating) + spawn(0) + floating_process() + +/mob/proc/floating_process() + is_floating = 1 + while(floatiness) + var/amplitude = 2 + var/frequency = 10 + pixel_y = amplitude * sin(frequency * world.time) + sleep(1) + //endwhile - reset the pixel offsets to zero + is_floating = 0 + pixel_y = 0 + /mob/Stat() ..() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 86f3724fb5..a252b55e65 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -104,6 +104,8 @@ var/is_dizzy = 0 var/is_jittery = 0 var/jitteriness = 0//Carbon + var/is_floating = 0 + var/floatiness = 0 var/charges = 0.0 var/nutrition = 400.0//Carbon diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 9310155160..90eca44847 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -402,9 +402,6 @@ ///For moving in space ///Return 1 for movement 0 for none /mob/proc/Process_Spacemove(var/check_drift = 0) - //First check to see if we can do things - if(restrained()) - return 0 /* if(istype(src,/mob/living/carbon)) @@ -451,9 +448,19 @@ //Nothing to push off of so end here if(!dense_object) + make_floating(1) return 0 + if(istype(src,/mob/living/carbon/human/)) + if(istype(src:shoes, /obj/item/clothing/shoes/magboots) && (src:shoes.flags & NOSLIP)) //magboots + dense_object = no floaty effect + make_floating(0) + else + make_floating(1) + else + make_floating(1) + if(restrained()) //Check to see if we can do things + return 0 //Check to see if we slipped if(prob(Process_Spaceslipping(5)))