diff --git a/code/game/objects/items/paintkit.dm b/code/game/objects/items/paintkit.dm index 87b7566b60b..4b3bd408d24 100644 --- a/code/game/objects/items/paintkit.dm +++ b/code/game/objects/items/paintkit.dm @@ -149,6 +149,52 @@ return return ..() +/obj/item/device/kit/suit/rig + name = "rig modification kit" + desc = "A kit for modifying a rigsuit." + uses = 1 + +/obj/item/device/kit/suit/rig/customize(var/obj/item/I, var/mob/user) + var/obj/item/weapon/rig/RIG = I + RIG.suit_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)) + icon = 'icons/mob/custom_items_rig_boots.dmi' + icon_override = 'icons/mob/custom_items_rig_boots.dmi' + if(istype(piece, /obj/item/clothing/suit)) + icon = 'icons/mob/custom_items_rig_suit.dmi' + icon_override = 'icons/mob/custom_items_rig_suit.dmi' + if(istype(piece, /obj/item/clothing/head)) + icon = 'icons/mob/custom_items_rig_helmet.dmi' + icon_override = 'icons/mob/custom_items_rig_helmet.dmi' + if(istype(piece, /obj/item/clothing/gloves)) + icon = 'icons/mob/custom_items_rig_gloves.dmi' + 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/device/kit/suit/rig/can_customize(var/obj/item/I) + return istype(I, /obj/item/weapon/rig) + +/obj/item/weapon/rig/attackby(var/obj/item/O, var/mob/user) + if(istype(O,/obj/item/device/kit/suit)) + var/obj/item/device/kit/suit/rig/kit = O + kit.customize(src, user) + return + return ..() /obj/item/device/kit/paint name = "mecha customisation kit" diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index b176ba2ff77..293e2601cc5 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -26,6 +26,8 @@ unacidable = 1 preserve_item = 1 + var/suit_state //The string used for the suit's icon_state. + var/interface_path = "hardsuit.tmpl" var/ai_interface_path = "hardsuit.tmpl" var/interface_title = "Hardsuit Controller" @@ -111,6 +113,7 @@ /obj/item/weapon/rig/New() ..() + suit_state = icon_state item_state = icon_state wires = new(src) @@ -155,7 +158,7 @@ piece.canremove = 0 piece.name = "[suit_type] [initial(piece.name)]" piece.desc = "It seems to be part of a [src.name]." - piece.icon_state = "[initial(icon_state)]" + piece.icon_state = "[suit_state]" piece.min_cold_protection_temperature = min_cold_protection_temperature piece.max_heat_protection_temperature = max_heat_protection_temperature if(piece.siemens_coefficient > siemens_coefficient) //So that insulated gloves keep their insulation. @@ -207,7 +210,7 @@ canremove = 1 for(var/obj/item/piece in list(helmet,boots,gloves,chest)) if(!piece) continue - piece.icon_state = "[initial(icon_state)]" + piece.icon_state = "[suit_state]" if(airtight) piece.item_flags &= ~(STOPPRESSUREDAMAGE|AIRTIGHT) update_icon(1) @@ -272,7 +275,7 @@ if(seal_delay && !instant && !do_after(M,seal_delay,needhand=0)) failed_to_seal = 1 - piece.icon_state = "[initial(icon_state)][!seal_target ? "_sealed" : ""]" + piece.icon_state = "[suit_state][!seal_target ? "_sealed" : ""]" switch(msg_type) if("boots") M << "\The [piece] [!seal_target ? "seal around your feet" : "relax their grip on your legs"]." @@ -310,7 +313,7 @@ qdel(booting_R) for(var/obj/item/piece in list(helmet,boots,gloves,chest)) if(!piece) continue - piece.icon_state = "[initial(icon_state)][!seal_target ? "" : "_sealed"]" + piece.icon_state = "[suit_state][!seal_target ? "" : "_sealed"]" canremove = !seal_target if(airtight) update_component_sealed() diff --git a/html/changelogs/Mechoid - Custom Rigs.yml b/html/changelogs/Mechoid - Custom Rigs.yml new file mode 100644 index 00000000000..54ce0704cc7 --- /dev/null +++ b/html/changelogs/Mechoid - Custom Rigs.yml @@ -0,0 +1,37 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Mechoid + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added a RIG customization kit." + - tweak: "RIGs now use a var called suit_state to determine the basis for their component icons, rather than the rig's icon state." diff --git a/icons/mob/custom_items_rig_boots.dmi b/icons/mob/custom_items_rig_boots.dmi new file mode 100644 index 00000000000..cf74d73796c Binary files /dev/null and b/icons/mob/custom_items_rig_boots.dmi differ diff --git a/icons/mob/custom_items_rig_gloves.dmi b/icons/mob/custom_items_rig_gloves.dmi new file mode 100644 index 00000000000..cf74d73796c Binary files /dev/null and b/icons/mob/custom_items_rig_gloves.dmi differ diff --git a/icons/mob/custom_items_rig_helmet.dmi b/icons/mob/custom_items_rig_helmet.dmi new file mode 100644 index 00000000000..cf74d73796c Binary files /dev/null and b/icons/mob/custom_items_rig_helmet.dmi differ diff --git a/icons/mob/custom_items_rig_suit.dmi b/icons/mob/custom_items_rig_suit.dmi new file mode 100644 index 00000000000..cf74d73796c Binary files /dev/null and b/icons/mob/custom_items_rig_suit.dmi differ