From d067eee4b2138d22143ee7843bcf999b8dc6e610 Mon Sep 17 00:00:00 2001
From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com>
Date: Fri, 14 Jun 2024 20:22:52 +0200
Subject: [PATCH] Adds digitigrade robotic legs (#2646)
---
code/__DEFINES/inventory.dm | 3 +++
code/datums/traits/negative.dm | 6 ++++++
code/game/machinery/aug_manipulator.dm | 19 +++++++++++++++---
code/modules/clothing/spacesuits/hardsuit.dm | 3 +++
.../mob/living/carbon/human/update_icons.dm | 12 +++++++----
code/modules/surgery/bodyparts/bodyparts.dm | 2 +-
icons/mob/species/misc/digitigrade_suits.dmi | Bin 34844 -> 34852 bytes
nsv13.dme | 1 +
.../nsv_modular_bodypart_overrides.dm | 17 ++++++++++++++++
.../mob/augmentation/digitigrade_legs.dmi | Bin 0 -> 1099 bytes
10 files changed, 55 insertions(+), 8 deletions(-)
create mode 100644 nsv13/code/modules/surgery/bodyparts/nsv_modular_bodypart_overrides.dm
create mode 100644 nsv13/icons/mob/augmentation/digitigrade_legs.dmi
diff --git a/code/__DEFINES/inventory.dm b/code/__DEFINES/inventory.dm
index 53416d80c64..cce6b67dbca 100644
--- a/code/__DEFINES/inventory.dm
+++ b/code/__DEFINES/inventory.dm
@@ -104,6 +104,9 @@
#define FULL_DIGITIGRADE 1
#define SQUISHED_DIGITIGRADE 2
+
+#define DIGI_ICON_FILE_PASSED (1<<0) //! NSV13 - An accursed flag for update_worn_icon that implies a digi file was passed by the calling proc. This will override other file variables.
+
//! ## flags for covering body parts
#define GLASSESCOVERSEYES (1<<0)
#define MASKCOVERSEYES (1<<1) //! get rid of some of the other stupidity in these flags
diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm
index e0cd1540902..370e4a8dbc4 100644
--- a/code/datums/traits/negative.dm
+++ b/code/datums/traits/negative.dm
@@ -444,6 +444,12 @@
if(BODY_ZONE_R_LEG)
prosthetic = new/obj/item/bodypart/r_leg/robot/surplus(quirk_holder)
slot_string = "right leg"
+ //NSV13 - If the old limb is digitigrade, so is your prosthetic.
+ if(old_part.bodytype & BODYTYPE_DIGITIGRADE) //This proc seems to trust old part never missing and so will I :)
+ prosthetic.bodytype |= BODYTYPE_DIGITIGRADE
+ prosthetic.static_icon = 'nsv13/icons/mob/augmentation/digitigrade_legs.dmi'
+ prosthetic.limb_id = "digitigrade"
+ //NSV13 end.
prosthetic.replace_limb(H)
qdel(old_part)
H.regenerate_icons()
diff --git a/code/game/machinery/aug_manipulator.dm b/code/game/machinery/aug_manipulator.dm
index 9613dafc597..74abe7acd49 100644
--- a/code/game/machinery/aug_manipulator.dm
+++ b/code/game/machinery/aug_manipulator.dm
@@ -9,7 +9,7 @@
var/obj/item/bodypart/storedpart
var/initial_icon_state
var/static/list/style_list_icons = list("standard" = 'icons/mob/augmentation/augments.dmi', "engineer" = 'icons/mob/augmentation/augments_engineer.dmi', "security" = 'icons/mob/augmentation/augments_security.dmi', "mining" = 'icons/mob/augmentation/augments_mining.dmi', "veymed female" = 'nsv13/icons/mob/augmentation/veymed.dmi', "veymed male" = 'nsv13/icons/mob/augmentation/veymedm.dmi', "shellguard" = 'nsv13/icons/mob/augmentation/shellguard.dmi', "xion" = 'nsv13/icons/mob/augmentation/xion.dmi', "zeng-hu" = 'nsv13/icons/mob/augmentation/zenghu.dmi', "ward-takahashi" = 'nsv13/icons/mob/augmentation/wardtakahashi.dmi', "bishop" = 'nsv13/icons/mob/augmentation/bishop.dmi') //NSV13 added extra sprites for additional prosthetic looks
-
+ var/static/list/style_list_legs_bonus_icons = list("digitigrade" = 'nsv13/icons/mob/augmentation/digitigrade_legs.dmi') //NSV13 - digitigrade (leg) augmentations WOOOOO
/obj/machinery/aug_manipulator/examine(mob/user)
. = ..()
@@ -102,14 +102,27 @@
add_fingerprint(user)
if(storedpart)
- var/augstyle = input(user, "Select style.", "Augment Custom Fitting") as null|anything in style_list_icons
+ //NSV13 - digitigrade robot leggies
+ var/style_options = style_list_icons
+ if(istype(storedpart, /obj/item/bodypart/r_leg) || istype(storedpart, /obj/item/bodypart/l_leg))
+ style_options += style_list_legs_bonus_icons //Doing this with assoc lists IS actually legal. Very cool. And Yes I know this somewhat reduces the point of using static lists, but this proc is rare.
+ var/augstyle = input(user, "Select style.", "Augment Custom Fitting") as null|anything in style_options
+ //NSV13 end.
if(!augstyle)
return
if(!in_range(src, user))
return
if(!storedpart)
return
- storedpart.static_icon = style_list_icons[augstyle]
+ //NSV13 - digi robot leggies. This is kind of scuffed but the proc gets called rarely enough and this is compact.
+ storedpart.static_icon = style_options[augstyle]
+ if(augstyle == "digitigrade")
+ storedpart.bodytype |= BODYTYPE_DIGITIGRADE
+ storedpart.limb_id = "digitigrade" //Sooo basically limb code is cursed and digitigrade limbs even more so.
+ else
+ storedpart.bodytype &= ~(BODYTYPE_DIGITIGRADE)
+ storedpart.limb_id = "robotic" //Sooo basically augment code is also cursed which means this actually fixes a bug :)
+ //NSV13 end.
eject_part(user)
else
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index 43ce2baed00..e1bdee8c52c 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -196,6 +196,7 @@
icon = 'nsv13/icons/obj/clothing/suits.dmi' //NSV13
worn_icon = 'nsv13/icons/mob/suit.dmi' //NSV13
icon_state = "hardsuit-engineering-legacy" //NSV13
+ supports_variations = DIGITIGRADE_VARIATION //NSV13 - legacy sprite has digisprite.
item_state = "eng_hardsuit"
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 15, "bomb" = 10, "bio" = 100, "rad" = 75, "fire" = 100, "acid" = 75, "stamina" = 20)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/engine
@@ -216,6 +217,7 @@
name = "atmospherics hardsuit"
desc = "A special suit that protects against hazardous, low pressure environments. Has thermal shielding."
icon_state = "hardsuit-atmospherics-legacy" //NSV13
+ supports_variations = DIGITIGRADE_VARIATION //NSV13 - legacy sprite has digisprite.
item_state = "atmo_hardsuit"
armor = list("melee" = 30, "bullet" = 5, "laser" = 10, "energy" = 15, "bomb" = 10, "bio" = 100, "rad" = 25, "fire" = 100, "acid" = 75, "stamina" = 20)
heat_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS //Uncomment to enable firesuit protection
@@ -236,6 +238,7 @@
/obj/item/clothing/suit/space/hardsuit/engine/elite
icon_state = "hardsuit-white-legacy" //NSV13
+ supports_variations = DIGITIGRADE_VARIATION //NSV13 - legacy sprite has digisprite.
name = "advanced hardsuit"
desc = "An advanced suit that protects against hazardous, low pressure environments. Shines with a high polish."
item_state = "ce_hardsuit"
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index 8a7fd1487ed..f8a43d4bf67 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -313,6 +313,7 @@ There are several things that need to be remembered:
if(shoes)
var/icon_file = 'icons/mob/clothing/feet.dmi'
+ var/build_worn_icon_override_flags = NONE //NSV13 - variable to pass override flags to build worn icon.
if(istype(shoes, /obj/item/clothing/shoes))
var/obj/item/clothing/shoes/S = shoes
if(S.sprite_sheets & (dna?.species.bodyflag))
@@ -321,13 +322,14 @@ There are several things that need to be remembered:
if(dna?.species.bodytype & BODYTYPE_DIGITIGRADE)
if(S.supports_variations & DIGITIGRADE_VARIATION)
icon_file = 'icons/mob/species/misc/digitigrade_shoes.dmi'
+ build_worn_icon_override_flags |= DIGI_ICON_FILE_PASSED //NSV13 - high priority file.
shoes.screen_loc = ui_shoes //move the item to the appropriate screen loc
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open
client.screen += shoes //add it to client's screen
update_observer_view(shoes,1)
- overlays_standing[SHOES_LAYER] = shoes.build_worn_icon(default_layer = SHOES_LAYER, default_icon_file = icon_file)
+ overlays_standing[SHOES_LAYER] = shoes.build_worn_icon(default_layer = SHOES_LAYER, default_icon_file = icon_file, special_override_flags = build_worn_icon_override_flags) //NSV13 - pass special override flags.
var/mutable_appearance/shoes_overlay = overlays_standing[SHOES_LAYER]
if(OFFSET_SHOES in dna.species.offset_features)
shoes_overlay.pixel_x += dna.species.offset_features[OFFSET_SHOES][1]
@@ -427,6 +429,7 @@ There are several things that need to be remembered:
if(istype(wear_suit, /obj/item/clothing/suit))
var/icon_file = 'icons/mob/clothing/suit.dmi'
+ var/build_worn_icon_override_flags = NONE //NSV13 - override flags passed to build worn icon.
var/obj/item/clothing/suit/S = wear_suit
if(S.sprite_sheets & (dna?.species.bodyflag))
icon_file = dna.species.get_custom_icons("suit")
@@ -434,6 +437,7 @@ There are several things that need to be remembered:
if(dna?.species.bodytype & BODYTYPE_DIGITIGRADE)
if(S.supports_variations & DIGITIGRADE_VARIATION)
icon_file = 'icons/mob/species/misc/digitigrade_suits.dmi'
+ build_worn_icon_override_flags |= DIGI_ICON_FILE_PASSED //NSV13 - high priority file.
wear_suit.screen_loc = ui_oclothing
if(client && hud_used && hud_used.hud_shown)
@@ -441,7 +445,7 @@ There are several things that need to be remembered:
client.screen += wear_suit
update_observer_view(wear_suit,1)
- overlays_standing[SUIT_LAYER] = wear_suit.build_worn_icon(default_layer = SUIT_LAYER, default_icon_file = icon_file)
+ overlays_standing[SUIT_LAYER] = wear_suit.build_worn_icon(default_layer = SUIT_LAYER, default_icon_file = icon_file, special_override_flags = build_worn_icon_override_flags) //NSV13 - can pass special override flags.
var/mutable_appearance/suit_overlay = overlays_standing[SUIT_LAYER]
if(OFFSET_SUIT in dna.species.offset_features)
suit_overlay.pixel_x += dna.species.offset_features[OFFSET_SUIT][1]
@@ -667,7 +671,7 @@ generate/load female uniform sprites matching all previously decided variables
*/
-/obj/item/proc/build_worn_icon(default_layer = 0, default_icon_file = null, isinhands = FALSE, femaleuniform = NO_FEMALE_UNIFORM, override_state = null)
+/obj/item/proc/build_worn_icon(default_layer = 0, default_icon_file = null, isinhands = FALSE, femaleuniform = NO_FEMALE_UNIFORM, override_state = null, special_override_flags = NONE) //NSV13 - special override flag to help with the mess that is digisprites.
var/t_state
if(override_state)
@@ -676,7 +680,7 @@ generate/load female uniform sprites matching all previously decided variables
t_state = !isinhands ? (worn_icon_state ? worn_icon_state : icon_state) : (item_state ? item_state : icon_state)
//Find a valid icon file from variables+arguments
- var/file2use = !isinhands ? (worn_icon ? worn_icon : default_icon_file) : default_icon_file
+ var/file2use = !isinhands ? ((worn_icon && !(special_override_flags & DIGI_ICON_FILE_PASSED)) ? worn_icon : default_icon_file) : default_icon_file //NSV13 - prioritize digitigrade file over ANY others if it is passed.
//Find a valid layer from variables+arguments
var/layer2use = alternate_worn_layer ? alternate_worn_layer : default_layer
diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm
index b92e729398d..2ed52079952 100644
--- a/code/modules/surgery/bodyparts/bodyparts.dm
+++ b/code/modules/surgery/bodyparts/bodyparts.dm
@@ -93,7 +93,7 @@
if(burn_dam >= DAMAGE_PRECISION)
. += "This limb has [burn_dam > 30 ? "severe" : "minor"] burns."
if(limb_id)
- . += "It is a [limb_id] [parse_zone(body_zone)]."
+ . += "It is a [limb_id][bonus_limb_id_text()] [parse_zone(body_zone)]." //NSV13 - I have to hook in here.
/obj/item/bodypart/blob_act()
take_damage(max_damage)
diff --git a/icons/mob/species/misc/digitigrade_suits.dmi b/icons/mob/species/misc/digitigrade_suits.dmi
index 9abc584e2f922733c2f1fa1f2a07149ca159b38e..c76b84959a8f4b77cbc9ad1b840d257cb09d743c 100644
GIT binary patch
delta 269
zcmV+o0rLKwkOHKT0+1wsEg$yp_7
zbM>V-6d#gbFhbf&3)VX9ZW{9UJ(S*BY#j&QgJEV5@8^&43d3b|UnoioLl38ygXIQfP6eaG(67f~GDdO!rRBRxUj+VYp{`t=uKK7r}5yr#heo&Ma1`oTpjq9$I
zEQ5#byX!L2ob9hr3x?ofm4hU`ko9@dmFp6Tf`^^!z9bY>@Gv}PfE8mse9dH7k0Z~-
zh(bKqOTo&b-x-Bs!x)9QrOVLkjT2S#n?}Bu)Q}w$#c+Nppx8+$#cnXrcaafIVe0TYL<#(us4
diff --git a/nsv13.dme b/nsv13.dme
index b3b278369d7..8806afaff65 100644
--- a/nsv13.dme
+++ b/nsv13.dme
@@ -4104,6 +4104,7 @@
#include "nsv13\code\modules\squads\squad_lead_finder.dm"
#include "nsv13\code\modules\squads\squad_manager.dm"
#include "nsv13\code\modules\squads\squad_vendor.dm"
+#include "nsv13\code\modules\surgery\bodyparts\nsv_modular_bodypart_overrides.dm"
#include "nsv13\code\modules\surgery\organs\tails.dm"
#include "nsv13\code\modules\turbolift\lazylift.dm"
#include "nsv13\code\modules\turbolift\turbolift.dm"
diff --git a/nsv13/code/modules/surgery/bodyparts/nsv_modular_bodypart_overrides.dm b/nsv13/code/modules/surgery/bodyparts/nsv_modular_bodypart_overrides.dm
new file mode 100644
index 00000000000..73d2b0a3a91
--- /dev/null
+++ b/nsv13/code/modules/surgery/bodyparts/nsv_modular_bodypart_overrides.dm
@@ -0,0 +1,17 @@
+//This file is for some NSV bodypart overrides to avoid throwing them into base files.
+
+///Bonus text to get for a given limb in its examine.
+/obj/item/bodypart/proc/bonus_limb_id_text()
+ return ""
+
+//These two are here because how the name is static-built is stupid and this is a nice-ish way to attach to it.
+
+/obj/item/bodypart/r_leg/robot/bonus_limb_id_text()
+ if(bodytype & BODYTYPE_DIGITIGRADE)
+ return " robotic"
+ return ""
+
+/obj/item/bodypart/l_leg/robot/bonus_limb_id_text()
+ if(bodytype & BODYTYPE_DIGITIGRADE)
+ return " robotic"
+ return ""
diff --git a/nsv13/icons/mob/augmentation/digitigrade_legs.dmi b/nsv13/icons/mob/augmentation/digitigrade_legs.dmi
new file mode 100644
index 0000000000000000000000000000000000000000..43456a5132d1b181ccc02cfe1c4f7564ad8b8983
GIT binary patch
literal 1099
zcmV-R1ho5!P)005u_0{{R3dEt5<0000XP)t-sz`(#m
zLs@2Kf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