Files
Bubberstation/code/modules/holodeck/holo_effect.dm
SpaceLoveSs13 91946bbab6 Cherry-pick of all NO DESTRUCTION (#27477)
* [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>
2024-04-27 03:16:47 +02:00

126 lines
4.0 KiB
Plaintext

/*
The holodeck activates these shortly after the program loads,
and deactivates them immediately before changing or disabling the holodeck.
These remove snowflake code for special holodeck functions.
*/
/obj/effect/holodeck_effect
icon = 'icons/hud/screen_gen.dmi'
icon_state = "x2"
invisibility = INVISIBILITY_ABSTRACT
/obj/effect/holodeck_effect/proc/activate(obj/machinery/computer/holodeck/HC)
return
/obj/effect/holodeck_effect/proc/deactivate(obj/machinery/computer/holodeck/HC)
qdel(src)
return
// Called by the holodeck computer as long as the program is running
/obj/effect/holodeck_effect/proc/tick(obj/machinery/computer/holodeck/HC)
return
/obj/effect/holodeck_effect/proc/safety(active)
return
// Generates a holodeck-tracked card deck
/obj/effect/holodeck_effect/cards
icon = 'icons/obj/toys/playing_cards.dmi'
icon_state = "deck_syndicate_full"
/obj/effect/holodeck_effect/cards/activate(obj/machinery/computer/holodeck/holodeck)
var/obj/item/toy/cards/deck/syndicate/holographic/deck = new(loc, holodeck)
deck.flags_1 |= HOLOGRAM_1
return deck
/obj/effect/holodeck_effect/sparks/activate(obj/machinery/computer/holodeck/HC)
var/turf/T = get_turf(src)
if(T)
var/datum/effect_system/spark_spread/s = new
s.set_up(3, 1, T)
s.start()
T.temperature = 5000 //Why? not quite sure to be honest with you
T.hotspot_expose(50000,50000,1)
/obj/effect/holodeck_effect/random_book
/obj/effect/holodeck_effect/random_book/activate(obj/machinery/computer/holodeck/father_holodeck)
var/static/banned_books = list(/obj/item/book/manual/random, /obj/item/book/manual/nuclear, /obj/item/book/manual/wiki)
var/newtype = pick(subtypesof(/obj/item/book/manual) - banned_books)
var/obj/item/book/manual/to_spawn = new newtype(loc)
to_spawn.flags_1 |= HOLOGRAM_1
to_spawn.obj_flags |= NO_DEBRIS_AFTER_DECONSTRUCTION
return to_spawn
/obj/effect/holodeck_effect/mobspawner
var/mobtype = /mob/living/basic/carp/holographic
var/mob/our_mob = null
/obj/effect/holodeck_effect/mobspawner/activate(obj/machinery/computer/holodeck/HC)
if(islist(mobtype))
mobtype = pick(mobtype)
our_mob = new mobtype(loc)
our_mob.flags_1 |= HOLOGRAM_1
// these vars are not really standardized but all would theoretically create stuff on death
our_mob.add_traits(list(TRAIT_PERMANENTLY_MORTAL, TRAIT_NO_BLOOD_OVERLAY, TRAIT_NOBLOOD, TRAIT_NOHUNGER), INNATE_TRAIT)
RegisterSignal(our_mob, COMSIG_QDELETING, PROC_REF(handle_mob_delete))
return our_mob
/obj/effect/holodeck_effect/mobspawner/deactivate(obj/machinery/computer/holodeck/HC)
if(our_mob)
HC.derez(our_mob)
qdel(src)
/obj/effect/holodeck_effect/mobspawner/proc/handle_mob_delete(datum/source)
SIGNAL_HANDLER
our_mob = null
/obj/effect/holodeck_effect/mobspawner/pet
/obj/effect/holodeck_effect/mobspawner/pet/Initialize(mapload)
. = ..()
mobtype = list(
/mob/living/basic/butterfly,
/mob/living/basic/chick/permanent,
/mob/living/basic/pet/fox/docile,
/mob/living/basic/rabbit,
)
mobtype += pick(
/mob/living/basic/pet/dog/corgi,
/mob/living/basic/pet/dog/corgi/puppy,
/mob/living/basic/pet/dog/pug,
)
mobtype += pick(
/mob/living/basic/pet/cat,
/mob/living/basic/pet/cat/kitten,
)
/obj/effect/holodeck_effect/mobspawner/bee
mobtype = /mob/living/basic/bee/toxin
/obj/effect/holodeck_effect/mobspawner/monkey
mobtype = /mob/living/carbon/human/species/monkey
/obj/effect/holodeck_effect/mobspawner/monkey/activate(obj/machinery/computer/holodeck/computer)
var/mob/living/carbon/human/monkey = ..()
. = list() + monkey
for(var/atom/atom as anything in monkey.contents + monkey.organs)
. += atom
/obj/effect/holodeck_effect/mobspawner/penguin
mobtype = /mob/living/basic/pet/penguin/emperor/neuter
/obj/effect/holodeck_effect/mobspawner/penguin/Initialize(mapload)
if(prob(1))
mobtype = /mob/living/basic/pet/penguin/emperor/shamebrero/neuter
return ..()
/obj/effect/holodeck_effect/mobspawner/penguin_baby
mobtype = /mob/living/basic/pet/penguin/baby/permanent
/obj/effect/holodeck_effect/mobspawner/crab/jon
mobtype = /mob/living/basic/crab/jon