Skip to content

Commit

Permalink
Adds digitigrade robotic legs (#2646)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaFire15 authored Jun 14, 2024
1 parent afe5367 commit d067eee
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 8 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
19 changes: 16 additions & 3 deletions code/game/machinery/aug_manipulator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions code/modules/clothing/spacesuits/hardsuit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
12 changes: 8 additions & 4 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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]
Expand Down Expand Up @@ -427,21 +429,23 @@ 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")

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)
if(hud_used.inventory_shown)
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]
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion code/modules/surgery/bodyparts/bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
if(burn_dam >= DAMAGE_PRECISION)
. += "<span class='warning'>This limb has [burn_dam > 30 ? "severe" : "minor"] burns.</span>"
if(limb_id)
. += "<span class='notice'>It is a [limb_id] [parse_zone(body_zone)].</span>"
. += "<span class='notice'>It is a [limb_id][bonus_limb_id_text()] [parse_zone(body_zone)].</span>" //NSV13 - I have to hook in here.

/obj/item/bodypart/blob_act()
take_damage(max_damage)
Expand Down
Binary file modified icons/mob/species/misc/digitigrade_suits.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions nsv13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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 ""
Binary file added nsv13/icons/mob/augmentation/digitigrade_legs.dmi
Binary file not shown.

0 comments on commit d067eee

Please sign in to comment.