Skip to content

Commit

Permalink
Adds storage to helmets, which can overlay certain items in them (#2845)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## 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)


<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
  * It looks nice.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Helmets now have a small, two-item storage. You can put goggles in
there, and it might overlay them.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
meemofcourse authored May 9, 2024
1 parent d70b6c6 commit 2dd6ccd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
14 changes: 10 additions & 4 deletions code/datums/components/storage/concrete/pockets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 21 additions & 7 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -214,6 +224,7 @@
"Snow" = "helmetalt_snow",
"Urban" = "helmetalt_urban",
)
content_overlays = TRUE

/obj/item/clothing/head/helmet/marine
name = "tactical combat helmet"
Expand Down Expand Up @@ -497,13 +508,15 @@
icon_state = "inteq_swat"
item_state = "inteq_swat"
flags_inv = HIDEHAIR
content_overlays = TRUE

/obj/item/clothing/head/helmet/inteq
name = "inteq helmet"
desc = "A standard issue helmet in the colors of the IRMG. It doesn't feel special in any way."
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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions code/modules/clothing/spacesuits/_spacesuits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Binary file added icons/mob/clothing/helmet_overlays.dmi
Binary file not shown.

0 comments on commit 2dd6ccd

Please sign in to comment.