Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MODULAR] The Layerening #192

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
// Why we need bespoke organ slots for these isn't entirely within my understanding but I assume there's a good reason
#define ORGAN_SLOT_EXTERNAL_BREASTS "breasts"

// Used to make it easier
#define ORGAN_VISIBILITY_MODE_ALWAYS_SHOW "Always Show"
#define ORGAN_VISIBILITY_MODE_NORMAL "Normal"
#define ORGAN_VISIBILITY_MODE_ALWAYS_HIDE "Always Hide"
64 changes: 25 additions & 39 deletions modular_doppler/enterprise_resource_planning/code/breasts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@


/// The boobage in question
/obj/item/organ/external/breasts
/obj/item/organ/external/nsfw/breasts
name = "breasts"
desc = "Super-effective at deterring ice dragons."
icon_state = "snout"
icon_state = "breasts"

zone = BODY_ZONE_CHEST
slot = ORGAN_SLOT_EXTERNAL_BREASTS

preference = "feature_breasts"
Expand All @@ -35,27 +34,34 @@
dna_block = DNA_BREASTS_BLOCK
restyle_flags = EXTERNAL_RESTYLE_FLESH

bodypart_overlay = /datum/bodypart_overlay/mutant/breasts
bodypart_overlay = /datum/bodypart_overlay/mutant/nsfw/breasts

/datum/bodypart_overlay/mutant/breasts
layers = EXTERNAL_ADJACENT | EXTERNAL_ADJACENT_2 | EXTERNAL_ADJACENT_3 | EXTERNAL_BEHIND | EXTERNAL_BEHIND_2 | EXTERNAL_BEHIND_3
/datum/bodypart_overlay/mutant/nsfw/breasts
feature_key = "breasts"
organ_slot = ORGAN_SLOT_EXTERNAL_BREASTS

/datum/bodypart_overlay/mutant/breasts/can_draw_on_bodypart(mob/living/carbon/human/human)
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
offset1 = 0.09
offset2 = 0.08
offset3 = 0.07

/datum/bodypart_overlay/mutant/breasts/get_global_feature_list()
/datum/bodypart_overlay/mutant/nsfw/breasts/can_draw_on_bodypart(mob/living/carbon/human/human)
if(visibility == ORGAN_VISIBILITY_MODE_NORMAL)
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
else
var/vis = visibility == ORGAN_VISIBILITY_MODE_ALWAYS_SHOW ? TRUE : FALSE
return vis

/datum/bodypart_overlay/mutant/nsfw/breasts/get_global_feature_list()
return SSaccessories.breasts_list

/datum/bodypart_overlay/mutant/breasts/color_image(image/overlay, draw_layer, obj/item/bodypart/limb)
/datum/bodypart_overlay/mutant/nsfw/breasts/color_image(image/overlay, draw_layer, obj/item/bodypart/limb)
if(limb.owner == null)
return ..()
if(draw_layer == bitflag_to_layer(EXTERNAL_ADJACENT))
Expand All @@ -78,26 +84,6 @@
return overlay
return ..()

/datum/bodypart_overlay/mutant/breasts/mutant_bodyparts_layertext(layer)
switch(layer)
if(-(UNIFORM_LAYER + 0.09))
return "ADJ"
if(-(UNIFORM_LAYER + 0.08))
return "ADJ_2"
if(-(UNIFORM_LAYER + 0.07))
return "ADJ_3"
return ..()

/datum/bodypart_overlay/mutant/breasts/bitflag_to_layer(layer)
switch(layer)
if(EXTERNAL_ADJACENT)
return -(UNIFORM_LAYER + 0.09)
if(EXTERNAL_ADJACENT_2)
return -(UNIFORM_LAYER + 0.08)
if(EXTERNAL_ADJACENT_3)
return -(UNIFORM_LAYER + 0.07)
return ..()


/// Main breast prefs
//core toggle
Expand All @@ -124,7 +110,7 @@
//to_chat(world, "Boobs are in the features list, adding [target.dna.features["breasts"]]")
if(target.dna.features["breasts"] != "Bare")
//to_chat(world, "Boob type valid, trying to insert [target.dna.features["breasts"]]")
var/obj/item/organ/replacement = SSwardrobe.provide_type(/obj/item/organ/external/breasts)
var/obj/item/organ/replacement = SSwardrobe.provide_type(/obj/item/organ/external/nsfw/breasts)
//to_chat(world, "Inserted boobage exists: [replacement]")
//replacement.build_from_dna(target.dna, "breasts") //TODO: do we need to add this
replacement.Insert(target, special = TRUE, movement_flags = DELETE_IF_REPLACED)
Expand Down
108 changes: 108 additions & 0 deletions modular_doppler/enterprise_resource_planning/code/erp_prefs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,111 @@
final_icon.Crop(-2, 1, 29, 32)

