mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-05 14:17:12 +01:00
ae5a4f955d
## About The Pull Request Signals were initially only usable with component listeners, which while no longer the case has lead to outdated documentation, names, and a similar location in code. This pr pulls the two apart. Partially because mso thinks we should, but also because they really aren't directly linked anymore, and having them in this midstate just confuses people. [Renames comp_lookup to listen_lookup, since that's what it does](https://github.com/tgstation/tgstation/commit/102b79694fa8eb57ecf7b36032616a9e368ccced) [Moves signal procs over to their own file](https://github.com/tgstation/tgstation/commit/33d07d01fd336726b4f6f6f1b61bb0b3f11a00dc) [Renames the PREQDELETING and QDELETING comsigs to drop the parent bit since they can hook to more then just comps now](https://github.com/tgstation/tgstation/commit/335ea4ad081ec63c42cfa05856e582cca833af6e) [Does something similar to the attackby comsigs (PARENT -> ATOM)](https://github.com/tgstation/tgstation/commit/210e57051df63f88dac3dd83321236da825aae5e) [And finally passes over the examine signals](https://github.com/tgstation/tgstation/commit/65917658fb8a1e7d28ae23c9437a583d646f0302) ## Why It's Good For The Game Code makes more sense, things are better teased apart, s just good imo ## Changelog 🆑 refactor: Pulled apart the last vestiges of names/docs directly linking signals to components /🆑
119 lines
3.8 KiB
Plaintext
119 lines
3.8 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 | NODECONSTRUCT_1)
|
|
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
|
|
for(var/v in list("butcher_results","corpse","weapon1","weapon2","blood_volume") & our_mob.vars)
|
|
our_mob.vars[v] = null
|
|
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/rabbit,
|
|
/mob/living/simple_animal/pet/fox,
|
|
)
|
|
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/simple_animal/pet/cat,
|
|
/mob/living/simple_animal/pet/cat/kitten,
|
|
)
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/bee
|
|
mobtype = /mob/living/simple_animal/hostile/bee/toxin
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/monkey
|
|
mobtype = /mob/living/simple_animal/holodeck_monkey
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/penguin
|
|
mobtype = /mob/living/simple_animal/pet/penguin/emperor
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/penguin/Initialize(mapload)
|
|
if(prob(1))
|
|
mobtype = /mob/living/simple_animal/pet/penguin/emperor/shamebrero
|
|
return ..()
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/penguin_baby
|
|
mobtype = /mob/living/simple_animal/pet/penguin/baby
|
|
|
|
/obj/effect/holodeck_effect/mobspawner/crab/jon
|
|
mobtype = /mob/living/simple_animal/crab/jon
|