diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 3df635790a5e2..e8f014b0962d0 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -267,12 +267,16 @@ #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_CREST "t_ability_crest" +#define TRAIT_ABILITY_FORTIFY "t_ability_fortify" /// Used by shielder to check stance. #define TRAIT_ABILITY_ENCLOSED_PLATES "t_ability_enclosed_plates" /// Used by shielder for reflective plates. #define TRAIT_ABILITY_REFLECTIVE_PLATES "t_ability_reflective_plates" - //-- item traits -- // TOOL TRAITS #define TRAIT_TOOL_SCREWDRIVER "t_tool_screwdriver" diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index ff5348756c8ae..d44c52e384542 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -285,7 +285,7 @@ GLOBAL_LIST_EMPTY(deevolved_ckeys) to_chat(src, SPAN_WARNING("We must be at full health to evolve.")) return FALSE - if(fortify || crest_defense || stealth || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(src, TRAIT_ABILITY_CREST) || stealth || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) to_chat(src, SPAN_WARNING("We cannot evolve while in this stance.")) return FALSE @@ -326,7 +326,7 @@ GLOBAL_LIST_EMPTY(deevolved_ckeys) if(tier == 0 || tier == 4) to_chat(src, SPAN_XENOWARNING("We can't transmute.")) return - if(fortify || crest_defense || stealth) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(src, TRAIT_ABILITY_CREST) || stealth) to_chat(src, SPAN_XENOWARNING("We can't transmute while in this stance.")) return if(lock_evolve) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm index 816ba1fb8c7f4..c712824c3619e 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoAttacks.dm @@ -109,7 +109,7 @@ //Hot hot Aliens on Aliens action. //Actually just used for eating people. /mob/living/carbon/xenomorph/attack_alien(mob/living/carbon/xenomorph/xeno) - if(xeno.fortify || HAS_TRAIT(xeno, TRAIT_ABILITY_BURROWED) || HAS_TRAIT(xeno, TRAIT_ABILITY_REFLECTIVE_PLATES)) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(xeno, TRAIT_ABILITY_BURROWED) || HAS_TRAIT(xeno, TRAIT_ABILITY_REFLECTIVE_PLATES)) return XENO_NO_DELAY_ACTION if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index ce4d8f9c4af50..a0f0e2d2d29f4 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -296,8 +296,6 @@ var/tunnel = FALSE /// for check on lurker invisibility var/stealth = FALSE - var/fortify = FALSE - var/crest_defense = FALSE /// For drones/hivelords. Extends the maximum build range they have var/extra_build_dist = 0 /// tiles from self you can plant eggs. diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index ec981e3d9ce13..ddab4c9ee513e 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -98,7 +98,7 @@ to_chat(src, SPAN_WARNING("No time to rest, must KILL!")) return - if(fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) to_chat(src, SPAN_WARNING("We cannot rest while fortified!")) return @@ -106,7 +106,7 @@ to_chat(src, SPAN_WARNING("We cannot rest while burrowed!")) return - if(crest_defense) + if(HAS_TRAIT(src, TRAIT_ABILITY_CREST)) to_chat(src, SPAN_WARNING("We cannot rest while our crest is down!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index 3a2098f14bea3..375dd3ce124f8 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -9,7 +9,7 @@ // this proc could use refactoring at some point /mob/living/carbon/human/attack_alien(mob/living/carbon/xenomorph/attacking_xeno, dam_bonus, unblockable = FALSE) - if(attacking_xeno.fortify || HAS_TRAIT(attacking_xeno, TRAIT_ABILITY_BURROWED) || HAS_TRAIT(attacking_xeno, TRAIT_ABILITY_REFLECTIVE_PLATES)) + if(HAS_TRAIT(attacking_xeno, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(attacking_xeno, TRAIT_ABILITY_BURROWED) || HAS_TRAIT(attacking_xeno, TRAIT_ABILITY_REFLECTIVE_PLATES)) return XENO_NO_DELAY_ACTION if(HAS_TRAIT(src, TRAIT_HAULED)) @@ -253,7 +253,7 @@ //Every other type of nonhuman mob /mob/living/attack_alien(mob/living/carbon/xenomorph/xeno) - if(xeno.fortify || HAS_TRAIT(xeno, TRAIT_ABILITY_BURROWED)) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(xeno, TRAIT_ABILITY_BURROWED)) return XENO_NO_DELAY_ACTION switch(xeno.a_intent) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm index c14045216b4ed..c4a576dbe7357 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm @@ -64,26 +64,45 @@ pelt = /obj/item/pelt/defender /mob/living/carbon/xenomorph/defender/handle_special_state() - if(fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) return TRUE - if(crest_defense) + if(HAS_TRAIT(src, TRAIT_ABILITY_CREST)) return TRUE return FALSE /mob/living/carbon/xenomorph/defender/handle_special_wound_states(severity) . = ..() - if(fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) return "Defender_fortify_[severity]" - if(crest_defense) + if(HAS_TRAIT(src, TRAIT_ABILITY_CREST)) return "Defender_crest_[severity]" /mob/living/carbon/xenomorph/defender/handle_special_backpack_states() . = ..() - if(fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) return " Fortify" - if(crest_defense) + if(HAS_TRAIT(src, TRAIT_ABILITY_CREST)) return " Crest" +/mob/living/carbon/xenomorph/defender/ex_act() + . = ..() + if(HAS_TRAIT(src, TRAIT_INCAPACITATED) && HAS_TRAIT(src, TRAIT_FLOORED)) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) + var/datum/action/xeno_action/activable/fortify/fortify_used = get_action(src, /datum/action/xeno_action/activable/fortify) + fortify_used.stop_fortify() + +/mob/living/carbon/xenomorph/defender/death() + var/datum/action/xeno_action/activable/fortify/fortify_used = get_action(src, /datum/action/xeno_action/activable/fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) + fortify_used.stop_fortify() + + var/datum/action/xeno_action/onclick/toggle_crest/crest_used = get_action(src, /datum/action/xeno_action/onclick/toggle_crest) + if(HAS_TRAIT(src, TRAIT_ABILITY_CREST)) + crest_used.stop_crest() + + return ..() + + /datum/behavior_delegate/defender_base name = "Base Defender Behavior Delegate" @@ -91,65 +110,62 @@ if(bound_xeno.stat == DEAD) return - if(bound_xeno.fortify && bound_xeno.health > 0) - bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Defender Fortify" - return TRUE - if(bound_xeno.crest_defense && bound_xeno.health > 0) - bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Defender Crest" - return TRUE + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) + if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_FORTIFY) && bound_xeno.health > 0) + bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Defender Fortify" + return TRUE + if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_CREST) && bound_xeno.health > 0) + bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Defender Crest" + return TRUE -/datum/action/xeno_action/onclick/toggle_crest/use_ability(atom/target) - var/mob/living/carbon/xenomorph/xeno = owner - if (!istype(xeno)) - return + else + bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Defender Knocked Down" - if(xeno.fortify) - to_chat(xeno, SPAN_XENOWARNING("We cannot use abilities while fortified.")) - return - if(!xeno.check_state()) +/datum/action/xeno_action/onclick/toggle_crest/use_ability(atom/target_atom) + var/mob/living/carbon/xenomorph/xeno = owner + if(!istype(xeno)) return - if(!action_cooldown_check()) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY)) + to_chat(xeno, SPAN_XENOWARNING("We cannot use crest while fortified.")) return - if(!xeno.crest_defense) - RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(unconscious_check)) - headcrest_switch(xeno, TRUE) - if(xeno.selected_ability != src) - button.icon_state = "template_active" + XENO_ACTION_CHECK(xeno) + + if(HAS_TRAIT(xeno, TRAIT_ABILITY_CREST)) + stop_crest() else - UnregisterSignal(owner, COMSIG_MOB_STATCHANGE) - headcrest_switch(xeno, FALSE) - if(xeno.selected_ability != src) - button.icon_state = "template_xeno" + start_crest() - apply_cooldown() return ..() -/datum/action/xeno_action/onclick/toggle_crest/proc/headcrest_switch(mob/living/carbon/xenomorph/xeno, crest_state) - if(xeno.crest_defense == crest_state) - return - - if(crest_state) - to_chat(xeno, SPAN_XENOWARNING("We lower our crest.")) +/datum/action/xeno_action/onclick/toggle_crest/proc/start_crest() + var/mob/living/carbon/xenomorph/xeno = owner - xeno.ability_speed_modifier += speed_debuff - xeno.armor_deflection_buff += armor_buff - xeno.crest_defense = TRUE - xeno.mob_size = MOB_SIZE_BIG //knockback immune - button.icon_state = "template_active" - else - to_chat(xeno, SPAN_XENOWARNING("We raise our crest.")) + ADD_TRAIT(xeno, TRAIT_ABILITY_CREST, TRAIT_SOURCE_ABILITY("crest")) + to_chat(xeno, SPAN_XENOWARNING("We lower our crest.")) + xeno.ability_speed_modifier += speed_debuff + xeno.armor_deflection_buff += armor_buff + xeno.mob_size = MOB_SIZE_BIG //knockback immune + button.icon_state = "template_active" + xeno.update_icons() + apply_cooldown() - xeno.ability_speed_modifier -= speed_debuff - xeno.armor_deflection_buff -= armor_buff - xeno.crest_defense = FALSE - xeno.mob_size = MOB_SIZE_XENO //no longer knockback immune - button.icon_state = "template_xeno" +/datum/action/xeno_action/onclick/toggle_crest/proc/stop_crest() + var/mob/living/carbon/xenomorph/xeno = owner + REMOVE_TRAIT(xeno, TRAIT_ABILITY_CREST, TRAIT_SOURCE_ABILITY("crest")) + to_chat(xeno, SPAN_XENOWARNING("We raise our crest.")) + xeno.ability_speed_modifier -= speed_debuff + xeno.armor_deflection_buff -= armor_buff + xeno.mob_size = MOB_SIZE_XENO //no longer knockback immune + button.icon_state = "template_xeno" xeno.update_icons() + apply_cooldown() + + // Defender Headbutt /datum/action/xeno_action/activable/headbutt/use_ability(atom/target_atom) @@ -160,16 +176,9 @@ if(!isxeno_human(target_atom) || fendy.can_not_harm(target_atom)) return - if(!fendy.check_state()) - return - - if(!action_cooldown_check()) - return - - if(!check_and_use_plasma_owner()) - return + XENO_ACTION_CHECK_USE_PLASMA(fendy) - if(fendy.fortify && !usable_while_fortified) + if(HAS_TRAIT(fendy, TRAIT_ABILITY_FORTIFY) && !usable_while_fortified) to_chat(fendy, SPAN_XENOWARNING("We cannot use headbutt while fortified.")) return @@ -177,14 +186,17 @@ if(carbone.stat == DEAD) return + var/fortify = HAS_TRAIT(fendy, TRAIT_ABILITY_FORTIFY) + var/crest_defense = HAS_TRAIT(fendy, TRAIT_ABILITY_CREST) + var/distance = get_dist(fendy, carbone) - var/max_distance = 3 - (fendy.crest_defense * 2) + var/max_distance = 3 - (crest_defense ? 2 : 0) if(distance > max_distance) return - if(!fendy.crest_defense) + if(!crest_defense) apply_cooldown() fendy.throw_atom(get_step_towards(carbone, fendy), 3, SPEED_SLOW, fendy, tracking=TRUE) if(!fendy.Adjacent(carbone)) @@ -197,11 +209,11 @@ if(carbone.stat != DEAD && (!(carbone.status_flags & XENO_HOST) || !HAS_TRAIT(carbone, TRAIT_NESTED))) // -10 damage if their crest is down. - var/damage = base_damage - (fendy.crest_defense * 10) + var/damage = base_damage - (crest_defense ? 10 : 0) carbone.apply_armoured_damage(get_xeno_damage_slash(carbone, damage), ARMOR_MELEE, BRUTE, "chest", 5) var/facing = get_dir(fendy, carbone) - var/headbutt_distance = 1 + (fendy.crest_defense * 2) + (fendy.fortify * 2) + var/headbutt_distance = 1 + (crest_defense ? 2 : 0) + (fortify ? 2 : 0) // Hmm today I will kill a marine while looking away from them fendy.face_atom(carbone) @@ -212,38 +224,35 @@ apply_cooldown() return ..() + + // Defender Tail Sweep -/datum/action/xeno_action/onclick/tail_sweep/use_ability(atom/A) +/datum/action/xeno_action/onclick/tail_sweep/use_ability(atom/target_atom) var/mob/living/carbon/xenomorph/xeno = owner - if (!istype(xeno)) + if(!istype(xeno)) return - if(!xeno.check_state()) - return + XENO_ACTION_CHECK(xeno) - if (!action_cooldown_check()) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY)) + to_chat(xeno, SPAN_XENOWARNING("We cannot use tail swipe while fortified.")) return - if(xeno.fortify) - to_chat(src, SPAN_XENOWARNING("We cannot use tail swipe while fortified.")) - return - - if(xeno.crest_defense) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_CREST)) xeno.balloon_alert(xeno, "our crest is lowered!", text_color = "#7d32bb", delay = 1 SECONDS) return xeno.visible_message(SPAN_XENOWARNING("[xeno] sweeps its tail in a wide circle!"), SPAN_XENOWARNING("We sweep our tail in a wide circle!")) - if(!check_and_use_plasma_owner()) - return + XENO_ACTION_CHECK_USE_PLASMA(xeno) xeno.spin_circle() xeno.emote("tail") var/sweep_range = 1 for(var/mob/living/carbon/human in orange(sweep_range, get_turf(xeno))) - if (!isxeno_human(human) || xeno.can_not_harm(human)) + if(!isxeno_human(human) || xeno.can_not_harm(human)) continue if(human.stat == DEAD) continue @@ -264,35 +273,32 @@ apply_cooldown() return ..() + + // Defender Fortify -/datum/action/xeno_action/activable/fortify/use_ability(atom/target) +/datum/action/xeno_action/activable/fortify/use_ability(atom/target_atom) var/mob/living/carbon/xenomorph/xeno = owner - if (!istype(xeno)) + if(!istype(xeno)) return - if(xeno.crest_defense) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_CREST)) xeno.balloon_alert(xeno, "our crest is lowered!", text_color = "#7d32bb", delay = 1 SECONDS) return - if(!xeno.check_state()) - return - - if (!action_cooldown_check()) - return + XENO_ACTION_CHECK(xeno) playsound(get_turf(xeno), 'sound/effects/stonedoor_openclose.ogg', 30, 1) - if(!xeno.fortify) - RegisterSignal(owner, COMSIG_MOB_STATCHANGE, PROC_REF(unconscious_check)) - fortify_switch(xeno, TRUE) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY)) + stop_fortify() if(xeno.selected_ability != src) - button.icon_state = "template_active" + button.icon_state = "template_xeno" else - UnregisterSignal(owner, COMSIG_MOB_STATCHANGE) - fortify_switch(xeno, FALSE) + start_fortify() if(xeno.selected_ability != src) - button.icon_state = "template_xeno" + button.icon_state = "template_active" + xeno.update_icons() apply_cooldown() return ..() @@ -300,38 +306,46 @@ . = ..() ..() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno.fortify && xeno.selected_ability != src) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY) && xeno.selected_ability != src) button.icon_state = "template_active" /datum/action/xeno_action/activable/fortify/action_deselect() ..() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno.fortify) + if(HAS_TRAIT(xeno, TRAIT_ABILITY_FORTIFY)) button.icon_state = "template_active" -/datum/action/xeno_action/activable/fortify/proc/fortify_switch(mob/living/carbon/xenomorph/xeno, fortify_state) - if(xeno.fortify == fortify_state) - return +/datum/action/xeno_action/activable/fortify/proc/start_fortify() + var/mob/living/carbon/xenomorph/xeno = owner - if(fortify_state) - to_chat(xeno, SPAN_XENOWARNING("We tuck ourself into a defensive stance.")) - RegisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE, PROC_REF(check_directional_armor)) - xeno.mob_size = MOB_SIZE_IMMOBILE //knockback immune - xeno.mob_flags &= ~SQUEEZE_UNDER_VEHICLES - xeno.fortify = TRUE - else - to_chat(xeno, SPAN_XENOWARNING("We resume our normal stance.")) - REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) - xeno.anchored = FALSE - UnregisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE) - xeno.mob_size = MOB_SIZE_XENO //no longer knockback immune - xeno.mob_flags |= SQUEEZE_UNDER_VEHICLES - xeno.fortify = FALSE - - apply_modifiers(xeno, fortify_state) - xeno.update_icons() + RegisterSignal(xeno, COMSIG_XENO_ENTER_CRIT, PROC_REF(unconscious_check)) + RegisterSignal(xeno, COMSIG_MOB_DEATH, PROC_REF(unconscious_check)) + RegisterSignal(xeno, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE, PROC_REF(check_directional_projectile_armor)) + + ADD_TRAIT(xeno, TRAIT_ABILITY_FORTIFY, TRAIT_SOURCE_ABILITY("fortify")) + to_chat(xeno, SPAN_XENOWARNING("We tuck ourself into a defensive stance.")) + + apply_modifiers(xeno, TRUE) + xeno.mob_size = MOB_SIZE_IMMOBILE //knockback immune + xeno.mob_flags &= ~SQUEEZE_UNDER_VEHICLES + +/datum/action/xeno_action/activable/fortify/proc/stop_fortify() + var/mob/living/carbon/xenomorph/xeno = owner -/datum/action/xeno_action/activable/fortify/proc/apply_modifiers(mob/living/carbon/xenomorph/xeno, fortify_state) + UnregisterSignal(xeno, COMSIG_XENO_ENTER_CRIT) + UnregisterSignal(xeno, COMSIG_MOB_DEATH) + UnregisterSignal(xeno, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE) + + REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) + REMOVE_TRAIT(xeno, TRAIT_ABILITY_FORTIFY, TRAIT_SOURCE_ABILITY("fortify")) + to_chat(xeno, SPAN_XENOWARNING("We resume our normal stance.")) + + apply_modifiers(xeno, FALSE) + xeno.anchored = FALSE + xeno.mob_size = MOB_SIZE_XENO //no longer knockback immune + xeno.mob_flags |= SQUEEZE_UNDER_VEHICLES + +/datum/action/xeno_action/activable/fortify/proc/apply_modifiers(mob/living/carbon/xenomorph/xeno, fortify_state = FALSE) if(fortify_state) xeno.armor_deflection_buff += 30 xeno.armor_explosive_buff += 60 @@ -343,21 +357,10 @@ xeno.armor_explosive_buff -= 60 xeno.small_explosives_stun = TRUE -/datum/action/xeno_action/activable/fortify/proc/check_directional_armor(mob/living/carbon/xenomorph/defendy, list/damagedata) +/datum/action/xeno_action/activable/fortify/proc/check_directional_projectile_armor(mob/living/carbon/xenomorph/defendy, list/damagedata) SIGNAL_HANDLER var/projectile_direction = damagedata["direction"] // If the defender is facing the projectile. if(defendy.dir & REVERSE_DIR(projectile_direction)) damagedata["armor"] += frontal_armor -/datum/action/xeno_action/activable/fortify/proc/unconscious_check() - SIGNAL_HANDLER - - UnregisterSignal(owner, COMSIG_MOB_STATCHANGE) - fortify_switch(owner, FALSE) - -/datum/action/xeno_action/onclick/toggle_crest/proc/unconscious_check() - SIGNAL_HANDLER - - UnregisterSignal(owner, COMSIG_MOB_STATCHANGE) - headcrest_switch(owner, FALSE) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index ec3729688f6f6..839e1b55cb2a0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -87,6 +87,28 @@ if(HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES)) return "Warrior_plates_[severity]" +/mob/living/carbon/xenomorph/warrior/ex_act() + . = ..() + + if(HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES)) + if(HAS_TRAIT(src, TRAIT_INCAPACITATED) && HAS_TRAIT(src, TRAIT_FLOORED)) + if(HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) + var/datum/action/xeno_action/onclick/reflective_shield/reflect_used = get_action(src, /datum/action/xeno_action/onclick/reflective_shield) + reflect_used.remove_reflective_shield() + + +/mob/living/carbon/xenomorph/warrior/death() + if(HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES)) + var/datum/action/xeno_action/onclick/reflective_shield/reflect_used = get_action(src, /datum/action/xeno_action/onclick/reflective_shield) + if(HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) + reflect_used.remove_reflective_shield() + + var/datum/action/xeno_action/onclick/toggle_plates/plates_used = get_action(src, /datum/action/xeno_action/onclick/toggle_plates) + if(HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES)) + plates_used.disengage_plates() + + return ..() + /mob/living/carbon/xenomorph/warrior/throw_item(atom/target) toggle_throw_mode(THROW_MODE_OFF) diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/defender/steel_crest.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/defender/steel_crest.dm index 50957326b920d..61103d0d803c8 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/defender/steel_crest.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/defender/steel_crest.dm @@ -17,12 +17,11 @@ /datum/xeno_strain/steel_crest/apply_strain(mob/living/carbon/xenomorph/defender/defender) defender.damage_modifier -= XENO_DAMAGE_MOD_VERY_SMALL - if(defender.fortify) + if(HAS_TRAIT(defender, TRAIT_ABILITY_FORTIFY)) defender.ability_speed_modifier += 2.5 defender.recalculate_stats() - // Steel crest override /datum/action/xeno_action/activable/fortify/steel_crest/apply_modifiers(mob/living/carbon/xenomorph/xeno, fortify_state) if(fortify_state) @@ -36,18 +35,19 @@ xeno.ability_speed_modifier -= 3 xeno.damage_modifier += XENO_DAMAGE_MOD_SMALL +/datum/action/xeno_action/activable/fortify/proc/unconscious_check() + SIGNAL_HANDLER -/datum/action/xeno_action/onclick/soak/use_ability(atom/A) - var/mob/living/carbon/xenomorph/steelcrest = owner - - if (!action_cooldown_check()) + if(QDELETED(owner)) return - if (!steelcrest.check_state()) - return + UnregisterSignal(owner, COMSIG_XENO_ENTER_CRIT) + UnregisterSignal(owner, COMSIG_MOB_DEATH) - if(!check_and_use_plasma_owner()) - return +/datum/action/xeno_action/onclick/soak/use_ability(atom/target_atom) + var/mob/living/carbon/xenomorph/steelcrest = owner + + XENO_ACTION_CHECK_USE_PLASMA(steelcrest) RegisterSignal(steelcrest, COMSIG_MOB_TAKE_DAMAGE, PROC_REF(damage_accumulate)) addtimer(CALLBACK(src, PROC_REF(stop_accumulating)), 6 SECONDS) @@ -79,10 +79,10 @@ owner.remove_filter("steelcrest_enraging") /datum/action/xeno_action/onclick/soak/proc/enraged() - owner.remove_filter("steelcrest_enraging") owner.add_filter("steelcrest_enraged", 1, list("type" = "outline", "color" = "#ad1313", "size" = 1)) - owner.visible_message(SPAN_XENOWARNING("[owner] gets enraged after being damaged enough!"), SPAN_XENOWARNING("We feel enraged after taking in oncoming damage! Our tail slam's cooldown is reset and we heal!")) + owner.visible_message(SPAN_XENOWARNING("[owner] gets enraged and their carapace start to rapidly mend!"), SPAN_XENOWARNING("We feel enraged after taking in oncoming damage! Our tail slam's cooldown is reset and our carapace start to rapidly mend!")) + owner.flick_heal_overlay(3 SECONDS, "#00B800") var/mob/living/carbon/xenomorph/enraged_mob = owner enraged_mob.gain_health(75) // pretty reasonable amount of health recovered @@ -90,10 +90,9 @@ // Check actions list for tail slam and reset it's cooldown if it's there var/datum/action/xeno_action/activable/tail_stab/slam/slam_action = locate() in owner.actions - if (slam_action && !slam_action.action_cooldown_check()) + if(slam_action && !slam_action.action_cooldown_check()) slam_action.end_cooldown() - addtimer(CALLBACK(src, PROC_REF(remove_enrage), owner), 3 SECONDS) diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/warrior/bulwark.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/warrior/bulwark.dm index 6bbecc671e415..3933ca6dfe885 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/warrior/bulwark.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/warrior/bulwark.dm @@ -81,14 +81,18 @@ if(bound_xeno.stat == DEAD) return - if(!HAS_TRAIT(bound_xeno, TRAIT_ABILITY_REFLECTIVE_PLATES)) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) + if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_REFLECTIVE_PLATES) && bound_xeno.health > 0) + bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Warrior Shield Reflective" + return TRUE + if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_ENCLOSED_PLATES) && bound_xeno.health > 0) bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Warrior Shield" return TRUE - if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_REFLECTIVE_PLATES) && bound_xeno.health > 0) - bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Warrior Shield Reflective" - return TRUE + else + bound_xeno.icon_state = "[bound_xeno.get_strain_icon()] Warrior Shield Knocked Down" + /datum/behavior_delegate/warrior_bulwark/melee_attack_additional_effects_target(mob/living/carbon/carbon_target) if(HAS_TRAIT(bound_xeno, TRAIT_ABILITY_ENCLOSED_PLATES)) diff --git a/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm b/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm index 8b73f42710425..4bd2210e1fa64 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/xeno_strain.dm @@ -171,7 +171,7 @@ to_chat(src, SPAN_WARNING("We must be at full health to take a strain.")) return FALSE - if(fortify || crest_defense || stealth || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY) || HAS_TRAIT(src, TRAIT_ABILITY_CREST) || stealth || HAS_TRAIT(src, TRAIT_ABILITY_ENCLOSED_PLATES) || HAS_TRAIT(src, TRAIT_ABILITY_REFLECTIVE_PLATES)) to_chat(src, SPAN_WARNING("We cannot take a strain while in this stance.")) return FALSE diff --git a/code/modules/vehicles/multitile/multitile_bump.dm b/code/modules/vehicles/multitile/multitile_bump.dm index e81097de0f75e..ae8f21ac23713 100644 --- a/code/modules/vehicles/multitile/multitile_bump.dm +++ b/code/modules/vehicles/multitile/multitile_bump.dm @@ -773,7 +773,7 @@ //DEFENDER /mob/living/carbon/xenomorph/defender/handle_vehicle_bump(obj/vehicle/multitile/V) - if(fortify) + if(HAS_TRAIT(src, TRAIT_ABILITY_FORTIFY)) if(V.vehicle_flags & VEHICLE_CLASS_WEAK) //defenders being able to completely block armored vehicles by crawling into a boulder is ridiculous visible_message(SPAN_DANGER("[src] digs its claws into the ground, anchoring itself in place and halting [V] in its tracks!"), SPAN_DANGER("You dig your claws into the ground, stopping [V] in its tracks!"))