Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Burrower burrow changes and fixes #3818

Merged
merged 1 commit into from
Jul 13, 2023
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
5 changes: 4 additions & 1 deletion code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
))

/*
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/defenses/sentry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/living_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added sound/effects/burrowing_b.ogg
Binary file not shown.
Binary file added sound/effects/burrowoff.ogg
Binary file not shown.