Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Acid dash changes + xeno charge fixes (#488)
Browse files Browse the repository at this point in the history
* dash

* .

* pizdec
  • Loading branch information
MeowEmiya authored Mar 26, 2024
1 parent ec2347a commit c984915
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 265 deletions.
4 changes: 3 additions & 1 deletion code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@

#define COMSIG_XENO_PSYCHIC_LINK_REMOVED "xeno_psychic_link_removed"

#define COMSIG_XENOMORPH_LEAP_BUMP "xenomorph_leap_bump" //from /mob/living/carbon/xenomorph/bump

//human signals
#define COMSIG_CLICK_QUICKEQUIP "click_quickequip"

Expand Down Expand Up @@ -757,7 +759,7 @@
#define COMSIG_XENOABILITY_TRANSFER_PLASMA "xenoability_transfer_plasma"
#define COMSIG_XENOABILITY_CORROSIVE_ACID "xenoability_corrosive_acid"
#define COMSIG_XENOABILITY_SPRAY_ACID "xenoability_spray_acid"
#define COMSIG_XENOABILITY_ACID_DASH "xenoability_acid_dash"
#define COMSIG_XENOABILITY_DASH "xenoability_dash"
#define COMSIG_XENOABILITY_XENO_SPIT "xenoability_xeno_spit"
#define COMSIG_XENOABILITY_HIDE "xenoability_hide"
#define COMSIG_XENOABILITY_NEUROTOX_STING "xenoability_neurotox_sting"
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA


//Xeno Defines
//Xeno flags
///Xeno is currently performing a leap/dash attack
#define XENO_LEAPING (1<<0)

#define XENO_DEFAULT_VENT_ENTER_TIME 4.5 SECONDS //Standard time for a xeno to enter a vent.
#define XENO_DEFAULT_VENT_EXIT_TIME 2 SECONDS //Standard time for a xeno to exit a vent.
Expand Down Expand Up @@ -725,6 +728,8 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA
#define TIME_TO_DISSOLVE 5 SECONDS
#define SPIDERLING_RAGE_RANGE 10 // how close a nearby human has to be in order to be targeted
*/
//Praetorian defines
#define PRAE_CHARGEDISTANCE 6

//misc

Expand Down
10 changes: 5 additions & 5 deletions code/datums/keybinding/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,11 @@
description = "Summons all xenos in a hive to the caller's location, uses all plasma to activate."
keybind_signal = COMSIG_XENOABILITY_HIVE_SUMMON

/datum/keybinding/xeno/acid_dash
name = "acid_dash"
full_name = "Praetorian: Acid Dash"
description = "Quickly dash, leaving acid in your path and knocking down the first marine hit. Has reset potential."
keybind_signal = COMSIG_XENOABILITY_ACID_DASH
/datum/keybinding/xeno/dash
name = "dash"
full_name = "Praetorian: Dash"
description = "Quickly dash forward."
keybind_signal = COMSIG_XENOABILITY_DASH
hotkey_keys = list("E")

/datum/keybinding/xeno/screech
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/action/ability/activable/xeno/forward_charge/unprecise
/datum/action/ability/activable/xeno/charge/forward_charge/unprecise
cooldown_duration = 30 SECONDS

/datum/action/ability/activable/xeno/forward_charge/unprecise/use_ability(atom/A)
/datum/action/ability/activable/xeno/charge/forward_charge/unprecise/use_ability(atom/A)
return ..(get_turf(A))
13 changes: 0 additions & 13 deletions code/modules/mob/living/carbon/xenomorph/castes/beetle/beetle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,3 @@
tier = XENO_TIER_MINION
upgrade = XENO_UPGRADE_BASETYPE
pull_speed = -2

/mob/living/carbon/xenomorph/beetle/Bump(atom/A)
if(!throwing || !throw_source || !thrower)
return ..()
if(!ishuman(A))
return ..()
var/mob/living/carbon/human/H = A
var/extra_dmg = xeno_caste.melee_damage * xeno_melee_damage_modifier * 0.5 // 50% dmg reduction
H.attack_alien_harm(src, extra_dmg, FALSE, TRUE, FALSE, TRUE) //Location is always random, cannot crit, harm only
var/target_turf = get_step_away(src, H, rand(1, 2)) //This is where we blast our target
target_turf = get_step_rand(target_turf) //Scatter
H.throw_at(get_turf(target_turf), 4, 5, H)
H.Paralyze(2 SECONDS)
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@

actions = list(
/datum/action/ability/xeno_action/xeno_resting,
/datum/action/ability/activable/xeno/forward_charge/unprecise,
/datum/action/ability/activable/xeno/charge/forward_charge/unprecise,
)
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
// ***************************************
// *********** Forward Charge
// ***************************************
/datum/action/ability/activable/xeno/forward_charge
/datum/action/ability/activable/xeno/charge/forward_charge
name = "Forward Charge"
action_icon_state = "pounce"
desc = "Charge up to 4 tiles and knockdown any targets in our way."
Expand All @@ -100,87 +100,64 @@
keybinding_signals = list(
KEYBINDING_NORMAL = COMSIG_XENOABILITY_FORWARD_CHARGE,
)
charge_range = DEFENDER_CHARGE_RANGE
///How long is the windup before charging
var/windup_time = 0.5 SECONDS

/datum/action/ability/activable/xeno/forward_charge/proc/charge_complete()
SIGNAL_HANDLER
UnregisterSignal(owner, list(COMSIG_XENO_OBJ_THROW_HIT, COMSIG_XENO_LIVING_THROW_HIT, COMSIG_MOVABLE_POST_THROW))

/datum/action/ability/activable/xeno/forward_charge/proc/mob_hit(datum/source, mob/M)
SIGNAL_HANDLER
if(M.stat || isxeno(M))
return
return COMPONENT_KEEP_THROWING

/datum/action/ability/activable/xeno/forward_charge/proc/obj_hit(datum/source, obj/target, speed)
SIGNAL_HANDLER
if(istype(target, /obj/structure/table))
var/obj/structure/S = target
owner.visible_message(span_danger("[owner] plows straight through [S]!"), null, null, 5)
S.deconstruct(FALSE) //We want to continue moving, so we do not reset throwing.
return // stay registered
target.hitby(owner, speed) //This resets throwing.
charge_complete()

/datum/action/ability/activable/xeno/forward_charge/can_use_ability(atom/A, silent = FALSE, override_flags)
. = ..()
if(!.)
return FALSE
/datum/action/ability/activable/xeno/charge/forward_charge/use_ability(atom/A)
if(!A)
return FALSE

/datum/action/ability/activable/xeno/forward_charge/on_cooldown_finish()
to_chat(owner, span_xenodanger("Our exoskeleton quivers as we get ready to use Forward Charge again."))
playsound(owner, "sound/effects/xeno_newlarva.ogg", 50, 0, 1)
return ..()

/datum/action/ability/activable/xeno/forward_charge/use_ability(atom/A)
var/mob/living/carbon/xenomorph/X = owner
return
var/mob/living/carbon/xenomorph/xeno_owner = owner

if(!do_after(X, windup_time, IGNORE_HELD_ITEM, X, BUSY_ICON_DANGER, extra_checks = CALLBACK(src, PROC_REF(can_use_ability), A, FALSE, ABILITY_USE_BUSY)))
if(!do_after(xeno_owner, windup_time, IGNORE_HELD_ITEM, xeno_owner, BUSY_ICON_DANGER, extra_checks = CALLBACK(src, PROC_REF(can_use_ability), A, FALSE, ABILITY_USE_BUSY)))
return fail_activate()

var/mob/living/carbon/xenomorph/defender/defender = X
var/mob/living/carbon/xenomorph/defender/defender = xeno_owner
if(defender.fortify)
var/datum/action/ability/xeno_action/fortify/fortify_action = X.actions_by_path[/datum/action/ability/xeno_action/fortify]
var/datum/action/ability/xeno_action/fortify/fortify_action = xeno_owner.actions_by_path[/datum/action/ability/xeno_action/fortify]

fortify_action.set_fortify(FALSE, TRUE)
fortify_action.add_cooldown()
to_chat(X, span_xenowarning("We rapidly untuck ourselves, preparing to surge forward."))
to_chat(xeno_owner, span_xenowarning("We rapidly untuck ourselves, preparing to surge forward."))

X.visible_message(span_danger("[X] charges towards \the [A]!"), \
xeno_owner.visible_message(span_danger("[xeno_owner] charges towards \the [A]!"), \
span_danger("We charge towards \the [A]!") )
X.emote("roar")
xeno_owner.emote("roar")
succeed_activate()

RegisterSignal(X, COMSIG_XENO_OBJ_THROW_HIT, PROC_REF(obj_hit),)
RegisterSignal(X, COMSIG_XENO_LIVING_THROW_HIT, PROC_REF(mob_hit))
RegisterSignal(X, COMSIG_MOVABLE_POST_THROW, PROC_REF(charge_complete))
RegisterSignal(xeno_owner, COMSIG_XENO_OBJ_THROW_HIT, PROC_REF(obj_hit))
RegisterSignal(xeno_owner, COMSIG_XENOMORPH_LEAP_BUMP, PROC_REF(mob_hit))
RegisterSignal(xeno_owner, COMSIG_MOVABLE_POST_THROW, PROC_REF(charge_complete))
xeno_owner.xeno_flags |= XENO_LEAPING

X.throw_at(A, DEFENDER_CHARGE_RANGE, 5, X)
xeno_owner.throw_at(A, charge_range, 5, xeno_owner)

add_cooldown()

/datum/action/ability/activable/xeno/forward_charge/ai_should_start_consider()
return TRUE

/datum/action/ability/activable/xeno/forward_charge/ai_should_use(atom/target)
if(!iscarbon(target))
return FALSE
if(!line_of_sight(owner, target, DEFENDER_CHARGE_RANGE))
return FALSE
if(!can_use_action(override_flags = ABILITY_IGNORE_SELECTED_ABILITY))
return FALSE
if(target.get_xeno_hivenumber() == owner.get_xeno_hivenumber())
return FALSE
/datum/action/ability/activable/xeno/charge/forward_charge/mob_hit(datum/source, mob/living/living_target)
. = TRUE
if(living_target.stat || isxeno(living_target) || !(iscarbon(living_target))) //we leap past xenos
return
var/mob/living/carbon/xenomorph/xeno_owner = owner
var/mob/living/carbon/carbon_victim = living_target
var/extra_dmg = xeno_owner.xeno_caste.melee_damage * xeno_owner.xeno_melee_damage_modifier * 0.5 // 50% dmg reduction
carbon_victim.attack_alien_harm(xeno_owner, extra_dmg, FALSE, TRUE, FALSE, TRUE) //Location is always random, cannot crit, harm only
var/target_turf = get_ranged_target_turf(carbon_victim, get_dir(src, carbon_victim), rand(1, 2)) //we blast our victim behind us
target_turf = get_step_rand(target_turf) //Scatter
carbon_victim.throw_at(get_turf(target_turf), charge_range, 5, src)
carbon_victim.Paralyze(4 SECONDS)

/datum/action/ability/activable/xeno/charge/forward_charge/ai_should_use(atom/target)
. = ..()
if(!.)
return
action_activate()
LAZYINCREMENT(owner.do_actions, target)
addtimer(CALLBACK(src, PROC_REF(decrease_do_action), target), windup_time)
return TRUE

///Decrease the do_actions of the owner
/datum/action/ability/activable/xeno/forward_charge/proc/decrease_do_action(atom/target)
/datum/action/ability/activable/xeno/charge/forward_charge/proc/decrease_do_action(atom/target)
LAZYDECREMENT(owner.do_actions, target)

// ***************************************
Expand Down Expand Up @@ -316,7 +293,7 @@
CD.add_cooldown()
to_chat(X, span_xenowarning("We tuck our lowered crest into ourselves."))

var/datum/action/ability/activable/xeno/forward_charge/combo_cooldown = X.actions_by_path[/datum/action/ability/activable/xeno/forward_charge]
var/datum/action/ability/activable/xeno/charge/forward_charge/combo_cooldown = X.actions_by_path[/datum/action/ability/activable/xeno/charge/forward_charge]
combo_cooldown.add_cooldown(cooldown_duration)

set_fortify(TRUE, was_crested)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/datum/action/ability/activable/xeno/psydrain,
/datum/action/ability/xeno_action/toggle_crest_defense,
/datum/action/ability/xeno_action/fortify,
/datum/action/ability/activable/xeno/forward_charge,
/datum/action/ability/activable/xeno/charge/forward_charge,
/datum/action/ability/xeno_action/tail_sweep,
/datum/action/ability/xeno_action/regenerate_skin,
)
Expand All @@ -75,7 +75,7 @@
/datum/action/ability/activable/xeno/psydrain,
/datum/action/ability/xeno_action/toggle_crest_defense,
/datum/action/ability/xeno_action/fortify,
/datum/action/ability/activable/xeno/forward_charge,
/datum/action/ability/activable/xeno/charge/forward_charge,
/datum/action/ability/xeno_action/tail_sweep,
/datum/action/ability/xeno_action/regenerate_skin,
/datum/action/ability/xeno_action/centrifugal_force,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@
// ***************************************
// *********** Mob overrides
// ***************************************
/mob/living/carbon/xenomorph/defender/Bump(atom/A)
if(!throwing || !throw_source || !thrower)
return ..()
if(!ishuman(A))
return ..()
var/mob/living/carbon/human/human_victim = A
var/extra_dmg = xeno_caste.melee_damage * xeno_melee_damage_modifier * 0.5 // 50% dmg reduction
human_victim.attack_alien_harm(src, extra_dmg, FALSE, TRUE, FALSE, TRUE) //Location is always random, cannot crit, harm only
var/target_turf = get_ranged_target_turf(human_victim, get_dir(src, human_victim), rand(1, 2)) //we blast our victim behind us
target_turf = get_step_rand(target_turf) //Scatter
human_victim.throw_at(get_turf(target_turf), DEFENDER_CHARGE_RANGE, 5, src)
human_victim.Paralyze(4 SECONDS)

/mob/living/carbon/xenomorph/defender/Initialize(mapload)
. = ..()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ RU TGMC EDIT */
/datum/action/ability/activable/xeno/pounce/on_cooldown_finish()
owner.balloon_alert(owner, "Pounce ready")
owner.playsound_local(owner, 'sound/effects/xeno_newlarva.ogg', 25, 0, 1)
var/mob/living/carbon/xenomorph/xeno_owner = owner
xeno_owner.usedPounce = FALSE
return ..()

/datum/action/ability/activable/xeno/pounce/can_use_ability(atom/A, silent = FALSE, override_flags)
Expand All @@ -303,11 +301,11 @@ RU TGMC EDIT */
owner.buckled.unbuckle_mob(owner)
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(movement_fx))
RegisterSignal(owner, COMSIG_XENO_OBJ_THROW_HIT, PROC_REF(object_hit))
RegisterSignal(owner, COMSIG_XENO_LIVING_THROW_HIT, PROC_REF(mob_hit))
RegisterSignal(owner, COMSIG_XENOMORPH_LEAP_BUMP, PROC_REF(mob_hit))
RegisterSignal(owner, COMSIG_MOVABLE_POST_THROW, PROC_REF(pounce_complete))
SEND_SIGNAL(owner, COMSIG_XENOMORPH_POUNCE)
var/mob/living/carbon/xenomorph/xeno_owner = owner
xeno_owner.usedPounce = TRUE
xeno_owner.xeno_flags |= XENO_LEAPING
xeno_owner.pass_flags |= PASS_LOW_STRUCTURE|PASS_FIRE|PASS_XENO
xeno_owner.throw_at(A, pounce_range, XENO_POUNCE_SPEED, xeno_owner)
addtimer(CALLBACK(src, PROC_REF(reset_pass_flags)), 0.6 SECONDS)
Expand All @@ -325,25 +323,30 @@ RU TGMC EDIT */

