Skip to content

Commit

Permalink
Merge pull request #111 from Kaostico/underwear
Browse files Browse the repository at this point in the history
[SEMI-MODULAR] Underwear
  • Loading branch information
carpotoxin authored Sep 28, 2024
2 parents 8f97e5c + 7251282 commit 7c03e9e
Show file tree
Hide file tree
Showing 27 changed files with 1,022 additions and 25 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ GLOBAL_LIST_INIT(human_heights_to_offsets, list(
/// DOPPLER SHIFT ADDITION BEGIN
/// Just below clothing layer
#define UNDER_UNIFORM_LAYER 27.5
/// Bra and socks
#define BRA_SOCKS_LAYER 27.02
/// Underwear and undershirt
#define UNDERWEAR_UNDERSHIRT 27.01
/// DOPPLER SHIFT ADDITION END
/// Jumpsuit clothing layer
#define UNIFORM_LAYER 27
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/~doppler_defines/mobs.dm
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
#define UNDERWEAR_HIDE_SOCKS (1<<0)
#define UNDERWEAR_HIDE_SHIRT (1<<1)
#define UNDERWEAR_HIDE_UNDIES (1<<2)
#define UNDERWEAR_HIDE_BRA (1<<3)
#define UNDERWEAR_HIDE_ALL (UNDERWEAR_HIDE_SOCKS | UNDERWEAR_HIDE_SHIRT | UNDERWEAR_HIDE_UNDIES | UNDERWEAR_HIDE_BRA)

#define BODYPART_ICON_SNAIL 'modular_doppler/modular_species/species_types/snails/icons/bodyparts/snail_bodyparts.dmi'
8 changes: 8 additions & 0 deletions code/__HELPERS/~doppler_helpers/mobs.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/proc/random_bra(gender)
switch(gender)
if(MALE)
return pick(SSaccessories.bra_m)
if(FEMALE)
return pick(SSaccessories.bra_f)
else
return pick(SSaccessories.bra_list)
5 changes: 5 additions & 0 deletions code/datums/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@
if(socks)
user.socks = initial(socks.name)

// DOPPLER EDIT ADDITION START - Underwear and bra split
if(bra)
user.bra = initial(bra.name)
// DOPPLER EDIT END

if(accessory)
var/obj/item/clothing/under/U = user.w_uniform
if(U)
Expand Down
8 changes: 8 additions & 0 deletions code/datums/sprite_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,8 @@
use_static = TRUE


// DOPPLER EDIT REMOVAL BEGIN - Underwear and bra split
/*
//FEMALE UNDERWEAR
/datum/sprite_accessory/underwear/female_bikini
name = "Bikini"
Expand Down Expand Up @@ -1261,6 +1263,8 @@
icon_state = "female_kinky"
gender = FEMALE
use_static = TRUE
*/
// DOPPLER EDIT END

////////////////////////////
// Undershirt Definitions //
Expand Down Expand Up @@ -1457,6 +1461,8 @@
icon_state = "whiteshortsleeve"
gender = NEUTER

// DOPPLER EDIT REMOVAL BEGIN - Underwear and bra split
/*
/datum/sprite_accessory/undershirt/sports_bra
name = "Sports Bra"
icon_state = "sports_bra"
Expand All @@ -1466,6 +1472,8 @@
name = "Sports Bra (Alt)"
icon_state = "sports_bra_alt"
gender = NEUTER
*/
// DOPPLER EDIT END

/datum/sprite_accessory/undershirt/blueshirtsport
name = "Sports Shirt (Blue)"
Expand Down
20 changes: 19 additions & 1 deletion code/game/objects/structures/dresser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
to_chat(dressing_human, span_warning("You are not capable of wearing underwear."))
return

var/choice = tgui_input_list(user, "Underwear, Undershirt, or Socks?", "Changing", list("Underwear","Underwear Color","Undershirt","Socks"))
var/choice = tgui_input_list(user, "Underwear, Bra, Undershirt or Socks?", "Changing", list("Underwear", "Underwear Color", "Bra", "Bra Color", "Undershirt", "Undershirt Color", "Socks", "Socks Color")) //DOPPLER EDIT ADDITION - Colorable Undershirt/Socks/Bra
if(isnull(choice))
return

Expand All @@ -55,6 +55,24 @@
var/new_socks = tgui_input_list(user, "Select your socks", "Changing", SSaccessories.socks_list)
if(new_socks)
dressing_human.socks = new_socks
//DOPPLER EDIT ADDITION BEGIN - Colorable Undershirt/Socks/Bras
if("Undershirt Color")
var/new_undershirt_color = input(dressing_human, "Choose your undershirt color", "Undershirt Color", dressing_human.undershirt_color) as color|null
if(new_undershirt_color)
dressing_human.undershirt_color = sanitize_hexcolor(new_undershirt_color)
if("Socks Color")
var/new_socks_color = input(dressing_human, "Choose your socks color", "Socks Color", dressing_human.socks_color) as color|null
if(new_socks_color)
dressing_human.socks_color = sanitize_hexcolor(new_socks_color)
if("Bra")
var/new_bra = tgui_input_list(user, "Select your Bra", "Changing", SSaccessories.bra_list)
if(new_bra)
dressing_human.bra = new_bra
if("Bra Color")
var/new_bra_color = input(dressing_human, "Choose your Bra color", "Bra Color", dressing_human.bra_color) as color|null
if(new_bra_color)
dressing_human.bra_color = sanitize_hexcolor(new_bra_color)
//DOPPLER EDIT ADDITION END - Colorable Undershirt/Socks/Bras

add_fingerprint(dressing_human)
dressing_human.update_body()
24 changes: 18 additions & 6 deletions code/game/objects/structures/mannequin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,24 @@
var/datum/sprite_accessory/underwear/underwear = SSaccessories.underwear_list[underwear_name]
if(underwear)
if(body_type == FEMALE && underwear.gender == MALE)
. += mutable_appearance(wear_female_version(underwear.icon_state, underwear.icon, FEMALE_UNIFORM_FULL), layer = -BODY_LAYER)
. += mutable_appearance(wear_female_version(underwear.icon_state, underwear.icon, FEMALE_UNIFORM_FULL), layer = -UNDERWEAR_UNDERSHIRT)
else
. += mutable_appearance(underwear.icon, underwear.icon_state, layer = -BODY_LAYER)
. += mutable_appearance(underwear.icon, underwear.icon_state, layer = -UNDERWEAR_UNDERSHIRT)
var/datum/sprite_accessory/undershirt/undershirt = SSaccessories.undershirt_list[undershirt_name]
if(undershirt)
if(body_type == FEMALE)
. += mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -BODY_LAYER)
. += mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -UNDERWEAR_UNDERSHIRT)
else
. += mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -BODY_LAYER)
. += mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -UNDERWEAR_UNDERSHIRT)
var/datum/sprite_accessory/socks/socks = SSaccessories.socks_list[socks_name]
if(socks)
. += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER)
. += mutable_appearance(socks.icon, socks.icon_state, -BRA_SOCKS_LAYER)
//DOPPLER EDIT ADDITION BEGIN - Underwear and Bra split
var/datum/sprite_accessory/bra/bra = SSaccessories.bra_list[bra_name]
if(bra)
. += mutable_appearance(bra.icon, bra.icon_state, -BRA_SOCKS_LAYER)
//DOPPLER EDIT END

