Files
Aurora.3/code/modules/admin/secrets/random_events/gravity.dm
T
Batrachophreno 4ecb0bc21c Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for
reviewers:** the only meaningful changed code exists within
**code/game/objects/structures.dm** and
**code/game/objects/structures/_machinery.dm**, largely concerning
damage procs. With the exception of moving airlock defines to their own
file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES.

Objects, _categorically_, are largely divided between those you can hold
in your hand/inventory and those you can't. Machinery objects are
already subtypes of Structures behaviorally, this PR just makes their
pathing reflect that, and allows for future work (tool actions, more
health/destruction functionality) to be developed without unnecessary
code duplication.

I have tested this PR by loading up the Horizon and dismantling various
machines and structures with tools, shooting guns of various types
throughout the ship, and detonating a bunch of explosions throughout the
ship.
2026-05-26 19:35:48 +00:00

34 lines
1.3 KiB
Plaintext

/**********
* Gravity *
**********/
/datum/admin_secret_item/random_event/gravity/New()
..()
name = "Toggle [station_name(TRUE)] Artificial Gravity"
/datum/admin_secret_item/random_event/gravity/can_execute(var/mob/user)
if(!(SSticker.mode))
return 0
return ..()
/datum/admin_secret_item/random_event/gravity/execute(var/mob/user)
. = ..()
if(!.)
return
GLOB.gravity_is_on = !GLOB.gravity_is_on
for(var/A in SSmachinery.gravity_generators)
var/obj/structure/machinery/gravity_generator/main/B = A
B.eventshutofftoggle()
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","Grav")
if(GLOB.gravity_is_on)
log_admin("[key_name(user)] toggled gravity on.")
message_admins(SPAN_NOTICE("[key_name_admin(user)] toggled gravity on."), 1)
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.")
else
log_admin("[key_name(user)] toggled gravity off.")
message_admins(SPAN_NOTICE("[key_name_admin(usr)] toggled gravity off."), 1)
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial gravity has been disabled whilst the system reinitializes. Further failures may result in a gravitational collapse and formation of blackholes. Have a nice day.")