This commit is contained in:
Poojawa
2018-09-11 02:49:41 -05:00
parent 09512a6001
commit b6430559e9
104 changed files with 1522 additions and 765 deletions
+14 -2
View File
@@ -1,8 +1,20 @@
/datum/component/forced_gravity
var/gravity = 1
var/gravity
var/ignore_space = FALSE //If forced gravity should also work on space turfs
/datum/component/forced_gravity/Initialize(forced_value = 1)
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
gravity = forced_value
RegisterSignal(COMSIG_ATOM_HAS_GRAVITY, .proc/gravity_check)
if(isturf(parent))
RegisterSignal(COMSIG_TURF_HAS_GRAVITY, .proc/turf_gravity_check)
gravity = forced_value
/datum/component/forced_gravity/proc/gravity_check(datum/source, turf/location, list/gravs)
if(!ignore_space && isspaceturf(location))
return
gravs += gravity
/datum/component/forced_gravity/proc/turf_gravity_check(datum/source, atom/checker, list/gravs)
return gravity_check(parent, gravs)