for(var/slot_flag in worn_items)
var/obj/item/worn_item = worn_items[slot_flag]
if(!worn_item)
Expand Down Expand Up @@ -163,7 +169,7 @@
. = ..()
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
return
var/choice = tgui_input_list(user, "Underwear, Undershirt, or Socks?", "Changing", list("Underwear","Undershirt","Socks"))
var/choice = tgui_input_list(user, "Underwear, Bra, Undershirt, or Socks?", "Changing", list("Underwear", "Bra", "Undershirt","Socks")) //DOPPLER EDIT ADDITION - Underwear and Bra split
if(!Adjacent(user))
return
switch(choice)
Expand All @@ -179,6 +185,12 @@
var/new_socks = tgui_input_list(user, "Select the mannequin's socks", "Changing", SSaccessories.socks_list)
if(new_socks)
socks_name = new_socks
//DOPPLER EDIT ADDITION BEGIN - Underwear and Bra split
if("Bra")
var/new_bra = tgui_input_list(user, "Select the mannequin's bra", "Changing", SSaccessories.bra_list)
if(new_bra)
bra_name = new_bra
//DOPPLER EDIT END
update_appearance()

/obj/structure/mannequin/wood
Expand Down
6 changes: 6 additions & 0 deletions code/modules/antagonists/changeling/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,12 @@
new_profile.underwear_color = target.underwear_color
new_profile.undershirt = target.undershirt
new_profile.socks = target.socks
// DOPPLER EDIT ADDITION START - Underwear and Bra split
new_profile.bra = target.bra
new_profile.undershirt_color = target.undershirt_color
new_profile.socks_color = target.socks_color
new_profile.bra_color = target.bra_color
// DOPPLER EDIT ADDITION END

