Skip to content

Commit

Permalink
Vastly improves digitigrade leg code + hazard suit fix (#22547)
Browse files Browse the repository at this point in the history
  • Loading branch information
SapphicOverload authored Aug 25, 2024
1 parent 21fa9c7 commit f0c43f9
Show file tree
Hide file tree
Showing 28 changed files with 160 additions and 197 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
#define NOZOMBIE 9
/// If we want a race to have a standard color (for now this is only polysmorphs)
#define NOCOLORCHANGE 10
/// Uses weird leg sprites. Optional for Lizards, required for ashwalkers. Don't give it to other races unless you make sprites for this (see human_parts_greyscale.dmi)
/// Has weird leg sprites. Used by lizards and polysmorphs. Don't give it to other races unless you make sprites for this (see human_parts_greyscale.dmi)
#define DIGITIGRADE 11
#define NO_UNDERWEAR 12
#define NOLIVER 13
Expand Down
10 changes: 0 additions & 10 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@
#define FEMALE_UNIFORM_FULL 1
#define FEMALE_UNIFORM_TOP 2

//flags for alternate styles: These are hard sprited so don't set this if you didn't put the effort in
#define NORMAL_STYLE 0
#define ALT_STYLE 1
#define DIGITIGRADE_STYLE 2
#define DIGIALT_STYLE 3 //Yogs

//flags for digitigrade checks related to footwear. Only Human accessible / Both accessible / Only funny leg accessible.
#define NO_DIGIT 0
#define EITHER_STYLE 1
Expand All @@ -123,10 +117,6 @@
//flags for outfits that have mutantrace variants (try not to use this): Currently only needed if you're trying to add tight fitting bootyshorts
#define DIGITIGRADE_VARIATION (1<<0)

#define NOT_DIGITIGRADE 0
#define FULL_DIGITIGRADE 1
#define SQUISHED_DIGITIGRADE 2

//flags for covering body parts
#define GLASSESCOVERSEYES (1<<0)
#define MASKCOVERSEYES (1<<1) // get rid of some of the other retardation in these flags
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@
#define TRAIT_NOCLONE "noclone" // No cloning
#define TRAIT_NODEFIB "nodefib" // No defibbing
#define TRAIT_COLDBLOODED "coldblooded" // Your body is literal room temperature. Does not make you immune to the temp
#define TRAIT_DIGITIGRADE "digitigrade" // the funny lizard legs
#define TRAIT_DIGI_SQUISH "digi_squish" // squished funny lizard legs
#define TRAIT_EAT_MORE "eat_more" //You get hungry three times as fast
#define TRAIT_BOTTOMLESS_STOMACH "bottomless_stomach" // Can never be full
#define TRAIT_MESONS "mesons"
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/robot/robot_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@

else if(istype(W, /obj/item/bodypart/r_leg/robot))
var/obj/item/bodypart/r_leg/robot/L = W
if(L.use_digitigrade != NOT_DIGITIGRADE)
if(L.use_digitigrade)
to_chat(user, span_warning("You can only install plantigrade legs on [src]!"))
return
if(src.r_leg)
Expand All @@ -194,7 +194,7 @@

else if(istype(W, /obj/item/bodypart/l_arm/robot))
var/obj/item/bodypart/l_leg/robot/L = W
if(L.use_digitigrade != NOT_DIGITIGRADE)
if(L.use_digitigrade)
to_chat(user, span_warning("You can only install plantigrade legs on [src]!"))
return
if(l_arm)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/bloodsuckers/bloodsucker_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
additionalmessage = "You have mutated werewolf legs!"
mutation = /obj/item/clothing/shoes/wolflegs
slot = ITEM_SLOT_FEET
if(DIGITIGRADE in user.dna.species.species_traits)
if(HAS_TRAIT(user, TRAIT_DIGITIGRADE))
mutation = /obj/item/clothing/shoes/xeno_wraps/wolfdigilegs
if(5 to INFINITY)
to_chat(user, span_danger("The beast inside of you seems satisfied with your current form."))
Expand Down
13 changes: 4 additions & 9 deletions code/modules/antagonists/bloodsuckers/powers/gangrel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
/datum/action/cooldown/bloodsucker/gangrel/transform/proc/transform(chosen_transform)
var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(/datum/antagonist/bloodsucker)
var/mob/living/carbon/human/user = owner
var/datum/species/user_species = user.dna.species
switch(chosen_transform)
if("Lizard/Felinid")
if(iscatperson(user))
Expand All @@ -70,17 +69,13 @@
else
user.set_species(/datum/species/human/felinid)
playsound(user.loc, 'sound/voice/feline/meow1.ogg', 50)
if(!LAZYFIND(user_species.species_traits, DIGITIGRADE))
user_species.species_traits += DIGITIGRADE
user.dna.species.armor -= 20 //careful
user.dna.species.speedmod = -0.5
user.dna.species.action_speed_coefficient *= 0.7
bloodsuckerdatum.AddBloodVolume(75)
user.dna.species.armor -= 20 //careful
user.dna.species.speedmod = -0.5
user.dna.species.action_speed_coefficient *= 0.7
bloodsuckerdatum.AddBloodVolume(75)
if("Gorilla")
user.set_species(/datum/species/gorilla)
playsound(user.loc, 'sound/creatures/gorilla.ogg', 50)
if(DIGITIGRADE in user_species.species_traits)
user_species.species_traits -= DIGITIGRADE
user.dna.species.punchdamagelow += 10
user.dna.species.punchdamagehigh += 10 //very stronk
user.dna.species.punchstunthreshold += 10
Expand Down
12 changes: 2 additions & 10 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -447,16 +447,8 @@ BLIND // can't see anything
H.update_body()

/obj/item/clothing/under/proc/toggle_jumpsuit_adjust() //Yogs Start: Reworking this to allow for Digialt to function
switch(adjusted)
if(NORMAL_STYLE)
adjusted = ALT_STYLE
if(ALT_STYLE)
adjusted = NORMAL_STYLE
if(DIGITIGRADE_STYLE)
adjusted = DIGIALT_STYLE
if(DIGIALT_STYLE)
adjusted = DIGITIGRADE_STYLE
if(adjusted == ALT_STYLE || adjusted == DIGIALT_STYLE) //Yogs End
adjusted = !adjusted
if(adjusted) //Yogs End
if(fitted != FEMALE_UNIFORM_TOP)
fitted = NO_FEMALE_UNIFORM
if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted (and also the arms, realistically)
Expand Down
28 changes: 15 additions & 13 deletions code/modules/clothing/shoes/_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
var/equipped_before_drop = FALSE
var/xenoshoe = NO_DIGIT // Check for if shoes can be worn by straight legs (NO_DIGIT) which is default, both / hybrid (EITHER_STYLE), or digitigrade only (YES_DIGIT)
var/mutantrace_variation = NONE // Assigns shoes to have variations for if worn clothing doesn't enforce straight legs (such as cursed jumpskirts)
var/adjusted = NORMAL_STYLE // Default needed to make the above work
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 15, RAD = 0, FIRE = 0, ACID = 0)

