Skip to content

Commit

Permalink
Merge pull request #18 from Bird-Lounge/the-leggening
Browse files Browse the repository at this point in the history
[SEMI-MODULAR] The Leggening
  • Loading branch information
Ephemeralis authored Sep 8, 2024
2 parents 7107516 + f6d25b7 commit 305eef8
Show file tree
Hide file tree
Showing 87 changed files with 1,588 additions and 94 deletions.
12 changes: 9 additions & 3 deletions code/__DEFINES/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,18 @@ DEFINE_BITFIELD(no_equip_flags, list(
#define DIGITIGRADE_STYLE 2

//Flags (actual flags, fucker ^) for /obj/item/var/supports_variations_flags
///No alternative sprites based on bodytype
/// No alternative sprites or handling based on bodytype
#define CLOTHING_NO_VARIATION (1<<0)
///Has a sprite for digitigrade legs specifically.
/// Has a sprite for digitigrade legs specifically.
#define CLOTHING_DIGITIGRADE_VARIATION (1<<1)
///The sprite works fine for digitigrade legs as-is.
/// The sprite works fine for digitigrade legs as-is.
#define CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON (1<<2)
/// Auto-generates the leg portion of the sprite with GAGS
/// Suggested that you set [/obj/item/var/digitigrade_greyscale_config_worn] when using this flag
#define CLOTHING_DIGITIGRADE_MASK (1<<3)

/// All variation flags which render "correctly" on a digitigrade leg setup
#define DIGITIGRADE_VARIATIONS (CLOTHING_DIGITIGRADE_VARIATION|CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON|CLOTHING_DIGITIGRADE_MASK)

//flags for covering body parts
#define GLASSESCOVERSEYES (1<<0)
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@
///The limb is snouted.
#define BODYSHAPE_SNOUTED (1<<3)

/// DOPPLER SHIFT ADDITION BEGIN
// This is where our custom bodyshapes are going to go. Keeping these in one place is critical for readability.
/// BREAKER: Numeric -> text for use in defines
#define BODYSHAPE_HUMANOID_T "1"
#define BODYSHAPE_MONKEY_T "2"
#define BODYSHAPE_DIGITIGRADE_T "4"
#define BODYSHAPE_SNOUTED_T "8"
/// DOPPLER SHIFT ADDITIO NEND

#define BODYTYPE_BIOSCRAMBLE_INCOMPATIBLE (BODYTYPE_ROBOTIC | BODYTYPE_LARVA_PLACEHOLDER | BODYTYPE_GOLEM | BODYTYPE_PEG)
#define BODYTYPE_CAN_BE_BIOSCRAMBLED(bodytype) (!(bodytype & BODYTYPE_BIOSCRAMBLE_INCOMPATIBLE))

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/overlays.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// A reasonable number of maximum overlays an object needs
// If you think you need more, rethink it
#define MAX_ATOM_OVERLAYS 100
#define MAX_ATOM_OVERLAYS 200 /// DOPPLER SHIFT EDIT: 200, up from 100

/// Checks if an atom has reached the overlay limit, and make a loud error if it does.
#define VALIDATE_OVERLAY_LIMIT(changed_on) \
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ DEFINE_BITFIELD(supports_variations_flags, list(
"CLOTHING_NO_VARIATION" = CLOTHING_NO_VARIATION,
"CLOTHING_DIGITIGRADE_VARIATION" = CLOTHING_DIGITIGRADE_VARIATION,
"CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON" = CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON,
"CLOTHING_DIGITIGRADE_MASK" = CLOTHING_DIGITIGRADE_MASK,
))

DEFINE_BITFIELD(flora_flags, list(
Expand Down
6 changes: 5 additions & 1 deletion code/datums/elements/gags_recolorable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
allowed_configs += "[config]"
if(isitem(target))
var/obj/item/item = target
if(initial(item.greyscale_config_worn))
/// DOPPLER SHIFT ADDITION BEGIN
if(initial(item.greyscale_config_worn_bodyshapes))
for(var/bconfig in item.greyscale_config_worn_bodyshapes)
allowed_configs += "[initial(item.greyscale_config_worn_bodyshapes[bconfig])]"
else if(initial(item.greyscale_config_worn)) /// DOPPLER SHIFT EDIT END
allowed_configs += "[initial(item.greyscale_config_worn)]"
if(initial(item.greyscale_config_inhand_left))
allowed_configs += "[initial(item.greyscale_config_inhand_left)]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@
icon_file = 'icons/mob/inhands/clothing/suits_righthand.dmi'
json_config = 'code/datums/greyscale/json_configs/jumpsuit_prison_inhand.json'

/datum/greyscale_config/jumpsuit/worn_digi
name = "Jumpsuit Worn (Digitigrate)"
icon_file = 'icons/mob/clothing/under/digi_template.dmi'
json_config = 'code/datums/greyscale/json_configs/jumpsuit_worn_digilegs.json'

/datum/greyscale_config/eth_tunic
name = "Ethereal Tunic"
icon_file = 'icons/obj/clothing/under/ethereal.dmi'
Expand Down
10 changes: 10 additions & 0 deletions code/datums/greyscale/json_configs/jumpsuit_worn_digilegs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"": [
{
"type": "icon_state",
"icon_state": "jumpsuit",
"blend_mode": "overlay",
"color_ids": [ 1 ]
}
]
}
43 changes: 42 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@
///The config type to use for greyscaled belt overlays. Both this and greyscale_colors must be assigned to work.
var/greyscale_config_belt

/// Greyscale config used when generating digitigrade versions of the sprite.
var/digitigrade_greyscale_config_worn
/// Greyscale colors used when generating digitigrade versions of the sprite.
/// Optional - If not set it will default to normal greyscale colors, or approximate them if those are unset as well
var/digitigrade_greyscale_colors

/// DOPPLER SHIFT ADDITION BEGIN
// A list to take the place of GREYSCALE_CONFIG_WORN used for alternate bodyshapes (e.g, Digitigrade)
// Use bodyshape IDs as the keys to a greyscale config for the alternate version.
// For instance, greyscale_config_worn_bodyshapes[BODYSHAPE_DIGITIGRADE] = /datum/greyscale_config/trek/worn_digi
// If you include multiple variants, make sure to include the default value of the worn config as BODYSHAPE_HUMANOID.
// This helps avoid Fuckery(tm) with dyes, changelings, chameleons, etc.
var/list/greyscale_config_worn_bodyshapes
/// Used with the above to help switch between greyscale configs cleanly and avoid Fuckery(tm).
var/greyscale_config_last_bodyshape

/// Used with both greyscales and eventually icon_state variants to allow MOAR BODYSHAPES
// this needs to contain a list of supported numerical IDs and be ordered in TOP PRIORITY to BOTTOM PRIORITY (e.g, DigiFemme > Digi > Femme > Normal)
var/list/supported_bodyshapes
/// Used to pick alternative worn_icon files
// See above; sort by TOP PRIORITY to BOTTOM PRIORITY with the bodyshapes as keys (DIGI | FEMME > DIGI > FEMME > HUMANOID)
// !!KEYS IN THIS SHOULD BE IDENTICAL TO SUPPORTED_BODYSHAPES!!
var/list/bodyshape_icon_files
/// DOPPLER SHIFT ADDITION END

/* !!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!
IF YOU ADD MORE ICON CRAP TO THIS
Expand Down Expand Up @@ -407,7 +432,15 @@
. = ..()
if(!greyscale_colors)
return
if(greyscale_config_worn)
/// DOPPLER SHIFT ADDITION BEGIN
if(greyscale_config_worn_bodyshapes && greyscale_config_last_bodyshape)
if(greyscale_config_worn_bodyshapes[greyscale_config_last_bodyshape])
greyscale_config_worn = greyscale_config_worn_bodyshapes[greyscale_config_last_bodyshape]
bodyshape_icon_files["[greyscale_config_last_bodyshape]"] = SSgreyscale.GetColoredIconByType(greyscale_config_worn, greyscale_colors)
worn_icon = bodyshape_icon_files["[greyscale_config_last_bodyshape]"]
else
worn_icon = SSgreyscale.GetColoredIconByType(greyscale_config_worn, greyscale_colors)
else if(greyscale_config_worn) /// DOPPLER SHIFT EDIT END
worn_icon = SSgreyscale.GetColoredIconByType(greyscale_config_worn, greyscale_colors)
if(greyscale_config_inhand_left)
lefthand_file = SSgreyscale.GetColoredIconByType(greyscale_config_inhand_left, greyscale_colors)
Expand Down Expand Up @@ -717,6 +750,14 @@
* polling ghosts while it's just being equipped as a visual preview for a dummy.
*/
/obj/item/proc/visual_equipped(mob/user, slot, initial = FALSE)
/// DOPPLER SHIFT ADDITION BEGIN
if(ishuman(user))
var/mob/living/carbon/human/humie = user
for(var/shape in supported_bodyshapes)
if(humie.bodyshape & shape)
greyscale_config_last_bodyshape = "[shape]"
update_greyscale()
/// DOPPLER SHIFT ADDITION END
return

/**
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/storage/garment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
atom_storage.max_specific_storage = WEIGHT_CLASS_NORMAL
atom_storage.numerical_stacking = FALSE
atom_storage.max_total_storage = 200
atom_storage.max_slots = 15
atom_storage.max_slots = 21 /// DOPPLER EDIT - 21, up from 15
atom_storage.insert_preposition = "in"
atom_storage.set_holdable(/obj/item/clothing)

Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/structures/mannequin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@
var/datum/sprite_accessory/underwear/underwear = SSaccessories.underwear_list[underwear_name]
if(underwear)
if(body_type == FEMALE && underwear.gender == MALE)
. += wear_female_version(underwear.icon_state, underwear.icon, BODY_LAYER, FEMALE_UNIFORM_FULL)
. += mutable_appearance(wear_female_version(underwear.icon_state, underwear.icon, FEMALE_UNIFORM_FULL), layer = -BODY_LAYER)
else
. += mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER)
. += mutable_appearance(underwear.icon, underwear.icon_state, layer = -BODY_LAYER)
var/datum/sprite_accessory/undershirt/undershirt = SSaccessories.undershirt_list[undershirt_name]
if(undershirt)
if(body_type == FEMALE)
. += wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER)
. += mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -BODY_LAYER)
else
. += mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER)
. += mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -BODY_LAYER)
var/datum/sprite_accessory/socks/socks = SSaccessories.socks_list[socks_name]
if(socks)
. += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER)
Expand Down
22 changes: 22 additions & 0 deletions code/modules/clothing/chameleon/_chameleon_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@
item_target.lefthand_file = initial(picked_item.lefthand_file)
item_target.righthand_file = initial(picked_item.righthand_file)

/// DOPPLER SHIFT ADDITION BEGIN
item_target.supported_bodyshapes = picked_item.supported_bodyshapes
item_target.bodyshape_icon_files = picked_item.bodyshape_icon_files
if(ishuman(owner))
var/mob/living/carbon/human/humie = owner
for(var/shape in picked_item.supported_bodyshapes)
if(humie.bodyshape & shape)
item_target.worn_icon = picked_item.bodyshape_icon_files["[shape]"]
/// DOPPLER SHIFT ADDITION END

item_target.worn_icon_state = initial(picked_item.worn_icon_state)
item_target.inhand_icon_state = initial(picked_item.inhand_icon_state)

Expand All @@ -154,6 +164,18 @@
initial(picked_item.greyscale_config_inhand_right),
initial(picked_item.greyscale_colors),
)
/// DOPPLER SHIFT ADDITION BEGIN - the necessary sacrifice to chameleon clothing
if(initial(picked_item.greyscale_config_worn_bodyshapes) && initial(picked_item.greyscale_colors))
item_target.greyscale_config_worn_bodyshapes = picked_item.greyscale_config_worn_bodyshapes
if(ishuman(owner))
var/mob/living/carbon/human/humie = owner
var/altbody
for(var/shape in picked_item.supported_bodyshapes)
if(humie.bodyshape & shape)
altbody = picked_item.greyscale_config_worn_bodyshapes["[shape]"]
item_target.bodyshape_icon_files["[shape]"] = SSgreyscale.GetColoredIconByType(altbody, initial(picked_item.greyscale_colors))
item_target.worn_icon = item_target.bodyshape_icon_files["[shape]"]
/// DOPPLER SHIFT ADDITION END

item_target.flags_inv = initial(picked_item.flags_inv)
item_target.transparent_protection = initial(picked_item.transparent_protection)
Expand Down
17 changes: 13 additions & 4 deletions code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
slot_flags = ITEM_SLOT_ICLOTHING
interaction_flags_click = NEED_DEXTERITY
armor_type = /datum/armor/clothing_under
supports_variations_flags = CLOTHING_DIGITIGRADE_MASK
digitigrade_greyscale_config_worn = /datum/greyscale_config/jumpsuit/worn_digi
equip_sound = 'sound/items/equip/jumpsuit_equip.ogg'
drop_sound = 'sound/items/handling/cloth_drop.ogg'
pickup_sound = 'sound/items/handling/cloth_pickup.ogg'
Expand Down Expand Up @@ -85,7 +87,8 @@
context[SCREENTIP_CONTEXT_LMB] = "Repair suit sensors"
changed = TRUE

if(can_adjust && adjusted != DIGITIGRADE_STYLE)
//if(can_adjust && adjusted != DIGITIGRADE_STYLE) /// DOPPLER SHIFT REMOVAL
if(can_adjust) /// DOPPLER SHIFT REPLACEMENT
context[SCREENTIP_CONTEXT_ALT_LMB] = "Wear [adjusted == ALT_STYLE ? "normally" : "casually"]"
changed = TRUE

Expand Down Expand Up @@ -162,11 +165,15 @@
if(adjusted == ALT_STYLE)
adjust_to_normal()

/// DOPPLER SHFIT REMOVAL BEGIN
/*
if((supports_variations_flags & CLOTHING_DIGITIGRADE_VARIATION) && ishuman(user))
var/mob/living/carbon/human/wearer = user
if(wearer.bodyshape & BODYSHAPE_DIGITIGRADE)
adjusted = DIGITIGRADE_STYLE
update_appearance()
update_appearance()
*/
/// DOPPLER SHIFT REMOVAL END

/obj/item/clothing/under/equipped(mob/living/user, slot)
..()
Expand Down Expand Up @@ -407,8 +414,10 @@
/// Returns the new state
/obj/item/clothing/under/proc/toggle_jumpsuit_adjust()
switch(adjusted)
if(DIGITIGRADE_STYLE)
return
/// DOPPLER SHIFT REMOVAL BEGIN
/*if(DIGITIGRADE_STYLE)
return*/
/// DOPPLER SHIFT REMOVAL END

if(NORMAL_STYLE)
adjust_to_alt()
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/under/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
greyscale_config_inhand_left = null
greyscale_config_inhand_right = null
greyscale_config_worn = null
digitigrade_greyscale_colors = "#3f3f3f"
can_adjust = FALSE
flags_1 = NONE

Expand Down
4 changes: 4 additions & 0 deletions code/modules/clothing/under/jobs/cargo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
inhand_icon_state = "lb_suit"
body_parts_covered = CHEST|GROIN|ARMS
supports_variations_flags = CLOTHING_DIGITIGRADE_VARIATION
/// DOPPLER SHIFT ADDITION BEGIN
supported_bodyshapes = list(BODYSHAPE_HUMANOID, BODYSHAPE_DIGITIGRADE)
bodyshape_icon_files = list(BODYSHAPE_HUMANOID_T = DEFAULT_UNIFORM_FILE, BODYSHAPE_DIGITIGRADE_T = DIGITIGRADE_UNIFORM_FILE)
/// DOPPLER SHIFT ADDITION END

/obj/item/clothing/under/rank/cargo/tech/skirt
name = "cargo technician's skirt"
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/under/jobs/civilian/clown_mime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
inhand_icon_state = "clown"
female_sprite_flags = FEMALE_UNIFORM_TOP_ONLY
can_adjust = FALSE
supports_variations_flags = CLOTHING_NO_VARIATION

/obj/item/clothing/under/rank/civilian/clown/Initialize(mapload)
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/under/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
desc = "Groovy!"
icon_state = "psyche"
inhand_icon_state = "p_suit"
digitigrade_greyscale_colors = "#3f3f3f"

/obj/item/clothing/under/misc/vice_officer
name = "vice officer's jumpsuit"
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/alien/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,6 @@ Des: Removes all infected images from the alien.

/mob/living/carbon/alien/proc/update_alien_speed()
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/alien_speed, multiplicative_slowdown = alien_speed)

/mob/living/carbon/alien/get_footprint_sprite()
return FOOTPRINT_SPRITE_CLAWS
12 changes: 6 additions & 6 deletions code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
var/mutable_appearance/underwear_overlay
if(underwear)
if(species_human.dna.species.sexes && species_human.physique == FEMALE && (underwear.gender == MALE))
underwear_overlay = wear_female_version(underwear.icon_state, underwear.icon, BODY_LAYER, FEMALE_UNIFORM_FULL)
underwear_overlay = mutable_appearance(wear_female_version(underwear.icon_state, underwear.icon, FEMALE_UNIFORM_FULL), layer = -BODY_LAYER)
else
underwear_overlay = mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER)
if(!underwear.use_static)
Expand All @@ -507,9 +507,9 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(undershirt)
var/mutable_appearance/working_shirt
if(species_human.dna.species.sexes && species_human.physique == FEMALE)
working_shirt = wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER)
working_shirt = mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -BODY_LAYER)
else
working_shirt = mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER)
working_shirt = mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -BODY_LAYER)
standing += working_shirt

