diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 25b478b26a2..d88fc674794 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -202,29 +202,33 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/g ///Datum used in item pixel shift TGUI var/datum/ui_module/item_pixel_shift/item_pixel_shift -/obj/item/New() - ..() - for(var/path in actions_types) - if(action_icon && action_icon_state) - new path(src, action_icon[path], action_icon_state[path]) - else - new path(src) - - if(!move_resist) - determine_move_resist() - /obj/item/Initialize(mapload) . = ..() + if(isstorage(loc)) //marks all items in storage as being such item_flags |= IN_STORAGE + if(!hitsound) if(damtype == "fire") hitsound = 'sound/items/welder.ogg' + if(damtype == "brute") hitsound = "swing_hit" + + for(var/path in actions_types) + if(action_icon && action_icon_state) + new path(src, action_icon[path], action_icon_state[path]) + + else + new path(src) + + if(!move_resist) + determine_move_resist() + add_eatable_component() + /obj/item/proc/add_eatable_component() AddComponent(/datum/component/eatable) diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index fab5b28c908..311be85a546 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -341,7 +341,7 @@ continue var/new_limb_type = organ_data["path"] - var/obj/item/organ/external/new_limb = new new_limb_type(holder = target, special = ORGAN_MANIPULATION_DEFAULT) + var/obj/item/organ/external/new_limb = new new_limb_type(target, ORGAN_MANIPULATION_DEFAULT) new_limb.robotize(company = L.model_info) if(L.sabotaged) diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm index 04a08e1a281..462f89ebc09 100644 --- a/code/modules/surgery/organs/organ.dm +++ b/code/modules/surgery/organs/organ.dm @@ -50,13 +50,14 @@ var/hidden_pain = FALSE -/obj/item/organ/New(mob/living/carbon/human/holder) - ..(holder) +/obj/item/organ/Initialize(mapload) + . = ..() if(!max_damage) max_damage = min_broken_damage * 2 - if(ishuman(holder)) + if(ishuman(loc)) + var/mob/living/carbon/human/holder = loc update_DNA(holder.dna) return diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 4eacc7768a4..acb5ccfd3d3 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -105,15 +105,16 @@ light_on = FALSE -/obj/item/organ/external/New(mob/living/carbon/holder, special = ORGAN_MANIPULATION_NOEFFECT) - ..() +/obj/item/organ/external/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() if(dna?.species) icobase = dna.species.icobase deform = dna.species.deform - if(ishuman(holder)) - replaced(holder, special) - sync_colour_to_human(holder) + + if(ishuman(loc)) + replaced(loc, special) + sync_colour_to_human(loc) properly_attached = TRUE if(is_robotic()) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index c12203c2244..e929d3fe9e6 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -12,10 +12,11 @@ light_on = FALSE -/obj/item/organ/internal/New(mob/living/carbon/holder) - ..() - if(istype(holder)) - insert(holder) +/obj/item/organ/internal/Initialize(mapload) + . = ..() + + if(iscarbon(loc)) + insert(loc) if(species_type == /datum/species/diona) AddComponent(/datum/component/diona_internals) diff --git a/code/modules/surgery/organs/subtypes/machine.dm b/code/modules/surgery/organs/subtypes/machine.dm index aa7ab941793..d9dfe52dbde 100644 --- a/code/modules/surgery/organs/subtypes/machine.dm +++ b/code/modules/surgery/organs/subtypes/machine.dm @@ -10,8 +10,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/head/ipc/New() - ..() +/obj/item/organ/external/head/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/chest/ipc @@ -22,8 +23,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/chest/ipc/New() - ..() +/obj/item/organ/external/chest/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/groin/ipc @@ -34,8 +36,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/groin/ipc/New() - ..() +/obj/item/organ/external/groin/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/arm/ipc @@ -46,8 +49,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/arm/ipc/New() - ..() +/obj/item/organ/external/arm/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/arm/right/ipc @@ -56,8 +60,9 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/arm/right/ipc/New() - ..() +/obj/item/organ/external/arm/right/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/leg/ipc @@ -68,8 +73,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/leg/ipc/New() - ..() +/obj/item/organ/external/leg/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/leg/right/ipc @@ -78,8 +84,9 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/leg/right/ipc/New() - ..() +/obj/item/organ/external/leg/right/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/foot/ipc @@ -90,8 +97,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/foot/ipc/New() - ..() +/obj/item/organ/external/foot/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/foot/right/ipc @@ -100,8 +108,9 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/foot/right/ipc/New() - ..() +/obj/item/organ/external/foot/right/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/hand/ipc @@ -112,8 +121,9 @@ pickup_sound = 'sound/items/handling/component_pickup.ogg' drop_sound = 'sound/items/handling/component_drop.ogg' -/obj/item/organ/external/hand/ipc/New() - ..() +/obj/item/organ/external/hand/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/external/hand/right/ipc @@ -122,8 +132,9 @@ status = ORGAN_ROBOT emp_resistant = TRUE -/obj/item/organ/external/hand/right/ipc/New() - ..() +/obj/item/organ/external/hand/right/ipc/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + robotize(company = "Morpheus Cyberkinetics") /obj/item/organ/internal/cell diff --git a/code/modules/surgery/organs/subtypes/standard.dm b/code/modules/surgery/organs/subtypes/standard.dm index d0971da1aca..27d9ff57e74 100644 --- a/code/modules/surgery/organs/subtypes/standard.dm +++ b/code/modules/surgery/organs/subtypes/standard.dm @@ -486,9 +486,10 @@ var/list/m_colours = list("tail" = "#000000") s_col = "#000000" -/obj/item/organ/external/tail/New(mob/living/carbon/holder) - ..() - if(!holder) +/obj/item/organ/external/tail/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + + if(!ishuman(loc)) var/icon/tempicon = new/icon("icon" = force_icon, "icon_state" = icon_name) var/icon/tempicon2 = new/icon(tempicon,dir=NORTH) tempicon2.Flip(SOUTH) @@ -548,9 +549,10 @@ var/list/m_colours = list("wing" = "#000000") s_col = "#000000" -/obj/item/organ/external/wing/New(mob/living/carbon/holder) - ..() - if(!holder) +/obj/item/organ/external/wing/Initialize(mapload, special = ORGAN_MANIPULATION_NOEFFECT) + . = ..() + + if(!ishuman(loc)) var/icon/tempicon = new/icon("icon" = force_icon, "icon_state" = icon_name) var/icon/tempicon2 = new/icon(tempicon,dir=NORTH) tempicon2.Flip(SOUTH)