diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index aa1832295ff..36e0bbd2486 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -158,6 +158,8 @@ GLOB.emote_list = init_emote_list() + GLOB.chemical_reagents_list = init_reagent_list() + // Set up PCWJ recipes initialize_cooking_recipes() @@ -240,3 +242,10 @@ .[E.key_third_person] = list(E) else .[E.key_third_person] |= E + +/// Initialises all of /datum/reagent into a list indexed by reagent id. +/proc/init_reagent_list() + . = list() + for(var/path in subtypesof(/datum/reagent)) + var/datum/reagent/R = new path() + .[R.id] = R diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index d141bfe61b1..a1138816e2d 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -730,8 +730,8 @@ GLOBAL_VAR(bomb_set) . = ..() . += SPAN_WARNING("This disk has had its safeties removed. It will not teleport back to the station if taken too far away.") -/obj/item/disk/nuclear/New() - ..() +/obj/item/disk/nuclear/Initialize(mapload) + . = ..() if(restricted_to_station) START_PROCESSING(SSobj, src) if(!training) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 8dd45dfcee3..9df84e01fd0 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -39,8 +39,8 @@ var/icon_medium = "pinonmedium" var/icon_far = "pinonfar" -/obj/item/pinpointer/New() - ..() +/obj/item/pinpointer/Initialize(mapload) + . = ..() GLOB.pinpointer_list += src /obj/item/pinpointer/Destroy() diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index bf3ac42f365..93fc6ccbf16 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -273,8 +273,8 @@ GLOBAL_LIST_EMPTY(multiverse) var/duplicate_self = 0 //Do we want the species randomized along with equipment should the user be duplicated in their entirety? var/sword_type = /obj/item/multisword //type of sword to equip. -/obj/item/multisword/New() - ..() +/obj/item/multisword/Initialize(mapload) + . = ..() GLOB.multiverse |= src diff --git a/code/game/gamemodes/wizard/godhand.dm b/code/game/gamemodes/wizard/godhand.dm index 19bbb178690..7d66b356ff9 100644 --- a/code/game/gamemodes/wizard/godhand.dm +++ b/code/game/gamemodes/wizard/godhand.dm @@ -16,9 +16,9 @@ var/on_use_sound = null var/datum/spell/touch/attached_spell -/obj/item/melee/touch_attack/New(spell) +/obj/item/melee/touch_attack/Initialize(mapload, spell) + . = ..() attached_spell = spell - ..() /obj/item/melee/touch_attack/Destroy() if(attached_spell) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 2f62ffea9c1..7bf231a3ec3 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -722,7 +722,7 @@ var/list/item_categories = list("Artefacts", "Weapons and Armors", "Staves", "Summons") var/list/loadout_categories = list("Standard", "Unique") -/obj/item/spellbook/proc/initialize() +/obj/item/spellbook/proc/create_spellbook() var/entry_types = subtypesof(/datum/spellbook_entry) - /datum/spellbook_entry/item - /datum/spellbook_entry/summon - /datum/spellbook_entry/loadout for(var/T in entry_types) var/datum/spellbook_entry/E = new T @@ -735,9 +735,9 @@ main_tab = main_categories[1] tab = categories[1] -/obj/item/spellbook/New() - ..() - initialize() +/obj/item/spellbook/Initialize(mapload) + . = ..() + create_spellbook() /obj/item/spellbook/attackby__legacy__attackchain(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/contract)) @@ -970,13 +970,10 @@ uses = 1 desc = "This template spellbook was never meant for the eyes of man..." -/obj/item/spellbook/oneuse/New() - ..() +/obj/item/spellbook/oneuse/Initialize(mapload) + . = ..() name += spellname -/obj/item/spellbook/oneuse/initialize() //No need to init - return - /obj/item/spellbook/oneuse/attack_self__legacy__attackchain(mob/user) var/datum/spell/S = new spell for(var/datum/spell/knownspell in user.mind.spell_list) @@ -1155,7 +1152,7 @@ /obj/item/spellbook/oneuse/random icon_state = "random_book" -/obj/item/spellbook/oneuse/random/initialize() +/obj/item/spellbook/oneuse/random/create_spellbook() . = ..() var/static/list/banned_spells = typesof(/obj/item/spellbook/oneuse/mime, /obj/item/spellbook/oneuse/emp) var/real_type = pick(subtypesof(/obj/item/spellbook/oneuse) - banned_spells) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 15c5956d3e5..17acd90764d 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -595,9 +595,9 @@ SSshuttle.autoEvac() return ..() -/obj/item/circuitboard/communications/New() +/obj/item/circuitboard/communications/Initialize(mapload) + . = ..() GLOB.shuttle_caller_list += src - ..() /obj/item/circuitboard/communications/Destroy() GLOB.shuttle_caller_list -= src diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm index fce6f789497..f1320a10ebe 100644 --- a/code/game/machinery/dye_generator.dm +++ b/code/game/machinery/dye_generator.dm @@ -78,8 +78,8 @@ w_class = WEIGHT_CLASS_TINY var/dye_color = "#FFFFFF" -/obj/item/hair_dye_bottle/New() - ..() +/obj/item/hair_dye_bottle/Initialize(mapload) + . = ..() update_icon(UPDATE_OVERLAYS) /obj/item/hair_dye_bottle/update_overlays() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index a3d2f5e8f27..dbe6226b65f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -199,18 +199,6 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons scatter_distance = 5 -/obj/item/New() - ..() - - if(!hitsound) - if(damtype == "fire") - hitsound = 'sound/items/welder.ogg' - if(damtype == "brute") - hitsound = "swing_hit" - LAZYINITLIST(attack_verb) - if(!move_resist) - determine_move_resist() - /obj/item/Initialize(mapload) . = ..() for(var/path in actions_types) @@ -219,6 +207,14 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons in_storage = TRUE if(sharp) AddComponent(/datum/component/surgery_initiator) + if(!hitsound) + if(damtype == "fire") + hitsound = 'sound/items/welder.ogg' + if(damtype == "brute") + hitsound = "swing_hit" + LAZYINITLIST(attack_verb) + if(!move_resist) + determine_move_resist() /// This proc is used to add text for items with ABSTRACT flag after default examine text. /obj/item/proc/customised_abstract_text(mob/living/carbon/owner) diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm index b0ab5a14185..5761aff109b 100644 --- a/code/game/objects/items/RCL.dm +++ b/code/game/objects/items/RCL.dm @@ -152,8 +152,8 @@ last = loaded.place_turf(get_turf(loc), user, turn(user.dir, 180)) is_empty(user) //If we've run out, display message -/obj/item/rcl/pre_loaded/New() //Comes preloaded with cable, for testing stuff - ..() +/obj/item/rcl/pre_loaded/Initialize(mapload) // Comes preloaded with cable, for testing stuff + . = ..() loaded = new() loaded.max_amount = max_amount loaded.amount = max_amount diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 38e38ca35ca..6ae075a2fe8 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -17,8 +17,8 @@ var/start_lit = FALSE var/flickering = FALSE -/obj/item/candle/New() - ..() +/obj/item/candle/Initialize(mapload) + . = ..() if(start_lit) // No visible message light(show_message = 0) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 2a64586d606..805519ead18 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -128,8 +128,8 @@ var/obj/item/card/id/guest/guest_pass = null // Guest pass attached to the ID -/obj/item/card/id/New() - ..() +/obj/item/card/id/Initialize(mapload) + . = ..() spawn(30) if(ishuman(loc) && blood_type == "\[UNSET\]") var/mob/living/carbon/human/H = loc @@ -403,9 +403,9 @@ registered_name = "Captain" assignment = "Captain" -/obj/item/card/id/captains_spare/New() +/obj/item/card/id/captains_spare/Initialize(mapload) + . = ..() access = get_all_accesses() - ..() /obj/item/card/id/admin name = "admin ID card" @@ -415,9 +415,9 @@ assignment = "Testing Shit" untrackable = TRUE -/obj/item/card/id/admin/New() +/obj/item/card/id/admin/Initialize(mapload) + . = ..() access = get_absolutely_all_accesses() - ..() /obj/item/card/id/centcom name = "central command ID card" @@ -426,9 +426,9 @@ registered_name = "Central Command" assignment = "General" -/obj/item/card/id/centcom/New() +/obj/item/card/id/centcom/Initialize(mapload) + . = ..() access = get_all_centcom_access() - ..() // MARK: Security /obj/item/card/id/prisoner @@ -482,8 +482,8 @@ registered_name = "Prisoner #13-007" /obj/item/card/id/prisoner/random -/obj/item/card/id/prisoner/random/New() - ..() +/obj/item/card/id/prisoner/random/Initialize(mapload) + . = ..() var/random_number = "#[rand(0, 99)]-[rand(0, 999)]" name = "Prisoner [random_number]" registered_name = name diff --git a/code/game/objects/items/cigs.dm b/code/game/objects/items/cigs.dm index b10f68288c3..d7e121b9db6 100644 --- a/code/game/objects/items/cigs.dm +++ b/code/game/objects/items/cigs.dm @@ -334,11 +334,11 @@ LIGHTERS ARE IN LIGHTERS.DM /obj/item/clothing/mask/cigarette/random -/obj/item/clothing/mask/cigarette/random/New() +/obj/item/clothing/mask/cigarette/random/Initialize(mapload) list_reagents = list("nicotine" = 40, pick("fuel", "saltpetre", "synaptizine", "green_vomit", "potass_iodide", "msg", "lexorin", "mannitol", \ "spaceacillin" ,"cryoxadone" ,"holywater", "tea" ,"egg" ,"haloperidol" ,"mutagen" ,"omnizine", "carpet", "aranesp", "cryostylane", "chocolate", \ "bilk", "cheese", "rum", "blood", "charcoal", "coffee", "ectoplasm", "space_drugs", "milk", "mutadone", "antihol", "teporone", "insulin", "salbutamol", "toxin") = 20) - ..() + . = ..() /obj/item/clothing/mask/cigarette/candy name = "candy cigarette" @@ -428,9 +428,9 @@ LIGHTERS ARE IN LIGHTERS.DM icon_state = "death_cig" butt_type = /obj/item/cigbutt/death -/obj/item/clothing/mask/cigarette/carcinoma/New() +/obj/item/clothing/mask/cigarette/carcinoma/Initialize(mapload) list_reagents = list("nicotine" = 40, "dnicotine" = 10, pick("carpotoxin", "toxin", "atrazine") = 1) - ..() + . = ..() /obj/item/cigbutt name = "cigarette butt" diff --git a/code/game/objects/items/decorations.dm b/code/game/objects/items/decorations.dm index bbc90e85bad..594dfc40bdd 100644 --- a/code/game/objects/items/decorations.dm +++ b/code/game/objects/items/decorations.dm @@ -6,7 +6,7 @@ /obj/item/decorations/sticky_decorations w_class = WEIGHT_CLASS_TINY -/obj/item/decorations/sticky_decorations/New() +/obj/item/decorations/sticky_decorations/Initialize(mapload) . = ..() AddComponent(/datum/component/ducttape, src, null, 0, 0, TRUE)//add this to something to make it sticky but without the tape overlay @@ -275,5 +275,3 @@ name = "lava land display" desc = "The tomb of many a miner and possibly a home for much worse things." icon_state = "lava_land_display" - - diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index f2287b736b2..da597a1e644 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -46,7 +46,7 @@ /obj/item/defibrillator/Initialize(mapload) // Base version starts without a cell for rnd . = ..() - paddles = new paddle_type(src) + paddles = new paddle_type(src, src) update_icon(UPDATE_OVERLAYS) /obj/item/defibrillator/loaded/Initialize(mapload) // Loaded version starts with high-capacity cell. @@ -308,7 +308,7 @@ var/on_cooldown = FALSE -/obj/item/shockpaddles/New(mainunit) +/obj/item/shockpaddles/Initialize(mapload, mainunit) . = ..() if(check_defib_exists(mainunit, null, src)) diff --git a/code/game/objects/items/devices/bodyanalyzer.dm b/code/game/objects/items/devices/bodyanalyzer.dm index 528caae8ccb..236ba85eee5 100644 --- a/code/game/objects/items/devices/bodyanalyzer.dm +++ b/code/game/objects/items/devices/bodyanalyzer.dm @@ -32,8 +32,8 @@ /obj/item/bodyanalyzer/borg/syndicate scan_cd = 20 SECONDS -/obj/item/bodyanalyzer/New() - ..() +/obj/item/bodyanalyzer/Initialize(mapload) + . = ..() cell = new cell_type(src) cell.give(cell.maxcharge) update_icon() diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index fbadd328c1e..3b3799c43a6 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -237,8 +237,8 @@ /obj/item/flash/cameraflash/burn_out() //stops from burning out return -/obj/item/flash/cameraflash/New() - ..() +/obj/item/flash/cameraflash/Initialize(mapload) + . = ..() START_PROCESSING(SSobj, src) /obj/item/flash/cameraflash/Destroy() diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 0411c7f9c35..3af6b44fac7 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -163,15 +163,19 @@ icon_state = "flare" inhand_icon_state = "flare" togglesound = 'sound/goonstation/misc/matchstick_light.ogg' - var/fuel = 0 + /// This var will get checked in Initialize() and if it's true, it'll get set to a randomized fuel value. + /// If it's 0, it'll simply remain a used up flare. + var/fuel = TRUE var/on_damage = 7 var/produce_heat = 1500 var/fuel_lower = 800 var/fuel_upp = 1000 -/obj/item/flashlight/flare/New() - fuel = rand(fuel_lower, fuel_upp) - ..() +/obj/item/flashlight/flare/Initialize(mapload) + . = ..() + if(fuel) + fuel = rand(fuel_lower, fuel_upp) + update_icon() /obj/item/flashlight/flare/update_icon_state() inhand_icon_state = "[initial(inhand_icon_state)][on ? "-on" : ""]" @@ -222,20 +226,10 @@ START_PROCESSING(SSobj, src) /obj/item/flashlight/flare/used - -/obj/item/flashlight/flare/used/Initialize(mapload) - . = ..() - // fuel gets set on New which is annoying so these can't just be vars fuel = 0 - on = 0 - update_icon() -/obj/item/flashlight/flare/glowstick/used/Initialize(mapload) - . = ..() - // fuel gets set on New which is annoying so these can't just be vars +/obj/item/flashlight/flare/glowstick/used fuel = 0 - on = 0 - update_icon() /obj/item/flashlight/flare/decompile_act(obj/item/matter_decompiler/C, mob/user) if(isdrone(user) && !fuel) @@ -334,8 +328,8 @@ materials = list() on = TRUE //Bio-luminesence has one setting, on. -/obj/item/flashlight/slime/New() - ..() +/obj/item/flashlight/slime/Initialize(mapload) + . = ..() set_light(brightness_on) spawn(1) //Might be sloppy, but seems to be necessary to prevent further runtimes and make these work as intended... don't judge me! update_brightness() @@ -358,8 +352,8 @@ var/emp_cur_charges = 4 var/charge_tick = 0 -/obj/item/flashlight/emp/New() - ..() +/obj/item/flashlight/emp/Initialize(mapload) + . = ..() START_PROCESSING(SSobj, src) /obj/item/flashlight/emp/Destroy() diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index e4b9db8a4f6..4f976f2778c 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -27,9 +27,9 @@ /obj/item/laser_pointer/purple pointer_icon_state = "purple_laser" -/obj/item/laser_pointer/New() - ..() - diode = new(src) +/obj/item/laser_pointer/Initialize(mapload) + . = ..() + create_diode() if(!pointer_icon_state) pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser") @@ -37,11 +37,11 @@ QDEL_NULL(diode) return ..() -/obj/item/laser_pointer/upgraded/New() - ..() - diode = new /obj/item/stock_parts/micro_laser/ultra - +/obj/item/laser_pointer/proc/create_diode() + diode = new(src) +/obj/item/laser_pointer/upgraded/create_diode() + diode = new /obj/item/stock_parts/micro_laser/ultra(src) /obj/item/laser_pointer/attack__legacy__attackchain(mob/living/M, mob/user) laser_act(M, user) diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 65beeb07e8a..674f4c83742 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -21,8 +21,8 @@ name = "syndicate personal AI device" faction = list("syndicate") -/obj/item/paicard/New() - ..() +/obj/item/paicard/Initialize(mapload) + . = ..() overlays += "pai-off" /obj/item/paicard/Destroy() diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 11dc402f3fa..5d48b8cede3 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -23,13 +23,10 @@ dog_fashion = null requires_tcomms = TRUE -/obj/item/radio/headset/New() - ..() - internal_channels.Cut() - /obj/item/radio/headset/Initialize(mapload) . = ..() + internal_channels.Cut() if(ks1type) keyslot1 = new ks1type(src) if(keyslot1.syndie) @@ -125,7 +122,7 @@ /obj/item/radio/headset/syndicate/alt/nocommon name = "syndicate researcher headset" -/obj/item/radio/headset/syndicate/alt/nocommon/New() +/obj/item/radio/headset/syndicate/alt/nocommon/Initialize(mapload) . = ..() set_frequency(SYND_FREQ) diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 264f3340229..241b7dd1966 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -49,8 +49,11 @@ name = "station intercom (Security)" frequency = SEC_I_FREQ -/obj/item/radio/intercom/New(turf/loc, direction, building = 3) +/obj/item/radio/intercom/Initialize(mapload, direction, building = 3) . = ..() + if(!custom_name) + name = "station intercom (General)" + buildstage = building if(buildstage) update_operating_status() @@ -63,17 +66,12 @@ GLOB.global_intercoms.Add(src) update_icon(UPDATE_ICON_STATE | UPDATE_OVERLAYS) -/obj/item/radio/intercom/Initialize(mapload) +/obj/item/radio/intercom/department/medbay/Initialize(mapload, direction, building) . = ..() - if(!custom_name) - name = "station intercom (General)" - -/obj/item/radio/intercom/department/medbay/New() - ..() internal_channels = GLOB.default_medbay_channels.Copy() -/obj/item/radio/intercom/department/security/New() - ..() +/obj/item/radio/intercom/department/security/Initialize(mapload, direction, building) + . = ..() internal_channels = list( num2text(PUB_FREQ) = list(), num2text(SEC_I_FREQ) = list(ACCESS_SECURITY) @@ -85,16 +83,16 @@ frequency = SYND_FREQ syndiekey = new /obj/item/encryptionkey/syndicate/nukeops -/obj/item/radio/intercom/syndicate/New() - ..() +/obj/item/radio/intercom/syndicate/Initialize(mapload, direction, building) + . = ..() internal_channels[num2text(SYND_FREQ)] = list(ACCESS_SYNDICATE) /obj/item/radio/intercom/pirate name = "pirate radio intercom" desc = "You wouldn't steal a space shuttle. Piracy. It's a crime!" -/obj/item/radio/intercom/pirate/New() - ..() +/obj/item/radio/intercom/pirate/Initialize(mapload, direction, building) + . = ..() internal_channels.Cut() internal_channels = list( num2text(PUB_FREQ) = list(), @@ -298,6 +296,6 @@ name = "prison intercom" desc = "A reliable form of communication even during local communication blackouts. It looks like it has been modified to not broadcast. Not so reliable, I guess..." -/obj/item/radio/intercom/locked/prison/New() - ..() +/obj/item/radio/intercom/locked/prison/Initialize(mapload, direction, building) + . = ..() wires.cut(WIRE_RADIO_TRANSMIT) diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 1bba07f9ebb..1c32ddfa8e1 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -89,13 +89,6 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) frequency = new_frequency radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT) -/obj/item/radio/New() - ..() - wires = new(src) - - internal_channels = GLOB.default_internal_channels.Copy() - GLOB.global_radios |= src - /obj/item/radio/Destroy() SStgui.close_uis(wires) QDEL_NULL(wires) @@ -110,6 +103,10 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) /obj/item/radio/Initialize(mapload) . = ..() + wires = new(src) + internal_channels = GLOB.default_internal_channels.Copy() + GLOB.global_radios |= src + if(frequency < RADIO_LOW_FREQ || frequency > RADIO_HIGH_FREQ) frequency = sanitize_frequency(frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ) set_frequency(frequency) @@ -646,24 +643,24 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) myborg = null return ..() -/obj/item/radio/borg/syndicate/New() - ..() +/obj/item/radio/borg/syndicate/Initialize(mapload) + . = ..() syndiekey = keyslot set_frequency(SYND_FREQ) freqlock = TRUE /obj/item/radio/borg/deathsquad -/obj/item/radio/borg/deathsquad/New() - ..() +/obj/item/radio/borg/deathsquad/Initialize(mapload) + . = ..() set_frequency(DTH_FREQ) freqlock = TRUE /obj/item/radio/borg/ert keyslot = new /obj/item/encryptionkey/ert -/obj/item/radio/borg/ert/New() - ..() +/obj/item/radio/borg/ert/Initialize(mapload) + . = ..() set_frequency(ERT_FREQ) freqlock = TRUE @@ -773,8 +770,8 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) /obj/item/radio/phone/medbay frequency = MED_I_FREQ -/obj/item/radio/phone/medbay/New() - ..() +/obj/item/radio/phone/medbay/Initialize(mapload) + . = ..() internal_channels = GLOB.default_medbay_channels.Copy() /obj/item/radio/proc/attempt_send_deadsay_message(mob/subject, message) diff --git a/code/game/objects/items/devices/sensor_device.dm b/code/game/objects/items/devices/sensor_device.dm index de6c40b9882..2f8301d9dcd 100644 --- a/code/game/objects/items/devices/sensor_device.dm +++ b/code/game/objects/items/devices/sensor_device.dm @@ -8,8 +8,8 @@ origin_tech = "programming=3;materials=3;magnets=3" var/datum/ui_module/crew_monitor/crew_monitor -/obj/item/sensor_device/New() - ..() +/obj/item/sensor_device/Initialize(mapload) + . = ..() crew_monitor = new(src) /obj/item/sensor_device/Destroy() diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 31fc65fc606..40d0a59891f 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -41,8 +41,8 @@ . += SPAN_NOTICE("[mytape] has [seconds_to_time(mytape.remaining_capacity)] remaining.") . += SPAN_NOTICE("Alt-Click to access the tape.") -/obj/item/taperecorder/New() - ..() +/obj/item/taperecorder/Initialize(mapload) + . = ..() if(starts_with_tape) mytape = new /obj/item/tape/random(src) update_icon(UPDATE_ICON_STATE) @@ -360,6 +360,6 @@ update_icon(UPDATE_OVERLAYS) //Random colour tapes -/obj/item/tape/random/New() - ..() +/obj/item/tape/random/Initialize(mapload) + . = ..() icon_state = "tape_[pick("white", "blue", "red", "yellow", "purple")]" diff --git a/code/game/objects/items/devices/thermal_drill.dm b/code/game/objects/items/devices/thermal_drill.dm index ac7dc5948eb..494832dcb64 100644 --- a/code/game/objects/items/devices/thermal_drill.dm +++ b/code/game/objects/items/devices/thermal_drill.dm @@ -11,8 +11,8 @@ var/datum/effect_system/spark_spread/spark_system var/datum/song/song -/obj/item/thermal_drill/New() - ..() +/obj/item/thermal_drill/Initialize(mapload) + . = ..() soundloop = new(list(src), FALSE) spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(1, 0, src) diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index 8ef7f77208e..5e7c7f52660 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -37,8 +37,8 @@ GLOBAL_LIST_EMPTY(world_uplinks) /obj/item/uplink/proc/update_uplink_type(new_uplink_type) uplink_type = new_uplink_type -/obj/item/uplink/New() - ..() +/obj/item/uplink/Initialize(mapload) + . = ..() uses = 100 GLOB.world_uplinks += src @@ -183,10 +183,10 @@ GLOBAL_LIST_EMPTY(world_uplinks) var/list/lucky_numbers // The hidden uplink MUST be inside an obj/item's contents. -/obj/item/uplink/hidden/New(loc) +/obj/item/uplink/hidden/Initialize(mapload) if(!isitem(loc)) qdel(src) - ..() + return ..() // Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated. /obj/item/uplink/hidden/proc/toggle() @@ -431,8 +431,8 @@ GLOBAL_LIST_EMPTY(world_uplinks) // Includes normal radio uplink, multitool uplink, // implant uplink (not the implant tool) and a preset headset uplink. -/obj/item/radio/uplink/New() - ..() +/obj/item/radio/uplink/Initialize(mapload) + . = ..() hidden_uplink = new(src) icon_state = "radio" @@ -449,8 +449,8 @@ GLOBAL_LIST_EMPTY(world_uplinks) if(hidden_uplink) hidden_uplink.trigger(user) -/obj/item/radio/uplink/nuclear/New() - ..() +/obj/item/radio/uplink/nuclear/Initialize(mapload) + . = ..() if(hidden_uplink) hidden_uplink.update_uplink_type(UPLINK_TYPE_NUCLEAR) GLOB.nuclear_uplink_list += src @@ -459,19 +459,19 @@ GLOBAL_LIST_EMPTY(world_uplinks) GLOB.nuclear_uplink_list -= src return ..() -/obj/item/radio/uplink/sst/New() - ..() +/obj/item/radio/uplink/sst/Initialize(mapload) + . = ..() if(hidden_uplink) hidden_uplink.update_uplink_type(UPLINK_TYPE_SST) -/obj/item/radio/uplink/admin/New() - ..() +/obj/item/radio/uplink/admin/Initialize(mapload) + . = ..() if(hidden_uplink) hidden_uplink.update_uplink_type(UPLINK_TYPE_ADMIN) hidden_uplink.uses = 2500 -/obj/item/multitool/uplink/New() - ..() +/obj/item/multitool/uplink/Initialize(mapload) + . = ..() hidden_uplink = new(src) /obj/item/multitool/uplink/activate_self(mob/user as mob) @@ -482,7 +482,7 @@ GLOBAL_LIST_EMPTY(world_uplinks) /obj/item/radio/headset/uplink traitor_frequency = 1445 -/obj/item/radio/headset/uplink/New() - ..() +/obj/item/radio/headset/uplink/Initialize(mapload) + . = ..() hidden_uplink = new(src) hidden_uplink.uses = 100 diff --git a/code/game/objects/items/devices/voice_changer.dm b/code/game/objects/items/devices/voice_changer.dm index 6cba6acad88..2ce45ded96e 100644 --- a/code/game/objects/items/devices/voice_changer.dm +++ b/code/game/objects/items/devices/voice_changer.dm @@ -11,7 +11,7 @@ var/voice var/active -/obj/item/voice_changer/New() +/obj/item/voice_changer/Initialize(mapload) . = ..() if(isitem(loc)) diff --git a/code/game/objects/items/disks.dm b/code/game/objects/items/disks.dm index b26e0b84249..b0598c71094 100644 --- a/code/game/objects/items/disks.dm +++ b/code/game/objects/items/disks.dm @@ -23,7 +23,7 @@ name = "data disk - 'God Emperor of Mankind'" read_only = TRUE -/obj/item/disk/data/demo/New() +/obj/item/disk/data/demo/Initialize(mapload) . = ..() initialize_data() buf.types = DNA2_BUF_UE|DNA2_BUF_UI @@ -40,7 +40,7 @@ name = "data disk - 'Mr. Muggles'" read_only = 1 -/obj/item/disk/data/monkey/New() +/obj/item/disk/data/monkey/Initialize(mapload) . = ..() initialize_data() buf.types = DNA2_BUF_SE @@ -51,7 +51,7 @@ buf.dna.SetSEValueRange(GLOB.monkeyblock, 0xDAC, 0xFFF) //Disk stuff. -/obj/item/disk/data/New() +/obj/item/disk/data/Initialize(mapload) . = ..() var/diskcolor = pick(0, 1, 2, 3, 4, 5) icon_state = "datadisk[diskcolor]" diff --git a/code/game/objects/items/flag.dm b/code/game/objects/items/flag.dm index 08a8a28764d..b61984afadf 100644 --- a/code/game/objects/items/flag.dm +++ b/code/game/objects/items/flag.dm @@ -214,9 +214,9 @@ var/obj/item/grenade/boobytrap = null var/mob/trapper = null -/obj/item/flag/chameleon/New() +/obj/item/flag/chameleon/Initialize(mapload) + . = ..() updated_icon_state = icon_state - ..() /obj/item/flag/chameleon/attack_self__legacy__attackchain(mob/user) if(used) @@ -294,6 +294,6 @@ /obj/item/flag/chameleon/get_flag_icon() return updated_icon_state -/obj/item/flag/chameleon/depot/New() - ..() +/obj/item/flag/chameleon/depot/Initialize(mapload) + . = ..() boobytrap = new /obj/item/grenade/gas/plasma(src) diff --git a/code/game/objects/items/lighters.dm b/code/game/objects/items/lighters.dm index b11df232f88..1f374521396 100644 --- a/code/game/objects/items/lighters.dm +++ b/code/game/objects/items/lighters.dm @@ -370,8 +370,8 @@ desc = "An unlit firebrand. It makes you wonder why it's not just called a stick." smoketime = 20 //40 seconds -/obj/item/match/firebrand/New() - ..() +/obj/item/match/firebrand/Initialize(mapload) + . = ..() matchignite() /obj/item/match/unathi diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index c3d2b9a28a4..72d340e59d7 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -8,8 +8,8 @@ var/sabotaged = FALSE //Emagging limbs can have repercussions when installed as prosthetics. var/model_info = "Unbranded" -/obj/item/robot_parts/New(newloc, model) - ..(newloc) +/obj/item/robot_parts/Initialize(mapload, model) + . = ..() if(model_info && model) model_info = model var/datum/robolimb/R = GLOB.all_robolimbs[model] @@ -101,8 +101,8 @@ var/aisync = 1 var/panel_locked = 1 -/obj/item/robot_parts/robot_suit/New() - ..() +/obj/item/robot_parts/robot_suit/Initialize(mapload) + . = ..() update_icon(UPDATE_OVERLAYS) /obj/item/robot_parts/robot_suit/Destroy() diff --git a/code/game/objects/items/storage/internal.dm b/code/game/objects/items/storage/internal.dm index 5f07e5f0f6a..4a6e256ebb9 100644 --- a/code/game/objects/items/storage/internal.dm +++ b/code/game/objects/items/storage/internal.dm @@ -3,11 +3,11 @@ /obj/item/storage/internal var/obj/item/master_item -/obj/item/storage/internal/New(obj/item/MI) +/obj/item/storage/internal/Initialize(mapload, obj/item/MI) + . = ..() master_item = MI loc = master_item name = master_item.name - ..() /obj/item/storage/internal/Destroy() master_item = null diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index c6cbd956c0d..ee3926b56d4 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -195,8 +195,8 @@ var/obj/item/tank/internals/tank = null var/mob/living/carbon/human/cur_user -/obj/item/tank/jetpack/suit/New() - ..() +/obj/item/tank/jetpack/suit/Initialize(mapload) + . = ..() STOP_PROCESSING(SSobj, src) temp_air_contents = air_contents diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index 9278345ac16..ddedb34979f 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -17,8 +17,8 @@ var/on = FALSE var/volume = 500 -/obj/item/watertank/New() - ..() +/obj/item/watertank/Initialize(mapload) + . = ..() create_reagents(volume) noz = make_noz() @@ -156,8 +156,8 @@ desc = "A janitorial watertank backpack with nozzle to clean dirt and graffiti." icon_state = "waterbackpackjani" -/obj/item/watertank/janitor/New() - ..() +/obj/item/watertank/janitor/Initialize(mapload) + . = ..() reagents.add_reagent("cleaner", 500) /obj/item/reagent_containers/spray/mister/janitor @@ -186,8 +186,8 @@ worn_icon_state = "waterbackpackatmos" inhand_icon_state = "waterbackpackatmos" -/obj/item/watertank/atmos/New() - ..() +/obj/item/watertank/atmos/Initialize(mapload) + . = ..() reagents.add_reagent("water", 500) /obj/item/watertank/atmos/make_noz() diff --git a/code/game/objects/items/tape.dm b/code/game/objects/items/tape.dm index 551acbbc12a..1644b424501 100644 --- a/code/game/objects/items/tape.dm +++ b/code/game/objects/items/tape.dm @@ -8,8 +8,8 @@ amount = 25 max_amount = 25 -/obj/item/stack/tape_roll/New(loc, amount=null) - ..() +/obj/item/stack/tape_roll/Initialize(mapload, loc, amount) + . = ..() update_icon(UPDATE_ICON_STATE) /obj/item/stack/tape_roll/attack__legacy__attackchain(mob/living/carbon/human/M, mob/living/user) diff --git a/code/game/objects/items/tools/screwdriver.dm b/code/game/objects/items/tools/screwdriver.dm index efe0c42d308..481503e7892 100644 --- a/code/game/objects/items/tools/screwdriver.dm +++ b/code/game/objects/items/tools/screwdriver.dm @@ -24,8 +24,17 @@ new_attack_chain = TRUE -/obj/item/screwdriver/Initialize(mapload) +/obj/item/screwdriver/Initialize(mapload, param_color = null) . = ..() + if(random_color) + if(!param_color) + param_color = pick("red", "blue", "pink", "brown", "green", "cyan", "yellow") + icon_state = "screwdriver_[param_color]" + belt_icon = "screwdriver_[param_color]" + + if(prob(75)) + pixel_y = rand(0, 16) + AddComponent(/datum/component/surgery_initiator/robo) RegisterSignal(src, COMSIG_ATTACK, PROC_REF(on_attack)) RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit)) @@ -42,17 +51,6 @@ user.visible_message(SPAN_SUICIDE("[user] is stabbing [src] into [user.p_their()] [pick("temple", "heart")]! It looks like [user.p_theyre()] trying to commit suicide!")) return BRUTELOSS -/obj/item/screwdriver/New(loc, param_color = null) - ..() - if(random_color) - if(!param_color) - param_color = pick("red","blue","pink","brown","green","cyan","yellow") - icon_state = "screwdriver_[param_color]" - belt_icon = "screwdriver_[param_color]" - - if(prob(75)) - src.pixel_y = rand(0, 16) - /obj/item/screwdriver/proc/on_attack(datum/source, mob/living/carbon/target, mob/living/user) if(!istype(target) || user.a_intent == INTENT_HELP) return diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index 17e89cebc4b..8a97e9b86b0 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -24,18 +24,15 @@ new_attack_chain = TRUE -/obj/item/wirecutters/Initialize(mapload) +/obj/item/wirecutters/Initialize(mapload, param_color = null) . = ..() - RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit)) - RegisterSignal(src, COMSIG_CLICK_ALT, PROC_REF(remove_bit)) - -/obj/item/wirecutters/New(loc, param_color = null) - ..() if(random_color) if(!param_color) param_color = pick("yellow", "red") belt_icon = "wirecutters_[param_color]" icon_state = "cutters_[param_color]" + RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit)) + RegisterSignal(src, COMSIG_CLICK_ALT, PROC_REF(remove_bit)) /obj/item/wirecutters/interact_with_atom(atom/target, mob/living/user, list/modifiers) var/mob/living/carbon/mob = target diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index c02c6d1ea8b..f815b784d61 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -35,8 +35,8 @@ icon = 'icons/obj/toy.dmi' icon_state = "waterballoon-e" -/obj/item/toy/balloon/New() - ..() +/obj/item/toy/balloon/Initialize(mapload) + . = ..() create_reagents(10) /obj/item/toy/balloon/pre_attack(atom/target, mob/living/user, params) @@ -1513,8 +1513,8 @@ playsound(loc, 'sound/weapons/gunshots/gunshot_strong.ogg', 50, 1) return BRUTELOSS -/obj/item/toy/russian_revolver/New() - ..() +/obj/item/toy/russian_revolver/Initialize(mapload) + . = ..() spin_cylinder() /obj/item/toy/russian_revolver/activate_self(mob/user) diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 46749524d56..9593850ed8b 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -15,14 +15,13 @@ resistance_flags = FLAMMABLE scatter_distance = 10 -/obj/item/a_gift/New() - ..() +/obj/item/a_gift/Initialize(mapload) + . = ..() scatter_atom() if(w_class > 0 && w_class < 4) icon_state = "gift[w_class]" else icon_state = "gift[pick(1, 2, 3)]" - return /obj/item/gift/attack_self__legacy__attackchain(mob/user as mob) user.drop_item() diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 21c6233fab9..a37fa8bfee8 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -187,9 +187,9 @@ /obj/item/restraints/handcuffs/cable/white color = COLOR_WHITE -/obj/item/restraints/handcuffs/cable/random/New() +/obj/item/restraints/handcuffs/cable/random/Initialize(mapload) + . = ..() color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN, COLOR_ORANGE) - ..() /obj/item/restraints/handcuffs/cable/proc/cable_color(colorC) if(!colorC) diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 3b0093809c8..82559587d22 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -521,8 +521,8 @@ hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") -/obj/item/nullrod/tribal_knife/New() - ..() +/obj/item/nullrod/tribal_knife/Initialize(mapload) + . = ..() START_PROCESSING(SSobj, src) /obj/item/nullrod/tribal_knife/Destroy() @@ -713,8 +713,8 @@ . += "This seemingly standard holy staff is actually a disguised neurotransmitter capable of inducing blind zealotry in its victims. It must be allowed to recharge in the presence of a linked set of missionary robes. \ Use the staff in hand while wearing robes to link them both, then aim the staff at your victim to try and convert them." -/obj/item/nullrod/missionary_staff/New() - ..() +/obj/item/nullrod/missionary_staff/Initialize(mapload) + . = ..() team_color = pick("red", "blue") icon_state = "godstaff-[team_color]" name = "[team_color] holy staff" diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index e476fd423ee..acaefd16ddf 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -36,8 +36,8 @@ armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 50, ACID = 30) var/max_contents = 1 -/obj/item/kitchen/utensil/New() - ..() +/obj/item/kitchen/utensil/Initialize(mapload) + . = ..() if(prob(60)) src.pixel_y = rand(0, 4) diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm index a88284398b9..8fbc5a10c79 100644 --- a/code/game/objects/items/weapons/legcuffs.dm +++ b/code/game/objects/items/weapons/legcuffs.dm @@ -176,8 +176,8 @@ flags = DROPDEL breakouttime = 6 SECONDS -/obj/item/restraints/legcuffs/beartrap/energy/New() - ..() +/obj/item/restraints/legcuffs/beartrap/energy/Initialize(mapload) + . = ..() addtimer(CALLBACK(src, PROC_REF(dissipate)), 100) /obj/item/restraints/legcuffs/beartrap/energy/proc/dissipate() diff --git a/code/game/objects/items/weapons/misc_items.dm b/code/game/objects/items/weapons/misc_items.dm index 62eed0a3672..c6d1a378d0f 100644 --- a/code/game/objects/items/weapons/misc_items.dm +++ b/code/game/objects/items/weapons/misc_items.dm @@ -203,8 +203,8 @@ icon_state = "lightning" desc = "test lightning." -/obj/item/lightning/New() - ..() +/obj/item/lightning/Initialize(mapload) + . = ..() icon_state = "1" /obj/item/lightning/afterattack__legacy__attackchain(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params) diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index b2d10c4ac05..3547f13e148 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -18,8 +18,8 @@ /// The cooldown between each mopping sound effect var/mop_sound_cooldown -/obj/item/mop/New() - ..() +/obj/item/mop/Initialize(mapload) + . = ..() create_reagents(mopcap) GLOB.janitorial_equipment += src @@ -109,8 +109,8 @@ /// Determins what reagent to use for refilling, just in case someone wanted to make a HOLY MOP OF PURGING var/refill_reagent = "water" -/obj/item/mop/advanced/New() - ..() +/obj/item/mop/advanced/Initialize(mapload) + . = ..() START_PROCESSING(SSobj, src) /obj/item/mop/advanced/activate_self(mob/user) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 0ed92e8bd85..2ece39483cb 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -16,8 +16,8 @@ var/integrity = 3 var/volume = 70 -/obj/item/tank/New() - ..() +/obj/item/tank/Initialize(mapload) + . = ..() air_contents = new /datum/gas_mixture() air_contents.volume = volume //liters @@ -26,7 +26,6 @@ populate_gas() START_PROCESSING(SSobj, src) - return /obj/item/tank/Destroy() QDEL_NULL(air_contents) diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 260ce384222..bdd2818b40c 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -63,11 +63,8 @@ /obj/item/fireaxe/energized/Initialize(mapload) . = ..() // only update the new args - AddComponent(/datum/component/two_handed, force_wielded = force_wielded, icon_wielded = "[base_icon_state]2") - -/obj/item/fireaxe/energized/New() - ..() START_PROCESSING(SSobj, src) + AddComponent(/datum/component/two_handed, force_wielded = force_wielded, icon_wielded = "[base_icon_state]2") /obj/item/fireaxe/energized/Destroy() STOP_PROCESSING(SSobj, src) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 4f8dc06c91a..1158f3ffe88 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -263,9 +263,12 @@ var/obj/item/roller/held var/obj/carry_holo = FALSE -/obj/item/roller_holder/New() - ..() - held = new /obj/item/roller(src) +/obj/item/roller_holder/Initialize(mapload) + . = ..() + create_roller() + +/obj/item/roller_holder/proc/create_roller() + held = new(src) /obj/item/roller_holder/interact_with_atom(atom/target, mob/living/user, list/modifiers) if(!istype(target, /obj/item/roller)) @@ -306,8 +309,7 @@ icon_state = "holo_retracted" carry_holo = TRUE -/obj/item/roller_holder/holo/New() - ..() +/obj/item/roller_holder/holo/create_roller() held = new /obj/item/roller/holo(src) /* diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 26f25a6de7b..80e43de9f9d 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -720,8 +720,8 @@ MAPPING_DIRECTIONAL_HELPERS_CUSTOM(/obj/structure/sink/kitchen/old, 18, -4, 0, 0 result = /obj/structure/sink result_name = "sink" -/obj/item/bathroom_parts/New() - ..() +/obj/item/bathroom_parts/Initialize(mapload) + . = ..() desc = "An entire [result_name] in a box, straight from Space Sweden. It has an [pick("unpronounceable", "overly accented", "entirely gibberish", "oddly normal-sounding")] name." /obj/item/bathroom_parts/activate_self(mob/user) diff --git a/code/modules/antagonists/changeling/powers/biodegrade.dm b/code/modules/antagonists/changeling/powers/biodegrade.dm index 9dabdf8c506..1dc8176638d 100644 --- a/code/modules/antagonists/changeling/powers/biodegrade.dm +++ b/code/modules/antagonists/changeling/powers/biodegrade.dm @@ -105,7 +105,7 @@ if(user.get_active_hand() && !user.drop_item()) to_chat(user, SPAN_WARNING("[user.get_active_hand()] is stuck to our hand, we cannot emit acid on this hand.")) return FALSE - current_hand = new hand(src) + current_hand = new hand(src, src) user.put_in_active_hand(current_hand) RegisterSignal(user, COMSIG_MOB_WILLINGLY_DROP, PROC_REF(remove_hand_spell)) return TRUE @@ -130,7 +130,7 @@ throw_speed = 0 var/datum/action/changeling/biodegrade/parent_action -/obj/item/melee/changeling_corrosive_acid/New(datum/action/changeling/biodegrade/new_parent) +/obj/item/melee/changeling_corrosive_acid/Initialize(mapload, datum/action/changeling/biodegrade/new_parent) . = ..() parent_action = new_parent diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index b48aa995350..3c60bc44e69 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -261,7 +261,7 @@ muzzle_flash_color = null var/obj/item/gun/magic/tentacle/gun //the item that shot it -/obj/item/ammo_casing/magic/tentacle/New(obj/item/gun/magic/tentacle/tentacle_gun) +/obj/item/ammo_casing/magic/tentacle/Initialize(mapload, obj/item/gun/magic/tentacle/tentacle_gun) gun = tentacle_gun ..() diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 8904bd4ceaf..7c9440f043d 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -49,8 +49,8 @@ update_icon() return secured -/obj/item/assembly/infra/New() - ..() +/obj/item/assembly/infra/Initialize(mapload) + . = ..() if(!secured) toggle_secure() @@ -185,8 +185,8 @@ -/obj/item/assembly/infra/armed/New() - ..() +/obj/item/assembly/infra/armed/Initialize(mapload) + . = ..() spawn(3) if(holder) if(holder.master) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index a6c481ae218..7805be57054 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -158,7 +158,7 @@ icon = 'icons/mob/screen_gen.dmi' icon_state = "block" -/obj/item/clothing/ears/offear/New(obj/O) +/obj/item/clothing/ears/offear/Initialize(mapload, obj/O) . = ..() name = O.name desc = O.desc diff --git a/code/modules/clothing/suits/suit_storage.dm b/code/modules/clothing/suits/suit_storage.dm index 4b1c4372c4c..cec19ac6142 100644 --- a/code/modules/clothing/suits/suit_storage.dm +++ b/code/modules/clothing/suits/suit_storage.dm @@ -4,7 +4,7 @@ /obj/item/clothing/suit/storage/Initialize(mapload) . = ..() - pockets = new pockets(src) + pockets = new pockets(src, src) pockets.storage_slots = 2 //two slots pockets.max_w_class = WEIGHT_CLASS_SMALL //fit only pocket sized items pockets.max_combined_w_class = 4 diff --git a/code/modules/clothing/under/accessories/storage_accessories.dm b/code/modules/clothing/under/accessories/storage_accessories.dm index 4ab0fa7119e..64cd8bc9308 100644 --- a/code/modules/clothing/under/accessories/storage_accessories.dm +++ b/code/modules/clothing/under/accessories/storage_accessories.dm @@ -10,7 +10,7 @@ /obj/item/clothing/accessory/storage/Initialize(mapload) . = ..() - hold = new/obj/item/storage/internal(src) + hold = new/obj/item/storage/internal(src, src) hold.storage_slots = slots /obj/item/clothing/accessory/storage/Destroy() diff --git a/code/modules/detective_work/evidence.dm b/code/modules/detective_work/evidence.dm index 8446286a153..aef2f35910f 100644 --- a/code/modules/detective_work/evidence.dm +++ b/code/modules/detective_work/evidence.dm @@ -93,10 +93,9 @@ transfer_evidence(supplied) name = "[initial(name)] ([supplied])" -/obj/item/sample/print/New(newloc, atom/supplied) - . = ..() if(length(evidence)) icon_state = "fingerprint1" + update_icon() /obj/item/sample/proc/transfer_evidence(atom/supplied) if(length(supplied.suit_fibers)) diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm index b0970a6abd8..a5798a95555 100644 --- a/code/modules/mining/equipment/wormhole_jaunter.dm +++ b/code/modules/mining/equipment/wormhole_jaunter.dm @@ -394,8 +394,8 @@ GLOBAL_LIST_EMPTY(wormhole_effect) /obj/item/wormhole_jaunter/wormhole_weaver/get_cell() return wcell -/obj/item/wormhole_jaunter/wormhole_weaver/New() - ..() +/obj/item/wormhole_jaunter/wormhole_weaver/Initialize(mapload) + . = ..() wcell = new(src) /obj/item/wormhole_jaunter/wormhole_weaver/examine(mob/user) diff --git a/code/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm index 82a4212ed2e..bf5c1b8a9cb 100644 --- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm +++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm @@ -244,7 +244,7 @@ var/timer = 0 var/banned_turfs -/obj/item/lava_staff/New() +/obj/item/lava_staff/Initialize(mapload) . = ..() banned_turfs = typecacheof(list(/turf/space/transit, /turf/simulated/wall, /turf/simulated/mineral)) diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm index 8dc011c9381..3f4bca58b13 100644 --- a/code/modules/mining/lavaland/loot/tendril_loot.dm +++ b/code/modules/mining/lavaland/loot/tendril_loot.dm @@ -30,8 +30,8 @@ /obj/item/shared_storage/red -/obj/item/shared_storage/red/New() - ..() +/obj/item/shared_storage/red/Initialize(mapload) + . = ..() if(!bag) var/obj/item/storage/backpack/shared/S = new(src) var/obj/item/shared_storage/blue = new(loc) @@ -323,8 +323,8 @@ desc = "A mysterious red cube." icon_state = "red_cube" -/obj/item/warp_cube/red/New() - ..() +/obj/item/warp_cube/red/Initialize(mapload) + . = ..() if(!linked) var/obj/item/warp_cube/blue = new(src.loc) linked = blue diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index ed9388fcf1a..117cead9e3d 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -92,7 +92,7 @@ icon_state = "datadisk1" var/modkit_design -/obj/item/disk/design_disk/modkit_disk/New() +/obj/item/disk/design_disk/modkit_disk/Initialize(mapload) . = ..() if(modkit_design) blueprint = new modkit_design diff --git a/code/modules/mob/living/brain/robotic_brain.dm b/code/modules/mob/living/brain/robotic_brain.dm index 48f5f367462..3815cf13841 100644 --- a/code/modules/mob/living/brain/robotic_brain.dm +++ b/code/modules/mob/living/brain/robotic_brain.dm @@ -170,7 +170,8 @@ brainmob.emp_damage += rand(10, 20) ..() -/obj/item/mmi/robotic_brain/New() +/obj/item/mmi/robotic_brain/Initialize(mapload) + . = ..() brainmob = new(src) brainmob.name = "[pick("PBU", "HIU", "SINA", "ARMA", "OSI")]-[rand(100, 999)]" brainmob.real_name = brainmob.name @@ -183,7 +184,6 @@ brainmob.dna.ResetSE() brainmob.dna.ResetUI() GLOB.dead_mob_list -= brainmob - ..() /obj/item/mmi/robotic_brain/attack_ghost(mob/dead/observer/O) if(brainmob && brainmob.key) diff --git a/code/modules/mob/living/carbon/human/human_inventory.dm b/code/modules/mob/living/carbon/human/human_inventory.dm index 8d1d98eb38e..06aab18ebc0 100644 --- a/code/modules/mob/living/carbon/human/human_inventory.dm +++ b/code/modules/mob/living/carbon/human/human_inventory.dm @@ -266,7 +266,7 @@ if(ITEM_SLOT_LEFT_EAR) l_ear = I // if(l_ear.slot_flags & ITEM_SLOT_LEFT_EAR) CHAP-TODO: ACTUALLY FIX OFFEARS OR REMOVE THEM COMPLETELY - // var/obj/item/clothing/ears/offear/O = new(I) + // var/obj/item/clothing/ears/offear/O = new(I, I) // O.forceMove(src) // r_ear = O // O.layer = ABOVE_HUD_LAYER @@ -275,7 +275,7 @@ if(ITEM_SLOT_RIGHT_EAR) r_ear = I // if(r_ear.slot_flags & ITEM_SLOT_RIGHT_EAR) - // var/obj/item/clothing/ears/offear/O = new(I) + // var/obj/item/clothing/ears/offear/O = new(I, I) // O.forceMove(src) // l_ear = O // O.layer = ABOVE_HUD_LAYER diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 79d49faef87..46fdad49d59 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -265,7 +265,7 @@ continue var/list/organ_data = has_limbs[limb_name] var/limb_path = organ_data["path"] - var/obj/item/organ/O = new limb_path(H) + var/obj/item/organ/O = new limb_path(H, H) organ_data["descriptor"] = O.name // Transfer things from the old organ to the new if(istype(O, /obj/item/organ/external) && transfer_list[limb_name]) @@ -295,7 +295,7 @@ // not doing so (as of now) causes weird issues for some organs like posibrains, which need a mob on init or they'll qdel themselves. // for the record: this caused every single IPC's brain to be deleted randomly throughout a round, killing them instantly. - new organ_path(H) + new organ_path(H, H) create_mutant_organs(H) @@ -318,7 +318,7 @@ qdel(ears) if(mutantears && !isnull(H.bodyparts_by_name[initial(mutantears.parent_organ)])) - new mutantears(H) + new mutantears(H, H) /datum/species/proc/breathe(mob/living/carbon/human/H) var/datum/organ/lungs/lung = H.get_int_organ_datum(ORGAN_DATUM_LUNGS) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 76a0dbec094..a8a32e30b9c 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -316,7 +316,7 @@ add_attack_logs(user, src, "Grabbed passively", ATKLOG_ALL) - var/obj/item/grab/G = new /obj/item/grab(user, src) + var/obj/item/grab/G = new /obj/item/grab(user, user, src) if(!G) //the grab will delete itself in New if src is anchored return 0 user.put_in_active_hand(G) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 2b2788fd239..cb407277c39 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -39,8 +39,8 @@ var/module_type = "NoMod" -/obj/item/robot_module/New() - ..() +/obj/item/robot_module/Initialize(mapload) + . = ..() // Creates new objects from the type lists. for(var/i in basic_modules) @@ -79,6 +79,7 @@ if(I) // If it exists, add the object reference. special_rechargables += I special_rechargables -= path // No matter what, remove the path from the list. + module_armor = getArmor(arglist(module_armor)) // Add all the modules into the robot's inventory. Without this, their inventory will be blank. rebuild_modules() @@ -102,9 +103,6 @@ QDEL_LIST_CONTENTS(special_rechargables) return ..() -/obj/item/robot_module/Initialize(mapload) - . = ..() - module_armor = getArmor(arglist(module_armor)) /** * Searches through the various module lists for the given `item_type`, deletes and removes the item from all supplied lists, if the item is found. * @@ -1129,4 +1127,3 @@ statpanel_name = "Metal" stack = /obj/item/stack/sheet/metal add_to_storage = TRUE - diff --git a/code/modules/mob/living/simple_animal/bot/bot_construction.dm b/code/modules/mob/living/simple_animal/bot/bot_construction.dm index cdc2eeb181c..e6f4d8cd6f9 100644 --- a/code/modules/mob/living/simple_animal/bot/bot_construction.dm +++ b/code/modules/mob/living/simple_animal/bot/bot_construction.dm @@ -358,8 +358,8 @@ var/treatment_virus = "spaceacillin" var/robot_arm = /obj/item/robot_parts/l_arm -/obj/item/firstaid_arm_assembly/New(loc, new_skin) - ..() +/obj/item/firstaid_arm_assembly/Initialize(mapload, new_skin) + . = ..() if(new_skin) skin = new_skin update_icon(UPDATE_OVERLAYS) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 40dcb4d2d3a..2f65531d018 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -27,8 +27,8 @@ plane = HUD_PLANE w_class = WEIGHT_CLASS_BULKY -/obj/item/grab/New(mob/user, mob/victim) - ..() +/obj/item/grab/Initialize(mapload, mob/user, mob/victim) + . = ..() //Okay, first off, some fucking sanity checking. No user, or no victim, or they are not mobs, no grab. if(!istype(user) || !istype(victim)) diff --git a/code/modules/mob/mob_holder.dm b/code/modules/mob/mob_holder.dm index d637d7d7ae1..199044af1bc 100644 --- a/code/modules/mob/mob_holder.dm +++ b/code/modules/mob/mob_holder.dm @@ -5,8 +5,8 @@ icon = 'icons/obj/objects.dmi' slot_flags = ITEM_SLOT_HEAD|ITEM_SLOT_NECK -/obj/item/holder/New() - ..() +/obj/item/holder/Initialize(mapload) + . = ..() START_PROCESSING(SSobj, src) /obj/item/holder/Destroy() diff --git a/code/modules/ninja/energy_katana.dm b/code/modules/ninja/energy_katana.dm index 4bfcdf49af5..dc6da8238a5 100644 --- a/code/modules/ninja/energy_katana.dm +++ b/code/modules/ninja/energy_katana.dm @@ -65,8 +65,8 @@ if(msg) to_chat(user, SPAN_NOTICE("[msg]")) -/obj/item/katana/energy/New() - ..() +/obj/item/katana/energy/Initialize(mapload) + . = ..() spark_system = new /datum/effect_system/spark_spread() spark_system.set_up(5, 0, src) spark_system.attach(src) diff --git a/code/modules/pda/pdas.dm b/code/modules/pda/pdas.dm index d3566716052..f831ef386ad 100644 --- a/code/modules/pda/pdas.dm +++ b/code/modules/pda/pdas.dm @@ -142,8 +142,8 @@ owner = "John Doe" default_pen = /obj/item/pen/multi/syndicate -/obj/item/pda/syndicate/New() - ..() +/obj/item/pda/syndicate/Initialize(mapload) + . = ..() var/datum/data/pda/app/messenger/M = find_program(/datum/data/pda/app/messenger) if(M) M.m_hidden = TRUE @@ -207,8 +207,8 @@ icon_state = "pda-h" default_pen = /obj/item/pen/multi/gold -/obj/item/pda/centcom/New() - ..() +/obj/item/pda/centcom/Initialize(mapload) + . = ..() var/datum/data/pda/app/messenger/M = find_program(/datum/data/pda/app/messenger) if(M) M.m_hidden = 1 diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index c60c19d12c9..a9e59c8666a 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -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() diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm index 6ea5f6c08ae..619c5c7b5fb 100644 --- a/code/modules/projectiles/ammunition/ammo_casings.dm +++ b/code/modules/projectiles/ammunition/ammo_casings.dm @@ -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 diff --git a/code/modules/projectiles/ammunition/energy_lens.dm b/code/modules/projectiles/ammunition/energy_lens.dm index 5083ed714c3..133c87b2fbc 100644 --- a/code/modules/projectiles/ammunition/energy_lens.dm +++ b/code/modules/projectiles/ammunition/energy_lens.dm @@ -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() diff --git a/code/modules/projectiles/guns/energy_guns.dm b/code/modules/projectiles/guns/energy_guns.dm index 7429afa76c1..8406d10d79b 100644 --- a/code/modules/projectiles/guns/energy_guns.dm +++ b/code/modules/projectiles/guns/energy_guns.dm @@ -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 diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index c7127ad88c9..d22c12e5da1 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -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) diff --git a/code/modules/reagents/chemistry/reagents/medicine.dm b/code/modules/reagents/chemistry/reagents/medicine.dm index 8262274d174..6ae6dadd0fe 100644 --- a/code/modules/reagents/chemistry/reagents/medicine.dm +++ b/code/modules/reagents/chemistry/reagents/medicine.dm @@ -1091,9 +1091,9 @@ var/mob/living/carbon/human/H = M if(!H.get_int_organ(/obj/item/organ/internal/bone_tumor)) if(isslimeperson(H)) - new /obj/item/organ/internal/bone_tumor/slime_tumor(H) + new /obj/item/organ/internal/bone_tumor/slime_tumor(H, H) else - new /obj/item/organ/internal/bone_tumor(H) + new /obj/item/organ/internal/bone_tumor(H, H) return ..() diff --git a/code/modules/reagents/chemistry/reagents_holder.dm b/code/modules/reagents/chemistry/reagents_holder.dm index b00789d35ee..11b9024aec7 100644 --- a/code/modules/reagents/chemistry/reagents_holder.dm +++ b/code/modules/reagents/chemistry/reagents_holder.dm @@ -43,13 +43,6 @@ if(temperature_maximum) temperature_max = temperature_maximum //I dislike having these here but map-objects are initialised before world/New() is called. >_> - if(!GLOB.chemical_reagents_list) - //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id - var/paths = subtypesof(/datum/reagent) - GLOB.chemical_reagents_list = list() - for(var/path in paths) - var/datum/reagent/D = new path() - GLOB.chemical_reagents_list[D.id] = D if(!GLOB.chemical_reactions_list) //Chemical Reactions - Initialises all /datum/chemical_reaction into a list // It is filtered into multiple lists within a list. diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 9c39afb3240..01c42fa8e75 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -462,8 +462,8 @@ GLOBAL_LIST_EMPTY(conveyor_switches) w_class = WEIGHT_CLASS_BULKY var/id -/obj/item/conveyor_switch_construct/New(loc, new_id) - ..(loc) +/obj/item/conveyor_switch_construct/Initialize(mapload, new_id) + . = ..() if(new_id) id = new_id else diff --git a/code/modules/research/anomaly/anomaly.dm b/code/modules/research/anomaly/anomaly.dm index 5f1e6bfc9a5..4bb6f0c49c8 100644 --- a/code/modules/research/anomaly/anomaly.dm +++ b/code/modules/research/anomaly/anomaly.dm @@ -61,8 +61,8 @@ /obj/item/assembly/signaler/anomaly/random name = "Random anomaly core" -/obj/item/assembly/signaler/anomaly/random/New() - ..() +/obj/item/assembly/signaler/anomaly/random/Initialize(mapload) + . = ..() var/list/types = list(/obj/item/assembly/signaler/anomaly/pyro, /obj/item/assembly/signaler/anomaly/cryo, /obj/item/assembly/signaler/anomaly/grav, /obj/item/assembly/signaler/anomaly/flux, /obj/item/assembly/signaler/anomaly/bluespace, /obj/item/assembly/signaler/anomaly/vortex) var/A = pick(types) new A(loc) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 960e5fa8875..198ce233596 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -31,8 +31,8 @@ injector_mob = user ..() -/obj/item/slime_extract/New() - ..() +/obj/item/slime_extract/Initialize(mapload) + . = ..() create_reagents(100) /obj/item/slime_extract/grey diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 366aa0bf6c3..3fbc6e08830 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -15,8 +15,8 @@ // You can use this var for item path, it would be converted into an item on New() -/obj/item/organ/internal/cyberimp/arm/New() - ..() +/obj/item/organ/internal/cyberimp/arm/Initialize(mapload) + . = ..() if(ispath(holder)) holder = new holder(src) @@ -353,8 +353,8 @@ augment_icon = "toolkit" do_extra_render = TRUE -/obj/item/organ/internal/cyberimp/arm/flash/New() - ..() +/obj/item/organ/internal/cyberimp/arm/flash/Initialize(mapload) + . = ..() if(locate(/obj/item/flash/armimplant) in items_list) var/obj/item/flash/armimplant/F = locate(/obj/item/flash/armimplant) in items_list F.implant = src @@ -374,8 +374,8 @@ origin_tech = "materials=5;combat=7;biotech=5;powerstorage=5;syndicate=6;programming=5" stealth_level = 4 //Only surgery or a body scanner with the highest tier of stock parts can detect this. -/obj/item/organ/internal/cyberimp/arm/combat/New() - ..() +/obj/item/organ/internal/cyberimp/arm/combat/Initialize(mapload) + . = ..() if(locate(/obj/item/flash/armimplant) in items_list) var/obj/item/flash/armimplant/F = locate(/obj/item/flash/armimplant) in items_list F.implant = src diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index aea1e1f68ab..44ca5ac1c68 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -8,7 +8,7 @@ tough = TRUE // Immune to damage augment_state ='icons/mob/human_races/robotic.dmi' -/obj/item/organ/internal/cyberimp/New(mob/M = null) +/obj/item/organ/internal/cyberimp/Initialize(mapload, mob/M = null) . = ..() if(implant_overlay) var/mutable_appearance/overlay = mutable_appearance(icon, implant_overlay) diff --git a/code/modules/surgery/organs/bone_tumor.dm b/code/modules/surgery/organs/bone_tumor.dm index 129b5e857fa..7054d789212 100644 --- a/code/modules/surgery/organs/bone_tumor.dm +++ b/code/modules/surgery/organs/bone_tumor.dm @@ -5,8 +5,8 @@ destroy_on_removal = TRUE var/tumor_size = 0 //Changed in New to be dependent on amount of osseous reagent in the system when formed, determines damage done -/obj/item/organ/internal/bone_tumor/New(mob/living/carbon/holder) - ..() +/obj/item/organ/internal/bone_tumor/Initialize(mapload, mob/living/carbon/holder) + . = ..() tumor_size = owner.reagents.get_reagent_amount("osseous_reagent") owner.reagents.remove_all_type(/datum/reagent/medicine/osseous_reagent, tumor_size) @@ -30,4 +30,3 @@ /obj/item/organ/internal/bone_tumor/slime_tumor name = "crystalized slime jelly" - diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm index f046d9eaa2c..eb2c5647260 100644 --- a/code/modules/surgery/organs/organ.dm +++ b/code/modules/surgery/organs/organ.dm @@ -58,8 +58,8 @@ /obj/item/organ/proc/update_health() return -/obj/item/organ/New(mob/living/carbon/holder, datum/species/species_override = null) - ..(holder) +/obj/item/organ/Initialize(mapload, mob/living/carbon/holder, datum/species/species_override = null) + . = ..() if(!max_damage) max_damage = min_broken_damage * 2 if(ishuman(holder)) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 8cd464c48cf..e763e540cb6 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -119,8 +119,8 @@ return -/obj/item/organ/external/New(mob/living/carbon/holder) - ..() +/obj/item/organ/external/Initialize(mapload, mob/living/carbon/holder) + . = ..() if(ishuman(holder)) var/mob/living/carbon/human/H = holder icobase = H.dna.species.icobase diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 1b9f9211501..c07c75c1b36 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -32,24 +32,20 @@ /// Does this organ have augmented skin to apply to the user on install? If so, apply it to the user and remove it. var/self_augmented_skin_level = 0 -/obj/item/organ/internal/New(mob/living/carbon/holder) - ..() +/obj/item/organ/internal/Initialize(mapload, mob/living/carbon/holder) + . = ..() + if(organ_datums) + var/list/temp_list = organ_datums.Copy() + organ_datums = list() + for(var/path in temp_list) + var/datum/organ/organ_datum = new path(src) + if(!organ_datum.organ_tag) + stack_trace("There was an organ datum [organ_datum] ([organ_datum.type]), that had no organ tag.") + continue + organ_datums[organ_datum.organ_tag] = organ_datum if(istype(holder)) insert(holder) -/obj/item/organ/internal/Initialize(mapload) - . = ..() - if(!organ_datums) - return - var/list/temp_list = organ_datums.Copy() - organ_datums = list() - for(var/path in temp_list) - var/datum/organ/organ_datum = new path(src) - if(!organ_datum.organ_tag) - stack_trace("There was an organ datum [organ_datum] ([organ_datum.type]), that had no organ tag.") - continue - organ_datums[organ_datum.organ_tag] = organ_datum - /obj/item/organ/internal/Destroy() if(owner) // we have to remove BEFORE organ_datums are qdel'd, or we can just live even if our heart organ got deleted remove(owner, TRUE) diff --git a/code/modules/surgery/organs/subtypes/machine_organs.dm b/code/modules/surgery/organs/subtypes/machine_organs.dm index a4c6f05e9ab..68feca01bfb 100644 --- a/code/modules/surgery/organs/subtypes/machine_organs.dm +++ b/code/modules/surgery/organs/subtypes/machine_organs.dm @@ -7,8 +7,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/head/ipc/New(mob/living/carbon/holder, datum/species/species_override = null) - ..(holder, /datum/species/machine) // IPC heads need to be explicitly set to this since you can print them +/obj/item/organ/external/head/ipc/Initialize(mapload, mob/living/carbon/holder, datum/species/species_override = null) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/chest/ipc @@ -16,8 +16,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/chest/ipc/New() - ..() +/obj/item/organ/external/chest/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/groin/ipc @@ -25,8 +25,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/groin/ipc/New() - ..() +/obj/item/organ/external/groin/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/arm/ipc @@ -34,8 +34,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/arm/ipc/New() - ..() +/obj/item/organ/external/arm/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/arm/right/ipc @@ -43,8 +43,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/arm/right/ipc/New() - ..() +/obj/item/organ/external/arm/right/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/leg/ipc @@ -52,8 +52,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/leg/ipc/New() - ..() +/obj/item/organ/external/leg/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/leg/right/ipc @@ -61,8 +61,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/leg/right/ipc/New() - ..() +/obj/item/organ/external/leg/right/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/foot/ipc @@ -70,8 +70,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/foot/ipc/New() - ..() +/obj/item/organ/external/foot/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/foot/right/ipc @@ -79,8 +79,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/foot/right/ipc/New() - ..() +/obj/item/organ/external/foot/right/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/hand/ipc @@ -88,8 +88,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/hand/ipc/New() - ..() +/obj/item/organ/external/hand/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/external/hand/right/ipc @@ -97,8 +97,8 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/hand/right/ipc/New() - ..() +/obj/item/organ/external/hand/right/ipc/Initialize(mapload) + . = ..() robotize("Morpheus Cyberkinetics") /obj/item/organ/internal/cell @@ -130,8 +130,8 @@ /obj/item/organ/internal/brain/mmi_holder/posibrain name = "positronic brain" -/obj/item/organ/internal/brain/mmi_holder/posibrain/New() - ..() +/obj/item/organ/internal/brain/mmi_holder/posibrain/Initialize(mapload) + . = ..() stored_mmi = new /obj/item/mmi/robotic_brain/positronic(src) if(!owner) stored_mmi.forceMove(get_turf(src)) diff --git a/code/modules/telesci/rcs.dm b/code/modules/telesci/rcs.dm index ce3c160d219..148b78520b4 100644 --- a/code/modules/telesci/rcs.dm +++ b/code/modules/telesci/rcs.dm @@ -27,16 +27,13 @@ /obj/item/rcs/Initialize(mapload) . = ..() + rcell = new(src) RegisterSignal(src, COMSIG_BIT_ATTACH, PROC_REF(add_bit)) RegisterSignal(src, COMSIG_CLICK_ALT, PROC_REF(remove_bit)) /obj/item/rcs/get_cell() return rcell -/obj/item/rcs/New() - ..() - rcell = new(src) - /obj/item/rcs/examine(mob/user) . = ..() . += SPAN_NOTICE("There are [round(rcell.charge/chargecost)] charge\s left.")