/obj/item/clothing/shoes/suicide_act(mob/living/carbon/user)
Expand Down Expand Up @@ -60,18 +59,15 @@
. += bloody_shoes

/obj/item/clothing/shoes/equipped(mob/user, slot)
if(adjusted)
adjusted = NORMAL_STYLE
if(mutantrace_variation && ishuman(user))
var/mob/living/carbon/human/H = user
if(DIGITIGRADE in H.dna.species.species_traits)
for(var/X in H.bodyparts)
var/obj/item/bodypart/O = X
if(!O.use_digitigrade)
continue
if(O.use_digitigrade == FULL_DIGITIGRADE)
adjusted = DIGITIGRADE_STYLE
user.update_inv_shoes()
if(!(mutantrace_variation & DIGITIGRADE_VARIATION) && ishuman(user))
if(slot_flags & slot)
ADD_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
else
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
var/mob/living/carbon/human/human_user = user
human_user.update_inv_w_uniform()
human_user.update_inv_wear_suit()
human_user.update_body_parts()
. = ..()
if(offset && slot_flags & slot)
user.pixel_y += offset
Expand All @@ -86,6 +82,12 @@
worn_y_dimension = world.icon_size

/obj/item/clothing/shoes/dropped(mob/user)
if(!(mutantrace_variation & DIGITIGRADE_VARIATION) && ishuman(user))
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
var/mob/living/carbon/human/human_user = user
human_user.update_inv_w_uniform()
human_user.update_inv_wear_suit()
human_user.update_body_parts()
if(offset && equipped_before_drop)
restore_offsets(user)
. = ..()
Expand Down
27 changes: 20 additions & 7 deletions code/modules/clothing/suits/_suits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/togglename = null
var/suittoggled = FALSE
var/mutantrace_variation = NONE
var/adjusted = NORMAL_STYLE
var/adjusted = FALSE
limb_integrity = 0 // disabled for most exo-suits
var/obj/item/badge/attached_badge
var/mutable_appearance/badge_overlay
Expand Down Expand Up @@ -53,13 +53,26 @@
/obj/item/clothing/suit/equipped(mob/user, slot)
..()
if(adjusted)
adjusted = NORMAL_STYLE
adjusted = FALSE

