Skip to content

Commit

Permalink
Adds loincloth as underwear option with mechanical impact (#82)
Browse files Browse the repository at this point in the history
* Add 'loincloth' underwear item and directional genital visibility option for underwears

* prevent underwear properties being checked if they don't exist, correct behind angle dimensions

* adjust formatting to reflect normal descriptor readout, don't print lines for genitals you don't have

* add sprites for loincloth and add as option on loadout menu

* add sprites for loincloth and add as option on loadout menu

* add sprites for loincloth and add as option on loadout menu

* add item sprite for loincloth and remove flag on loincloth to cover breasts
  • Loading branch information
Khloross authored Nov 27, 2024
1 parent 12d5ca4 commit eba8471
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 3 deletions.
11 changes: 10 additions & 1 deletion code/game/objects/items/rogueitems/undies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
var/covers_breasts = FALSE
sewrepair = TRUE

///Whether this underwear covers the rear. If it doesn't, genital information may still be shown in certain circumstances
var/covers_rear = TRUE

/obj/item/undies/attack(mob/M, mob/user, def_zone)
if(ishuman(M))
var/mob/living/carbon/human/H = M
Expand All @@ -42,4 +45,10 @@
/obj/item/undies/leotard
name = "leotard"
icon_state = "leotard"
covers_breasts = TRUE
covers_breasts = TRUE

/obj/item/undies/loincloth
name = "loincloth"
icon_state = "loincloth"
covers_rear = FALSE
desc = "An absolute necessity. Slightly less effective."
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@
/datum/sprite_accessory/underwear/panties,
/datum/sprite_accessory/underwear/bikini,
/datum/sprite_accessory/underwear/leotard,
/datum/sprite_accessory/underwear/loincloth
)
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@
/datum/sprite_accessory/underwear/leotard/get_icon_state(obj/item/organ/organ, obj/item/bodypart/bodypart, mob/living/carbon/owner)
if(owner.gender == MALE)
return "male_leotard"
return "female_leotard"
return "female_leotard"

/datum/sprite_accessory/underwear/loincloth
name = "Loincloth"
icon_state = "loincloth"
underwear_type = /obj/item/undies/loincloth
25 changes: 24 additions & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var/observer_privilege = isobserver(user)
var/t_He = p_they(TRUE)
var/t_his = p_their()
// var/t_him = p_them()
var/t_him = p_them()
var/t_has = p_have()
var/t_is = p_are()
var/obscure_name = FALSE
Expand Down Expand Up @@ -495,6 +495,29 @@
for(var/line in lines)
. += span_info(line)


// for underwears that don't cover from the rear, genital descriptions are still shown
if(get_location_accessible(src, BODY_ZONE_PRECISE_GROIN) && src.underwear)
//separate these conditions to not throw an error when no underwear is worn at all
if(user.InCone(src, turn(src.dir, 180)) && !src.underwear.covers_rear)
var/list/descriptors = list()
//only populate the descriptors for genitals you have
if(src.getorganslot(ORGAN_SLOT_PENIS))
descriptors += /datum/mob_descriptor/penis
if(src.getorganslot(ORGAN_SLOT_VAGINA))
descriptors += /datum/mob_descriptor/vagina
if(src.getorganslot(ORGAN_SLOT_TESTICLES))
descriptors += /datum/mob_descriptor/testicles
. += span_info("[t_his] underwear doesn't cover [t_him] from behind.")
//male genitalia line
var/malegen = build_coalesce_description(descriptors, src, list(MOB_DESCRIPTOR_SLOT_PENIS, MOB_DESCRIPTOR_SLOT_TESTICLES), "%THEY% %DESC1%, and %DESC2%.")
if(malegen)
. += span_info(malegen)
//female genitalia line
var/femgen = build_coalesce_description(descriptors, src, list(MOB_DESCRIPTOR_SLOT_VAGINA), "%THEY% %DESC1%.")
if(femgen)
. += span_info(femgen)

var/trait_exam = common_trait_examine()
if(!isnull(trait_exam))
. += trait_exam
Expand Down
Binary file modified icons/mob/sprite_accessory/underwear.dmi
Binary file not shown.
Binary file modified icons/roguetown/items/misc.dmi
Binary file not shown.

0 comments on commit eba8471

Please sign in to comment.