From f1838b83e9b63a0ea13333660b9a4ed4146162a9 Mon Sep 17 00:00:00 2001 From: Spaghetti-bit <60483458+Spaghetti-bit@users.noreply.github.com> Date: Thu, 30 May 2024 06:14:34 -0600 Subject: [PATCH] [FIX] My webbings, where are they? (#25570) * Changes necrosis_prob to use decaylevel. * Reverts previous change to create a new branch. * Reverts (https://github.com/ParadiseSS13/Paradise/pull/24667) * Does not revert the previous PR, it builds upon it. Allowing items on the belt slot with the "special" var set to TRUE to overlay suits. Judo Belt, Webbings, and Bandolier are the current selection. * Fully fleshes out the layering of special belts. * Adds more belts to the special layer. * Fixes an oversight with the captain's rapier being left out. :sob: * Fixes a few more oversights caused by a pull/fetch. * Moves around an if statement to fix the order of operations, which was causing items that should've been OVER the suit item to be appear UNDER it. * Should resolve the merge conflict. * Partial revert * Merge conflict resolution * Refactors how a 'special belt' is defined and handled. Makes it more readable. * renames all instances of `special` to `layer_over_suit` --- code/__DEFINES/misc_defines.dm | 41 ++++++++++--------- .../objects/items/weapons/storage/belt.dm | 8 ++++ code/modules/martial_arts/martial.dm | 1 + .../living/carbon/human/human_update_icons.dm | 37 ++++++++++++++--- 4 files changed, 62 insertions(+), 25 deletions(-) diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm index 790c9f9ea66..73a8b5ff784 100644 --- a/code/__DEFINES/misc_defines.dm +++ b/code/__DEFINES/misc_defines.dm @@ -171,25 +171,26 @@ #define MFOAM_IRON 2 //Human Overlays Indexes///////// -#define EYES_OVERLAY_LAYER 42 -#define WING_LAYER 41 -#define WING_UNDERLIMBS_LAYER 40 -#define MUTANTRACE_LAYER 39 -#define TAIL_UNDERLIMBS_LAYER 38 //Tail split-rendering. -#define LIMBS_LAYER 37 -#define MARKINGS_LAYER 36 -#define INTORGAN_LAYER 35 -#define UNDERWEAR_LAYER 34 -#define MUTATIONS_LAYER 33 -#define H_DAMAGE_LAYER 32 -#define UNIFORM_LAYER 31 -#define ID_LAYER 30 -#define HANDS_LAYER 29 //Exists to overlay hands over jumpsuits -#define SHOES_LAYER 28 -#define GLOVES_LAYER 27 -#define EARS_LAYER 26 -#define BELT_LAYER 25 //Possible make this an overlay of something required to wear a belt? -#define SUIT_LAYER 24 +#define EYES_OVERLAY_LAYER 43 +#define WING_LAYER 42 +#define WING_UNDERLIMBS_LAYER 41 +#define MUTANTRACE_LAYER 40 +#define TAIL_UNDERLIMBS_LAYER 39 //Tail split-rendering. +#define LIMBS_LAYER 38 +#define MARKINGS_LAYER 37 +#define INTORGAN_LAYER 36 +#define UNDERWEAR_LAYER 35 +#define MUTATIONS_LAYER 34 +#define H_DAMAGE_LAYER 33 +#define UNIFORM_LAYER 32 +#define ID_LAYER 31 +#define HANDS_LAYER 30 //Exists to overlay hands over jumpsuits +#define SHOES_LAYER 29 +#define GLOVES_LAYER 28 +#define EARS_LAYER 27 +#define BELT_LAYER 26 //Possible make this an overlay of something required to wear a belt? +#define SUIT_LAYER 25 +#define SPECIAL_BELT_LAYER 24 #define SUIT_STORE_LAYER 23 #define BACK_LAYER 22 #define HEAD_ACCESSORY_LAYER 21 @@ -213,7 +214,7 @@ #define FIRE_LAYER 3 //If you're on fire #define MISC_LAYER 2 #define FROZEN_LAYER 1 -#define TOTAL_LAYERS 42 +#define TOTAL_LAYERS 43 ///Access Region Codes/// #define REGION_ALL 0 diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index f9276d10f9a..4cef7f50a31 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -18,6 +18,9 @@ /// Ignores update_weight() if TRUE var/large = FALSE + /// Belt goes over all suit slots if TRUE + var/layer_over_suit = FALSE + /obj/item/storage/belt/proc/update_weight() if(large) return @@ -340,6 +343,7 @@ item_state = "securitywebbing" storage_slots = 6 use_item_overlays = FALSE + layer_over_suit = TRUE can_hold = list( /obj/item/grenade/flashbang, /obj/item/grenade/chem_grenade/teargas, @@ -591,6 +595,7 @@ item_state = "bandolier" storage_slots = 16 max_combined_w_class = 16 + layer_over_suit = TRUE can_hold = list(/obj/item/ammo_casing/shotgun) display_contents_with_number = TRUE @@ -729,6 +734,7 @@ w_class = WEIGHT_CLASS_BULKY max_w_class = WEIGHT_CLASS_BULKY can_hold = list(/obj/item/melee/rapier) + layer_over_suit = TRUE large = TRUE /obj/item/storage/belt/rapier/populate_contents() @@ -922,6 +928,7 @@ max_w_class = WEIGHT_CLASS_BULKY max_combined_w_class = 20 use_item_overlays = FALSE + layer_over_suit = TRUE can_hold = list( /obj/item/crowbar, /obj/item/screwdriver, @@ -984,6 +991,7 @@ storage_slots = 10 max_w_class = WEIGHT_CLASS_NORMAL max_combined_w_class = 25 + layer_over_suit = TRUE can_hold = list( /obj/item/kitchen/utensil, /obj/item/kitchen/knife, diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 8ab6c179008..9a533f3514a 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -258,6 +258,7 @@ /obj/item/storage/belt/champion/wrestling name = "Wrestling Belt" + layer_over_suit = TRUE var/datum/martial_art/wrestling/style /obj/item/storage/belt/champion/wrestling/Initialize() diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index c1109e078d1..9e4996bdd7e 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -846,6 +846,21 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) /mob/living/carbon/human/update_inv_belt() remove_overlay(BELT_LAYER) + remove_overlay(SPECIAL_BELT_LAYER) + var/overlay_layer = BELT_LAYER + + // Certain belts should go OVER the suit. But not all. + /* Items (on the belt slot) that go over the suit: + - /obj/item/storage/belt/security/webbing + - /obj/item/storage/belt/bandolier + - /obj/item/judobelt + - /obj/item/storage/belt/chef + - /obj/item/storage/belt/mining/.. + - /obj/item/storage/belt/rapier + - /obj/item/defibrillator/compact/.. + - /obj/item/nullrod/.. + - /obj/item/claymore/.. + */ if(client && hud_used) var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_BELT] if(inv) @@ -856,20 +871,32 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) belt.screen_loc = ui_belt if(belt) - update_observer_view(belt) + // Manual checks for outliers (Claymores, null rods, defibs, judobelt, etc.) - Items that are belts but not storages. + var/list/special_belts = list( + /obj/item/defibrillator/compact, + /obj/item/nullrod, + /obj/item/judobelt, + /obj/item/claymore) + overlay_layer = is_type_in_list(belt, special_belts) ? SPECIAL_BELT_LAYER : BELT_LAYER + if(istype(belt, /obj/item/storage/belt)) + var/obj/item/storage/belt/B = belt + overlay_layer = B.layer_over_suit ? SPECIAL_BELT_LAYER : BELT_LAYER + var/t_state = belt.item_state + update_observer_view(belt) if(!t_state) t_state = belt.icon_state if(belt.icon_override) t_state = "[t_state]_be" - overlays_standing[BELT_LAYER] = mutable_appearance(belt.icon_override, "[t_state]", layer = -BELT_LAYER) + overlays_standing[overlay_layer] = mutable_appearance(belt.icon_override, "[t_state]", layer = -overlay_layer) else if(belt.sprite_sheets && belt.sprite_sheets[dna.species.sprite_sheet_name]) - overlays_standing[BELT_LAYER] = mutable_appearance(belt.sprite_sheets[dna.species.sprite_sheet_name], "[t_state]", layer = -BELT_LAYER) + overlays_standing[overlay_layer] = mutable_appearance(belt.sprite_sheets[dna.species.sprite_sheet_name], "[t_state]", layer = -overlay_layer) else - overlays_standing[BELT_LAYER] = mutable_appearance('icons/mob/clothing/belt.dmi', "[t_state]", layer = -BELT_LAYER) - apply_overlay(BELT_LAYER) + overlays_standing[overlay_layer] = mutable_appearance('icons/mob/clothing/belt.dmi', "[t_state]", layer = -overlay_layer) + apply_overlay(BELT_LAYER) + apply_overlay(SPECIAL_BELT_LAYER) /mob/living/carbon/human/update_inv_wear_suit() remove_overlay(SUIT_LAYER)