Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
/datum/behavior_delegate/ravager_berserker/melee_attack_additional_effects_self()
..()

if (rage != max_rage && !rage_cooldown_start_time)
if(rage != max_rage && !rage_cooldown_start_time)
rage = rage + 1
bound_xeno.armor_modifier += armor_buff_per_rage
bound_xeno.attack_speed_modifier -= attack_delay_buff_per_rage
Expand All @@ -67,7 +67,7 @@
bound_xeno.recalculate_speed()
last_slash_time = world.time

if (rage == max_rage)
if(rage == max_rage)
bound_xeno.add_filter("berserker_rage", 1, list("type" = "outline", "color" = "#000000ff", "size" = 1))
rage_lock()
to_chat(bound_xeno, SPAN_XENOHIGHDANGER("We feel a euphoric rush as we reach max rage! We are LOCKED at max Rage!"))
Expand All @@ -82,15 +82,15 @@

/datum/behavior_delegate/ravager_berserker/on_life()
// Compute our current rage (demerit if necessary)
if (((last_slash_time + rage_decay_time) < world.time) && !(rage <= 0))
if(((last_slash_time + rage_decay_time) < world.time) && !(rage <= 0))
decrement_rage()

// Handles internal state from decrementing rage
/datum/behavior_delegate/ravager_berserker/proc/decrement_rage(amount = 1)
if (rage_lock_start_time)
if(rage_lock_start_time)
return
var/real_amount = amount
if (amount > rage)
if(amount > rage)
real_amount = rage

rage -= real_amount
Expand All @@ -106,13 +106,13 @@
rage_lock_start_time = world.time
var/color = "#00000035"
bound_xeno.add_filter("empower_rage", 1, list("type" = "outline", "color" = color, "size" = 3))
addtimer(CALLBACK(src, PROC_REF(rage_lock_weaken)), rage_lock_duration/2)
addtimer(CALLBACK(src, PROC_REF(rage_lock_weaken)), rage_lock_duration / 2)

/datum/behavior_delegate/ravager_berserker/proc/rage_lock_weaken()
bound_xeno.remove_filter("empower_rage")
var/color = "#00000027"
bound_xeno.add_filter("empower_rage", 1, list("type" = "outline", "color" = color, "size" = 3))
addtimer(CALLBACK(src, PROC_REF(rage_lock_callback)), rage_cooldown_duration/2)
addtimer(CALLBACK(src, PROC_REF(rage_lock_callback)), rage_cooldown_duration / 2)


/datum/behavior_delegate/ravager_berserker/proc/rage_lock_callback()
Expand All @@ -121,7 +121,7 @@
rage_cooldown_start_time = world.time
decrement_rage(rage)
bound_xeno.remove_filter("berserker_rage")
to_chat(bound_xeno, SPAN_XENOWARNING("Our adrenal glands spasm. We cannot gain any rage for [rage_cooldown_duration/10] seconds."))
to_chat(bound_xeno, SPAN_XENOWARNING("Our adrenal glands spasm. We cannot gain any rage for [rage_cooldown_duration / 10] seconds."))
addtimer(CALLBACK(src, PROC_REF(rage_cooldown_callback)), rage_cooldown_duration)
bound_xeno.add_filter("berserker_lockdown", 1, list("type" = "outline", "color" = "#fcfcfcff", "size" = 1))

Expand All @@ -130,14 +130,14 @@
rage_cooldown_start_time = 0
return

/datum/behavior_delegate/ravager_berserker/melee_attack_modify_damage(original_damage, mob/living/carbon/A)
if (!isxeno_human(A))
/datum/behavior_delegate/ravager_berserker/melee_attack_modify_damage(original_damage, mob/living/carbon/target_carbon)
if(!isxeno_human(target_carbon))
return original_damage

if (next_slash_buffed)
to_chat(bound_xeno, SPAN_XENOHIGHDANGER("We significantly strengthen our attack, slowing [A]!"))
to_chat(A, SPAN_XENOHIGHDANGER("You feel a sharp pain as [bound_xeno] slashes you, slowing you down!"))
A.apply_effect(get_xeno_stun_duration(A, slash_slow_duration), SLOW)
if(next_slash_buffed)
to_chat(bound_xeno, SPAN_XENOHIGHDANGER("We significantly strengthen our attack, slowing [target_carbon]!"))
to_chat(target_carbon, SPAN_XENOHIGHDANGER("You feel a sharp pain as [bound_xeno] slashes you, slowing you down!"))
target_carbon.apply_effect(get_xeno_stun_duration(target_carbon, slash_slow_duration), SLOW)
next_slash_buffed = FALSE

return original_damage
Expand All @@ -148,20 +148,13 @@
/datum/action/xeno_action/onclick/apprehend/use_ability(atom/affected_atom)
var/mob/living/carbon/xenomorph/xeno = owner

if (!istype(xeno))
if(!istype(xeno))
return

if (!action_cooldown_check())
return

if (!xeno.check_state())
return

if (!check_and_use_plasma_owner())
return
XENO_ACTION_CHECK_USE_PLASMA(xeno)

var/datum/behavior_delegate/ravager_berserker/behavior = xeno.behavior_delegate
if (istype(behavior))
if(istype(behavior))
behavior.next_slash_buffed = TRUE

to_chat(xeno, SPAN_XENODANGER("Our next slash will slow!"))
Expand All @@ -180,19 +173,19 @@
/datum/action/xeno_action/onclick/apprehend/proc/apprehend_off()
var/mob/living/carbon/xenomorph/xeno = owner
xeno.remove_filter("apprehend_on")
if (istype(xeno))
if(istype(xeno))
xeno.speed_modifier += speed_buff
xeno.recalculate_speed()
to_chat(xeno, SPAN_XENOHIGHDANGER("We feel our speed wane!"))