/datum/action/ability/activable/xeno/pounce/proc/mob_hit(datum/source, mob/living/living_target)
SIGNAL_HANDLER
if(living_target.stat)
. = TRUE
if(living_target.stat || isxeno(living_target)) //we leap past xenos
return

var/mob/living/carbon/xenomorph/xeno_owner = owner
if(ishuman(living_target) && (living_target.dir in reverse_nearby_direction(living_target.dir)))
var/mob/living/carbon/human/human_target = living_target
if(!human_target.check_shields(COMBAT_TOUCH_ATTACK, 30, "melee"))
xeno_owner.Paralyze(XENO_POUNCE_SHIELD_STUN_DURATION)
xeno_owner.set_throwing(FALSE)
return COMPONENT_KEEP_THROWING
return
playsound(living_target.loc, 'sound/voice/alien_pounce.ogg', 25, TRUE)
xeno_owner.set_throwing(FALSE)
xeno_owner.Immobilize(XENO_POUNCE_STANDBY_DURATION)
xeno_owner.forceMove(get_turf(living_target))
living_target.Knockdown(XENO_POUNCE_STUN_DURATION)
pounce_complete()

/datum/action/ability/activable/xeno/pounce/proc/pounce_complete()
SIGNAL_HANDLER
UnregisterSignal(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_XENO_OBJ_THROW_HIT, COMSIG_XENO_LIVING_THROW_HIT, COMSIG_MOVABLE_POST_THROW))
UnregisterSignal(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_XENO_OBJ_THROW_HIT, COMSIG_XENOMORPH_LEAP_BUMP, COMSIG_MOVABLE_POST_THROW))
SEND_SIGNAL(owner, COMSIG_XENOMORPH_POUNCE_END)
var/mob/living/carbon/xenomorph/xeno_owner = owner
xeno_owner.xeno_flags &= ~XENO_LEAPING

/datum/action/ability/activable/xeno/pounce/proc/reset_pass_flags()
var/mob/living/carbon/xenomorph/xeno_owner = owner
Expand All @@ -363,6 +366,20 @@ RU TGMC EDIT */
return FALSE
return TRUE

/datum/action/ability/activable/xeno/pounce/ai_should_start_consider()
return TRUE

/datum/action/ability/activable/xeno/pounce/ai_should_use(atom/target)
if(!iscarbon(target))
return FALSE
if(!line_of_sight(owner, target, pounce_range))
return FALSE
if(!can_use_ability(target, override_flags = ABILITY_IGNORE_SELECTED_ABILITY))
return FALSE
if(target.get_xeno_hivenumber() == owner.get_xeno_hivenumber())
return FALSE
return TRUE


// ***************************************
// *********** Hunter's Mark
Expand Down
Loading

0 comments on commit c984915

Please sign in to comment.