diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm index c86e47709c8..373290f7c9b 100644 --- a/code/__DEFINES/maps.dm +++ b/code/__DEFINES/maps.dm @@ -41,6 +41,9 @@ require only minor tweaks. // number - bombcap is multiplied by this before being applied to bombs #define ZTRAIT_BOMBCAP_MULTIPLIER "Bombcap Multiplier" +// number - default gravity if there's no gravity generators or area overrides present +#define ZTRAIT_GRAVITY "Gravity" + // numeric offsets - e.g. {"Down": -1} means that chasms will fall to z - 1 rather than oblivion #define ZTRAIT_UP "Up" #define ZTRAIT_DOWN "Down" diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 498e020cefe..a589991b62c 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -447,3 +447,7 @@ GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE)) //Filters #define AMBIENT_OCCLUSION filter(type="drop_shadow", x=0, y=-2, size=4, border=4, color="#04080FAA") + + +#define STANDARD_GRAVITY 1 //Anything above this is high gravity, anything below no grav +#define GRAVITY_DAMAGE_TRESHOLD 3 //Starting with this value gravity will start to damage mobs \ No newline at end of file diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 5e2747ec5ff..3d22cb55221 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -237,6 +237,16 @@ magboots would let you walk around normally on the floor. Barring those, you can or shoot a gun to move around via Newton's 3rd Law of Motion." icon_state = "weightless" +/obj/screen/alert/highgravity + name = "High Gravity" + desc = "You're getting crushed by high gravity, picking up items and movement will be slowed." + icon_state = "paralysis" + +/obj/screen/alert/veryhighgravity + name = "Crushing Gravity" + desc = "You're getting crushed by high gravity, picking up items and movement will be slowed. You'll also accumulate brute damage!" + icon_state = "paralysis" + /obj/screen/alert/fire name = "On Fire" desc = "You're on fire. Stop, drop and roll to put the fire out or move to a vacuum area." diff --git a/code/datums/components/forced_gravity.dm b/code/datums/components/forced_gravity.dm new file mode 100644 index 00000000000..bba0d8d71c4 --- /dev/null +++ b/code/datums/components/forced_gravity.dm @@ -0,0 +1,8 @@ +/datum/component/forced_gravity + var/gravity = 1 + 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 \ No newline at end of file diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index d65d28507c4..558c1978588 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -53,7 +53,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station icon_state = "start" requires_power = FALSE dynamic_lighting = DYNAMIC_LIGHTING_DISABLED - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY //EXTRA @@ -62,7 +62,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Asteroid" icon_state = "asteroid" requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY blob_allowed = FALSE //Nope, no winning on the asteroid as a blob. Gotta eat the station. valid_territory = FALSE ambientsounds = MINING diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 85a0fd1d4eb..9c0fa0cd452 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -47,7 +47,7 @@ var/static_light = 0 var/static_environ - var/has_gravity = FALSE + var/has_gravity = 0 var/noteleport = FALSE //Are you forbidden from teleporting to the area? (centcom, mobs, wizard, hand teleporter) var/hidden = FALSE //Hides area from player Teleport function. var/safe = FALSE //Is the area teleport-safe: no space / radiation / aggresive mobs / other dangers @@ -478,16 +478,39 @@ GLOBAL_LIST_EMPTY(teleportlocs) /atom/proc/has_gravity(turf/T) if(!T || !isturf(T)) T = get_turf(src) + + if(!T) + return 0 + + //Gravity forced on the atom + var/datum/component/forced_gravity/FG = GetComponent(/datum/component/forced_gravity) + if(FG) + if(!FG.ignore_space && isspaceturf(T)) + return 0 + else + return FG.gravity + + //Gravity forced on the turf + FG = T.GetComponent(/datum/component/forced_gravity) + if(FG) + if(!FG.ignore_space && isspaceturf(T)) + return 0 + else + return FG.gravity + var/area/A = get_area(T) if(isspaceturf(T)) // Turf never has gravity - return FALSE - else if(A && A.has_gravity) // Areas which always has gravity - return TRUE + return 0 + else if(A.has_gravity) // Areas which always has gravity + return A.has_gravity else // There's a gravity generator on our z level - if(T && GLOB.gravity_generators["[T.z]"] && length(GLOB.gravity_generators["[T.z]"])) - return TRUE - return FALSE + if(GLOB.gravity_generators["[T.z]"]) + var/max_grav = 0 + for(var/obj/machinery/gravity_generator/main/G in GLOB.gravity_generators["[T.z]"]) + max_grav = max(G.setting,max_grav) + return max_grav + return SSmapping.level_trait(T.z, ZTRAIT_GRAVITY) /area/proc/setup(a_name) name = a_name diff --git a/code/game/area/areas/away_content.dm b/code/game/area/areas/away_content.dm index cc2e317d854..b724c926079 100644 --- a/code/game/area/areas/away_content.dm +++ b/code/game/area/areas/away_content.dm @@ -7,7 +7,7 @@ Unused icons for new areas are "awaycontent1" ~ "awaycontent30" /area/awaymission name = "Strange Location" icon_state = "away" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY ambientsounds = AWAY_MISSION /area/awaymission/beach @@ -15,13 +15,13 @@ Unused icons for new areas are "awaycontent1" ~ "awaycontent30" icon_state = "away" dynamic_lighting = DYNAMIC_LIGHTING_DISABLED requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY ambientsounds = list('sound/ambience/shore.ogg', 'sound/ambience/seag1.ogg','sound/ambience/seag2.ogg','sound/ambience/seag2.ogg','sound/ambience/ambiodd.ogg','sound/ambience/ambinice.ogg') /area/awaymission/errorroom name = "Super Secret Room" dynamic_lighting = DYNAMIC_LIGHTING_DISABLED - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY /area/awaymission/vr name = "Virtual Reality" diff --git a/code/game/area/areas/centcom.dm b/code/game/area/areas/centcom.dm index c2719f57eb0..f5449369b5c 100644 --- a/code/game/area/areas/centcom.dm +++ b/code/game/area/areas/centcom.dm @@ -6,7 +6,7 @@ icon_state = "centcom" dynamic_lighting = DYNAMIC_LIGHTING_FORCED requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY noteleport = TRUE blob_allowed = FALSE //Should go without saying, no blobs should take over centcom as a win condition. flags_1 = NONE @@ -36,7 +36,7 @@ icon_state = "yellow" dynamic_lighting = DYNAMIC_LIGHTING_FORCED requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY flags_1 = NONE /area/tdome/arena @@ -74,7 +74,7 @@ icon_state = "yellow" dynamic_lighting = DYNAMIC_LIGHTING_FORCED requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY noteleport = TRUE flags_1 = NONE @@ -84,7 +84,7 @@ icon_state = "yellow" requires_power = FALSE noteleport = TRUE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY flags_1 = NONE //Syndicates @@ -92,7 +92,7 @@ name = "Syndicate Mothership" icon_state = "syndie-ship" requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY noteleport = TRUE blob_allowed = FALSE //Not... entirely sure this will ever come up... but if the bus makes blobs AND ops, it shouldn't aim for the ops to win. flags_1 = NONE @@ -120,7 +120,7 @@ name = "Capture the Flag" icon_state = "yellow" requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY flags_1 = NO_DEATHRATTLE_1 /area/ctf/control_room @@ -156,7 +156,7 @@ name = "Reebe" icon_state = "yellow" requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY noteleport = TRUE hidden = TRUE ambientsounds = REEBE diff --git a/code/game/area/areas/mining.dm b/code/game/area/areas/mining.dm index 493f36dd8d8..2ca9167bb2c 100644 --- a/code/game/area/areas/mining.dm +++ b/code/game/area/areas/mining.dm @@ -2,7 +2,7 @@ /area/mine icon_state = "mining" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY /area/mine/explored name = "Mine" @@ -80,7 +80,7 @@ /area/lavaland icon_state = "mining" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY flags_1 = NONE /area/lavaland/surface diff --git a/code/game/area/areas/ruins/_ruins.dm b/code/game/area/areas/ruins/_ruins.dm index 087842c5d1d..b97c3f0ef45 100644 --- a/code/game/area/areas/ruins/_ruins.dm +++ b/code/game/area/areas/ruins/_ruins.dm @@ -3,7 +3,7 @@ /area/ruin name = "\improper Unexplored Location" icon_state = "away" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY hidden = TRUE dynamic_lighting = DYNAMIC_LIGHTING_FORCED ambientsounds = RUINS diff --git a/code/game/area/areas/ruins/space.dm b/code/game/area/areas/ruins/space.dm index c52119361b9..00a7fed012d 100644 --- a/code/game/area/areas/ruins/space.dm +++ b/code/game/area/areas/ruins/space.dm @@ -5,7 +5,7 @@ blob_allowed = FALSE //Nope, no winning in space as a blob. Gotta eat the station. /area/ruin/space/has_grav - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY /area/ruin/space/has_grav/powered requires_power = FALSE @@ -413,13 +413,13 @@ /area/ruin/space/djstation name = "Ruskie DJ Station" icon_state = "DJ" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY blob_allowed = FALSE //Nope, no winning on the DJ station as a blob. Gotta eat the main station. /area/ruin/space/djstation/solars name = "DJ Station Solars" icon_state = "DJ" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY //ABANDONED TELEPORTER diff --git a/code/game/area/areas/shuttles.dm b/code/game/area/areas/shuttles.dm index 073e7714b2f..18948134914 100644 --- a/code/game/area/areas/shuttles.dm +++ b/code/game/area/areas/shuttles.dm @@ -6,7 +6,7 @@ name = "Shuttle" requires_power = FALSE dynamic_lighting = DYNAMIC_LIGHTING_FORCED - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY always_unpowered = FALSE valid_territory = FALSE icon_state = "shuttle" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 66610ed94d7..b937d4d932b 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -27,6 +27,8 @@ var/buckle_message_cooldown = 0 var/fingerprintslast + var/list/filter_data //For handling persistent filters + /atom/New(loc, ...) //atom creation method that preloads variables at creation if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New() @@ -576,3 +578,25 @@ /atom/proc/GenerateTag() return + +// Filter stuff +/atom/movable/proc/add_filter(name,priority,list/params) + if(!filter_data) + filter_data = list() + var/list/p = params.Copy() + p["priority"] = priority + filter_data[name] = p + update_filters() + +/atom/movable/proc/update_filters() + filters = null + sortTim(filter_data,associative = TRUE) + for(var/f in filter_data) + var/list/data = filter_data[f] + var/list/arguments = data.Copy() + arguments -= "priority" + filters += filter(arglist(arguments)) + +/atom/movable/proc/get_filter(name) + if(filter_data && filter_data[name]) + return filters[filter_data.Find(name)] \ No newline at end of file diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index 035fc845c4d..36129f4e4f8 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -86,9 +86,6 @@ density = FALSE var/boing = 0 -/obj/effect/anomaly/grav/New() - ..() - /obj/effect/anomaly/grav/anomalyEffect() ..() boing = 1 @@ -121,6 +118,20 @@ A.throw_at(target, 5, 1) boing = 0 +/obj/effect/anomaly/grav/high + var/grav_field + +/obj/effect/anomaly/grav/high/Initialize(mapload, new_lifespan) + . = ..() + setup_grav_field() + +/obj/effect/anomaly/grav/high/proc/setup_grav_field() + grav_field = make_field(/datum/proximity_monitor/advanced/gravity, list("current_range" = 7, "host" = src, "gravity_value" = rand(0,3))) + +/obj/effect/anomaly/grav/high/Destroy() + QDEL_NULL(grav_field) + . = ..() + ///////////////////// /obj/effect/anomaly/flux @@ -131,9 +142,6 @@ var/shockdamage = 20 var/explosive = TRUE -/obj/effect/anomaly/flux/New() - ..() - /obj/effect/anomaly/flux/anomalyEffect() ..() canshock = 1 @@ -179,9 +187,6 @@ icon_state = "bluespace" density = TRUE -/obj/effect/anomaly/bluespace/New() - ..() - /obj/effect/anomaly/bluespace/anomalyEffect() ..() for(var/mob/living/M in range(1,src)) @@ -252,9 +257,6 @@ icon_state = "mustard" var/ticks = 0 -/obj/effect/anomaly/pyro/New() - ..() - /obj/effect/anomaly/pyro/anomalyEffect() ..() ticks++ @@ -287,9 +289,6 @@ icon_state = "bhole3" desc = "That's a nice station you have there. It'd be a shame if something happened to it." -/obj/effect/anomaly/bhole/New() - ..() - /obj/effect/anomaly/bhole/anomalyEffect() ..() if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c38d2f67c69..f97f144d53a 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -275,6 +275,15 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE) if(!(interaction_flags_item & INTERACT_ITEM_ATTACK_HAND_PICKUP)) //See if we're supposed to auto pickup. return + //Heavy gravity makes picking up things very slow. + var/grav = user.has_gravity() + if(grav > STANDARD_GRAVITY) + var/grav_power = min(3,grav - STANDARD_GRAVITY) + to_chat(user,"You start picking up [src]...") + if(!do_mob(user,src,30*grav_power)) + return + + //If the item is in a storage item, take it out loc.SendSignal(COMSIG_TRY_STORAGE_TAKE, src, user.loc, TRUE) diff --git a/code/game/objects/items/grenades/antigravity.dm b/code/game/objects/items/grenades/antigravity.dm new file mode 100644 index 00000000000..43b2f949867 --- /dev/null +++ b/code/game/objects/items/grenades/antigravity.dm @@ -0,0 +1,17 @@ +/obj/item/grenade/antigravity + name = "antigravity grenade" + icon_state = "emp" + item_state = "emp" + + var/range = 7 + var/forced_value = 0 + var/duration = 300 + +/obj/item/grenade/antigravity/prime() + update_mob() + + for(var/turf/T in view(range,src)) + var/datum/component/C = T.AddComponent(/datum/component/forced_gravity,forced_value) + QDEL_IN(C,duration) + + qdel(src) diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index b5dfbf78174..260a4a9061e 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -177,5 +177,5 @@ /area/shuttle_arena name = "arena" - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY requires_power = FALSE diff --git a/code/modules/fields/gravity.dm b/code/modules/fields/gravity.dm new file mode 100644 index 00000000000..8b16bb6487f --- /dev/null +++ b/code/modules/fields/gravity.dm @@ -0,0 +1,17 @@ +/datum/proximity_monitor/advanced/gravity + name = "modified gravity zone" + setup_field_turfs = TRUE + var/gravity_value = 0 + var/list/grav_components = list() + field_shape = FIELD_SHAPE_RADIUS_SQUARE + +/datum/proximity_monitor/advanced/gravity/setup_field_turf(turf/T) + . = ..() + grav_components[T] = T.AddComponent(/datum/component/forced_gravity,gravity_value) + +/datum/proximity_monitor/advanced/gravity/cleanup_field_turf(turf/T) + . = ..() + var/datum/component/forced_gravity/G = grav_components[T] + grav_components -= T + if(G) + qdel(G) \ No newline at end of file diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 1ade5070a74..a21747837b4 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -915,7 +915,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( /datum/hallucination/fake_alert/New(mob/living/carbon/C, forced = TRUE, specific, duration = 150) set waitfor = FALSE ..() - var/alert_type = pick("not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","weightless","fire","locked","hacked","temphot","tempcold","pressure") + var/alert_type = pick("not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","gravity","fire","locked","hacked","temphot","tempcold","pressure") if(specific) alert_type = specific feedback_details += "Type: [alert_type]" @@ -937,7 +937,7 @@ GLOBAL_LIST_INIT(hallucination_list, list( target.throw_alert(alert_type, /obj/screen/alert/fat, override = TRUE) else target.throw_alert(alert_type, /obj/screen/alert/starving, override = TRUE) - if("weightless") + if("gravity") target.throw_alert(alert_type, /obj/screen/alert/weightless, override = TRUE) if("fire") target.throw_alert(alert_type, /obj/screen/alert/fire, override = TRUE) diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm index 9ad6d59c3a7..3005a29dcd7 100644 --- a/code/modules/mining/equipment/survival_pod.dm +++ b/code/modules/mining/equipment/survival_pod.dm @@ -4,7 +4,7 @@ icon_state = "away" dynamic_lighting = DYNAMIC_LIGHTING_FORCED requires_power = FALSE - has_gravity = TRUE + has_gravity = STANDARD_GRAVITY valid_territory = FALSE //Survival Capsule diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index a287c48f453..3899c95d661 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1074,8 +1074,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(H.movement_type & FLYING) flight = 1 - if(H.has_gravity()) - gravity = TRUE + gravity = H.has_gravity() if(!flightpack && gravity) //Check for chemicals and innate speedups and slowdowns if we're moving using our body and not a flying suit if(H.has_trait(TRAIT_GOTTAGOFAST)) @@ -1127,6 +1126,11 @@ GLOBAL_LIST_EMPTY(roundstart_races) if((hungry >= 70) && !flight) //Being hungry will still allow you to use a flightsuit/wings. . += hungry / 50 + //Moving in high gravity is very slow (Flying too) + if(gravity > STANDARD_GRAVITY) + var/grav_force = min(gravity - STANDARD_GRAVITY,3) + . += 1 + grav_force + GET_COMPONENT_FROM(mood, /datum/component/mood, H) if(mood && !flight) //How can depression slow you down if you can just fly away from your problems? switch(mood.sanity) diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 4ee96b26353..da683579ac7 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -58,7 +58,7 @@ //stuff in the stomach handle_stomach() - update_gravity(mob_has_gravity()) + handle_gravity() if(machine) machine.check_eye(src) @@ -137,3 +137,26 @@ /mob/living/proc/update_damage_hud() return + +/mob/living/proc/handle_gravity() + var/gravity = mob_has_gravity() + update_gravity(gravity) + + if(gravity > STANDARD_GRAVITY) + gravity_animate() + handle_high_gravity(gravity) + +/mob/living/proc/gravity_animate() + if(!get_filter("gravity")) + add_filter("gravity",1,list("type"="motion_blur", "x"=0, "y"=0)) + INVOKE_ASYNC(src, .proc/gravity_pulse_animation) + +/mob/living/proc/gravity_pulse_animation() + animate(get_filter("gravity"), y = 1, time = 10) + sleep(10) + animate(get_filter("gravity"), y = 0, time = 10) + +/mob/living/proc/handle_high_gravity(gravity) + if(gravity >= GRAVITY_DAMAGE_TRESHOLD) //Aka gravity values of 3 or more + var/grav_stregth = gravity - GRAVITY_DAMAGE_TRESHOLD + adjustBruteLoss(min(grav_stregth,3)) \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a9e1289b004..142533977b4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -647,9 +647,15 @@ if(!SSticker.HasRoundStarted()) return if(has_gravity) - clear_alert("weightless") + if(has_gravity == 1) + clear_alert("gravity") + else + if(has_gravity >= GRAVITY_DAMAGE_TRESHOLD) + throw_alert("gravity", /obj/screen/alert/veryhighgravity) + else + throw_alert("gravity", /obj/screen/alert/highgravity) else - throw_alert("weightless", /obj/screen/alert/weightless) + throw_alert("gravity", /obj/screen/alert/weightless) if(!override && !is_flying()) float(!has_gravity) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b149701591c..3fadd0d6c80 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -405,4 +405,7 @@ return 1 /mob/living/silicon/get_inactive_held_item() - return FALSE \ No newline at end of file + return FALSE + +/mob/living/silicon/handle_high_gravity(gravity) + return diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 0e6c3176e70..768843c0bce 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -124,6 +124,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne var/charge_count = 100 var/current_overlay = null var/broken_state = 0 + var/setting = 1 //Gravity value when on /obj/machinery/gravity_generator/main/Destroy() // If we somehow get deleted, remove all of our other parts. investigate_log("was destroyed!", INVESTIGATE_GRAVITY) @@ -385,6 +386,11 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne else GLOB.gravity_generators["[T.z]"] -= src +/obj/machinery/gravity_generator/main/proc/change_setting(value) + if(value != setting) + setting = value + shake_everyone() + // Misc /obj/item/paper/guides/jobs/engi/gravity_gen diff --git a/tgstation.dme b/tgstation.dme index 24f9efbae03..41b07e6d34e 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -321,6 +321,7 @@ #include "code\datums\components\earhealing.dm" #include "code\datums\components\earprotection.dm" #include "code\datums\components\empprotection.dm" +#include "code\datums\components\forced_gravity.dm" #include "code\datums\components\forensics.dm" #include "code\datums\components\infective.dm" #include "code\datums\components\jousting.dm" @@ -832,6 +833,7 @@ #include "code\game\objects\items\devices\radio\headset.dm" #include "code\game\objects\items\devices\radio\intercom.dm" #include "code\game\objects\items\devices\radio\radio.dm" +#include "code\game\objects\items\grenades\antigravity.dm" #include "code\game\objects\items\grenades\chem_grenade.dm" #include "code\game\objects\items\grenades\clusterbuster.dm" #include "code\game\objects\items\grenades\emgrenade.dm" @@ -1526,6 +1528,7 @@ #include "code\modules\events\wizard\shuffle.dm" #include "code\modules\events\wizard\summons.dm" #include "code\modules\fields\fields.dm" +#include "code\modules\fields\gravity.dm" #include "code\modules\fields\peaceborg_dampener.dm" #include "code\modules\fields\timestop.dm" #include "code\modules\fields\turf_objects.dm"