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
+9
View File
@@ -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
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)
+7 -10
View File
@@ -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)
@@ -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
+2 -2
View File
@@ -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()
+8 -12
View File
@@ -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)
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)
+10 -10
View File
@@ -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
+4 -4
View File
@@ -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"
+1 -3
View File
@@ -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"
+2 -2
View File
@@ -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))
@@ -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()
+2 -2
View File
@@ -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()
+13 -19
View File
@@ -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()
@@ -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)
+2 -2
View File
@@ -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()
@@ -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)
@@ -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)
@@ -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)
@@ -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()
@@ -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")]"
@@ -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)
+16 -16
View File
@@ -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
@@ -11,7 +11,7 @@
var/voice
var/active
/obj/item/voice_changer/New()
/obj/item/voice_changer/Initialize(mapload)
. = ..()
if(isitem(loc))
+3 -3
View File
@@ -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]"
+4 -4
View File
@@ -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)
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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()
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+6 -6
View File
@@ -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()
+2 -2
View File
@@ -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)
+10 -12
View File
@@ -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
+3 -6
View File
@@ -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
+4 -4
View File
@@ -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)
@@ -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()
+2 -2
View File
@@ -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)
@@ -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 @@
. += "<span class='warning'>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. \
<b>Use the staff in hand</b> while wearing robes to link them both, then aim the staff at your victim to try and convert them.</span>"
/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"
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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()
@@ -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)
+4 -4
View File
@@ -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)
@@ -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)
+1 -4
View File
@@ -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)
@@ -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)
/*
+2 -2
View File
@@ -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)
@@ -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
@@ -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
..()
+4 -4
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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()
+1 -2
View File
@@ -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))
@@ -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)
@@ -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))
@@ -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
@@ -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
@@ -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)
@@ -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
@@ -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)
+1 -1
View File
@@ -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)
@@ -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
@@ -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)
+2 -2
View File
@@ -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))
+2 -2
View File
@@ -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()
+2 -2
View File
@@ -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)
+4 -4
View File
@@ -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
+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)
@@ -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 ..()
@@ -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.
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)
@@ -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
+6 -6
View File
@@ -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
@@ -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)
+2 -3
View File
@@ -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"
+2 -2
View File
@@ -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))
@@ -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
+11 -15
View File
@@ -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)
@@ -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))
+1 -4
View File
@@ -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.")