// Grab skillchips they have
new_profile.skillchips = target.clone_skillchip_list(TRUE)
Expand Down
16 changes: 10 additions & 6 deletions code/modules/client/preferences/clothing.dm
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/proc/generate_underwear_icon(datum/sprite_accessory/accessory, icon/base_icon, color)
/proc/generate_underwear_icon(datum/sprite_accessory/accessory, icon/base_icon, color, icon_offset = 0) // DOPPLER EDIT CHANGE : adds icon_offset - Colorable Undershirt/Socks
var/icon/final_icon = new(base_icon)

if (!isnull(accessory))
var/icon/accessory_icon = icon('icons/mob/clothing/underwear.dmi', accessory.icon_state)
var/icon/accessory_icon = icon(accessory.icon, accessory.icon_state) // DOPPLER EDIT CHANGE: ORIGINAL - var/icon/accessory_icon = icon('icons/mob/clothing/underwear.dmi', accessory.icon_state)
if (color && !accessory.use_static)
accessory_icon.Blend(color, ICON_MULTIPLY)
final_icon.Blend(accessory_icon, ICON_OVERLAY)

final_icon.Crop(10, 1, 22, 13)
final_icon.Crop(10, 1+icon_offset, 22, 13+icon_offset) // DOPPLER EDIT CHANGE : adds icon_offset - Colorable Undershirt/Socks
final_icon.Scale(32, 32)

return final_icon
Expand Down Expand Up @@ -137,6 +137,8 @@
/datum/preference/choiced/undershirt/create_default_value()
return /datum/sprite_accessory/undershirt/nude::name

// DOPPLER EDIT REMOVAL BEGIN - Sports Bra doesn't exist anymore. We leave it as nude and set the underwear in modular_customization
/*
/datum/preference/choiced/undershirt/create_informed_default_value(datum/preferences/preferences)
switch(preferences.read_preference(/datum/preference/choiced/gender))
if(MALE)
Expand All @@ -145,6 +147,8 @@
return /datum/sprite_accessory/undershirt/sports_bra::name
return ..()
*/
// DOPPLER EDIT END

/datum/preference/choiced/undershirt/icon_for(value)
var/static/icon/body
Expand All @@ -161,9 +165,9 @@

if (value != "Nude")
var/datum/sprite_accessory/accessory = SSaccessories.undershirt_list[value]
icon_with_undershirt.Blend(icon('icons/mob/clothing/underwear.dmi', accessory.icon_state), ICON_OVERLAY)
icon_with_undershirt.Blend(icon(accessory.icon, accessory.icon_state), ICON_OVERLAY) // DOPPLER EDIT CHANGE: ORIGINAL - icon_with_undershirt.Blend(icon('icons/mob/clothing/underwear.dmi', accessory.icon_state), ICON_OVERLAY)

