From 7de84dd09256b5828a559abb8af094f783a99537 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:46:43 -0600 Subject: [PATCH 1/6] Functional M5 Gasmask 70% NVG code 30% trial and error --- code/game/objects/items/props/helmetgarb.dm | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 7860236d5d51..367ac59470fe 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -496,6 +496,32 @@ desc = "The USCM had its funding pulled for these when it became apparent that not every deployed enlisted was wearing a helmet 24/7; much to the bafflement of UA High Command." icon_state = "helmet_gasmask" +/obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/S) + if(!istype(S)) + return + + var/obj/item/MO = S.master_object + + if(!istype(MO, /obj/item/clothing/head/helmet/marine)) + return + + MO.flags_inventory = BLOCKSHARPOBJ | COVERMOUTH | COVEREYES | ALLOWINTERNALS | BLOCKGASEFFECT | ALLOWREBREATH | ALLOWCPR + MO.flags_inv_hide = HIDEEARS|HIDEFACE|HIDELOWHAIR + ..() + +/obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/S) + if(!istype(S)) + return + + var/obj/item/MO = S.master_object + + if(!istype(MO, /obj/item/clothing/head/helmet/marine)) + return + + MO.flags_inventory = BLOCKSHARPOBJ + MO.flags_inv_hide = HIDEEARS + return..() + /obj/item/prop/helmetgarb/trimmed_wire name = "trimmed barbed wire" desc = "It is a length of barbed wire that's had most of the sharp points filed down so that it is safe to handle." From 1a15c22c57c7b65cbae08669ce922a6e0c3e5d9a Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:11:28 -0600 Subject: [PATCH 2/6] Var names --- code/game/objects/items/props/helmetgarb.dm | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 367ac59470fe..99fc7ee72b95 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -496,30 +496,30 @@ desc = "The USCM had its funding pulled for these when it became apparent that not every deployed enlisted was wearing a helmet 24/7; much to the bafflement of UA High Command." icon_state = "helmet_gasmask" -/obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/S) - if(!istype(S)) +/obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/HelmetInternalInv) + if(!istype(HelmetInternalInv)) return - var/obj/item/MO = S.master_object + var/obj/item/Helmet = HelmetInternalInv.master_object - if(!istype(MO, /obj/item/clothing/head/helmet/marine)) + if(!istype(Helmet, /obj/item/clothing/head/helmet/marine)) return - MO.flags_inventory = BLOCKSHARPOBJ | COVERMOUTH | COVEREYES | ALLOWINTERNALS | BLOCKGASEFFECT | ALLOWREBREATH | ALLOWCPR - MO.flags_inv_hide = HIDEEARS|HIDEFACE|HIDELOWHAIR + Helmet.flags_inventory = BLOCKSHARPOBJ | COVERMOUTH | COVEREYES | ALLOWINTERNALS | BLOCKGASEFFECT | ALLOWREBREATH | ALLOWCPR + Helmet.flags_inv_hide = HIDEEARS|HIDEFACE|HIDELOWHAIR ..() -/obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/S) - if(!istype(S)) +/obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/HelmetInternalInv) + if(!istype(HelmetInternalInv)) return - var/obj/item/MO = S.master_object + var/obj/item/Helmet = HelmetInternalInv.master_object - if(!istype(MO, /obj/item/clothing/head/helmet/marine)) + if(!istype(Helmet, /obj/item/clothing/head/helmet/marine)) return - MO.flags_inventory = BLOCKSHARPOBJ - MO.flags_inv_hide = HIDEEARS + Helmet.flags_inventory = BLOCKSHARPOBJ + Helmet.flags_inv_hide = HIDEEARS return..() /obj/item/prop/helmetgarb/trimmed_wire From 2d50963a6c4be6498a67206f1c54808106dda10e Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Mon, 4 Dec 2023 15:09:13 -0600 Subject: [PATCH 3/6] I really hope this is better I don't want to make Functional M5 Gasmask 3: Fucking With Functional Code To Make One Obscure Feature Work Better --- code/game/objects/items/props/helmetgarb.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 99fc7ee72b95..7f5b0b5809d2 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -502,11 +502,11 @@ var/obj/item/Helmet = HelmetInternalInv.master_object - if(!istype(Helmet, /obj/item/clothing/head/helmet/marine)) + if(!istype(Helmet, /obj/item/clothing/head/helmet)) return - Helmet.flags_inventory = BLOCKSHARPOBJ | COVERMOUTH | COVEREYES | ALLOWINTERNALS | BLOCKGASEFFECT | ALLOWREBREATH | ALLOWCPR - Helmet.flags_inv_hide = HIDEEARS|HIDEFACE|HIDELOWHAIR + Helmet.flags_inventory = initial(Helmet.flags_inventory)+BLOCKGASEFFECT + Helmet.flags_inv_hide = initial(Helmet.flags_inv_hide)+HIDEFACE ..() /obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/HelmetInternalInv) @@ -515,11 +515,11 @@ var/obj/item/Helmet = HelmetInternalInv.master_object - if(!istype(Helmet, /obj/item/clothing/head/helmet/marine)) + if(!istype(Helmet, /obj/item/clothing/head/helmet)) return - Helmet.flags_inventory = BLOCKSHARPOBJ - Helmet.flags_inv_hide = HIDEEARS + Helmet.flags_inventory = initial(Helmet.flags_inventory) + Helmet.flags_inv_hide = initial(Helmet.flags_inv_hide) return..() /obj/item/prop/helmetgarb/trimmed_wire From 5c819ecd1eb517302943f36e0ef70ad098c142d0 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:27:36 -0600 Subject: [PATCH 4/6] make shit better --- code/game/objects/items/props/helmetgarb.dm | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 7f5b0b5809d2..dd14a35c9418 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -496,30 +496,30 @@ desc = "The USCM had its funding pulled for these when it became apparent that not every deployed enlisted was wearing a helmet 24/7; much to the bafflement of UA High Command." icon_state = "helmet_gasmask" -/obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/HelmetInternalInv) - if(!istype(HelmetInternalInv)) +/obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/helmet_internal_inventory) + if(!istype(helmet_internal_inventory)) return - var/obj/item/Helmet = HelmetInternalInv.master_object + var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object - if(!istype(Helmet, /obj/item/clothing/head/helmet)) + if(!istype(helmet_item)) return - Helmet.flags_inventory = initial(Helmet.flags_inventory)+BLOCKGASEFFECT - Helmet.flags_inv_hide = initial(Helmet.flags_inv_hide)+HIDEFACE + helmet_item.flags_inventory|=BLOCKGASEFFECT + helmet_item.flags_inv_hide|=HIDEFACE ..() -/obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/HelmetInternalInv) - if(!istype(HelmetInternalInv)) +/obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/helmet_internal_inventory) + if(!istype(helmet_internal_inventory)) return - var/obj/item/Helmet = HelmetInternalInv.master_object + var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object - if(!istype(Helmet, /obj/item/clothing/head/helmet)) + if(!istype(helmet_item)) return - Helmet.flags_inventory = initial(Helmet.flags_inventory) - Helmet.flags_inv_hide = initial(Helmet.flags_inv_hide) + helmet_item.flags_inventory = initial(helmet_item.flags_inventory) + helmet_item.flags_inv_hide = initial(helmet_item.flags_inv_hide) return..() /obj/item/prop/helmetgarb/trimmed_wire From d3985255cb5985341654bac9207bacd95db50b40 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:33:26 -0600 Subject: [PATCH 5/6] tweak it again --- code/game/objects/items/props/helmetgarb.dm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index dd14a35c9418..137aa57fde79 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -497,22 +497,17 @@ icon_state = "helmet_gasmask" /obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/helmet_internal_inventory) - if(!istype(helmet_internal_inventory)) - return - + ..() var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object if(!istype(helmet_item)) return - helmet_item.flags_inventory|=BLOCKGASEFFECT - helmet_item.flags_inv_hide|=HIDEFACE - ..() + helmet_item.flags_inventory |= BLOCKGASEFFECT + helmet_item.flags_inv_hide |= HIDEFACE /obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/helmet_internal_inventory) - if(!istype(helmet_internal_inventory)) - return - + ..() var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object if(!istype(helmet_item)) @@ -520,7 +515,6 @@ helmet_item.flags_inventory = initial(helmet_item.flags_inventory) helmet_item.flags_inv_hide = initial(helmet_item.flags_inv_hide) - return..() /obj/item/prop/helmetgarb/trimmed_wire name = "trimmed barbed wire" From 684b9ca1c9c5fcbf5e8f56d2c53c6ece3f5a0f16 Mon Sep 17 00:00:00 2001 From: Ediblebomb <95509996+Ediblebomb@users.noreply.github.com> Date: Wed, 6 Dec 2023 00:07:01 -0600 Subject: [PATCH 6/6] Not sure how I didn't consider using this button before Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/objects/items/props/helmetgarb.dm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index 137aa57fde79..85ba018eea3a 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -498,6 +498,8 @@ /obj/item/prop/helmetgarb/helmet_gasmask/on_enter_storage(obj/item/storage/internal/helmet_internal_inventory) ..() + if(!istype(helmet_internal_inventory)) + return var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object if(!istype(helmet_item)) @@ -508,13 +510,15 @@ /obj/item/prop/helmetgarb/helmet_gasmask/on_exit_storage(obj/item/storage/internal/helmet_internal_inventory) ..() + if(!istype(helmet_internal_inventory)) + return var/obj/item/clothing/head/helmet/helmet_item = helmet_internal_inventory.master_object if(!istype(helmet_item)) return - helmet_item.flags_inventory = initial(helmet_item.flags_inventory) - helmet_item.flags_inv_hide = initial(helmet_item.flags_inv_hide) + helmet_item.flags_inventory &= ~(BLOCKGASEFFECT) + helmet_item.flags_inv_hide &= ~(HIDEFACE) /obj/item/prop/helmetgarb/trimmed_wire name = "trimmed barbed wire"