diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index c1496ba8b349..96ed3e0fea22 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -674,23 +674,25 @@ // Mob Overlays Indexes /// Total number of layers for mob overlays -#define TOTAL_LAYERS 34 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_; +#define TOTAL_LAYERS 35 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_; /// Mutations layer - Tk headglows, cold resistance glow, etc -#define MUTATIONS_LAYER 34 +#define MUTATIONS_LAYER 35 /// Mutantrace features (tail when looking south) that must appear behind the body parts -#define BODY_BEHIND_LAYER 33 +#define BODY_BEHIND_LAYER 34 /// Layer for bodyparts that should appear behind every other bodypart - Mostly, legs when facing WEST or EAST -#define BODYPARTS_LOW_LAYER 32 +#define BODYPARTS_LOW_LAYER 33 /// Layer for most bodyparts, appears above BODYPARTS_LOW_LAYER and below BODYPARTS_HIGH_LAYER -#define BODYPARTS_LAYER 31 +#define BODYPARTS_LAYER 32 /// Mutantrace features (snout, body markings) that must appear above the body parts -#define BODY_ADJ_LAYER 30 +#define BODY_ADJ_LAYER 31 /// Eyes! -#define EYE_LAYER 29 +#define EYE_LAYER 30 /// Underwear, undershirts, socks, eyes, lips(makeup) -#define BODY_LAYER 28 +#define BODY_LAYER 29 /// Mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes) -#define FRONT_MUTATIONS_LAYER 27 +#define FRONT_MUTATIONS_LAYER 28 +/// Gauze specifically +#define GAUZE_LAYER 27 /// Damage indicators (cuts and burns) #define DAMAGE_LAYER 26 /// Jumpsuit clothing layer diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 1551eac742e4..aa7e08b53e48 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -184,6 +184,7 @@ GLOBAL_LIST_INIT(announcer_keys, list( #define SFX_BULLET_MISS "bullet_miss" #define SFX_CAN_OPEN "can_open" #define SFX_CLOWN_STEP "clown_step" +#define SFX_CLOTH_RIP "cloth_rip" #define SFX_DESECRATION "desecration" #define SFX_EXPLOSION "explosion" #define SFX_EXPLOSION_CREAKING "explosion_creaking" diff --git a/code/datums/elements/tool_flash.dm b/code/datums/elements/tool_flash.dm index 2808e02f9e4f..07c3e09bb318 100644 --- a/code/datums/elements/tool_flash.dm +++ b/code/datums/elements/tool_flash.dm @@ -1,7 +1,7 @@ /** * Tool flash bespoke element * - * Flashes the user when using this tool + * Flashes the user (and nearby mobs) when using this tool */ /datum/element/tool_flash element_flags = ELEMENT_BESPOKE @@ -33,5 +33,12 @@ /datum/element/tool_flash/proc/flash(datum/source, mob/living/user) SIGNAL_HANDLER - if(user && get_dist(get_turf(source), get_turf(user)) <= 1) - user.flash_act(flash_strength) + if(flash_strength <= 0) + return + + var/turf/weld_location = get_turf(source) + for(var/mob/living/victim in viewers(1, weld_location)) + var/relative_dir = get_dir(victim, weld_location) + if(relative_dir == 0 || (victim.dir & relative_dir)) // Same tile or victim is facing the tile. + var/flash_strength_for_victim = max(flash_strength - get_dist(victim, weld_location), 0) + victim.flash_act(flash_strength_for_victim) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 36700d53267e..fbf16a230690 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -100,9 +100,11 @@ if(!affecting) //Missing limb? to_chat(user, span_warning("[C] doesn't have \a [parse_zone(user.zone_selected)]!")) return FALSE + if(!IS_ORGANIC_LIMB(affecting)) //Limb must be organic to be healed - RR to_chat(user, span_warning("[src] won't work on a robotic limb!")) return FALSE + if(affecting.brute_dam && brute || affecting.burn_dam && burn) user.visible_message( span_infoplain(span_green("[user] applies [src] on [C]'s [parse_zone(affecting.body_zone)].")), @@ -112,7 +114,8 @@ affecting.heal_damage(brute, burn) post_heal_effects(max(previous_damage - affecting.get_damage(), 0), C, user) return TRUE - to_chat(user, span_warning("[C]'s [parse_zone(affecting.body_zone)] can not be healed with [src]!")) + + to_chat(user, span_warning("[C]'s [parse_zone(affecting.body_zone)] can not be healed with [src].")) return FALSE ///Override this proc for special post heal effects. @@ -161,6 +164,13 @@ merge_type = /obj/item/stack/gauze dynamically_set_name = TRUE +/obj/item/stack/gauze/try_bandage(mob/living/carbon/human/target, mob/living/user) + . = ..() + if(!(. & ITEM_INTERACT_SUCCESS)) + return + + playsound(user, SFX_CLOTH_RIP, 50, TRUE) + /obj/item/stack/gauze/twelve amount = 12 diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 78c139c7b87f..644a2062a59b 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -654,10 +654,10 @@ if(splint_slowdown) return try_splint(interacting_with, user) - if(!absorption_capacity || !ishuman(interacting_with)) - return NONE + if(absorption_capacity && ishuman(interacting_with)) + return try_bandage(interacting_with, user) - var/mob/living/carbon/human/target = interacting_with +/obj/item/stack/proc/try_bandage(mob/living/carbon/human/target, mob/living/user) var/obj/item/bodypart/BP = target.get_bodypart(user.zone_selected, TRUE) if(BP.bandage) to_chat(user, span_warning("[target]'s [BP.plaintext_zone] is already bandaged.")) diff --git a/code/game/sound.dm b/code/game/sound.dm index 412cfe5ff231..674513379d2f 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -195,6 +195,8 @@ if(istext(soundin)) soundin = get_sfx_pariah(soundin) //PARIAH EDIT ADDITION - This overrides the default sound effects too, so use it to modularly change a sound effect output. switch(soundin) + if(SFX_CLOTH_RIP) + soundin = pick('sound/items/handling/cloth_rip1.ogg', 'sound/items/handling/cloth_rip2.ogg', 'sound/items/handling/cloth_rip3.ogg', 'sound/items/handling/cloth_rip4.ogg') if (SFX_SHATTER) soundin = pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg') if (SFX_EXPLOSION) diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 4ad4512b936a..f909f859aaaf 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -107,14 +107,9 @@ var/list/overlays = list() for(var/obj/item/bodypart/iter_part as anything in bodyparts) - if(iter_part.is_stump) - continue - - if(iter_part.icon_dmg_overlay && !iter_part.is_husked) - if(iter_part.brutestate) - overlays += image(iter_part.icon_dmg_overlay, "[iter_part.body_zone]_[iter_part.brutestate]0", -DAMAGE_LAYER) //we're adding icon_states of the base image as overlays - if(iter_part.burnstate) - overlays += image(iter_part.icon_dmg_overlay, "[iter_part.body_zone]_0[iter_part.burnstate]", -DAMAGE_LAYER) + var/list/limb_overlays = iter_part.get_damage_overlays() + if(limb_overlays) + overlays += limb_overlays overlays_standing[DAMAGE_LAYER] = overlays if(length(overlays)) diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index e45b251b6d66..a7303c3f2637 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1046,6 +1046,10 @@ return bandage = new_bandage.split_stack(null, 1, src) + bandage.worn_icon_state = "[body_zone][rand(1, 3)]" + + owner?.update_damage_overlays() + RegisterSignal(bandage, COMSIG_PARENT_QDELETING, PROC_REF(bandage_gone)) if(bandage.absorption_capacity && owner.stat < UNCONSCIOUS) for(var/datum/wound/iter_wound as anything in wounds) @@ -1057,11 +1061,16 @@ if(!bandage) return FALSE + bandage.worn_icon_state = "nothing" + . = bandage + UnregisterSignal(bandage, COMSIG_PARENT_QDELETING) if(bandage.loc == src) bandage.forceMove(drop_location()) + bandage = null + owner?.update_damage_overlays() /obj/item/bodypart/proc/bandage_gone(obj/item/stack/bandage) SIGNAL_HANDLER diff --git a/code/modules/surgery/bodyparts/rendering.dm b/code/modules/surgery/bodyparts/rendering.dm index 4f0676e43db1..5dd1a195f887 100644 --- a/code/modules/surgery/bodyparts/rendering.dm +++ b/code/modules/surgery/bodyparts/rendering.dm @@ -330,3 +330,24 @@ GLOBAL_LIST_EMPTY(masked_leg_icons_cache) /obj/item/bodypart/proc/remove_color_override(color_priority) LAZYREMOVE(color_overrides, "[color_priority]") + +/// Return damage overlays, not rendered as apart of the bodypart, for some reason. +/obj/item/bodypart/proc/get_damage_overlays() + var/list/overlays + if(is_stump) + return overlays + + if(icon_dmg_overlay && !is_husked) + if(brutestate) + LAZYADD(overlays, image(icon_dmg_overlay, "[body_zone]_[brutestate]0", -DAMAGE_LAYER)) + if(burnstate) + LAZYADD(overlays, image(icon_dmg_overlay, "[body_zone]_[burnstate]0", -DAMAGE_LAYER)) + + if(bandage) + var/mutable_appearance/gauze_overlay = bandage.build_worn_icon( + default_layer = GAUZE_LAYER, // build_worn_icon inverts it for us + override_file = 'icons/mob/bandage.dmi', + override_state = bandage.worn_icon_state, + ) + LAZYADD(overlays, gauze_overlay) + return overlays diff --git a/icons/mob/bandage.dmi b/icons/mob/bandage.dmi new file mode 100644 index 000000000000..24b65c9c48ef Binary files /dev/null and b/icons/mob/bandage.dmi differ diff --git a/sound/items/handling/attribution.txt b/sound/items/handling/attribution.txt new file mode 100644 index 000000000000..51dae70a71b9 --- /dev/null +++ b/sound/items/handling/attribution.txt @@ -0,0 +1,8 @@ +{ +cloth_rip1.ogg +cloth_rip2.ogg +cloth_rip3.ogg +cloth_rip4.ogg +} +ported from https://github.com/Baystation12/Baystation12/commit/c9e54f011e83bb4d0330bf52babfb158b439f69c, +which in turn is from https://freesound.org/people/altfuture/sounds/174627/ -- License: Creative Commons 0 diff --git a/sound/items/handling/cloth_rip1.ogg b/sound/items/handling/cloth_rip1.ogg new file mode 100644 index 000000000000..ab0fabbb3d69 Binary files /dev/null and b/sound/items/handling/cloth_rip1.ogg differ diff --git a/sound/items/handling/cloth_rip2.ogg b/sound/items/handling/cloth_rip2.ogg new file mode 100644 index 000000000000..93a5cec50f8a Binary files /dev/null and b/sound/items/handling/cloth_rip2.ogg differ diff --git a/sound/items/handling/cloth_rip3.ogg b/sound/items/handling/cloth_rip3.ogg new file mode 100644 index 000000000000..82d93582923e Binary files /dev/null and b/sound/items/handling/cloth_rip3.ogg differ diff --git a/sound/items/handling/cloth_rip4.ogg b/sound/items/handling/cloth_rip4.ogg new file mode 100644 index 000000000000..32c594b688d7 Binary files /dev/null and b/sound/items/handling/cloth_rip4.ogg differ