icon_with_undershirt.Crop(9, 9, 23, 23)
icon_with_undershirt.Crop(10, 11, 22, 23) // DOPPLER EDIT CHANGE : ORIGINAL - icon_with_undershirt.Crop(9, 9, 23, 23)
icon_with_undershirt.Scale(32, 32)
return icon_with_undershirt

Expand Down Expand Up @@ -194,7 +198,7 @@
lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_r_leg"), ICON_OVERLAY)
lower_half.Blend(icon('icons/mob/human/bodyparts_greyscale.dmi', "human_l_leg"), ICON_OVERLAY)

return generate_underwear_icon(SSaccessories.underwear_list[value], lower_half, COLOR_ALMOST_BLACK)
return generate_underwear_icon(SSaccessories.underwear_list[value], lower_half, COLOR_ALMOST_BLACK, icon_offset = 5) // DOPPLER EDIT CHANGE : ICON_OFFSET // DOPPLER EDIT CHANGE - ORIGINAL: return generate_underwear_icon(SSaccessories.underwear_list[value], lower_half, COLOR_ALMOST_BLACK)

/datum/preference/choiced/underwear/apply_to_human(mob/living/carbon/human/target, value)
target.underwear = value
Expand Down
50 changes: 39 additions & 11 deletions code/modules/mob/living/carbon/human/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -488,34 +488,61 @@ GLOBAL_LIST_EMPTY(features_by_species)
eye_organ.refresh(call_update = FALSE)
standing += eye_organ.generate_body_overlay(species_human)

//Underwear, Undershirts & Socks
// DOPPLER EDIT ADDITION START - Underwear, Bra, Undershirts & Socks
if(!HAS_TRAIT(species_human, TRAIT_NO_UNDERWEAR))
if(species_human.underwear)
if(species_human.underwear && !(species_human.underwear_visibility & UNDERWEAR_HIDE_UNDIES))
var/datum/sprite_accessory/underwear/underwear = SSaccessories.underwear_list[species_human.underwear]
var/mutable_appearance/underwear_overlay
var/female_sprite_flags = FEMALE_UNIFORM_FULL // the default gender shaping
if(underwear)
var/icon_state = underwear.icon_state
if(underwear.has_digitigrade && (species_human.bodyshape & BODYSHAPE_DIGITIGRADE))
icon_state += "_d"
female_sprite_flags = FEMALE_UNIFORM_TOP_ONLY // for digi gender shaping
if(species_human.dna.species.sexes && species_human.physique == FEMALE && (underwear.gender == MALE))
underwear_overlay = mutable_appearance(wear_female_version(underwear.icon_state, underwear.icon, FEMALE_UNIFORM_FULL), layer = -BODY_LAYER)
underwear_overlay = mutable_appearance(wear_female_version(icon_state, underwear.icon, female_sprite_flags), layer = -UNDERWEAR_UNDERSHIRT)
else
underwear_overlay = mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER)
underwear_overlay = mutable_appearance(underwear.icon, icon_state, -UNDERWEAR_UNDERSHIRT)
if(!underwear.use_static)
underwear_overlay.color = species_human.underwear_color
standing += underwear_overlay

if(species_human.undershirt)
if(species_human.bra && !(species_human.underwear_visibility & UNDERWEAR_HIDE_BRA))
var/datum/sprite_accessory/bra/bra = SSaccessories.bra_list[species_human.bra]

if(bra)
var/mutable_appearance/bra_overlay
var/icon_state = bra.icon_state
bra_overlay = mutable_appearance(bra.icon, icon_state, -BRA_SOCKS_LAYER)
if(!bra.use_static)
bra_overlay.color = species_human.bra_color
standing += bra_overlay

