mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Mobs will bob up and down in space and zero-gravity unless they are both wearing magboots and within 1 tile of a dense object/turf.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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()
|
||||
..()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user