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
@@ -14,9 +14,9 @@
icon_state = "camera"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
/obj/machinery/computer/camera_advanced/abductor/New()
/obj/machinery/computer/camera_advanced/abductor/Initialize(mapload)
. = ..()
GLOB.abductor_equipment.Add(src)
..()
/obj/machinery/computer/camera_advanced/abductor/CreateEye()
..()
@@ -4,9 +4,9 @@
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
var/team = 0
/obj/machinery/abductor/New()
/obj/machinery/abductor/Initialize(mapload)
. = ..()
GLOB.abductor_equipment.Add(src)
..()
/obj/machinery/abductor/Destroy()
GLOB.abductor_equipment.Remove(src)
@@ -30,6 +30,12 @@
/obj/machinery/abductor/console/Initialize()
..()
return INITIALIZE_HINT_LATELOAD
/obj/machinery/abductor/console/LateInitialize()
..()
// GLOB.abductor_equipment is populated in Initialize;
// delaying linkage until after.
Link_Abduction_Equipment()
/obj/machinery/abductor/console/attack_hand(mob/user)
@@ -13,8 +13,8 @@
//TODO : replace with presets or spectrum
return rgb(rand(0,255),rand(0,255),rand(0,255))
/obj/machinery/abductor/gland_dispenser/New()
..()
/obj/machinery/abductor/gland_dispenser/Initialize(mapload)
. = ..()
gland_types = subtypesof(/obj/item/organ/internal/heart/gland)
gland_types = shuffle(gland_types)
gland_colors = new/list(gland_types.len)