return final_icon



/// === BASE ORGAN TYPE. HELPS WITH THE BULLSHITTERY ===
/obj/item/organ/external/nsfw
name = "nsfw organ"
desc = "If you see this, yell at Naaka. Shit's fucked."
icon = 'modular_doppler/enterprise_resource_planning/icons/organs.dmi'
icon_state = ""
zone = BODY_ZONE_CHEST

var/baselayer_name = "Below Uniform"
var/list/valid_layers = list("Below Uniform" = UNIFORM_LAYER, "Above Uniform" = BANDAGE_LAYER, "Above All Clothes" = HANDS_LAYER, "Above Everything" = WOUND_LAYER)

/datum/bodypart_overlay/mutant/nsfw
layers = EXTERNAL_ADJACENT | EXTERNAL_ADJACENT_2 | EXTERNAL_ADJACENT_3 | EXTERNAL_BEHIND | EXTERNAL_BEHIND_2 | EXTERNAL_BEHIND_3

var/visibility = ORGAN_VISIBILITY_MODE_NORMAL

var/organ_slot = ORGAN_SLOT_EARS //why ears by default? why not?

var/baselayer = UNIFORM_LAYER
var/offset1 = 0.03
var/offset2 = 0.02
var/offset3 = 0.01

/datum/bodypart_overlay/mutant/nsfw/mutant_bodyparts_layertext(layer)
if(layer == -(baselayer + offset1))
return "ADJ"
if(layer == -(baselayer + offset2))
return "ADJ_2"
if(layer == -(baselayer + offset3))
return "ADJ_3"
return ..()

/datum/bodypart_overlay/mutant/nsfw/bitflag_to_layer(layer)
switch(layer)
if(EXTERNAL_ADJACENT)
return -(baselayer + offset1)
if(EXTERNAL_ADJACENT_2)
return -(baselayer + offset2)
if(EXTERNAL_ADJACENT_3)
return -(baselayer + offset3)
return ..()



/// === LAYERING ADJUST VERB ===
/mob/living/carbon/human/verb/adjust_genitals()
set category = "IC"
set name = "Adjust Parts"
set desc = "Allows you to adjust the layering and visibility of your NSFW parts."

if(stat != CONSCIOUS)
to_chat(usr, span_warning("You're not conscious enough to do this!"))
return

var/list/part_list = list()
for(var/obj/item/organ/external/nsfw/part in organs)
part_list += part

if(!part_list.len) //There is nothing to expose
update_body()
return

var/obj/item/organ/external/nsfw/picked_organ = tgui_input_list(src, "Choose which part to adjust", "Part Adjuster", part_list)

if(!picked_organ || !(picked_organ in organs))
update_body()
return

var/static/list/adjust_modes = list(
"Show/Hide part",
"Adjust Part Layer"
)
var/picked_mode = tgui_input_list(src, "Choose how to adjust [picked_organ]", "Part Adjuster", adjust_modes)

if(picked_mode == adjust_modes[1]) //show/hide
var/static/list/vis_states = list(
"Always Show" = ORGAN_VISIBILITY_MODE_ALWAYS_SHOW,
"Normal" = ORGAN_VISIBILITY_MODE_NORMAL,
"Always Hide" = ORGAN_VISIBILITY_MODE_ALWAYS_HIDE
)
var/picked_vis = tgui_input_list(src, "Choose a visibility mode for [picked_organ]; normal is hidden when under clothing", "Part Adjuster", vis_states)

if(picked_vis)
var/datum/bodypart_overlay/mutant/nsfw/overlay = picked_organ.bodypart_overlay
if(istype(overlay))
overlay.visibility = picked_vis
balloon_alert(src, "set visibility to [lowertext(picked_vis)]")
else
balloon_alert(src, "wrong overlay type! yell at coders!")
else if(picked_mode == adjust_modes[2]) //change layer
var/picked_layer = tgui_input_list(src, "Choose a rendering layer for [picked_organ]; it's currently on [picked_organ.baselayer_name]", "Part Adjuster", picked_organ.valid_layers)

if(picked_layer)
var/datum/bodypart_overlay/mutant/nsfw/overlay = picked_organ.bodypart_overlay
if(istype(overlay))
overlay.baselayer = picked_organ.valid_layers[picked_layer]
picked_organ.baselayer_name = picked_layer
balloon_alert(src, "set layer to [lowertext(picked_organ.baselayer_name)]")
else
balloon_alert(src, "wrong overlay type! yell at coders!")
else
update_body()
return

update_body()
Binary file modified modular_doppler/enterprise_resource_planning/icons/organs.dmi
Binary file not shown.
Loading