if(mutantrace_variation && ishuman(user))
var/mob/living/carbon/human/H = user
if(DIGITIGRADE in H.dna.species.species_traits)
adjusted = DIGITIGRADE_STYLE
H.update_inv_w_uniform()
if(!(mutantrace_variation & DIGITIGRADE_VARIATION) && ishuman(user))
if(slot_flags & slot)
ADD_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
else
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
var/mob/living/carbon/human/human_user = user
human_user.update_inv_w_uniform()
human_user.update_inv_shoes()
human_user.update_body_parts()

/obj/item/clothing/suit/dropped(mob/user)
if(!(mutantrace_variation & DIGITIGRADE_VARIATION) && ishuman(user))
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
var/mob/living/carbon/human/human_user = user
human_user.update_inv_w_uniform()
human_user.update_inv_shoes()
human_user.update_body_parts()
return ..()

/obj/item/clothing/suit/attackby(obj/item/I, mob/user, params)
if(!attach_badge(I, user))
Expand Down
56 changes: 30 additions & 26 deletions code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
var/random_sensor = TRUE
var/sensor_mode = NO_SENSORS
var/can_adjust = TRUE
var/adjusted = NORMAL_STYLE
var/adjusted = FALSE
var/alt_covers_chest = FALSE // for adjusted/rolled-down jumpsuits, FALSE = exposes chest and arms, TRUE = exposes arms only
var/mutantrace_variation = NONE //Are there special sprites for specific situations? Don't use this unless you need to.
var/freshly_laundered = FALSE
Expand Down Expand Up @@ -90,7 +90,7 @@
/obj/item/clothing/under/equipped(mob/user, slot)
..()
if(adjusted)
adjusted = NORMAL_STYLE
adjusted = FALSE
fitted = initial(fitted)
if(!alt_covers_chest)
body_parts_covered |= CHEST
Expand All @@ -101,39 +101,43 @@

if(!ishuman(user)) //Yogs Start: Reorganized to reduce repetition
return
var/mob/living/carbon/human/H = user

if(mutantrace_variation & DIGITIGRADE_VARIATION)
var/is_digi = FALSE
if(DIGITIGRADE in H.dna.species.species_traits)
is_digi = TRUE

