mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-19 22:23:11 +00:00
* [NO GBP] Patches & renaming for `NO_DECONSTRUCTION` flag (#82547) ## About The Pull Request 1. Renames `NO_DECONSTRUCTION` -> `NO_DEBRIS_AFTER_DECONSTRUCTION`. As the name suggests when the object is deconstructed it won't drop any items/debris. After my last refactor for this flag it now serves a new purpose so its name has been changed to match that 2. Fixes objects that are now using `NO_DECONSTRUCTION` incorrectly. Some of these changes include - Removing the flag in objects where there are no means to deconstruct them (e.g. jukebox, hydroponics soil, flora etc) - Replacing the flags old purpose by overriding its tool procs so that it regains its old behaviour(e.g. You once again cannot deconstruct ctf reinforced tables, survival pods, indestructible windows etc) ## Changelog 🆑 code: renamed `NO_DECONSTRUCTION` to `NO_DEBRIS_AFTER_DECONSTRUCTION` so its name matches its intended purpose fix: fixes some items that incorrectly used `NO_DECONSTRUCTION` prior to its refactor, meaning makes some objects non deconstructable again /🆑 * NO DESTRUCTION * Linter fix * Fixes standard RPEDs not working on machines (#82528) ## About The Pull Request Previously, `exchange_parts(...)` would cancel if both the `NO_DECONSTRUCTION` flag was set and you couldn't use your part replacer from a distance.1583cf0cc9/code/game/machinery/_machinery.dm (L958-L959)Our recent removal of `NO_DECONSTRUCTION`, however, has left this to _only_ be the latter.f0ed4ba4ce/code/game/machinery/_machinery.dm (L956-L957)Buuuuut this makes it unconditionally cancel for normal RPEDs, instead of only blocking them if `NO_DECONSTRUCTION` was set. As `NO_DECONSTRUCTION` is very much no longer relevant for this purpose, we simply remove the ranged RPED check altogether. This fixes our issue. ## Why It's Good For The Game Fixes #82525. ## Changelog 🆑 fix: Standard RPEDs work on machines again. /🆑 * Machinery Destroy() side effect clean up (#82659) ## About The Pull Request I have combed over implementations of `Destroy()` for `obj/machinery`, and noticed quite a few was spawning items or playing sounds. **Slot machines**: Moved payout to on_deconstruction() **Windoors**: Break sound moved to on_deconstruction(). I have also slightly cleaned up Destroy(), the windoor calls air_update_turf directly, as that proc already retrieves the turf it is on. **Atmospheric pipe**: Releases air and deconstructs meter objects on_deconstruction(). **Portable atmospheric devices**: Drop hyper noblium crystal on on_destruction(). **Pump, Scrubbers**: Releases air on_deconstruction(). **PACMAN power generator**: Spawns dropped fuel on_deconstruction(). **Runic vendor**: Moved vanishing effects to on_deconstruction(). I did not change Destroy side effects in the following instances: - side effects are critical for the round (e.g. doomsday device, nuke, blackbox recorder dropping the tape, gulag item reclaimer [less critical but still]) - might spawn messages and noises, but moving them to on_deconstruct would put linked items into an unusable state if deleted directly (e.g. express order console, cyborg lockdown console, tram paired sensors) - would potentially delete mobs we don't want deleted (e.g. disposals, slime camera console) Out of 220 Destroy defines, I found only 8 side effects that could not be moved to other procs, so `machinery\Destroy()` has almost always been used properly! I really hope `structure` will be as well made. Other changes: - Stasis beds had a completely empty destroy, removed - Mass drivers had two destroy procs, merged ## Why It's Good For The Game The Destroy() proc should only contain reference clean ups, barring edge cases that would harm playability. ## Changelog Nothing player facing. * Fix linter * icon fix * icon fix again --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: Profakos <profakos@gmail.com>
110 lines
3.9 KiB
Plaintext
110 lines
3.9 KiB
Plaintext
/obj/machinery/spaceship_navigation_beacon
|
|
name = "radio navigation gigabeacon"
|
|
desc = "A device that constantly transmits its position over several different commonly used maritime navigation frequencies. Used to create shuttle navigation waypoints in unexplored or undeveloped areas."
|
|
icon = 'icons/obj/machines/navigation_beacon.dmi'
|
|
icon_state = "beacon_active"
|
|
base_icon_state = "beacon"
|
|
density = TRUE
|
|
|
|
/// Locked beacons cannot be jumped to by ships.
|
|
var/locked = FALSE
|
|
/// Time between automated messages.
|
|
var/automatic_message_cooldown = 5 MINUTES
|
|
/// Next world tick to send an automatic message.
|
|
var/next_automatic_message_time
|
|
/// Our internal radio.
|
|
var/obj/item/radio/radio
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/Initialize(mapload)
|
|
. = ..()
|
|
SSshuttle.beacon_list |= src
|
|
|
|
name = "[initial(src.name)] [z]-[rand(0, 999)]"
|
|
|
|
var/static/list/multitool_tips = list(
|
|
TOOL_MULTITOOL = list(
|
|
SCREENTIP_CONTEXT_LMB = "Edit beacon name",
|
|
SCREENTIP_CONTEXT_RMB = "Lock/Unlock beacon",
|
|
)
|
|
)
|
|
AddElement(/datum/element/contextual_screentip_tools, multitool_tips)
|
|
|
|
radio = new(src)
|
|
radio.set_listening(FALSE)
|
|
radio.set_frequency(FREQ_RADIO_NAV_BEACON)
|
|
radio.freqlock = RADIO_FREQENCY_LOCKED
|
|
radio.recalculateChannels()
|
|
|
|
START_PROCESSING(SSmachines, src)
|
|
COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown)
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/emp_act(severity)
|
|
. = ..()
|
|
locked = TRUE
|
|
update_appearance(UPDATE_ICON_STATE)
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/Destroy()
|
|
SSshuttle.beacon_list -= src
|
|
return ..()
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/update_icon_state()
|
|
icon_state = "[base_icon_state][locked ? "_locked" : "_active"]"
|
|
return ..()
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/tool)
|
|
..()
|
|
|
|
var/chosen_tag = tgui_input_text(user, "Enter the custom name for this beacon", "Beacon Reclassification", max_length = MAX_NAME_LEN)
|
|
if(!chosen_tag)
|
|
return
|
|
|
|
var/new_name = "[initial(src.name)] [chosen_tag]"
|
|
if(new_name && Adjacent(user))
|
|
name = new_name
|
|
balloon_alert_to_viewers("beacon renamed")
|
|
|
|
return TRUE
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/multitool_act_secondary(mob/living/user, obj/item/tool)
|
|
..()
|
|
|
|
locked = !locked
|
|
|
|
balloon_alert_to_viewers("[!locked ? "unlocked" : "locked"]")
|
|
update_icon_state()
|
|
|
|
return TRUE
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/examine()
|
|
.=..()
|
|
. += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.")
|
|
if(locked)
|
|
. += span_warning("The blinking red light on the front indicates that this beacon is LOCKED.")
|
|
else
|
|
. += span_notice("The blinking green light on the front indicates that this beacon is operating normally.")
|
|
|
|
/obj/machinery/spaceship_navigation_beacon/process(seconds_per_tick)
|
|
if(COOLDOWN_FINISHED(src, next_automatic_message_time) && radio)
|
|
var/automatic_nav_message = "[src], Sector [z], [locked ? "Beacon Locked" : "Beacon Operational"], Grid Coordinates, [x] East, [y] North."
|
|
|
|
radio.talk_into(src, "[automatic_nav_message]")
|
|
|
|
COOLDOWN_START(src, next_automatic_message_time, automatic_message_cooldown)
|
|
|
|
// Item used to actually make nav beacons
|
|
|
|
/obj/item/folded_navigation_gigabeacon
|
|
name = "compact radio navigation gigabeacon"
|
|
desc = "A compact radio navigation gigabeacon, a device used to provide shuttle navigation waypoints in unexplored areas. Must be deployed before use."
|
|
icon = 'icons/obj/machines/navigation_beacon.dmi'
|
|
icon_state = "beacon_folded"
|
|
|
|
/obj/item/folded_navigation_gigabeacon/Initialize(mapload)
|
|
. = ..()
|
|
AddComponent(/datum/component/deployable, 3 SECONDS, /obj/machinery/spaceship_navigation_beacon)
|
|
|
|
/obj/item/folded_navigation_gigabeacon/examine()
|
|
.=..()
|
|
. += span_notice("The backside has instructions in various galactic languages detailing how this can be deployed <b>in hand</b> without any special tools.")
|
|
. += span_notice("'[FREQ_RADIO_NAV_BEACON / 10] kHz' is printed on the side.")
|