migrate all /obj/item from /New() to /Initialize() (#31232)

* migrate all /obj/item from /New() to /Initialize()

* move GLOB.chemical_reagents_list creation to /world/New()

* review

* oops

* autodoc a smart var
This commit is contained in:
Toastical
2026-01-28 19:44:32 +00:00
committed by GitHub
parent a0ed4b0066
commit 4c74b78a18
89 changed files with 321 additions and 362 deletions
+2 -2
View File
@@ -30,8 +30,8 @@
scatter_distance = 10
/obj/item/ammo_casing/New()
..()
/obj/item/ammo_casing/Initialize(mapload)
. = ..()
if(projectile_type)
BB = new projectile_type(src)
scatter_atom()
@@ -299,8 +299,8 @@
muzzle_flash_strength = MUZZLE_FLASH_STRENGTH_NORMAL
muzzle_flash_range = MUZZLE_FLASH_RANGE_NORMAL
/obj/item/ammo_casing/shotgun/dart/New()
..()
/obj/item/ammo_casing/shotgun/dart/Initialize(mapload)
. = ..()
create_reagents(30)
/obj/item/ammo_casing/shotgun/dart/attackby__legacy__attackchain()
@@ -309,8 +309,8 @@
/obj/item/ammo_casing/shotgun/dart/bioterror
desc = "A shotgun dart filled with deadly toxins."
/obj/item/ammo_casing/shotgun/dart/bioterror/New()
..()
/obj/item/ammo_casing/shotgun/dart/bioterror/Initialize(mapload)
. = ..()
reagents.add_reagent("neurotoxin", 6)
reagents.add_reagent("spore", 6)
reagents.add_reagent("capulettium_plus", 6) //;HELP OPS IN MAINT
@@ -163,8 +163,8 @@
fire_sound = 'sound/weapons/pulse3.ogg'
var/temp = 300
/obj/item/ammo_casing/energy/temp/New()
..()
/obj/item/ammo_casing/energy/temp/Initialize(mapload)
. = ..()
BB = null
/obj/item/ammo_casing/energy/temp/newshot()
@@ -234,7 +234,7 @@
select_name = "blue"
harmful = FALSE
/obj/item/ammo_casing/energy/wormhole/New(obj/item/gun/energy/wormhole_projector/wh)
/obj/item/ammo_casing/energy/wormhole/Initialize(mapload, obj/item/gun/energy/wormhole_projector/wh)
gun = wh
return ..()
@@ -348,8 +348,8 @@
select_name = "teleport beam"
var/teleport_target
/obj/item/ammo_casing/energy/teleport/New()
..()
/obj/item/ammo_casing/energy/teleport/Initialize(mapload)
. = ..()
BB = null
/obj/item/ammo_casing/energy/teleport/newshot()
@@ -362,8 +362,8 @@
select_name = "gun mimic"
var/mimic_type
/obj/item/ammo_casing/energy/mimic/New()
..()
/obj/item/ammo_casing/energy/mimic/Initialize(mapload)
. = ..()
BB = null
/obj/item/ammo_casing/energy/mimic/newshot()
+1 -1
View File
@@ -115,7 +115,7 @@
select = clamp(select, 1, length(ammo_type)) // If we decrease ammo types while selecting a removed one, we want to make sure it doesnt try to select an out of bounds index
for(var/i = 1, i <= length(ammo_type), i++)
var/shottype = ammo_type[i]
shot = new shottype(src)
shot = new shottype(src, src)
ammo_type[i] = shot
shot = ammo_type[select]
fire_sound = shot.fire_sound
+1 -1
View File
@@ -54,7 +54,7 @@
/obj/item/gun/magic/Initialize(mapload)
. = ..()
charges = max_charges
chambered = new ammo_type(src)
chambered = new ammo_type(src, src)
if(can_charge)
START_PROCESSING(SSobj, src)