if(species_human.socks && species_human.num_legs >= 2 && !(species_human.bodyshape & BODYSHAPE_DIGITIGRADE))
Expand Down Expand Up @@ -629,7 +629,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
if(H.num_legs < 2)
return FALSE
if((H.bodyshape & BODYSHAPE_DIGITIGRADE) && !(I.item_flags & IGNORE_DIGITIGRADE))
if(!(I.supports_variations_flags & (CLOTHING_DIGITIGRADE_VARIATION|CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON)))
if(!((I.supports_variations_flags & DIGITIGRADE_VARIATIONS) || (BODYSHAPE_DIGITIGRADE in I.supported_bodyshapes))) /// DOPPLER SHIFT EDIT
if(!disable_warning)
to_chat(H, span_warning("The footwear around here isn't compatible with your feet!"))
return FALSE
Expand Down Expand Up @@ -1863,8 +1863,8 @@ GLOBAL_LIST_EMPTY(features_by_species)

var/list/final_bodypart_overrides = new_species.bodypart_overrides.Copy()
if((new_species.digitigrade_customization == DIGITIGRADE_OPTIONAL && target.dna.features["legs"] == DIGITIGRADE_LEGS) || new_species.digitigrade_customization == DIGITIGRADE_FORCED)
final_bodypart_overrides[BODY_ZONE_R_LEG] = /obj/item/bodypart/leg/right/digitigrade
final_bodypart_overrides[BODY_ZONE_L_LEG] = /obj/item/bodypart/leg/left/digitigrade
final_bodypart_overrides[BODY_ZONE_R_LEG] = new_species.digi_leg_overrides[BODY_ZONE_R_LEG] /// DOPPLER SHIFT EDIT: allows digilegs to be overridden
final_bodypart_overrides[BODY_ZONE_L_LEG] = new_species.digi_leg_overrides[BODY_ZONE_L_LEG] /// DOPPLER SHIFT EDIT: allows digilegs to be overridden

for(var/obj/item/bodypart/old_part as anything in target.bodyparts)
if((old_part.change_exempt_flags & BP_BLOCK_CHANGE_SPECIES) || (old_part.bodypart_flags & BODYPART_IMPLANTED))
Expand Down
Loading

0 comments on commit 305eef8

Please sign in to comment.