Convert most of /obj/machinery to use Initialize rather than New (#17845)

* Switch a bunch of /obj/machinery from /New to /Initialize

This is an easy and uncontroversial batch.
No globs, no late init, and stuff.

* Move more machinery to Initialize

This time the ones dealing with GLOB vars,
as well as some simpler ones i missed previously.

* More tricky New -> Initialize migrations

* The last of machinery Initialize conversion

* fixups

* Newscaster armor fix

* styling

* Comment on armor handling

* Move newscaster armor definition back to datum

* farie82 review

* kill extra .=

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

* farie's review part 2

Co-authored-by: Farie82 <farie82@users.noreply.github.com>

Co-authored-by: Farie82 <farie82@users.noreply.github.com>
This commit is contained in:
moxian
2022-06-29 08:33:52 +02:00
committed by GitHub
co-authored by Farie82
parent 3807bf43c7
commit 09e7f54a43
101 changed files with 410 additions and 453 deletions
+3 -3
View File
@@ -14,12 +14,12 @@
var/last_winner = null //for letting people who to hunt down and steal prizes from
var/window_name = "arcade" //in case you want to change the window name for certain machines
/obj/machinery/arcade/New()
..()
/obj/machinery/arcade/Initialize(mapload)
. = ..()
if(type == /obj/machinery/arcade) //if you spawn the base-type, it will replace itself with a random subtype for randomness
var/choice = pick(subtypesof(/obj/machinery/arcade))
new choice(loc)
qdel(src)
return INITIALIZE_HINT_QDEL
/obj/machinery/arcade/examine(mob/user)
. = ..()
+2 -2
View File
@@ -17,8 +17,8 @@ GLOBAL_VAR(claw_game_html)
'icons/obj/arcade_images/prize_inside.png',
'icons/obj/arcade_images/prizeorbs.png')
/obj/machinery/arcade/claw/New()
..()
/obj/machinery/arcade/claw/Initialize(mapload)
. = ..()
machine_image = pick("_1", "_2")
update_icon()
+2 -2
View File
@@ -10,8 +10,8 @@
idle_power_usage = 40
var/tickets = 0
/obj/machinery/prize_counter/New()
..()
/obj/machinery/prize_counter/Initialize(mapload)
. = ..()
component_parts = list()
component_parts += new /obj/item/circuitboard/prize_counter(null)
component_parts += new /obj/item/stock_parts/matter_bin(null)