From 2dd6ccd8994607548335b46ba31cd3df6d629dd0 Mon Sep 17 00:00:00 2001 From: meem <75212565+meemofcourse@users.noreply.github.com> Date: Thu, 9 May 2024 17:36:45 -0400 Subject: [PATCH] Adds storage to helmets, which can overlay certain items in them (#2845) ## About The Pull Request ![imagen](https://github.com/shiptest-ss13/Shiptest/assets/75212565/cc1a9bfc-5f6a-4091-8ea5-695c5b1e1ca7) Adds a whitelisted storage component to helmets, and a variable that determines if they should process overlays. Features codersprites. ![imagen](https://github.com/shiptest-ss13/Shiptest/assets/75212565/8e874d88-885b-4909-9f5d-81be1ae4f5ae) ## Why It's Good For The Game * It looks nice. ## Changelog :cl: add: Helmets now have a small, two-item storage. You can put goggles in there, and it might overlay them. /:cl: --- .../components/storage/concrete/pockets.dm | 14 ++++++--- code/game/objects/items.dm | 3 ++ code/modules/clothing/head/helmet.dm | 28 +++++++++++++----- .../clothing/spacesuits/_spacesuits.dm | 2 ++ icons/mob/clothing/helmet_overlays.dmi | Bin 0 -> 4861 bytes 5 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 icons/mob/clothing/helmet_overlays.dmi diff --git a/code/datums/components/storage/concrete/pockets.dm b/code/datums/components/storage/concrete/pockets.dm index bd0a59f85f42..ce224d44e4e5 100644 --- a/code/datums/components/storage/concrete/pockets.dm +++ b/code/datums/components/storage/concrete/pockets.dm @@ -83,10 +83,16 @@ /datum/component/storage/concrete/pockets/helmet/Initialize() . = ..() set_holdable(list( - /obj/item/reagent_containers/food/drinks/bottle/vodka, - /obj/item/reagent_containers/food/drinks/bottle/molotov, - /obj/item/reagent_containers/food/drinks/drinkingglass, - /obj/item/ammo_box/magazine/illestren_a850r + /obj/item/clothing/glasses/cold, + /obj/item/clothing/glasses/heat, + /obj/item/clothing/glasses/welding, + /obj/item/clothing/glasses/thermal, + /obj/item/clothing/glasses/night, + /obj/item/clothing/glasses/hud/health/night, + /obj/item/clothing/glasses/hud/security/night, + /obj/item/clothing/glasses/hud/security/sunglasses/inteq, + /obj/item/ammo_casing, + /obj/item/ammo_box/magazine/illestren_a850r, )) /datum/component/storage/concrete/pockets/holster diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 437aa7625d71..0cfa30f86a7c 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -699,6 +699,9 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb /obj/item/proc/get_belt_overlay() //Returns the icon used for overlaying the object on a belt return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', icon_state) +/obj/item/proc/get_helmet_overlay() // returns the icon for overlaying on a helmet + return mutable_appearance('icons/mob/clothing/helmet_overlays.dmi', icon_state) + /obj/item/proc/update_slot_icon() if(!ismob(loc)) return diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index 22baf7d2ae86..651ebe8b0745 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -16,10 +16,15 @@ dog_fashion = /datum/dog_fashion/head/helmet - var/can_flashlight = FALSE //if a flashlight can be mounted. if it has a flashlight and this is false, it is permanently attached. + //if a flashlight can be mounted. if it has a flashlight and this is false, it is permanently attached. + var/can_flashlight = FALSE var/obj/item/flashlight/seclite/attached_light var/datum/action/item_action/toggle_helmet_flashlight/action_light + pocket_storage_component_path = /datum/component/storage/concrete/pockets/helmet + // should we overlay the items inside our helmet + var/content_overlays = FALSE + /obj/item/clothing/head/helmet/Initialize() . = ..() if(attached_light) @@ -171,16 +176,21 @@ var/mutable_appearance/flashlightlight_overlay if(isinhands) return - if(!attached_light) - return - if(attached_light.on) - flashlightlight_overlay = mutable_appearance('icons/mob/clothing/head.dmi', "[flashlight_state]_on") + if(attached_light) + if(attached_light.on) + flashlightlight_overlay = mutable_appearance('icons/mob/clothing/head.dmi', "[flashlight_state]_on") + else + flashlightlight_overlay = mutable_appearance('icons/mob/clothing/head.dmi', flashlight_state) + . += flashlightlight_overlay + if(content_overlays) + for(var/obj/item/I in contents) + . += I.get_helmet_overlay() else - flashlightlight_overlay = mutable_appearance('icons/mob/clothing/head.dmi', flashlight_state) - . += flashlightlight_overlay + return /obj/item/clothing/head/helmet/sec can_flashlight = TRUE + content_overlays = TRUE /obj/item/clothing/head/helmet/sec/attackby(obj/item/I, mob/user, params) if(issignaler(I)) @@ -214,6 +224,7 @@ "Snow" = "helmetalt_snow", "Urban" = "helmetalt_urban", ) + content_overlays = TRUE /obj/item/clothing/head/helmet/marine name = "tactical combat helmet" @@ -497,6 +508,7 @@ icon_state = "inteq_swat" item_state = "inteq_swat" flags_inv = HIDEHAIR + content_overlays = TRUE /obj/item/clothing/head/helmet/inteq name = "inteq helmet" @@ -504,6 +516,7 @@ icon_state = "inteq_helmet" icon_state = "inteq_helmet" can_flashlight = TRUE + content_overlays = TRUE /obj/item/clothing/head/solgov name = "\improper SolGov officer's cap" @@ -545,6 +558,7 @@ desc = "A robust combat helmet commonly employed by Syndicate forces, regardless of alignment." icon_state = "operator" item_state = "operator" + content_overlays = TRUE /obj/item/clothing/head/helmet/medical name = "\improper trauma team helmet" diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index 4b19735b5f62..fe89fab6b21d 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -19,6 +19,8 @@ flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF resistance_flags = NONE dog_fashion = null + content_overlays = FALSE + pocket_storage_component_path = null /obj/item/clothing/suit/space name = "space suit" diff --git a/icons/mob/clothing/helmet_overlays.dmi b/icons/mob/clothing/helmet_overlays.dmi new file mode 100644 index 0000000000000000000000000000000000000000..1c41c357a42a747c1e57f6411e087a50681d3621 GIT binary patch literal 4861 zcmcgwXIK;K)(t9x2x0*|DgsA}G?9ZMqM^f~DIkKOgMxyD-dhYF6fOdyK?JFy6e%I1 z1f+zZ9zdjr5_%{?2#{b5B!Q63H=KLF@7_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