Skip to content
Open
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
6 changes: 5 additions & 1 deletion code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
/// If the mob won't drop items held in face slot when downed
#define TRAIT_IRON_TEETH "t_iron_teeth"

// -- ability traits --
// -- general ability traits --
/// Xenos with this trait cannot have plasma transferred to them
#define TRAIT_ABILITY_NO_PLASMA_TRANSFER "t_ability_no_plasma_transfer"
/// Shows that the xeno queen is on ovi
Expand All @@ -267,6 +267,10 @@
#define TRAIT_ABILITY_BURROWED "t_ability_burrowed"
/// Xenos with this trait can toggle long sight while resting.
#define TRAIT_ABILITY_SIGHT_IGNORE_REST "t_ability_sight_ignore_rest"


// -- specific ability traits --
#define TRAIT_ABILITY_BOMBARD "t_ability_bombard"
/// Used by shielder to check stance.
#define TRAIT_ABILITY_ENCLOSED_PLATES "t_ability_enclosed_plates"
/// Used by shielder for reflective plates.
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -806,3 +806,7 @@
#define FACEHUGGER_JUMP_RANGE 1 // dont really want them to hug you immediately as you break down a corner or a door when a carrier stacks them on a tile
#define EGG_JUMP_RANGE 2 // This is for egg huggers, they are supposed to be scary and leap at people yes.
#define CARRIER_HUGGER_THROW_RANGE 6

// defines below should only be used in ability actions.
#define XENO_ACTION_CHECK(X) if(!X.check_state() || !action_cooldown_check() || !check_plasma_owner(src.plasma_cost)) return
#define XENO_ACTION_CHECK_USE_PLASMA(X) if(!X.check_state() || !action_cooldown_check() || !check_and_use_plasma_owner(src.plasma_cost)) return
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@
ability_uses_acid_overlay = TRUE

/// Var that keeps track of in-progress wind-up spits like Bombard to prevent spitting multiple spits at the same time
var/spitting = FALSE
var/sound_to_play = "acid_spit"
var/aim_turf = FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,52 +911,48 @@
return FALSE
return TRUE

/datum/action/xeno_action/activable/xeno_spit/use_ability(atom/atom)
/datum/action/xeno_action/activable/xeno_spit/use_ability(atom/target_atom)
var/mob/living/carbon/xenomorph/xeno = owner
var/spit_target = aim_turf ? get_turf(atom) : atom
if(!xeno.check_state())
return
var/spit_target = aim_turf ? get_turf(target_atom) : target_atom

if(spitting)
to_chat(src, SPAN_WARNING("We are already preparing a spit!"))
if(HAS_TRAIT(xeno, TRAIT_ABILITY_BOMBARD))
to_chat(xeno, SPAN_WARNING("We are already preparing a spit!"))
return

if(!isturf(xeno.loc))
to_chat(src, SPAN_WARNING("We can't spit from here!"))
to_chat(xeno, SPAN_WARNING("We can't spit from here!"))
return

if(!action_cooldown_check())
to_chat(src, SPAN_WARNING("We must wait for our spit glands to refill."))
to_chat(xeno, SPAN_WARNING("We must wait for our spit glands to refill."))
return

var/turf/current_turf = get_turf(xeno)

if(!current_turf)
return

if (!check_plasma_owner())
return
XENO_ACTION_CHECK(xeno)

if(xeno.ammo.spit_windup)
spitting = TRUE
ADD_TRAIT(xeno, TRAIT_ABILITY_BOMBARD, TRAIT_SOURCE_ABILITY("bombard"))
if(xeno.ammo.pre_spit_warn)
playsound(xeno.loc,"alien_drool", 55, 1)
to_chat(xeno, SPAN_WARNING("We begin to prepare a large spit!"))
xeno.visible_message(SPAN_WARNING("[xeno] prepares to spit a massive glob!"),
SPAN_WARNING("We begin to spit [xeno.ammo.name]!"))
if (!do_after(xeno, xeno.ammo.spit_windup, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE))
if(!do_after(xeno, xeno.ammo.spit_windup, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE))
to_chat(xeno, SPAN_XENODANGER("We decide to cancel our spit."))
spitting = FALSE
REMOVE_TRAIT(xeno, TRAIT_ABILITY_BOMBARD, TRAIT_SOURCE_ABILITY("bombard"))
return
plasma_cost = xeno.ammo.spit_cost

