mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 20:11:56 +00:00
* Fixes mapstart and random arcade machines (#53958) Randomly generated arcade machines were getting random boards and initing properly, but they weren't re-built as the appropriate subtype. This oversight has been remedied. A new subtype has been created for random arcade machines which exists purely to pick a random circuit then create a machine from that circuit's build path before returning that it should be qdel'd. This new subtype has been appropriately regex find-and-replaced into all maps. * Objectify * Fixes mapstart and random arcade machines Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
26 lines
866 B
Plaintext
26 lines
866 B
Plaintext
/obj/effect/spawner/randomarcade
|
|
icon = 'icons/obj/computer.dmi'
|
|
icon_state = "arcade"
|
|
name = "spawn random arcade machine"
|
|
desc = "Automagically transforms into a random arcade machine. If you see this while in a shift, please create a bug report."
|
|
|
|
/obj/effect/spawner/randomarcade/Initialize(mapload)
|
|
..()
|
|
|
|
var/static/list/gameodds = list(
|
|
/obj/item/circuitboard/computer/arcade/battle = 49,
|
|
/obj/item/circuitboard/computer/arcade/orion_trail = 49,
|
|
/obj/item/circuitboard/computer/arcade/amputation = 2)
|
|
var/obj/item/circuitboard/circuit = pickweight(gameodds)
|
|
var/new_build_path = initial(circuit.build_path)
|
|
|
|
if(!ispath(new_build_path))
|
|
stack_trace("Circuit with incorrect build path: [circuit]")
|
|
return INITIALIZE_HINT_QDEL
|
|
|
|
var/obj/arcade = new new_build_path(loc)
|
|
arcade.setDir(dir)
|
|
|
|
// And request a qdel.
|
|
return INITIALIZE_HINT_QDEL
|