From cf7ce5f90184af532568b1ce8531f8419c5451aa Mon Sep 17 00:00:00 2001 From: KOCMOHABT <25280520+KOCMODECAHTHUK@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:03:37 +0500 Subject: [PATCH 1/2] add: Per-species sprite offsets (kepori and vox) Co-authored-by: Ossa88 (SYNAPSE) --- code/modules/clothing/clothing.dm | 4 +-- .../carbon/human/species_types/kepori.dm | 8 ++++- .../living/carbon/human/species_types/vox.dm | 8 ++++- mod_celadon/fixes/_fixes.dme | 1 + .../fixes/code/species_sprite_helper.dm | 34 +++++++++++++++++++ 5 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 mod_celadon/fixes/code/species_sprite_helper.dm diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 12f41166dd61..2c050e24d2a0 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -368,10 +368,10 @@ var/icon/human_clothing_icon = icon(file2use, state2use) - if("[layer]" in mob_species.offset_clothing) + var/list/shifts = get_species_worn_offsets(layer, mob_species) // [CELADON-EDIT] - Get species-specific offsets + if(shifts) // [/CELADON-EDIT] // This code taken from Baystation 12 var/icon/final_I = icon('icons/blanks/64x64.dmi', "nothing") - var/list/shifts = mob_species.offset_clothing["[layer]"] // Apply all pixel shifts for each direction. for(var/shift_facing in shifts) diff --git a/code/modules/mob/living/carbon/human/species_types/kepori.dm b/code/modules/mob/living/carbon/human/species_types/kepori.dm index 6eb9e0dcbaf9..6a3229375d37 100644 --- a/code/modules/mob/living/carbon/human/species_types/kepori.dm +++ b/code/modules/mob/living/carbon/human/species_types/kepori.dm @@ -114,7 +114,13 @@ "[NORTH]" = list("x" = 8, "y" = -1), "[EAST]" = list("x" = 8, "y" = -1), "[SOUTH]" = list("x" = 8, "y" = -1), - "[WEST]" = list("x" = -8, "y" = -1) + "[WEST]" = list("x" = -8, "y" = -1), + ), + "[BACK_LAYER]" = list( + "[NORTH]" = list("x" = 8, "y" = -1), + "[EAST]" = list("x" = 16, "y" = -1), + "[SOUTH]" = list("x" = 8, "y" = -1), + "[WEST]" = list("x" = 0, "y" = -1) ), ) diff --git a/code/modules/mob/living/carbon/human/species_types/vox.dm b/code/modules/mob/living/carbon/human/species_types/vox.dm index 9db26ebddd9f..afbb3986422f 100644 --- a/code/modules/mob/living/carbon/human/species_types/vox.dm +++ b/code/modules/mob/living/carbon/human/species_types/vox.dm @@ -95,7 +95,13 @@ "[NORTH]" = list("x" = 8, "y" = 0), "[EAST]" = list("x" = 8, "y" = 0), "[SOUTH]" = list("x" = 8, "y" = 0), - "[WEST]" = list("x" = -8, "y" = 0) + "[WEST]" = list("x" = -8, "y" = 0), + ), + "[BACK_LAYER]" = list( + "[NORTH]" = list("x" = 8, "y" = 0), + "[EAST]" = list("x" = 16, "y" = 0), + "[SOUTH]" = list("x" = 8, "y" = 0), + "[WEST]" = list("x" = 0, "y" = 0) ), ) diff --git a/mod_celadon/fixes/_fixes.dme b/mod_celadon/fixes/_fixes.dme index b46aedb297d9..8f67711006e2 100644 --- a/mod_celadon/fixes/_fixes.dme +++ b/mod_celadon/fixes/_fixes.dme @@ -30,6 +30,7 @@ #include "code/shutters.dm" #include "code/simple_mobs.dm" #include "code/species_moth.dm" +#include "code/species_sprite_helper.dm" #include "code/status_effects.dm" #include "code/TEG_pipes.dm" #include "code/tesla.dm" diff --git a/mod_celadon/fixes/code/species_sprite_helper.dm b/mod_celadon/fixes/code/species_sprite_helper.dm new file mode 100644 index 000000000000..4df4ebc25f9a --- /dev/null +++ b/mod_celadon/fixes/code/species_sprite_helper.dm @@ -0,0 +1,34 @@ +/obj/item + /// Per-species sprite offsets. Format: list("species_id" = list("NORTH" = list("x" = 0, "y" = 0), "SOUTH" = ..., etc.)) + var/list/species_offsets + /* EXAMPLE: + species_offsets = list( + SPECIES_KEPORI = list( + "[NORTH]" = list("x" = 10, "y" = -2), + "[EAST]" = list("x" = 12, "y" = -1), + "[SOUTH]" = list("x" = 10, "y" = -2), + "[WEST]" = list("x" = -10, "y" = -1) + ) + ) + */ + +/** + * Helper proc to get species-specific sprite offsets for worn clothing + * Checks item-specific offsets first, then falls back to species layer offsets + * + * Arguments: + * * layer - The layer the item is being worn on + * * mob_species - The species datum of the wearer + * + * Returns: List of directional offsets, or null if none apply + */ +/obj/item/proc/get_species_worn_offsets(layer, datum/species/mob_species) + // Item-specific offsets take priority + if(species_offsets && (mob_species.id in species_offsets)) + return species_offsets[mob_species.id] + + // Fall back to species layer offsets + if("[layer]" in mob_species.offset_clothing) + return mob_species.offset_clothing["[layer]"] + + return null From 855c00c5c1a5f584a874b8d4b878581b1f24bf29 Mon Sep 17 00:00:00 2001 From: KOCMOHABT <25280520+KOCMODECAHTHUK@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:26:10 +0500 Subject: [PATCH 2/2] Slightly better offsets Co-authored-by: Ossa88 (SYNAPSE) --- .../mob/living/carbon/human/species_types/kepori.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species_types/kepori.dm b/code/modules/mob/living/carbon/human/species_types/kepori.dm index 6a3229375d37..908573b4d8ad 100644 --- a/code/modules/mob/living/carbon/human/species_types/kepori.dm +++ b/code/modules/mob/living/carbon/human/species_types/kepori.dm @@ -117,10 +117,10 @@ "[WEST]" = list("x" = -8, "y" = -1), ), "[BACK_LAYER]" = list( - "[NORTH]" = list("x" = 8, "y" = -1), - "[EAST]" = list("x" = 16, "y" = -1), - "[SOUTH]" = list("x" = 8, "y" = -1), - "[WEST]" = list("x" = 0, "y" = -1) + "[NORTH]" = list("x" = 9, "y" = -3), + "[EAST]" = list("x" = 16, "y" = -3), + "[SOUTH]" = list("x" = 9, "y" = -3), + "[WEST]" = list("x" = 0, "y" = -3) ), )