Skip to content

Commit

Permalink
[Port] Hardsuit Tails (#2715)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaFire15 authored Jan 10, 2025
1 parent 13ae901 commit 306ca33
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 7 deletions.
13 changes: 13 additions & 0 deletions code/modules/mob/dead/new_player/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
var/center = FALSE //Should we center the sprite?
var/limbs_id // The limbs id supplied for full-body replacing features.

///Category this tail falls into (for suit sprites). On basetype because for some reason wagging and nonwagging tails are not related??
var/general_type //NSV13

//////////////////////
// Hair Definitions //
//////////////////////
Expand Down Expand Up @@ -1686,34 +1689,42 @@
/datum/sprite_accessory/tails/lizard/smooth
name = "Smooth"
icon_state = "smooth"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails_animated/lizard/smooth
name = "Smooth"
icon_state = "smooth"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails/lizard/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails_animated/lizard/dtiger
name = "Dark Tiger"
icon_state = "dtiger"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails/lizard/ltiger
name = "Light Tiger"
icon_state = "ltiger"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails_animated/lizard/ltiger
name = "Light Tiger"
icon_state = "ltiger"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails/lizard/spikes
name = "Spikes"
icon_state = "spikes"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails_animated/lizard/spikes
name = "Spikes"
icon_state = "spikes"
general_type = "lizard" //NSV13

/datum/sprite_accessory/tails/human/none
name = "None"
Expand All @@ -1727,11 +1738,13 @@
name = "Cat"
icon_state = "cat"
color_src = HAIR
general_type = "feline" //NSV13

/datum/sprite_accessory/tails_animated/human/cat
name = "Cat"
icon_state = "cat"
color_src = HAIR
general_type = "feline" //NSV13

/datum/sprite_accessory/tails/human/clock
name = "Clockwork"
Expand Down
71 changes: 64 additions & 7 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -709,24 +709,46 @@ GLOBAL_LIST_EMPTY(roundstart_races)

var/obj/item/bodypart/head/HD = H.get_bodypart(BODY_ZONE_HEAD)

///Both hardsuit and a tail present, but suit also supports tail?
var/suitedtail = FALSE //NSV13 - I'm not sure how I feel about this, but I am NOT refactoring the entire proc right now.

if("tail_lizard" in mutant_bodyparts)
if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT))
bodyparts_to_add -= "tail_lizard"
//NSV13 - render tail if suit allows it.
if(!H.wear_suit.hardsuit_tail_colors)
bodyparts_to_add -= "tail_lizard"
else
suitedtail = TRUE
//NSV13 end.

if("waggingtail_lizard" in mutant_bodyparts)
if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT))
bodyparts_to_add -= "waggingtail_lizard"
//NSV13 - render tail if suit allows it.
if(!H.wear_suit.hardsuit_tail_colors || ("tail_lizard" in mutant_bodyparts))
bodyparts_to_add -= "waggingtail_lizard"
else
suitedtail = TRUE
//NSV13 end.
else if ("tail_lizard" in mutant_bodyparts)
bodyparts_to_add -= "waggingtail_lizard"

if("tail_human" in mutant_bodyparts)
if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT))
bodyparts_to_add -= "tail_human"

//NSV13 - render tail if suit allows it.
if(!H.wear_suit.hardsuit_tail_colors)
bodyparts_to_add -= "tail_human"
else
suitedtail = TRUE
//NSV13 end.

if("waggingtail_human" in mutant_bodyparts)
if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT))
bodyparts_to_add -= "waggingtail_human"
//NSV13 - render tail if suit allows it.
if(!H.wear_suit.hardsuit_tail_colors || ("tail_human" in mutant_bodyparts))
bodyparts_to_add -= "waggingtail_human"
else
suitedtail = TRUE
//NSV13 end.
else if ("tail_human" in mutant_bodyparts)
bodyparts_to_add -= "waggingtail_human"

Expand Down Expand Up @@ -878,7 +900,33 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(!S || S.icon_state == "none")
continue

var/mutable_appearance/accessory_overlay = mutable_appearance(S.icon, layer = -layer)
//NSV13 - my 'mildly' cursed hook that makes hardsuit tails possible.

//Override vars to hook into later parts of this proc.
var/internal_color_override = null
var/internal_used_icon_override = null
var/internal_state_override = null

//Coloration and state handling if hardsuited tail present and the tail is compatible.
if(suitedtail && (bodypart in list("tail_lizard", "tail_human", "waggingtail_lizard", "waggingtail_human")) && S.general_type)
if(layer == BODY_ADJ_LAYER) //Why did they write that loop like THIS. Oh well, not my problem!
continue //In any case, we only use BEHIND and FRONT layer.
//Currently this way, when I have more time I'll write a hex -> matrix converter to pre-bake them instead
var/list/finished_list = list()
finished_list += ReadRGB("[H.wear_suit.hardsuit_tail_colors[1]]0")
finished_list += ReadRGB("[H.wear_suit.hardsuit_tail_colors[2]]0")
finished_list += ReadRGB("[H.wear_suit.hardsuit_tail_colors[3]]0")
finished_list += list(0,0,0,255)
for(var/index in 1 to finished_list.len)
finished_list[index] /= 255
internal_color_override = finished_list
internal_used_icon_override = 'nsv13/icons/obj/clothing/suits/tails_hardsuit.dmi'
internal_state_override = "m_tail_[S.general_type]_hardsuit_[layertext]" //I am very sorry, dear coder who wrote this pipeline.. Then again, it IS also jank regardless.

//Also hooked internal_used_icon_override into this.
var/mutable_appearance/accessory_overlay = mutable_appearance(internal_used_icon_override ? internal_used_icon_override : S.icon, layer = -layer)

