Skip to content
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
35 changes: 31 additions & 4 deletions code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,41 @@

/obj/item/clothing/update_icon()
..()

overlays.len = 0
dynamic_overlay.len = 0
var/image/dyn_overlay_worn
var/image/dyn_overlay_left
var/image/dyn_overlay_right

if ((luminosity > 0) || (dyed_parts.len > 0))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, but relational operators always are checked prior to boolean operators so your parentheses are not necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double nit, dyed_parts.len > 0 could be simplified to dyed_parts.len

dyn_overlay_worn = image('icons/effects/32x32.dmi', src, "blank")
dyn_overlay_left = image('icons/effects/32x32.dmi', src, "blank")
dyn_overlay_right = image('icons/effects/32x32.dmi', src, "blank")

if (luminosity > 0)
update_moody_light_index("luminous_clothing", image_override = image(icon, src, icon_state))
//dynamic in-hands moody lights
var/image/worn_moody = image(cloth_icon, src, "[icon_state][(cloth_layer == UNIFORM_LAYER) ? "_s" : ""]")
var/image/left_moody = image(inhand_states["left_hand"], src, item_state)
var/image/right_moody = image(inhand_states["right_hand"], src, item_state)
worn_moody.blend_mode = BLEND_ADD
worn_moody.plane = LIGHTING_PLANE
dyn_overlay_worn.overlays += worn_moody
left_moody.blend_mode = BLEND_ADD
left_moody.plane = LIGHTING_PLANE
dyn_overlay_left.overlays += left_moody
right_moody.blend_mode = BLEND_ADD
right_moody.plane = LIGHTING_PLANE
dyn_overlay_right.overlays += right_moody

if (dyed_parts.len > 0)
if (!cloth_layer || !cloth_icon)
return
var/image/dyn_overlay_worn = image('icons/effects/32x32.dmi', src, "blank")
var/image/dyn_overlay_left = image('icons/effects/32x32.dmi', src, "blank")
var/image/dyn_overlay_right = image('icons/effects/32x32.dmi', src, "blank")
for (var/part in dyed_parts)
var/list/dye_data = dyed_parts[part]
var/dye_color = dye_data[1]
var/dye_alpha = dye_data[2]
//TODO: dye_date[3] to allow glowing clothing?

var/_state = dye_base_iconstate_override
if (!_state)
Expand Down Expand Up @@ -120,10 +142,15 @@
right_overlay.alpha = dye_alpha
dyn_overlay_right.overlays += right_overlay

if ((luminosity > 0) || (dyed_parts.len > 0))
dynamic_overlay["[cloth_layer]"] = dyn_overlay_worn
dynamic_overlay["[HAND_LAYER]-[GRASP_LEFT_HAND]"] = dyn_overlay_left
dynamic_overlay["[HAND_LAYER]-[GRASP_RIGHT_HAND]"] = dyn_overlay_right

set_blood_overlay()//re-applying blood stains
if (on_fire && fire_overlay)
overlays += fire_overlay


/obj/item/clothing/can_quick_store(var/obj/item/I)
for(var/obj/item/clothing/accessory/storage/A in accessories)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/clothing/masks/gasmask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@
desc = "A true prankster's groovy facial attire. A clown is incomplete without his wig and mask."
icon_state = "clownmaskpsyche"
item_state = "clownmaskpsyche"
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/clothing.dmi', "right_hand" = 'icons/mob/in-hand/right/clothing.dmi')
luminosity = 2
species_fit = list(VOX_SHAPED, GREY_SHAPED, INSECT_SHAPED)
can_flip = 0
canstage = 0
Expand Down
2 changes: 2 additions & 0 deletions code/modules/clothing/shoes/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@
name = "clown psychedelic shoes"
icon_state = "clownshoespsyche"
item_state = "clownshoespsyche"
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/clothing.dmi', "right_hand" = 'icons/mob/in-hand/right/clothing.dmi')
luminosity = 2
_color = "clownshoespsyche"
footprint_type = /obj/effect/decal/cleanable/blood/tracks/footprints/clown
species_fit = list(VOX_SHAPED)
Expand Down
8 changes: 6 additions & 2 deletions code/modules/clothing/under/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
/obj/item/clothing/under/color/pink
name = "pink jumpsuit"
icon_state = "pink"
item_state = "p_suit"
item_state = "pi_suit"
_color = "pink"
color = null
clothing_flags = ONESIZEFITSALL | COLORS_OVERLAY
Expand Down Expand Up @@ -126,9 +126,12 @@
name = "psychedelic jumpsuit"
desc = "Groovy!"
icon_state = "psyche"
item_state = "psyche"
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/clothing.dmi', "right_hand" = 'icons/mob/in-hand/right/clothing.dmi')
_color = "psyche"
clothing_flags = ONESIZEFITSALL
species_fit = list(GREY_SHAPED, INSECT_SHAPED)
luminosity = 2

/obj/item/clothing/under/lightblue
name = "lightblue jumpsuit"
Expand All @@ -140,14 +143,15 @@
/obj/item/clothing/under/aqua
name = "aqua jumpsuit"
icon_state = "aqua"
item_state = "a_suit"
_color = "aqua"
clothing_flags = ONESIZEFITSALL
species_fit = list(VOX_SHAPED, GREY_SHAPED, INSECT_SHAPED)

/obj/item/clothing/under/purple
name = "purple jumpsuit"
icon_state = "purple"
item_state = "p_suit"
item_state = "pu_suit"
_color = "purple"
clothing_flags = ONESIZEFITSALL
species_fit = list(GREY_SHAPED, INSECT_SHAPED)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/clothing/under/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,8 @@
desc = "Do you know the definition of insanity?"
icon_state = "clownpsyche"
item_state = "clownpsyche"
inhand_states = list("left_hand" = 'icons/mob/in-hand/left/clothing.dmi', "right_hand" = 'icons/mob/in-hand/right/clothing.dmi')
luminosity = 2
_color = "clownpsyche"
clothing_flags = ONESIZEFITSALL
species_fit = list(INSECT_SHAPED)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,16 @@ Please contact me on #coderbus IRC. ~Carn x //FUCK YOU CARN
update_overlays_standing()
update_transform()
update_hands_icons()
update_luminosity()
if(istype(loc,/obj/structure/inflatable/shelter))
var/obj/O = loc
O.update_icon() //Shelters use an overlay of the human inside, so if we change state we want the appearance to reflect that.

/mob/living/carbon/human/proc/update_luminosity()//due to moody lights we might want people to show up in the dark even if they aren't actually emitting light
luminosity = 0
for (var/obj/item/I in contents)
luminosity = max(luminosity, I.luminosity)

/mob/living/carbon/human/proc/update_overlays_standing()
if(species && species.override_icon)
species_override_icon()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@
var/tangibility = 1 //can this mob be interacted with things hitting it and etc?

var/braindamagespeechcooldown = FALSE //used to avoid braindamage proc spamming when checking the like 80 replacements

var/list/luminosity_sources = list()
Binary file modified icons/mob/in-hand/left/clothing.dmi
Binary file not shown.
Binary file modified icons/mob/in-hand/left/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/in-hand/right/clothing.dmi
Binary file not shown.
Binary file modified icons/mob/in-hand/right/items_righthand.dmi
Binary file not shown.