if(!check_and_use_plasma_owner())
spitting = FALSE
REMOVE_TRAIT(xeno, TRAIT_ABILITY_BOMBARD, TRAIT_SOURCE_ABILITY("bombard"))
return

xeno.visible_message(SPAN_XENOWARNING("[xeno] spits at [atom]!"),
xeno.visible_message(SPAN_XENOWARNING("[xeno] spits at [target_atom]!"),

SPAN_XENOWARNING("We spit [xeno.ammo.name] at [atom]!") )
SPAN_XENOWARNING("We spit [xeno.ammo.name] at [target_atom]!") )
playsound(xeno.loc, sound_to_play, 25, 1)

var/obj/projectile/proj = new (current_turf, create_cause_data(xeno.ammo.name, xeno))
Expand All @@ -965,8 +961,7 @@
proj.def_zone = xeno.get_limbzone_target()
proj.fire_at(spit_target, xeno, xeno, xeno.ammo.max_range, xeno.ammo.shell_speed)

spitting = FALSE

REMOVE_TRAIT(xeno, TRAIT_ABILITY_BOMBARD, TRAIT_SOURCE_ABILITY("bombard"))
SEND_SIGNAL(xeno, COMSIG_XENO_POST_SPIT)

apply_cooldown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,3 @@

/datum/action/xeno_action/proc/on_deselect(mob/user)
return

#define XENO_ACTION_CHECK(X) if(!X.check_state() || !action_cooldown_check() || !check_plasma_owner(src.plasma_cost)) return
#define XENO_ACTION_CHECK_USE_PLASMA(X) if(!X.check_state() || !action_cooldown_check() || !check_and_use_plasma_owner(src.plasma_cost)) return
18 changes: 7 additions & 11 deletions code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
. = ..()
var/mob/living/carbon/xenomorph/xeno = owner
if(!action_cooldown_check()) // activate c/d only if we already spit
for (var/action_type in action_types_to_cd)
for(var/action_type in action_types_to_cd)
var/datum/action/xeno_action/xeno_action = get_action(xeno, action_type)
if (!istype(xeno_action))
if(!istype(xeno_action))
continue

xeno_action.apply_cooldown_override(cooldown_duration)
Expand All @@ -113,21 +113,17 @@
/datum/action/xeno_action/onclick/acid_shroud/use_ability(atom/affected_atom)
var/datum/effect_system/smoke_spread/xeno_acid/spicy_gas
var/mob/living/carbon/xenomorph/xeno = owner
if (!isxeno(owner))
if(!isxeno(owner))
return

if (!action_cooldown_check())
return

if (!xeno.check_state())
return
XENO_ACTION_CHECK(xeno)

if(sound_play)
playsound(xeno,"acid_strike", 35, 1)
sound_play = FALSE
addtimer(VARSET_CALLBACK(src, sound_play, TRUE), 2 SECONDS)

if (!do_after(xeno, xeno.ammo.spit_windup/6.5, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE, numticks = 2)) /// 0.7 seconds
if(!do_after(xeno, xeno.ammo.spit_windup / 6.5, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE, numticks = 2)) /// 0.7 seconds
to_chat(xeno, SPAN_XENODANGER("We decide to cancel our gas shroud."))
return

Expand All @@ -144,9 +140,9 @@
spicy_gas.start()
to_chat(xeno, SPAN_XENOHIGHDANGER("We dump our acid through our pores, creating a shroud of gas!"))

for (var/action_type in action_types_to_cd)
for(var/action_type in action_types_to_cd)
var/datum/action/xeno_action/xeno_action = get_action(xeno, action_type)
if (!istype(xeno_action))
if(!istype(xeno_action))
continue

xeno_action.apply_cooldown_override(cooldown_duration)
Expand Down