//NSV13 end.

//A little rename so we don't have to use tail_lizard or tail_human when naming the sprites.
if(bodypart == "tail_lizard" || bodypart == "tail_human")
Expand All @@ -891,10 +939,15 @@ GLOBAL_LIST_EMPTY(roundstart_races)
else
accessory_overlay.icon_state = "m_[bodypart]_[S.icon_state]_[layertext]"

//NSV13 - hook for internal_state_override.
if(internal_state_override)
accessory_overlay.icon_state = internal_state_override
//NSV13 end.

if(S.center)
accessory_overlay = center_image(accessory_overlay, S.dimension_x, S.dimension_y)

if(!(HAS_TRAIT(H, TRAIT_HUSK)))
if(!(HAS_TRAIT(H, TRAIT_HUSK)) && !internal_color_override) //NSV13 - Also checks for internal_color_override.
if(!forced_colour)
switch(S.color_src)
if(MUTCOLORS)
Expand All @@ -913,6 +966,10 @@ GLOBAL_LIST_EMPTY(roundstart_races)
accessory_overlay.color = "#[H.eye_color]"
else
accessory_overlay.color = forced_colour
//NSV13 - hook for internal_color_override to override color.
else if(internal_color_override)
accessory_overlay.color = internal_color_override
//NSV13 end.
standing += accessory_overlay

if(S.hasinner)
Expand Down
1 change: 1 addition & 0 deletions nsv13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3892,6 +3892,7 @@
#include "nsv13\code\modules\clothing\ears\babelfish.dm"
#include "nsv13\code\modules\clothing\masks\_masks.dm"
#include "nsv13\code\modules\clothing\masks\hailer.dm"
#include "nsv13\code\modules\clothing\suits\hardsuit_tails.dm"
#include "nsv13\code\modules\coffee\items\coffee_cartridge.dm"
#include "nsv13\code\modules\coffee\items\coffee_pack.dm"
#include "nsv13\code\modules\coffee\items\coffeepots.dm"
Expand Down
76 changes: 76 additions & 0 deletions nsv13/code/modules/clothing/suits/hardsuit_tails.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
//Modular attachment - hardsuit tails. Have to define it on /clothing, but only used on hardsuits for the time being, and in general only useful on SUIT slot clothing.
/obj/item/clothing
///Defines colors used for this particular hardsuit's tail rendering. Only useful on clothing that goes in the outer SUIT slot.
var/list/hardsuit_tail_colors

//Hexadecimal color lists for hardsuit tail sprites.
//The list gets used by the overlay renderer turned to RGB values, and overlayed onto the uncolored tailsprite in tails_hardsuit.dmi

/obj/item/clothing/suit/space/hardsuit/engine
hardsuit_tail_colors = list("974", "A62", "C95")

/obj/item/clothing/suit/space/hardsuit/engine/atmos
hardsuit_tail_colors = list("974", "487", "498")

/obj/item/clothing/suit/space/hardsuit/engine/elite
hardsuit_tail_colors = list("321", "CCB", "EEE")

/obj/item/clothing/suit/space/hardsuit/mining
hardsuit_tail_colors = list("877", "BA9", "655")

/obj/item/clothing/suit/space/hardsuit/syndi
hardsuit_tail_colors = list("A11", "322", "c45")

/obj/item/clothing/suit/space/hardsuit/syndi/elite
hardsuit_tail_colors = list("222", "454", "443")

/obj/item/clothing/suit/space/hardsuit/medical
hardsuit_tail_colors = list("DDD", "A75", "FFF")

/obj/item/clothing/suit/space/hardsuit/research_director
hardsuit_tail_colors = list("CB7", "839", "995")

/obj/item/clothing/suit/space/hardsuit/security
hardsuit_tail_colors = list("222", "C23", "335")

/obj/item/clothing/suit/space/hardsuit/security/head_of_security
hardsuit_tail_colors = list("212", "C32", "234")

/obj/item/clothing/suit/space/hardsuit/swat
hardsuit_tail_colors = list("333", "345", "335")

/obj/item/clothing/suit/space/hardsuit/swat/captain
hardsuit_tail_colors = list("368", "CA0", "030")

/obj/item/clothing/suit/space/hardsuit/shielded/syndi
hardsuit_tail_colors = list("A11", "322", "c45")

/obj/item/clothing/suit/space/hardsuit/shielded/swat
hardsuit_tail_colors = list("222", "454", "443")

/obj/item/clothing/suit/space/hardsuit/deathsquad
hardsuit_tail_colors = list("222", "510", "443")

/obj/item/clothing/suit/space/hardsuit/ert
hardsuit_tail_colors = list("112", "553", "28F")

/obj/item/clothing/suit/space/hardsuit/ert/sec
hardsuit_tail_colors = list("411", "D34", "D34")

/obj/item/clothing/suit/space/hardsuit/ert/engi
hardsuit_tail_colors = list("333", "FA0", "FA0")

/obj/item/clothing/suit/space/hardsuit/ert/med
hardsuit_tail_colors = list("321", "FFF", "FFF")

/obj/item/clothing/suit/space/hardsuit/ert/jani
hardsuit_tail_colors = list("112", "93E", "93E")

/obj/item/clothing/suit/space/hardsuit/ert/paranormal
hardsuit_tail_colors = list("9AA", "A23", "222")

/obj/item/clothing/suit/space/hardsuit/ert/paranormal/inquisitor
hardsuit_tail_colors = list("223", "521", "721")

/obj/item/clothing/suit/space/hardsuit/pilot
hardsuit_tail_colors = list("111", "555", "555")
Binary file added nsv13/icons/obj/clothing/suits/tails_hardsuit.dmi
Binary file not shown.

0 comments on commit 306ca33

Please sign in to comment.