From 2e37f5390f2fb0d01d4f9bcd55e0cedf025c547c Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Tue, 11 Jul 2023 21:52:02 +1000 Subject: [PATCH] General custom item kit rework. Aligning gender bool check with other gender checks. --- code/game/objects/items/paintkit.dm | 348 ------------------ code/game/objects/items/paintkit/_paintkit.dm | 73 ++++ .../items/paintkit/_paintkit_overrides.dm | 104 ++++++ .../items/paintkit/paintkit_clothing.dm | 5 + .../objects/items/paintkit/paintkit_mecha.dm | 104 ++++++ .../objects/items/paintkit/paintkit_rig.dm | 10 + .../objects/items/paintkit/paintkit_suit.dm | 12 + .../mob/living/carbon/human/human_organs.dm | 5 +- polaris.dme | 7 +- 9 files changed, 317 insertions(+), 351 deletions(-) delete mode 100644 code/game/objects/items/paintkit.dm create mode 100644 code/game/objects/items/paintkit/_paintkit.dm create mode 100644 code/game/objects/items/paintkit/_paintkit_overrides.dm create mode 100644 code/game/objects/items/paintkit/paintkit_clothing.dm create mode 100644 code/game/objects/items/paintkit/paintkit_mecha.dm create mode 100644 code/game/objects/items/paintkit/paintkit_rig.dm create mode 100644 code/game/objects/items/paintkit/paintkit_suit.dm diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm deleted file mode 100644 index 4481c22d21f..00000000000 --- a/code/game/objects/items/paintkit.dm +++ /dev/null @@ -1,348 +0,0 @@ -/obj/item/kit - icon_state = "modkit" - icon = 'icons/obj/device.dmi' - pickup_sound = 'sound/items/pickup/device.ogg' - drop_sound = 'sound/items/drop/device.ogg' - w_class = ITEMSIZE_SMALL - var/new_name = "custom item" - var/new_desc = "A custom item." - var/new_icon - var/new_icon_file - var/new_icon_override_file - var/uses = 1 // Uses before the kit deletes itself. - var/list/allowed_types = list() - -/obj/item/kit/examine() - . = ..() - . += "It has [uses] use\s left." - -/obj/item/kit/proc/use(var/amt, var/mob/user) - uses -= amt - playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) - if(uses<1) - user.drop_item() - qdel(src) - -/obj/item/kit/proc/can_customize(var/obj/item/I) - return is_type_in_list(I, allowed_types) - -/obj/item/kit/proc/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) - new_name = kit_name - new_desc = kit_desc - new_icon = kit_icon - new_icon_file = kit_icon_file - new_icon_override_file = kit_icon_override_file - - for(var/path in splittext(additional_data, ", ")) - allowed_types |= text2path(path) - -/obj/item/kit/proc/customize(var/obj/item/I, var/mob/user) - if(can_customize(I)) - I.name = new_name ? new_name : I.name - I.desc = new_desc ? new_desc : I.desc - I.icon = new_icon_file ? new_icon_file : I.icon - I.icon_override = new_icon_override_file ? new_icon_override_file : I.icon_override - if(new_icon) - I.icon_state = new_icon - var/obj/item/clothing/under/U = I - if(istype(U)) - U.worn_state = I.icon_state - U.update_rolldown_status() - use(1, user) - -// Generic use -/obj/item/attackby(obj/item/W, mob/user) - if(istype(W, /obj/item/kit)) - var/obj/item/kit/K = W - K.customize(src, user) - return TRUE - return ..() - -/// Ponchos specifically, but other accessories may eventually need this. -/// Consequence of snowflake-y Teshari code. -/obj/item/kit/accessory - name = "accessory modification kit" - desc = "A kit for modifying accessories." - -/obj/item/kit/accessory/can_customize(var/obj/item/I) - return istype(I, /obj/item/clothing/accessory/storage/poncho) - -/obj/item/kit/accessory/customize(var/obj/item/I, var/mob/user) - if(can_customize(I)) - if(istype(I, /obj/item/clothing/accessory/storage/poncho)) - var/obj/item/clothing/accessory/storage/poncho/P = I - P.icon_override_state = new_icon_override_file - P.item_state = new_icon - to_chat(user, "You set about modifying the poncho into [new_name].") - return ..() - -/// General clothing items, that need to set item_state.. -/obj/item/kit/clothing - name = "clothing modification kit" - desc = "A kit for modifying clothing." - -/obj/item/kit/clothing/customize(var/obj/item/clothing/I, var/mob/user) - if(istype(I) && can_customize(I)) - I.item_state = new_icon - return ..() - -// Root hardsuit kit defines. -// Icons for modified hardsuits need to be in the proper .dmis because suit cyclers may cock them up. -/obj/item/kit/suit - name = "voidsuit modification kit" - desc = "A kit for modifying a voidsuit." - uses = 2 - var/new_light_overlay - -/obj/item/kit/suit/can_customize(var/obj/item/I) - return istype(I, /obj/item/clothing/head/helmet/space/void) || istype(I, /obj/item/clothing/suit/space/void) || istype(I, /obj/item/clothing/suit/storage/hooded) - -/obj/item/kit/suit/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) - ..() - - new_light_overlay = additional_data - - -/obj/item/kit/suit/customize(var/obj/item/I, var/mob/user) - if(can_customize(I)) - if(istype(I, /obj/item/clothing/head/helmet/space/void)) - var/obj/item/clothing/head/helmet/space/void/helmet = I - helmet.name = "[new_name] suit helmet" - helmet.desc = new_desc - helmet.icon_state = "[new_icon]_helmet" - helmet.item_state = "[new_icon]_helmet" - if(new_icon_file) - helmet.icon = new_icon_file - if(new_icon_override_file) - helmet.icon_override = new_icon_override_file - if(new_light_overlay) - helmet.light_overlay = new_light_overlay - to_chat(user, "You set about modifying the helmet into [helmet].") - var/mob/living/carbon/human/H = user - if(istype(H)) - helmet.species_restricted = list(H.species.get_bodytype(H)) - else if(istype(I, /obj/item/clothing/suit/storage/hooded)) - var/obj/item/clothing/suit/storage/hooded/suit = I - suit.name = "[new_name] suit" - suit.desc = new_desc - suit.icon_state = "[new_icon]_suit" - suit.toggleicon = "[new_icon]_suit" - var/obj/item/clothing/head/hood/S = suit.hood - S.icon_state = "[new_icon]_helmet" - if(new_icon_file) - suit.icon = new_icon_file - S.icon = new_icon_file - if(new_icon_override_file) - suit.icon_override = new_icon_override_file - S.icon_override = new_icon_override_file - to_chat(user, "You set about modifying the suit into [suit].") -// var/mob/living/carbon/human/H = user -// if(istype(H)) -// suit.species_restricted = list(H.species.get_bodytype(H)) Does not quite make sense for something usually very pliable. - else - var/obj/item/clothing/suit/space/void/suit = I - suit.name = "[new_name] voidsuit" - suit.desc = new_desc - suit.icon_state = "[new_icon]_suit" - suit.item_state = "[new_icon]_suit" - if(new_icon_file) - suit.icon = new_icon_file - if(new_icon_override_file) - suit.icon_override = new_icon_override_file - to_chat(user, "You set about modifying the suit into [suit].") - var/mob/living/carbon/human/H = user - if(istype(H)) - suit.species_restricted = list(H.species.get_bodytype(H)) - use(1,user) - -/obj/item/clothing/head/helmet/space/void/attackby(var/obj/item/O, var/mob/user) - if(istype(O,/obj/item/kit/suit)) - var/obj/item/kit/suit/kit = O - kit.customize(src, user) - return - return ..() - -/obj/item/clothing/suit/space/void/attackby(var/obj/item/O, var/mob/user) - if(istype(O,/obj/item/kit/suit)) - var/obj/item/kit/suit/kit = O - kit.customize(src, user) - return - return ..() - -/obj/item/clothing/suit/storage/hooded/attackby(var/obj/item/O, var/mob/user) - if(istype(O,/obj/item/kit/suit)) - var/obj/item/kit/suit/kit = O - kit.customize(src, user) - return TRUE - return ..() - -/obj/item/kit/suit/rig - name = "rig modification kit" - desc = "A kit for modifying a rigsuit." - uses = 1 - -/obj/item/kit/suit/rig/customize(var/obj/item/I, var/mob/user) - var/obj/item/rig/RIG = I - RIG.suit_state = new_icon - RIG.item_state = new_icon - RIG.suit_type = "customized [initial(RIG.suit_type)]" - RIG.name = "[new_name]" - RIG.desc = new_desc - RIG.icon = new_icon_file - RIG.icon_state = new_icon - RIG.icon_override = new_icon_override_file - for(var/obj/item/piece in list(RIG.gloves,RIG.helmet,RIG.boots,RIG.chest)) - if(!istype(piece)) - continue - piece.name = "[RIG.suit_type] [initial(piece.name)]" - piece.desc = "It seems to be part of a [RIG.name]." - piece.icon_state = "[RIG.suit_state]" - if(istype(piece, /obj/item/clothing/shoes)) - piece.icon = 'icons/mob/custom_items_rig_boots.dmi' - piece.icon_override = 'icons/mob/custom_items_rig_boots.dmi' - if(istype(piece, /obj/item/clothing/suit)) - piece.icon = 'icons/mob/custom_items_rig_suit.dmi' - piece.icon_override = 'icons/mob/custom_items_rig_suit.dmi' - if(istype(piece, /obj/item/clothing/head)) - piece.icon = 'icons/mob/custom_items_rig_helmet.dmi' - piece.icon_override = 'icons/mob/custom_items_rig_helmet.dmi' - if(istype(piece, /obj/item/clothing/gloves)) - piece.icon = 'icons/mob/custom_items_rig_gloves.dmi' - piece.icon_override = 'icons/mob/custom_items_rig_gloves.dmi' - if(RIG.helmet && istype(RIG.helmet, /obj/item/clothing/head/helmet) && new_light_overlay) - var/obj/item/clothing/head/helmet/H = RIG.helmet - H.light_overlay = new_light_overlay - use(1,user) - -/obj/item/kit/suit/rig/can_customize(var/obj/item/I) - return istype(I, /obj/item/rig) - -/obj/item/rig/attackby(var/obj/item/O, var/mob/user) - if(istype(O,/obj/item/kit/suit)) - var/obj/item/kit/suit/rig/kit = O - kit.customize(src, user) - return - return ..() - -/obj/item/kit/suit/rig/debug/Initialize() - . = ..() - set_info("debug suit", "This is a test", "debug", CUSTOM_ITEM_OBJ, CUSTOM_ITEM_MOB) - -/obj/item/kit/paint - name = "mecha customisation kit" - desc = "A kit containing all the needed tools and parts to repaint a mech." - var/removable = null - -/obj/item/kit/paint/can_customize(var/obj/mecha/M) - if(!istype(M)) - return 0 - - for(var/type in allowed_types) - if(type == M.initial_icon) - return 1 - -/obj/item/kit/paint/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) - ..() - - allowed_types = splittext(additional_data, ", ") - - -/obj/item/kit/paint/examine() - . = ..() - . += "This kit will convert an exosuit into: [new_name]." - . += "This kit can be used on the following exosuit models:" - for(var/exotype in allowed_types) - . += "- [capitalize(exotype)]" - -/obj/item/kit/paint/customize(var/obj/mecha/M, var/mob/user) - if(!can_customize(M)) - to_chat(user, "That kit isn't meant for use on this class of exosuit.") - return - - if(M.occupant) - to_chat(user, "You can't customize a mech while someone is piloting it - that would be unsafe!") - return - - user.visible_message("[user] opens [src] and spends some quality time customising [M].") - M.name = new_name - M.desc = new_desc - M.initial_icon = new_icon - if(new_icon_file) - M.icon = new_icon_file - M.update_icon() - use(1, user) - -/obj/mecha/attackby(var/obj/item/W, var/mob/user) - if(istype(W, /obj/item/kit/paint)) - var/obj/item/kit/paint/P = W - P.customize(src, user) - return - else - return ..() - -//Ripley APLU kits. -/obj/item/kit/paint/ripley - name = "\"Classic\" APLU customisation kit" - new_name = "APLU \"Classic\"" - new_desc = "A very retro APLU unit; didn't they retire these back in 2543?" - new_icon = "ripley-old" - allowed_types = list("ripley") - -/obj/item/kit/paint/ripley/death - name = "\"Reaper\" APLU customisation kit" - new_name = "APLU \"Reaper\"" - new_desc = "A terrifying, grim power loader. Why do those clamps have spikes?" - new_icon = "deathripley" - allowed_types = list("ripley","firefighter") - -/obj/item/kit/paint/ripley/flames_red - name = "\"Firestarter\" APLU customisation kit" - new_name = "APLU \"Firestarter\"" - new_desc = "A standard APLU exosuit with stylish orange flame decals." - new_icon = "ripley_flames_red" - -/obj/item/kit/paint/ripley/flames_blue - name = "\"Burning Chrome\" APLU customisation kit" - new_name = "APLU \"Burning Chrome\"" - new_desc = "A standard APLU exosuit with stylish blue flame decals." - new_icon = "ripley_flames_blue" - -// Durand kits. -/obj/item/kit/paint/durand - name = "\"Classic\" Durand customisation kit" - new_name = "Durand \"Classic\"" - new_desc = "An older model of Durand combat exosuit. This model was retired for rotating a pilot's torso 180 degrees." - new_icon = "old_durand" - allowed_types = list("durand") - -/obj/item/kit/paint/durand/seraph - name = "\"Cherubim\" Durand customisation kit" - new_name = "Durand \"Cherubim\"" - new_desc = "A Durand combat exosuit modelled after ancient Earth entertainment. Your heart goes doki-doki just looking at it." - new_icon = "old_durand" - -/obj/item/kit/paint/durand/phazon - name = "\"Sypher\" Durand customisation kit" - new_name = "Durand \"Sypher\"" - new_desc = "A Durand combat exosuit with some very stylish neons and decals. Seems to blur slightly at the edges; probably an optical illusion." - new_icon = "phazon" - -// Gygax kits. -/obj/item/kit/paint/gygax - name = "\"Jester\" Gygax customisation kit" - new_name = "Gygax \"Jester\"" - new_desc = "A Gygax exosuit modelled after the infamous combat-troubadors of Earth's distant past. Terrifying to behold." - new_icon = "honker" - allowed_types = list("gygax") - -/obj/item/kit/paint/gygax/darkgygax - name = "\"Silhouette\" Gygax customisation kit" - new_name = "Gygax \"Silhouette\"" - new_desc = "An ominous Gygax exosuit modelled after the fictional corporate 'death squads' that were popular in pulp action-thrillers back in 2554." - new_icon = "darkgygax" - -/obj/item/kit/paint/gygax/recitence - name = "\"Gaoler\" Gygax customisation kit" - new_name = "Durand \"Gaoler\"" - new_desc = "A bulky silver Gygax exosuit. The extra armour appears to be painted on, but it's very shiny." - new_icon = "recitence" diff --git a/code/game/objects/items/paintkit/_paintkit.dm b/code/game/objects/items/paintkit/_paintkit.dm new file mode 100644 index 00000000000..abb22e65f3c --- /dev/null +++ b/code/game/objects/items/paintkit/_paintkit.dm @@ -0,0 +1,73 @@ +// Generic use +/obj/attackby(obj/item/W, mob/user) + return attempt_customization(W, user) || ..() + +/obj/proc/attempt_customization(var/obj/item/W, var/mob/user) + if(!istype(W, /obj/item/kit)) + return FALSE + var/obj/item/kit/K = W + if(!K.can_customize(src)) + return FALSE + var/old_name = name + if(!K.try_customize(src, user)) + return FALSE + K.use(1, user) + K.show_customization_message(user, src, old_name) + return TRUE + +/obj/item/kit + icon_state = "modkit" + icon = 'icons/obj/device.dmi' + pickup_sound = 'sound/items/pickup/device.ogg' + drop_sound = 'sound/items/drop/device.ogg' + w_class = ITEMSIZE_SMALL + + /// A string to use to modify the obj name. + var/new_name = "custom item" + /// A string to use to modify the obj desc. + var/new_desc = "A custom item." + /// A new string to set icon_state to. + var/new_icon + /// A new .dmi to set icon to. + var/new_icon_file + /// A new .dmi to set icon_override to. + var/new_icon_override_file + /// Number of uses before the kit is consumed. + var/uses = 1 // Uses before the kit deletes itself. + /// A list of base types that are accepted for use by this kit. + var/list/accepted_refit_types + +/obj/item/kit/examine() + . = ..() + . += "It has [uses] use\s left." + +/obj/item/kit/proc/use(var/amt, var/mob/user) + if(uses) + uses -= amt + playsound(src, 'sound/items/Screwdriver.ogg', 50, 1) + if(uses <= 0) + user.drop_item() + qdel(src) + +/obj/item/kit/proc/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) + new_name = kit_name + new_desc = kit_desc + new_icon = kit_icon + new_icon_file = kit_icon_file + new_icon_override_file = kit_icon_override_file + for(var/path in splittext(additional_data, ", ")) + var/refit_type = text2path(path) + if(ispath(refit_type, /obj)) + LAZYDISTINCTADD(accepted_refit_types, refit_type) + else + crash_with("Invalid path value supplied to custom item serde: [refit_type || "NULL"]") + +/obj/item/kit/proc/can_customize(var/obj/I) + return istype(I) && is_type_in_list(I, accepted_refit_types) + +/obj/item/kit/proc/try_customize(var/obj/I, var/mob/user) + if(!can_customize(I)) + return + +/obj/item/kit/proc/show_customization_message(var/mob/user, var/obj/I, var/old_name) + user.visible_message("\The [user] opens \the [src] and converts \the [old_name] into \a [I].") diff --git a/code/game/objects/items/paintkit/_paintkit_overrides.dm b/code/game/objects/items/paintkit/_paintkit_overrides.dm new file mode 100644 index 00000000000..0495e58b2c5 --- /dev/null +++ b/code/game/objects/items/paintkit/_paintkit_overrides.dm @@ -0,0 +1,104 @@ +/obj/proc/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + SHOULD_CALL_PARENT(TRUE) + if(!istype(kit)) + return FALSE + if(kit.new_name) + name = kit.new_name + if(kit.new_desc) + desc = kit.new_desc + return TRUE + +/obj/mecha/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + if(kit.new_icon) + initial_icon = kit.new_icon + if(kit.new_icon_file) + icon = kit.new_icon_file + update_icon() + +/obj/item/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + if(kit.new_icon) + icon_state = kit.new_icon + if(kit.new_icon_file) + icon = kit.new_icon_file + if(kit.new_icon_override_file) + icon_override = kit.new_icon_override_file + +/obj/item/clothing/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + var/species_name = istype(user) && user.get_species_name() + if(species_name && species_name != SPECIES_HUMAN) + species_restricted = list(species_name) + if(kit.new_icon_override_file) + LAZYSET(sprite_sheets, species_name, kit.new_icon_override_file) + +/obj/item/clothing/under/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + worn_state = icon_state + update_rolldown_status() + +/obj/item/clothing/head/helmet/space/void/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + name = "[kit.new_name] suit helmet" + icon_state = "[kit.new_icon]_helmet" + item_state = "[kit.new_icon]_helmet" + if(kit.new_light_overlay) + light_overlay = kit.new_light_overlay + +/obj/item/clothing/suit/storage/hooded/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + name = "[kit.new_name] suit" + icon_state = "[kit.new_icon]_suit" + toggleicon = "[kit.new_icon]_suit" + if(hood) + hood.customize_with_kit(user, kit) + +/obj/item/clothing/head/hood/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + name = "[kit.new_name] hood" + icon_state = "[kit.new_icon]_helmet" + item_state = "[kit.new_icon]_helmet" + +/obj/item/clothing/accessory/storage/poncho/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + icon_override_state = kit.new_icon_override_file + item_state = kit.new_icon + +/obj/item/rig/customize_with_kit(var/mob/user, var/obj/item/kit/suit/kit) + . = ..() + if(.) + if(kit.new_icon) + suit_state = kit.new_icon + item_state = kit.new_icon + suit_type = "customized [initial(suit_type)]" + + if(istype(helmet, /obj/item/clothing/head/helmet) && kit.new_light_overlay) + var/obj/item/clothing/head/helmet/helm_ref = helmet + helm_ref.light_overlay = kit.new_light_overlay + + for(var/obj/item/piece in list(gloves, helmet, boots, chest)) + piece.name = "[suit_type] [initial(piece.name)]" + piece.desc = "It seems to be part of \a [name]." + piece.icon_state = "[suit_state]" + piece.customize_with_kit(user, kit, src) + if(istype(piece, /obj/item/clothing/shoes)) + piece.icon = 'icons/mob/custom_items_rig_boots.dmi' + piece.icon_override = 'icons/mob/custom_items_rig_boots.dmi' + if(istype(piece, /obj/item/clothing/suit)) + piece.icon = 'icons/mob/custom_items_rig_suit.dmi' + piece.icon_override = 'icons/mob/custom_items_rig_suit.dmi' + if(istype(piece, /obj/item/clothing/head)) + piece.icon = 'icons/mob/custom_items_rig_helmet.dmi' + piece.icon_override = 'icons/mob/custom_items_rig_helmet.dmi' + if(istype(piece, /obj/item/clothing/gloves)) + piece.icon = 'icons/mob/custom_items_rig_gloves.dmi' + piece.icon_override = 'icons/mob/custom_items_rig_gloves.dmi' diff --git a/code/game/objects/items/paintkit/paintkit_clothing.dm b/code/game/objects/items/paintkit/paintkit_clothing.dm new file mode 100644 index 00000000000..9585fed120c --- /dev/null +++ b/code/game/objects/items/paintkit/paintkit_clothing.dm @@ -0,0 +1,5 @@ +/// General clothing items, that need to set item_state.. +/obj/item/kit/clothing + name = "clothing modification kit" + desc = "A kit for modifying clothing." + accepted_refit_types = list(/obj/item/clothing) diff --git a/code/game/objects/items/paintkit/paintkit_mecha.dm b/code/game/objects/items/paintkit/paintkit_mecha.dm new file mode 100644 index 00000000000..0f5f6c21896 --- /dev/null +++ b/code/game/objects/items/paintkit/paintkit_mecha.dm @@ -0,0 +1,104 @@ +/obj/item/kit/paint + name = "mecha customisation kit" + desc = "A kit containing all the needed tools and parts to repaint a mech." + accepted_refit_types = list(/obj/mecha) + var/list/accepted_base_icon_states = list() + var/removable = null + +/obj/item/kit/paint/can_customize(var/mob/user, var/obj/I) + . = ..() + if(!.) + return + var/obj/mecha/M = I + if(M.occupant) + to_chat(user, SPAN_WARNING("You can't customize a mech while someone is piloting it - that would be unsafe!")) + return FALSE + if(length(accepted_base_icon_states)) + . = FALSE + for(var/base_icon_type in accepted_base_icon_states) + if(base_icon_type == M.initial_icon) + . = TRUE + break + if(!. && user) + to_chat(user, SPAN_WARNING("That kit isn't meant for use on this class of exosuit.")) + +/obj/item/kit/paint/show_customization_message(var/mob/user, var/obj/I, var/old_name) + user.visible_message("\The [user] opens \the [src] and spends some quality time customising \the [old_name].") + +/obj/item/kit/paint/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) + ..() + accepted_base_icon_states = splittext(additional_data, ", ") + +/obj/item/kit/paint/examine() + . = ..() + . += "This kit will convert an exosuit into: [new_name]." + . += "This kit can be used on the following exosuit models:" + for(var/exotype in accepted_base_icon_states) + . += "- [capitalize(exotype)]" + +//Ripley APLU kits. +/obj/item/kit/paint/ripley + name = "\"Classic\" APLU customisation kit" + new_name = "APLU \"Classic\"" + new_desc = "A very retro APLU unit; didn't they retire these back in 2543?" + new_icon = "ripley-old" + accepted_base_icon_states = list("ripley") + +/obj/item/kit/paint/ripley/death + name = "\"Reaper\" APLU customisation kit" + new_name = "APLU \"Reaper\"" + new_desc = "A terrifying, grim power loader. Why do those clamps have spikes?" + new_icon = "deathripley" + accepted_base_icon_states = list("ripley","firefighter") + +/obj/item/kit/paint/ripley/flames_red + name = "\"Firestarter\" APLU customisation kit" + new_name = "APLU \"Firestarter\"" + new_desc = "A standard APLU exosuit with stylish orange flame decals." + new_icon = "ripley_flames_red" + +/obj/item/kit/paint/ripley/flames_blue + name = "\"Burning Chrome\" APLU customisation kit" + new_name = "APLU \"Burning Chrome\"" + new_desc = "A standard APLU exosuit with stylish blue flame decals." + new_icon = "ripley_flames_blue" + +// Durand kits. +/obj/item/kit/paint/durand + name = "\"Classic\" Durand customisation kit" + new_name = "Durand \"Classic\"" + new_desc = "An older model of Durand combat exosuit. This model was retired for rotating a pilot's torso 180 degrees." + new_icon = "old_durand" + accepted_base_icon_states = list("durand") + +/obj/item/kit/paint/durand/seraph + name = "\"Cherubim\" Durand customisation kit" + new_name = "Durand \"Cherubim\"" + new_desc = "A Durand combat exosuit modelled after ancient Earth entertainment. Your heart goes doki-doki just looking at it." + new_icon = "old_durand" + +/obj/item/kit/paint/durand/phazon + name = "\"Sypher\" Durand customisation kit" + new_name = "Durand \"Sypher\"" + new_desc = "A Durand combat exosuit with some very stylish neons and decals. Seems to blur slightly at the edges; probably an optical illusion." + new_icon = "phazon" + +// Gygax kits. +/obj/item/kit/paint/gygax + name = "\"Jester\" Gygax customisation kit" + new_name = "Gygax \"Jester\"" + new_desc = "A Gygax exosuit modelled after the infamous combat-troubadors of Earth's distant past. Terrifying to behold." + new_icon = "honker" + accepted_base_icon_states = list("gygax") + +/obj/item/kit/paint/gygax/darkgygax + name = "\"Silhouette\" Gygax customisation kit" + new_name = "Gygax \"Silhouette\"" + new_desc = "An ominous Gygax exosuit modelled after the fictional corporate 'death squads' that were popular in pulp action-thrillers back in 2554." + new_icon = "darkgygax" + +/obj/item/kit/paint/gygax/recitence + name = "\"Gaoler\" Gygax customisation kit" + new_name = "Durand \"Gaoler\"" + new_desc = "A bulky silver Gygax exosuit. The extra armour appears to be painted on, but it's very shiny." + new_icon = "recitence" diff --git a/code/game/objects/items/paintkit/paintkit_rig.dm b/code/game/objects/items/paintkit/paintkit_rig.dm new file mode 100644 index 00000000000..88098a07938 --- /dev/null +++ b/code/game/objects/items/paintkit/paintkit_rig.dm @@ -0,0 +1,10 @@ + +/obj/item/kit/rig + name = "rig modification kit" + desc = "A kit for modifying a rigsuit." + uses = 1 + accepted_refit_types = list(/obj/item/rig) + +/obj/item/kit/rig/debug/Initialize() + . = ..() + set_info("debug suit", "This is a test", "debug", CUSTOM_ITEM_OBJ, CUSTOM_ITEM_MOB) diff --git a/code/game/objects/items/paintkit/paintkit_suit.dm b/code/game/objects/items/paintkit/paintkit_suit.dm new file mode 100644 index 00000000000..2b179869e11 --- /dev/null +++ b/code/game/objects/items/paintkit/paintkit_suit.dm @@ -0,0 +1,12 @@ +// Root hardsuit kit defines. +// Icons for modified hardsuits need to be in the proper .dmis because suit cyclers may cock them up. +/obj/item/kit/suit + name = "voidsuit modification kit" + desc = "A kit for modifying a voidsuit." + uses = 2 + accepted_refit_types = list(/obj/item/clothing/suit/space/void) + var/new_light_overlay + +/obj/item/kit/suit/set_info(var/kit_name, var/kit_desc, var/kit_icon, var/kit_icon_file = CUSTOM_ITEM_OBJ, var/kit_icon_override_file = CUSTOM_ITEM_MOB, var/additional_data) + ..() + new_light_overlay = additional_data diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index c3d50d01bac..a522645937e 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -200,6 +200,7 @@ if(g != gender) gender = g - if(dna.GetUIState(DNA_UI_GENDER) ^ gender == FEMALE) // XOR will catch both cases where they do not match - dna.SetUIState(DNA_UI_GENDER, gender == FEMALE) + var/new_gender_bool = gender != MALE + if(dna.GetUIState(DNA_UI_GENDER) != new_gender_bool) + dna.SetUIState(DNA_UI_GENDER, new_gender_bool) sync_organ_dna(dna) diff --git a/polaris.dme b/polaris.dme index e907bfe7022..b221e9e6753 100644 --- a/polaris.dme +++ b/polaris.dme @@ -960,7 +960,6 @@ #include "code\game\objects\items\glassjar.dm" #include "code\game\objects\items\gunbox.dm" #include "code\game\objects\items\magazine.dm" -#include "code\game\objects\items\paintkit.dm" #include "code\game\objects\items\poi_items.dm" #include "code\game\objects\items\robobag.dm" #include "code\game\objects\items\shooting_range.dm" @@ -1030,6 +1029,12 @@ #include "code\game\objects\items\mines\mine_sleeping.dm" #include "code\game\objects\items\mines\mine_stun.dm" #include "code\game\objects\items\mines\mine_training.dm" +#include "code\game\objects\items\paintkit\_paintkit.dm" +#include "code\game\objects\items\paintkit\_paintkit_overrides.dm" +#include "code\game\objects\items\paintkit\paintkit_clothing.dm" +#include "code\game\objects\items\paintkit\paintkit_mecha.dm" +#include "code\game\objects\items\paintkit\paintkit_rig.dm" +#include "code\game\objects\items\paintkit\paintkit_suit.dm" #include "code\game\objects\items\robot\robot_frame.dm" #include "code\game\objects\items\robot\robot_items.dm" #include "code\game\objects\items\robot\robot_parts.dm"