Mobs will now slowly bop up and down while in zero gravity.

Conflicts:
	code/game/area/areas.dm
	code/game/turfs/turf.dm
	code/modules/clothing/shoes/magboots.dm
	code/modules/mob/living/carbon/human/human_movement.dm
	code/modules/mob/living/living.dm
	code/modules/mob/living/living_defines.dm
	code/modules/mob/mob_movement.dm
	code/modules/power/gravitygenerator.dm
This commit is contained in:
Giacomand
2014-05-09 00:00:44 +01:00
committed by ZomgPonies
parent 25853d7d79
commit f32f2b329f
8 changed files with 73 additions and 32 deletions
+3
View File
@@ -186,6 +186,9 @@ BLIND // can't see anything
slowdown = SHOES_SLOWDOWN
species_restricted = list("exclude","Unathi","Tajaran")
/obj/item/proc/negates_gravity()
return 0
//Suit
/obj/item/clothing/suit
icon = 'icons/obj/clothing/suits.dmi'
+5 -1
View File
@@ -26,6 +26,7 @@
icon_state = "magboots1"
user << "You enable the mag-pulse traction system."
user.update_inv_shoes() //so our mob-overlays update
user.update_gravity(user.mob_has_gravity())
examine()
set src in view()
@@ -33,4 +34,7 @@
var/state = "disabled"
if(src.flags&NOSLIP)
state = "enabled"
usr << "Its mag-pulse traction system appears to be [state]."
usr << "Its mag-pulse traction system appears to be [state]."
/obj/item/clothing/shoes/magboots/negates_gravity()
return flags & NOSLIP
@@ -104,3 +104,12 @@
prob_slip = round(prob_slip)
return(prob_slip)
/mob/living/carbon/human/mob_has_gravity()
. = ..()
if(!.)
if(mob_negates_gravity())
. = 1
/mob/living/carbon/human/mob_negates_gravity()
return shoes && shoes.negates_gravity()
+13
View File
@@ -705,3 +705,16 @@
CM.drop_from_inventory(CM.legcuffed)
CM.legcuffed = null
CM.update_inv_legcuffed()
/mob/living/update_gravity(has_gravity)
if(!ticker)
return
float(!has_gravity)
/mob/living/proc/float(on)
if(on && !floating)
animate(src, pixel_y = 2, time = 10, loop = -1)
floating = 1
else if(!on && floating)
animate(src, pixel_y = initial(pixel_y), time = 10)
floating = 0
@@ -42,3 +42,4 @@
var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death.
var/implanting = 0 //Used for the mind-slave implant
var/silent = null //Can't talk. Value goes down every life proc.
var/floating = 0
+11 -10
View File
@@ -424,14 +424,8 @@
if(istype(turf,/turf/space))
continue
if(istype(src,/mob/living/carbon/human/)) // Only humans can wear magboots, so we give them a chance to.
if((istype(turf,/turf/simulated/floor)) && (src.lastarea.has_gravity == 0) && !(istype(src:shoes, /obj/item/clothing/shoes/magboots) && (src:shoes:flags & NOSLIP)))
continue
else
if((istype(turf,/turf/simulated/floor)) && (src.lastarea.has_gravity == 0)) // No one else gets a chance.
continue
if(!turf.density && !mob_negates_gravity())
continue
@@ -460,18 +454,22 @@
if(!dense_object)
return 0
//Check to see if we slipped
if(prob(Process_Spaceslipping(5)))
src << "\blue <B>You slipped!</B>"
src.inertia_dir = src.last_move
step(src, src.inertia_dir)
return 0
//If not then we can reset inertia and move
inertia_dir = 0
return 1
/mob/proc/mob_has_gravity(turf/T)
return has_gravity(src, T)
/mob/proc/mob_negates_gravity()
return 0
/mob/proc/Process_Spaceslipping(var/prob_slip = 5)
//Setup slipage
@@ -481,3 +479,6 @@
prob_slip = round(prob_slip)
return(prob_slip)
/mob/proc/update_gravity()
return
+18 -21
View File
@@ -1,3 +1,4 @@
//
// Gravity Generator
//
@@ -31,6 +32,9 @@ var/const/GRAV_NEEDS_WRENCH = 3
if(severity == 1) // Very sturdy.
set_broken()
/obj/machinery/gravity_generator/blob_act()
set_broken()
/obj/machinery/gravity_generator/meteorhit()
return
@@ -138,10 +142,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
var/obj/machinery/gravity_generator/part/part = new(T)
if(count == 5) // Middle
middle = part
if(count <= 3) // Their sprite is the top part of the generator
part.density = 0
part.layer = MOB_LAYER + 0.1
part.sprite_number = count
part.sprite_number = count;
part.main_part = src
parts += part
part.update_icon()
@@ -289,24 +290,15 @@ var/const/GRAV_NEEDS_WRENCH = 3
alert = 1
investigate_log("was brought online and is now producing gravity for this level.", "gravity")
message_admins("The gravity generator was brought online. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
for(var/area/A in world)
if (A.z != 1) continue
A.gravitychange(1,A)
else
if(gravity_in_level() == 1)
alert = 1
investigate_log("was brought offline and there is now no gravity for this level.", "gravity")
message_admins("The gravity generator was brought offline with no backup generator. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>[area.name]</a>)")
for(var/area/A in world)
if (A.z != 1) continue
A.gravitychange(0,A)
update_icon()
update_list()
update_list(alert)
src.updateUsrDialog()
if(alert)
shake_everyone()
// Charge/Discharge and turn on/off gravity when you reach 0/100 percent.
// Also emit radiation and handle the overlays.
@@ -325,7 +317,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
charge_count -= 2
if(charge_count % 4 == 0 && prob(75)) // Let them know it is charging/discharging.
playsound(src.loc, 'sound/effects/EMPulse.ogg', 75, 1)
playsound(src.loc, 'sound/effects/EMPulse.ogg', 100, 1)
updateDialog()
if(prob(25)) // To help stop "Your clothes feel warm" spam.
@@ -357,15 +349,19 @@ var/const/GRAV_NEEDS_WRENCH = 3
L.apply_effect(20, IRRADIATE)
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
/obj/machinery/gravity_generator/main/proc/shake_everyone()
// Update their gravity floatness
/obj/machinery/gravity_generator/main/proc/check_everyone(var/alert)
if(!ticker)
return
var/turf/our_turf = get_turf(src)
for(var/mob/M in player_list)
for(var/mob/M in mob_list)
var/turf/their_turf = get_turf(M)
if(M.client && their_turf.z == our_turf.z)
M.update_gravity(M.mob_has_gravity(their_turf))
if(alert && M.client && their_turf.z == our_turf.z)
shake_camera(M, 15, 1)
M.playsound_local(our_turf, 'sound/machines/signal.ogg', 100)
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
/obj/machinery/gravity_generator/main/proc/gravity_in_level()
/obj/machinery/gravity_generator/main/proc/gravity_in_level(var/alert)
var/turf/T = get_turf(src)
if(!T)
return 0
@@ -373,7 +369,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
return length(gravity_generators["[T.z]"])
return 0
/obj/machinery/gravity_generator/main/proc/update_list()
/obj/machinery/gravity_generator/main/proc/update_list(var/alert)
var/turf/T = get_turf(src.loc)
if(T)
if(!gravity_generators["[T.z]"])
@@ -382,6 +378,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
gravity_generators["[T.z]"] |= src
else
gravity_generators["[T.z]"] -= src
check_everyone(alert)
// Misc