portable gravity machine (#85694)

## About The Pull Request



https://github.com/user-attachments/assets/98aa2177-ee0f-48d0-bbd4-83d01e688b54


it makes gravity in a radius
you may order it from cargo
may take power from wire instead
## Why It's Good For The Game

good for like space bases and stuff

## Changelog

🆑
add: portable gravity unit, bought at cargo
/🆑
This commit is contained in:
jimmyl
2024-08-17 21:12:38 +02:00
committed by GitHub
parent eb0c661bdd
commit 3fc1503fbd
15 changed files with 538 additions and 0 deletions
@@ -63,3 +63,63 @@
/datum/proximity_monitor/advanced/gravity/warns_on_entrance/proc/clear_recent_warning(mob_ref_key)
LAZYREMOVE(recently_warned, mob_ref_key)
/obj/gravity_fluff_field
icon = 'icons/obj/smooth_structures/grav_field.dmi'
icon_state = "grav_field-0"
base_icon_state = "grav_field"
obj_flags = NONE
anchored = TRUE
move_resist = INFINITY
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pass_flags_self = LETPASSCLICKS
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_GRAV_FIELD
canSmoothWith = SMOOTH_GROUP_GRAV_FIELD
alpha = 200
/// our emissive appearance
var/mutable_appearance/emissive
/obj/gravity_fluff_field/Initialize(mapload, strength)
. = ..()
if(isnull(strength))
return INITIALIZE_HINT_QDEL
QUEUE_SMOOTH(src)
QUEUE_SMOOTH_NEIGHBORS(src)
switch(strength)
if(2 to INFINITY)
particles = new /particles/grav_field_down/strong()
if(1 to 2)
particles = new /particles/grav_field_down()
if(0 to 1)
particles = new /particles/grav_field_float()
if(-INFINITY to -1)
particles = new /particles/grav_field_up()
color = particles.color
RegisterSignal(src, COMSIG_ATOM_SMOOTHED_ICON, PROC_REF(smoothed))
/obj/gravity_fluff_field/Destroy(force)
. = ..()
QDEL_NULL(particles)
emissive = null
/obj/gravity_fluff_field/proc/smoothed(datum/source)
SIGNAL_HANDLER
cut_overlay(emissive)
// because it uses a different name
emissive = emissive_appearance('icons/obj/smooth_structures/grav_field_emissive.dmi', "grav_field_emissive-[splittext(icon_state, "-")[2]]", src)
add_overlay(emissive)
// Subtype which adds a subtle overlay to all turfs
/datum/proximity_monitor/advanced/gravity/subtle_effect
/datum/proximity_monitor/advanced/gravity/subtle_effect/setup_field_turf(turf/target)
. = ..()
if(!isopenturf(target))
return
new /obj/gravity_fluff_field(target, gravity_value)
/datum/proximity_monitor/advanced/gravity/subtle_effect/cleanup_field_turf(turf/target)
. = ..()
qdel(locate(/obj/gravity_fluff_field) in target)