Skip to content

Commit

Permalink
Merge pull request tgstation#1138 from Absolucy/accessories-boogaloo
Browse files Browse the repository at this point in the history
[PORT] Allows uniforms to have multiple accessories attached
  • Loading branch information
dwasint committed Mar 2, 2024
2 parents 92eda30 + e9f1dab commit a46909d
Show file tree
Hide file tree
Showing 23 changed files with 1,021 additions and 741 deletions.
21 changes: 18 additions & 3 deletions code/__DEFINES/dcs/signals/signals_clothing.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
// /obj/item/clothing
/// (/obj/item/clothing, visor_state) - When a clothing gets it's visor toggled.
#define COMSIG_CLOTHING_VISOR_TOGGLE "clothing_visor_toggle"
// /obj/item/clothing
/// Sent when mobs try to equip clothing on others through attacking
#define COMSIG_CLOTHING_ATTACK_EQUIP "clothing_attack_equip"
/// From an undersuit being adjusted: ()
#define COMSIG_CLOTHING_UNDER_ADJUSTED "clothing_under_adjusted"

// Accessory sending to clothing
/// /obj/item/clothing/accessory/successful_attach : (obj/item/clothing/under/attached_to)
/// The accessory, at the point of signal sent, is in the clothing's accessory list / loc
#define COMSIG_CLOTHING_ACCESSORY_ATTACHED "clothing_accessory_pinned"
/// /obj/item/clothing/accessory/detach : (obj/item/clothing/under/detach_from)
/// The accessory, at the point of signal sent, is no longer in the accessory list but may still be in the loc
#define COMSIG_CLOTHING_ACCESSORY_DETACHED "clothing_accessory_unpinned"

// To accessories themselves
/// /obj/item/clothing/accessory/successful_attach : (obj/item/clothing/under/attached_to)
/// The accessory, at the point of signal sent, is in the clothing's accessory list / loc
#define COMSIG_ACCESSORY_ATTACHED "accessory_pinned"
/// /obj/item/clothing/accessory/detach : (obj/item/clothing/under/detach_from)
/// The accessory, at the point of signal sent, is no longer in the accessory list but may still be in the loc
#define COMSIG_ACCESSORY_DETACHED "accessory_unpinned"
4 changes: 2 additions & 2 deletions code/datums/mood_events/generic_positive_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
timeout = 3 MINUTES

/datum/mood_event/hope_lavaland
description = "What a peculiar emblem. It makes me feel hopeful for my future."
mood_change = 10
description = "What a peculiar emblem. It makes me feel hopeful for my future."
mood_change = 6

/datum/mood_event/confident_mane
description = "I'm feeling confident with a head full of hair."
Expand Down
3 changes: 1 addition & 2 deletions code/datums/quirks/negative_quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,7 @@
medical_record_text = "Patient's immune system responds violently to [allergy_string]"

var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/clothing/accessory/allergy_dogtag/dogtag = new(get_turf(human_holder))
dogtag.display = allergy_string
var/obj/item/clothing/accessory/dogtag/allergy/dogtag = new(get_turf(human_holder), allergy_string)

give_item_to_holder(dogtag, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS), flavour_text = "Make sure medical staff can see this...")

Expand Down
21 changes: 13 additions & 8 deletions code/game/data_huds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,24 @@ FAN HUDs! For identifying other fans on-sight.

/mob/living/carbon/human/proc/fan_hud_set_fandom()
var/image/holder = hud_list[FAN_HUD]
var/icon/I = icon(icon, icon_state, dir)
holder.pixel_y = I.Height() - world.icon_size
var/icon/hud_icon = icon(icon, icon_state, dir)
holder.pixel_y = hud_icon.Height() - world.icon_size
holder.icon_state = "hudfan_no"
var/obj/item/clothing/under/U = get_item_by_slot(ITEM_SLOT_ICLOTHING)
if(!U)

var/obj/item/clothing/under/undershirt = w_uniform
if(!istype(undershirt))
set_hud_image_inactive(FAN_HUD)
return

if(istype(U.attached_accessory, /obj/item/clothing/accessory/mime_fan_pin))
holder.icon_state = "mime_fan_pin"
for(var/accessory in undershirt.attached_accessories)
if(istype(accessory, /obj/item/clothing/accessory/mime_fan_pin))
holder.icon_state = "mime_fan_pin"
break

if(istype(accessory, /obj/item/clothing/accessory/clown_enjoyer_pin))
holder.icon_state = "clown_enjoyer_pin"
break

else if(istype(U.attached_accessory, /obj/item/clothing/accessory/clown_enjoyer_pin))
holder.icon_state = "clown_enjoyer_pin"
set_hud_image_active(FAN_HUD)
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ GLOBAL_LIST_INIT(dye_registry, list(
if(.)
var/obj/item/clothing/under/U = .
can_adjust = initial(U.can_adjust)
if(!can_adjust && adjusted) //we deadjust the uniform if it's now unadjustable
if(!can_adjust && adjusted == ALT_STYLE) //we deadjust the uniform if it's now unadjustable
toggle_jumpsuit_adjust()

/obj/item/clothing/head/mob_holder/machine_wash(obj/machinery/washing_machine/washer)
Expand Down
16 changes: 9 additions & 7 deletions code/modules/clothing/suits/_suits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
if(GET_ATOM_BLOOD_DNA_LENGTH(src))
. += mutable_appearance('icons/effects/blood.dmi', "[blood_overlay_type]blood")

var/mob/living/carbon/human/M = loc
if(!ishuman(M) || !M.w_uniform)
var/mob/living/carbon/human/wearer = loc
if(!ishuman(wearer) || !wearer.w_uniform)
return
var/obj/item/clothing/under/U = M.w_uniform
if(istype(U) && U.attached_accessory)
var/obj/item/clothing/accessory/A = U.attached_accessory
if(A.above_suit)
. += U.accessory_overlay
var/obj/item/clothing/under/undershirt = wearer.w_uniform
if(!istype(undershirt) || !LAZYLEN(undershirt.attached_accessories))
return

var/obj/item/clothing/accessory/displayed = undershirt.attached_accessories[1]
if(displayed.above_suit)
. += undershirt.accessory_overlay

/obj/item/clothing/suit/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED)
..()
Expand Down

0 comments on commit a46909d

Please sign in to comment.