if(is_digi && !adjusted == ALT_STYLE && mutantrace_variation)
adjusted = DIGITIGRADE_STYLE
else if(is_digi && adjusted == ALT_STYLE && mutantrace_variation) //Handles when you are using an alternate style while having digi legs
adjusted = DIGIALT_STYLE
else if(!is_digi && adjusted == DIGITIGRADE_STYLE)
adjusted = NORMAL_STYLE
else if(!is_digi && adjusted == DIGIALT_STYLE)
adjusted = ALT_STYLE
H.update_inv_w_uniform()
var/update_suit = FALSE
var/mob/living/carbon/human/human_user = user
if(!(mutantrace_variation & DIGITIGRADE_VARIATION))
if(slot_flags & slot)
ADD_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
else
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
human_user.update_inv_shoes()
human_user.update_body_parts()
update_suit = TRUE
//Yogs End
if(attached_accessory && slot != ITEM_SLOT_HANDS)
attached_accessory.on_clothing_equip(src, user)
if(attached_accessory.above_suit)
H.update_inv_wear_suit()
update_suit = TRUE
if(update_suit)
human_user.update_inv_wear_suit()
if(is_synth(user) && has_sensor)
to_chat(user, span_notice("Suit sensors disabled due to non-compatible user."))
sensor_mode = SENSOR_OFF

/obj/item/clothing/under/dropped(mob/user)
if(attached_accessory)
attached_accessory.on_clothing_dropped(src, user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(ishuman(user))
var/update_suit = FALSE
var/mob/living/carbon/human/human_user = user
if(!(mutantrace_variation & DIGITIGRADE_VARIATION))
REMOVE_TRAIT(user, TRAIT_DIGI_SQUISH, REF(src))
human_user.update_inv_shoes()
human_user.update_body_parts()
update_suit = TRUE
if(attached_accessory)
attached_accessory.on_clothing_dropped(src, user)
if(attached_accessory.above_suit)
H.update_inv_wear_suit()
..()
update_suit = TRUE
if(update_suit)
human_user.update_inv_wear_suit()
return ..()

/obj/item/clothing/under/proc/attach_accessory(obj/item/I, mob/user, notifyAttach = 1)
. = FALSE
Expand Down Expand Up @@ -197,7 +201,7 @@
if(freshly_laundered)
. += "It looks fresh and clean."
if(can_adjust)
if(adjusted == ALT_STYLE || adjusted == DIGIALT_STYLE)
if(adjusted)
. += "Alt-click on [src] to wear it normally."
else
. += "Alt-click on [src] to wear it casually."
Expand Down
1 change: 0 additions & 1 deletion code/modules/clothing/under/jobs/engineering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
icon_state = "hazard"
item_state = "suit-orange"
alt_covers_chest = TRUE
mutantrace_variation = NONE

/obj/item/clothing/under/rank/engineering/engineer/skirt
name = "engineer's jumpskirt"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
if (H.jumpsuit_style == PREF_SKIRT && uniform_skirt)
uniform = uniform_skirt

if((DIGITIGRADE in H.dna.species.species_traits) && digitigrade_shoes)
if(HAS_TRAIT(H, TRAIT_DIGITIGRADE) && digitigrade_shoes)
shoes = digitigrade_shoes

/datum/outfit/job/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
Expand Down
18 changes: 8 additions & 10 deletions code/modules/mining/equipment/explorer_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT
armor = list(MELEE = 25, BULLET = 5, LASER = 5, ENERGY = 5, BOMB = 50, BIO = 100, RAD = 50, FIRE = 50, ACID = 50, WOUND = 10)
resistance_flags = FIRE_PROOF
var/adjusted = NORMAL_STYLE
var/adjusted = FALSE

/obj/item/clothing/suit/hooded/explorer/Initialize(mapload)
. = ..()
Expand All @@ -42,15 +42,13 @@
set name = "Adjust Hood Style"
set category = null
set src in usr
switch(adjusted)
if(NORMAL_STYLE)
adjusted = ALT_STYLE
to_chat(usr, span_notice("You adjust the hood to wear it more casually."))
flags_inv &= ~HIDEHAIR
if(ALT_STYLE)
adjusted = NORMAL_STYLE
to_chat(usr, span_notice("You adjust the hood back to normal."))
flags_inv |= HIDEHAIR
adjusted = !adjusted
if(adjusted)
to_chat(usr, span_notice("You adjust the hood to wear it more casually."))
flags_inv &= ~HIDEHAIR
else
to_chat(usr, span_notice("You adjust the hood back to normal."))
flags_inv |= HIDEHAIR
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.update_hair()
Expand Down
Loading

0 comments on commit f0c43f9

Please sign in to comment.