/datum/action/xeno_action/onclick/apprehend/proc/unbuff_slash()
var/mob/living/carbon/xenomorph/xeno = owner
if (!istype(xeno))
if(!istype(xeno))
return
var/datum/behavior_delegate/ravager_berserker/behavior = xeno.behavior_delegate
if (istype(behavior))
if(istype(behavior))
// In case slash has already landed
if (!behavior.next_slash_buffed)
if(!behavior.next_slash_buffed)
return
behavior.next_slash_buffed = FALSE

Expand All @@ -202,17 +195,13 @@
/datum/action/xeno_action/activable/clothesline/use_ability(atom/affected_atom)
var/mob/living/carbon/xenomorph/xeno = owner

if (!action_cooldown_check())
return

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

if (!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom))
if(!isxeno_human(affected_atom) || xeno.can_not_harm(affected_atom))
to_chat(xeno, SPAN_XENOWARNING("We must target a hostile!"))
return

if (!xeno.Adjacent(affected_atom))
if(!xeno.Adjacent(affected_atom))
to_chat(xeno, SPAN_XENOWARNING("We must be adjacent to our target!"))
return

Expand All @@ -221,15 +210,15 @@
var/fling_distance = fling_dist_base
var/debilitate = TRUE // Do we apply neg. status effects to the target?

if (carbon.mob_size >= MOB_SIZE_BIG)
if(carbon.mob_size >= MOB_SIZE_BIG)
to_chat(xeno, SPAN_XENOWARNING("We creature is too massive to target."))
return

if (carbon.stat == DEAD)
if(carbon.stat == DEAD)
return

var/datum/behavior_delegate/ravager_berserker/behavior = xeno.behavior_delegate
if (behavior.rage >= 2)
if(behavior.rage >= 2)
behavior.decrement_rage()
heal_amount += additional_healing_enraged
else
Expand All @@ -253,16 +242,16 @@
var/turf/turf = get_turf(xeno)
var/turf/temp = turf

for (var/step in 0 to fling_distance-1)
for(var/step in 0 to fling_distance-1)
temp = get_step(turf, facing)
if (!temp)
if(!temp)
break
turf = temp

carbon.throw_atom(turf, fling_distance, SPEED_VERY_FAST, xeno, TRUE)

// Negative stat effects
if (debilitate)
if(debilitate)
carbon.AdjustDaze(daze_amount)

apply_cooldown()
Expand All @@ -271,11 +260,10 @@
/datum/action/xeno_action/activable/eviscerate/use_ability(atom/affected_atom)
var/mob/living/carbon/xenomorph/xeno = owner

if(!action_cooldown_check() || xeno.action_busy)
if(xeno.action_busy)
return

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

var/damage = base_damage
var/range = 1
Expand All @@ -285,7 +273,7 @@
var/lifesteal_range = 1

var/datum/behavior_delegate/ravager_berserker/behavior = xeno.behavior_delegate
if (behavior.rage == 0)
if(behavior.rage == 0)
to_chat(xeno, SPAN_XENODANGER("We cannot eviscerate when we have 0 rage!"))
return
damage = damage_at_rage_levels[clamp(behavior.rage, 1, behavior.max_rage)]
Expand All @@ -295,32 +283,32 @@

apply_cooldown()

if (range > 1)
if(range > 1)
xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] begins digging in for a massive strike!"), SPAN_XENOHIGHDANGER("We begin digging in for a massive strike!"))
else
xeno.visible_message(SPAN_XENODANGER("[xeno] begins digging in for a strike!"), SPAN_XENOHIGHDANGER("We begin digging in for a strike!"))

ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate"))
xeno.anchored = TRUE

if (do_after(xeno, (activation_delay - windup_reduction), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE))
if(do_after(xeno, (activation_delay - windup_reduction), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE))
xeno.emote("roar")
xeno.spin_circle()

for (var/mob/living/carbon/targets_to_hit in orange(xeno, range))
for(var/mob/living/carbon/targets_to_hit in orange(xeno, range))
if(!isxeno_human(targets_to_hit) || xeno.can_not_harm(targets_to_hit))
continue

if (targets_to_hit.stat == DEAD)
if(targets_to_hit.stat == DEAD)
continue

if (HAS_TRAIT(targets_to_hit, TRAIT_NESTED))
if(HAS_TRAIT(targets_to_hit, TRAIT_NESTED))
continue

if(!check_clear_path_to_target(xeno, targets_to_hit))
continue

if (range > 1)
if(range > 1)
xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] rips open the guts of [targets_to_hit]!"), SPAN_XENOHIGHDANGER("We rip open the guts of [targets_to_hit]!"))
targets_to_hit.spawn_gibs()
playsound(get_turf(targets_to_hit), 'sound/effects/gibbed.ogg', 30, 1)
Expand All @@ -334,11 +322,11 @@
var/valid_count = 0
var/list/mobs_in_range = oviewers(lifesteal_range, xeno)

for(var/mob/mob as anything in mobs_in_range)
if(mob.stat == DEAD || HAS_TRAIT(mob, TRAIT_NESTED))
for(var/mob/target_mob as anything in mobs_in_range)
if(target_mob.stat == DEAD || HAS_TRAIT(target_mob, TRAIT_NESTED))
continue

if(xeno.can_not_harm(mob))
if(xeno.can_not_harm(target_mob))
continue

valid_count++
Expand Down