Files
Bubberstation/code/game/objects/effects/spawners/arcade.dm
SkyratBot dfb34d55ba [MIRROR] Fixes mapstart and random arcade machines (#1011)
* 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>
2020-09-27 19:18:44 +02:00

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