if(species_human.undershirt && !(species_human.underwear_visibility & UNDERWEAR_HIDE_SHIRT))
var/datum/sprite_accessory/undershirt/undershirt = SSaccessories.undershirt_list[species_human.undershirt]
if(undershirt)
var/mutable_appearance/working_shirt
var/mutable_appearance/undershirt_overlay
if(species_human.dna.species.sexes && species_human.physique == FEMALE)
working_shirt = mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -BODY_LAYER)
undershirt_overlay = mutable_appearance(wear_female_version(undershirt.icon_state, undershirt.icon), layer = -UNDERWEAR_UNDERSHIRT)
else
working_shirt = mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -BODY_LAYER)
standing += working_shirt
undershirt_overlay = mutable_appearance(undershirt.icon, undershirt.icon_state, layer = -UNDERWEAR_UNDERSHIRT)
if(!undershirt.use_static)
undershirt_overlay.color = species_human.undershirt_color
standing += undershirt_overlay

if(species_human.socks && species_human.num_legs >= 2 && !(species_human.bodyshape & BODYSHAPE_DIGITIGRADE))
if(species_human.socks && !(species_human.underwear_visibility & UNDERWEAR_HIDE_SOCKS))
// if(!("taur" in mutant_bodyparts) || mutant_bodyparts["taur"][MUTANT_INDEX_NAME] == SPRITE_ACCESSORY_NONE)
var/datum/sprite_accessory/socks/socks = SSaccessories.socks_list[species_human.socks]
if(socks)
standing += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER)
var/mutable_appearance/socks_overlay
var/icon_state = socks.icon_state
if((species_human.bodyshape & BODYSHAPE_DIGITIGRADE))
icon_state += "_d"
socks_overlay = mutable_appearance(socks.icon, icon_state, -BRA_SOCKS_LAYER)
if(!socks.use_static)
socks_overlay.color = species_human.socks_color
standing += socks_overlay
// DOPPLER EDIT ADDITION END

if(standing.len)
species_human.overlays_standing[BODY_LAYER] = standing
Expand Down Expand Up @@ -544,6 +571,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
human_mob.undershirt = random_undershirt(human_mob.gender)
human_mob.underwear = random_underwear(human_mob.gender)
human_mob.socks = random_socks(human_mob.gender)
human_mob.bra = random_bra(human_mob.gender) //DOPPLER EDIT ADDITION - Underwear and Bra split

///Proc that will randomise the underwear (i.e. top, pants and socks) of a species' associated mob
/datum/species/proc/randomize_active_underwear(mob/living/carbon/human/human_mob)
Expand Down
6 changes: 5 additions & 1 deletion modular_doppler/enterprise_resource_planning/code/breasts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@
feature_key = "breasts"

/datum/bodypart_overlay/mutant/breasts/can_draw_on_bodypart(mob/living/carbon/human/human)
if(human.undershirt != "Nude")
if((human.undershirt != "Nude" && !(human.underwear_visibility & UNDERWEAR_HIDE_SHIRT)) || (human.bra != "Nude" && !(human.underwear_visibility & UNDERWEAR_HIDE_BRA)))
return FALSE
if((human.w_uniform && human.w_uniform.body_parts_covered & CHEST) || (human.wear_suit && human.wear_suit.body_parts_covered & CHEST))
return FALSE
if(human.underwear != "Nude" && !(human.underwear_visibility & UNDERWEAR_HIDE_UNDIES))
var/datum/sprite_accessory/underwear/worn_underwear = SSaccessories.underwear_list[human.underwear]
if(worn_underwear.hides_breasts)
return FALSE
return TRUE

/datum/bodypart_overlay/mutant/breasts/get_global_feature_list()
Expand Down
9 changes: 9 additions & 0 deletions modular_doppler/modular_antagonists/changeling/changeling.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/datum/changeling_profile
/// The bra worn by the profile source
var/bra
/// The color of the undershirt used by the profile source
var/undershirt_color
/// The color of the socks used by the profile source
var/socks_color
/// The color of the bra used by the profile source
var/bra_color
Loading

0 comments on commit 7c03e9e

Please sign in to comment.