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:
RavingManiac
2014-09-30 01:22:13 +08:00
parent cc6c66c558
commit 918520df83
4 changed files with 35 additions and 3 deletions

View File

@@ -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))

View File

@@ -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()
..()

View File

@@ -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

View File

@@ -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)))