diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index dd700ccde996..ce17cf05f021 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -179,6 +179,8 @@ #define TRAIT_ABILITY_NO_PLASMA_TRANSFER "t_ability_no_plasma_transfer" /// Shows that the xeno queen is on ovi #define TRAIT_ABILITY_OVIPOSITOR "t_ability_ovipositor" +/// Used for burrowed mobs, prevent's SG/sentrys/claymores from autofiring +#define TRAIT_ABILITY_BURROWED "t_ability_burrowed" //-- item traits -- // TOOL TRAITS @@ -231,7 +233,8 @@ GLOBAL_LIST_INIT(mob_traits, list( TRAIT_TWOBORE_TRAINING, TRAIT_LEADERSHIP, TRAIT_DEXTROUS, - TRAIT_REAGENT_SCANNER + TRAIT_REAGENT_SCANNER, + TRAIT_ABILITY_BURROWED )) /* diff --git a/code/game/objects/items/explosives/mine.dm b/code/game/objects/items/explosives/mine.dm index 6b8c9bccd299..742a5f314c4a 100644 --- a/code/game/objects/items/explosives/mine.dm +++ b/code/game/objects/items/explosives/mine.dm @@ -198,6 +198,8 @@ return if(L.get_target_lock(iff_signal) || isrobot(L)) return + if(HAS_TRAIT(L, TRAIT_ABILITY_BURROWED)) + return L.visible_message(SPAN_DANGER("[icon2html(src, viewers(src))] The [name] clicks as [L] moves in front of it."), \ SPAN_DANGER("[icon2html(src, L)] The [name] clicks as you move in front of it."), \ SPAN_DANGER("You hear a click.")) diff --git a/code/modules/defenses/sentry.dm b/code/modules/defenses/sentry.dm index 946c347efaa0..fc52c254c0b8 100644 --- a/code/modules/defenses/sentry.dm +++ b/code/modules/defenses/sentry.dm @@ -370,7 +370,7 @@ targets.Remove(A) continue - if(M.get_target_lock(faction_group) || M.invisibility) + if(M.get_target_lock(faction_group) || M.invisibility || HAS_TRAIT(M, TRAIT_ABILITY_BURROWED)) if(M == target) target = null targets.Remove(M) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm index be772e3a0a4f..b12ff5d6c3bb 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm @@ -93,6 +93,9 @@ if (M.fortify || M.burrow) return XENO_NO_DELAY_ACTION + if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) + return XENO_NO_DELAY_ACTION + if(islarva(M)) //Larvas can't eat people M.visible_message(SPAN_DANGER("[M] nudges its head against \the [src]."), \ SPAN_DANGER("You nudge your head against \the [src]."), null, null, CHAT_TYPE_XENO_FLUFF) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index f1d03d6507b1..40d38c24085a 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -745,6 +745,8 @@ if(SEND_SIGNAL(AM, COMSIG_MOVABLE_XENO_START_PULLING, src) & COMPONENT_ALLOW_PULL) return do_pull(AM, lunge, no_msg) + if(burrow) + return if(!isliving(AM)) return FALSE var/mob/living/L = AM diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index 4f104c00f92e..4d3aae33ae9c 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -42,7 +42,12 @@ density = FALSE if(caste.fire_immunity == FIRE_IMMUNITY_NONE) RegisterSignal(src, COMSIG_LIVING_PREIGNITION, PROC_REF(fire_immune)) - RegisterSignal(src, COMSIG_LIVING_FLAMER_CROSSED, PROC_REF(flamer_crossed_immune)) + RegisterSignal(src, list( + COMSIG_LIVING_FLAMER_CROSSED, + COMSIG_LIVING_FLAMER_FLAMED, + ), PROC_REF(flamer_crossed_immune)) + ADD_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) + playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25) update_canmove() update_icons() addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) @@ -65,21 +70,29 @@ to_chat(src, SPAN_NOTICE("You resurface.")) burrow = FALSE if(caste.fire_immunity == FIRE_IMMUNITY_NONE) - UnregisterSignal(src, COMSIG_LIVING_PREIGNITION) - UnregisterSignal(src, COMSIG_LIVING_FLAMER_CROSSED) + UnregisterSignal(src, list( + COMSIG_LIVING_PREIGNITION, + COMSIG_LIVING_FLAMER_CROSSED, + COMSIG_LIVING_FLAMER_FLAMED, + )) + REMOVE_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) frozen = FALSE invisibility = FALSE anchored = FALSE density = TRUE - for(var/mob/living/carbon/human/H in loc) - H.apply_effect(2, WEAKEN) + playsound(loc, 'sound/effects/burrowoff.ogg', 25) + for(var/mob/living/carbon/mob in loc) + if(!can_not_harm(mob)) + mob.apply_effect(2, WEAKEN) + addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) update_canmove() update_icons() /mob/living/carbon/xenomorph/proc/do_burrow_cooldown() used_burrow = FALSE - to_chat(src, SPAN_NOTICE("You can now surface.")) + if(burrow) + to_chat(src, SPAN_NOTICE("You can now surface.")) for(var/X in actions) var/datum/action/act = X act.update_button_icon() diff --git a/code/modules/mob/living/living_verbs.dm b/code/modules/mob/living/living_verbs.dm index 9b003562825d..fe95f14182ea 100644 --- a/code/modules/mob/living/living_verbs.dm +++ b/code/modules/mob/living/living_verbs.dm @@ -11,6 +11,12 @@ to_chat(src, SPAN_WARNING("You can't resist in your current state.")) return + if(isxeno(src)) + var/mob/living/carbon/xenomorph/xeno = src + if(xeno.burrow) + to_chat(src, SPAN_WARNING("You can't resist in your current state.")) + return + resisting = TRUE next_move = world.time + 20 diff --git a/sound/effects/burrowing_b.ogg b/sound/effects/burrowing_b.ogg new file mode 100644 index 000000000000..cc44a8e19282 Binary files /dev/null and b/sound/effects/burrowing_b.ogg differ diff --git a/sound/effects/burrowoff.ogg b/sound/effects/burrowoff.ogg new file mode 100644 index 000000000000..66f10b253612 Binary files /dev/null and b/sound/effects/burrowoff.ogg differ