diff --git a/code/__DEFINES/combat.dm b/code/__DEFINES/combat.dm index 32dd88a6e10..b5ea83cd26e 100644 --- a/code/__DEFINES/combat.dm +++ b/code/__DEFINES/combat.dm @@ -415,3 +415,6 @@ GLOBAL_LIST_INIT(leg_zones, list(BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)) /// Needs to have support for force overrides and multipliers of 0 (hence why we ternaries are used over 'or's) #define CALCULATE_FORCE(some_item, atk_mods) \ ((((FORCE_OVERRIDE in atk_mods) ? atk_mods[FORCE_OVERRIDE] : some_item.force) + (atk_mods?[FORCE_MODIFIER] || 0)) * ((FORCE_MULTIPLIER in atk_mods) ? atk_mods[FORCE_MULTIPLIER] : 1)) + +///Do we block carbon-level flash_act() from performing its default stamina damage/knockdown? +#define FLASH_COMPLETED "flash_completed" diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm index 5781430e338..c9f9b283271 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm @@ -227,6 +227,10 @@ ///from living/flash_act(), when a mob is successfully flashed. #define COMSIG_MOB_FLASHED "mob_flashed" +/// from /obj/item/assembly/flash/flash_carbon, to the mob being flashed +#define COMSIG_MOB_FLASH_OVERRIDE_CHECK "mob_flash_override_check" + /// Has the flash effect been overridden? + #define FLASH_OVERRIDDEN (1<<0) /// from /obj/item/assembly/flash/flash_carbon, to the mob flashing another carbon #define COMSIG_MOB_PRE_FLASHED_CARBON "mob_pre_flashed_carbon" /// Return to override deviation to be full deviation (fail the flash, usually) diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm index 7b7a5b6d94a..8c8900cb025 100644 --- a/code/modules/assembly/flash.dm +++ b/code/modules/assembly/flash.dm @@ -166,7 +166,11 @@ return if(targeted) - if(flashed.flash_act(1, 1)) + var/flash_result = flashed.flash_act(1, 1) + if(flash_result == FLASH_COMPLETED) + return //Behavior was overwritten, so we just skip the flashy stunny part and go with the override behavior instead + + if(flash_result) flashed.set_confusion_if_lower(confusion_duration * CONFUSION_STACK_MAX_MULTIPLIER) visible_message(span_danger("[user] blinds [flashed] with the flash!"), span_userdanger("[user] blinds you with the flash!")) //easy way to make sure that you can only long stun someone who is facing in your direction diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index db1aaff322e..1a3629883b2 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -452,6 +452,9 @@ return embeds /mob/living/carbon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /atom/movable/screen/fullscreen/flash, length = 25) + if(SEND_SIGNAL(src, COMSIG_MOB_FLASH_OVERRIDE_CHECK, src) & FLASH_OVERRIDDEN) //Check for behavior overrides before doing the act itself. If we have a behavior override, we handle everything there and skip the rest + return FLASH_COMPLETED + var/obj/item/organ/eyes/eyes = get_organ_slot(ORGAN_SLOT_EYES) if(!eyes) //can't flash what can't see! return diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 82cfccfe3c8..d96f9587f91 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -32,6 +32,14 @@ BODY_ZONE_CHEST = /obj/item/bodypart/chest/shadow, ) +/datum/species/shadow/on_species_gain(mob/living/carbon/carbon_mob, datum/species/old_species, pref_load, regenerate_icons) + . = ..() + RegisterSignal(carbon_mob, COMSIG_MOB_FLASH_OVERRIDE_CHECK, PROC_REF(on_flashed)) + +/datum/species/shadow/on_species_loss(mob/living/carbon/human/human, datum/species/new_species, pref_load) + . = ..() + UnregisterSignal(human, COMSIG_MOB_FLASH_OVERRIDE_CHECK) + /datum/species/shadow/check_roundstart_eligible() if(check_holidays(HALLOWEEN)) return TRUE @@ -103,3 +111,23 @@ name = "shadowling tumor" desc = "Something that was once a brain, before being remolded by a shadowling. It has adapted to the dark, irreversibly." icon = 'icons/obj/medical/organs/shadow_organs.dmi' + +/datum/species/shadow/get_scream_sound(mob/living/carbon/human/moth) + return 'sound/mobs/humanoids/shadow/shadow_wail.ogg' + +/datum/species/shadow/proc/on_flashed(source, mob/living/carbon/flashed, flash, deviation) + SIGNAL_HANDLER + + if(deviation == DEVIATION_FULL) //If no deviation, we can assume it's a non-assembly flash and should do max flash damage. + flashed.apply_damage(16, BURN, attacking_item = flash) + flashed.adjust_confusion_up_to(3 SECONDS, 6 SECONDS) + else //If it's anything less than a full hit, it does less than stellar damage. Bear in mind that this damage is dished out much faster since flashes have a quicker cooldown on clicks. + flashed.apply_damage(8, BURN, attacking_item = flash) + flashed.adjust_confusion_up_to(1 SECONDS, 3 SECONDS) + + INVOKE_ASYNC(flashed, TYPE_PROC_REF(/mob, emote), "scream") + flashed.visible_message(span_danger("[flashed] wails in pain as a burst of light singes their flesh!"), \ + span_danger("You wail in pain as the sudden burst of light singes your flesh!"), \ + span_danger("Something wails in pain! It sounds like a terrifying monster! Good thing you can't see it, or you'd probably be freaking out right now.")) + + return FLASH_OVERRIDDEN diff --git a/sound/attributions.txt b/sound/attributions.txt index 767b5ec624a..9ffbe3d39ee 100644 --- a/sound/attributions.txt +++ b/sound/attributions.txt @@ -234,3 +234,5 @@ sound/effect/plasticflaps.ogg -- door_plastic_tapes.wav by estupe -- https://fre sound/effects/siren.ogg -- siren.wav by IFartInUrGeneralDirection -- https://freesound.org/s/46092/ -- License: Attribution 4.0 sound/mobs/non-humanoids/stoats/stoat_sound.ogg -- https://suche.tierstimmenarchiv.de/ + +sounds/mobs/humanoids/shadow/shadow_wail.ogg -- https://freesound.org/people/Robinhood76/sounds/585631/ -- License: Attribution 4.0 \ No newline at end of file diff --git a/sound/mobs/humanoids/shadow/shadow_wail.ogg b/sound/mobs/humanoids/shadow/shadow_wail.ogg new file mode 100644 index 00000000000..ac2a0ed24d1 Binary files /dev/null and b/sound/mobs/humanoids/shadow/shadow_wail.ogg differ