diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 46b6c857d481..491af4ff64ee 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -554,22 +554,22 @@ if(pipe) handle_ventcrawl(pipe) -/mob/living/carbon/xenomorph/proc/attempt_tackle(mob/M, tackle_mult = 1, tackle_min_offset = 0, tackle_max_offset = 0, tackle_bonus = 0) - var/datum/tackle_counter/TC = LAZYACCESS(tackle_counter, M) +/mob/living/carbon/xenomorph/proc/attempt_tackle(mob/living/carbon/human/tackled_mob, tackle_min_offset = 0, tackle_max_offset = 0) + var/datum/tackle_counter/TC = LAZYACCESS(tackle_counter, tackled_mob) if(!TC) - TC = new(tackle_min + tackle_min_offset, tackle_max + tackle_max_offset, tackle_chance*tackle_mult) - LAZYSET(tackle_counter, M, TC) - RegisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(tackle_handle_lying_changed)) + TC = new(tackled_mob, tackle_min + tackle_min_offset, tackle_max + tackle_max_offset) + LAZYSET(tackle_counter, tackled_mob, TC) + RegisterSignal(tackled_mob, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(tackle_handle_lying_changed)) if (TC.tackle_reset_id) deltimer(TC.tackle_reset_id) TC.tackle_reset_id = null - . = TC.attempt_tackle(tackle_bonus) - if (!. || (M.status_flags & XENO_HOST)) - TC.tackle_reset_id = addtimer(CALLBACK(src, PROC_REF(reset_tackle), M), 4 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE) + . = TC.attempt_tackle() + if (!. || (tackled_mob.status_flags & XENO_HOST)) + TC.tackle_reset_id = addtimer(CALLBACK(src, PROC_REF(reset_tackle), tackled_mob), 4 SECONDS, TIMER_UNIQUE | TIMER_STOPPABLE) else - reset_tackle(M) + reset_tackle(tackled_mob) /mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/living/M, body_position) SIGNAL_HANDLER diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 69ab18431237..2f43b09da252 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -103,9 +103,8 @@ var/can_hivemind_speak = TRUE // Tackles - var/tackle_min = 2 - var/tackle_max = 6 - var/tackle_chance = 35 + var/tackle_min = 3 + var/tackle_max = 7 var/tacklestrength_min = 2 var/tacklestrength_max = 3 @@ -194,7 +193,6 @@ var/explosivearmor_modifier = 0 var/plasmapool_modifier = 1 var/plasmagain_modifier = 0 - var/tackle_chance_modifier = 0 var/regeneration_multiplier = 1 var/speed_modifier = 0 var/phero_modifier = 0 @@ -843,9 +841,6 @@ /mob/living/carbon/xenomorph/proc/recalculate_tackle() tackle_min = caste.tackle_min tackle_max = caste.tackle_max - tackle_chance = caste.tackle_chance + tackle_chance_modifier - tacklestrength_min = caste.tacklestrength_min - tacklestrength_max = caste.tacklestrength_max /mob/living/carbon/xenomorph/proc/recalculate_health() var/new_max_health = nocrit ? health_modifier + maxHealth : health_modifier + caste.max_health diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index 56f908389966..3e014d61d502 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -194,15 +194,13 @@ return XENO_ATTACK_ACTION M.flick_attack_overlay(src, "disarm") - var/tackle_mult = 1 var/tackle_min_offset = 0 var/tackle_max_offset = 0 if (isyautja(src)) - tackle_mult = 0.2 - tackle_min_offset += 2 - tackle_max_offset += 2 + tackle_min_offset += 3 + tackle_max_offset += 3 - if(M.attempt_tackle(src, tackle_mult, tackle_min_offset, tackle_max_offset)) + if(M.attempt_tackle(src, tackle_min_offset, tackle_max_offset)) playsound(loc, 'sound/weapons/alien_knockdown.ogg', 25, 1) var/strength = rand(M.tacklestrength_min, M.tacklestrength_max) Stun(strength) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm index f7e906a82b28..ab6c0328c86c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm @@ -27,9 +27,8 @@ // 3x fire damage fire_vulnerability_mult = FIRE_MULTIPLIER_DEADLY - tackle_min = 2 + tackle_min = 3 tackle_max = 6 - tackle_chance = 25 tacklestrength_min = 3 tacklestrength_max = 4 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index bec41a87521e..b34429ac51a5 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -23,8 +23,7 @@ behavior_delegate_type = /datum/behavior_delegate/burrower_base tackle_min = 3 - tackle_max = 5 - tackle_chance = 40 + tackle_max = 6 tacklestrength_min = 4 tacklestrength_max = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index d290b917e945..9c497643c98f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -28,9 +28,8 @@ huggers_max = 16 eggs_max = 8 - tackle_min = 2 - tackle_max = 4 - tackle_chance = 50 + tackle_min = 3 + tackle_max = 5 tacklestrength_min = 4 tacklestrength_max = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm index 38b1e5816ffe..244f706bb99e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm @@ -19,9 +19,8 @@ minimum_evolve_time = 15 MINUTES - tackle_min = 2 + tackle_min = 3 tackle_max = 6 - tackle_chance = 25 evolution_allowed = FALSE deevolves_to = list(XENO_CASTE_WARRIOR) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm index a63bafb5d2b0..ac16f866e03d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm @@ -21,7 +21,7 @@ available_strains = list(/datum/xeno_strain/steel_crest) behavior_delegate_type = /datum/behavior_delegate/defender_base - tackle_min = 2 + tackle_min = 3 tackle_max = 4 minimum_evolve_time = 4 MINUTES diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm index a0ce70316eb8..e15fa6a092df 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm @@ -28,7 +28,7 @@ weed_level = WEED_LEVEL_STANDARD max_build_dist = 1 - tackle_min = 2 + tackle_min = 3 tackle_max = 4 tacklestrength_min = 3 tacklestrength_max = 4 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm index 93d40820bf7b..fe962caaa555 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm @@ -18,7 +18,6 @@ tackle_min = 4 tackle_max = 5 - tackle_chance = 40 tacklestrength_min = 4 tacklestrength_max = 4 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm index ee4157a67d84..b5d5026af68e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm @@ -26,9 +26,8 @@ behavior_delegate_type = /datum/behavior_delegate/hivelord_base max_build_dist = 1 - tackle_min = 2 + tackle_min = 3 tackle_max = 4 - tackle_chance = 45 tacklestrength_min = 4 tacklestrength_max = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index b9bde4c78992..51c1e31c01c5 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -53,7 +53,7 @@ ) claw_type = CLAW_TYPE_SHARP - tackle_min = 2 + tackle_min = 4 tackle_max = 6 icon_xeno = 'icons/mob/xenos/lurker.dmi' diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm index 69b679573352..9d290da482df 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm @@ -22,9 +22,8 @@ aura_strength = 3 spit_delay = 20 - tackle_min = 2 + tackle_min = 3 tackle_max = 5 - tackle_chance = 45 available_strains = list( /datum/xeno_strain/dancer, diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index f5207e6abf30..1ab8cf40633f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -34,9 +34,8 @@ spit_delay = 25 - tackle_min = 2 + tackle_min = 3 tackle_max = 6 - tackle_chance = 55 aura_strength = 4 tacklestrength_min = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm index e50a0f026d65..9ae9ce0a9f62 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm @@ -14,9 +14,8 @@ speed = XENO_SPEED_TIER_3 heal_standing = 0.66 - tackle_min = 2 - tackle_max = 5 - tackle_chance = 35 + tackle_min = 3 + tackle_max = 6 tacklestrength_min = 4 tacklestrength_max = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm index 400195f21de0..701857ae33e8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm @@ -20,10 +20,7 @@ deevolves_to = list("Larva") tackle_min = 4 - tackle_max = 5 - tackle_chance = 40 - tacklestrength_min = 4 - tacklestrength_max = 4 + tackle_max = 6 heal_resting = 1.75 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm index 2e53f97e297b..0a4dd4b8341d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm @@ -19,8 +19,7 @@ acid_level = 1 tackle_min = 4 - tackle_max = 4 - tackle_chance = 50 + tackle_max = 5 tacklestrength_min = 4 tacklestrength_max = 4 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm index 984a2d08bb75..2de7e5516381 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm @@ -21,9 +21,8 @@ spit_delay = 2.5 SECONDS - tackle_min = 2 + tackle_min = 3 tackle_max = 6 - tackle_chance = 45 tacklestrength_min = 4 tacklestrength_max = 5 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm index 1c329c8b9e82..93b1996f385d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm @@ -20,8 +20,8 @@ caste_desc = "A powerful front line combatant." can_vent_crawl = 0 - tackle_min = 2 - tackle_max = 4 + tackle_min = 3 + tackle_max = 6 agility_speed_increase = -0.9 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm b/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm index feee2edecb67..c2565cb9919a 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/caste_datum.dm @@ -32,9 +32,8 @@ var/caste_desc = null // Tackles - var/tackle_min = 2 - var/tackle_max = 6 - var/tackle_chance = 35 + var/tackle_min = 3 + var/tackle_max = 7 var/tacklestrength_min = 2 var/tacklestrength_max = 3 diff --git a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm index 8b268ebfce62..19ac90972b8d 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm @@ -25,7 +25,7 @@ max_build_dist = 1 tackle_min = 4 - tackle_max = 5 + tackle_max = 6 aura_strength = 1 diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm index 0fcbb2ecf09a..73ee29ccc9da 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/drone/healer.dm @@ -26,7 +26,6 @@ drone.phero_modifier += XENO_PHERO_MOD_LARGE drone.plasma_types += PLASMA_PHEROMONE drone.damage_modifier -= XENO_DAMAGE_MOD_VERY_SMALL - drone.tackle_chance_modifier -= 5 drone.max_placeable = 3 drone.available_fruits = list(/obj/effect/alien/resin/fruit) diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_tackle_counter.dm b/code/modules/mob/living/carbon/xenomorph/xeno_tackle_counter.dm index 98ed9241c9c9..b0519e9525a3 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_tackle_counter.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_tackle_counter.dm @@ -1,23 +1,36 @@ /datum/tackle_counter + var/mob/living/carbon/human/tackled_mob var/tackle_count = 0 var/min_tackles var/max_tackles - var/tackle_chance var/tackle_reset_id -/datum/tackle_counter/New(min, max, chance) +/datum/tackle_counter/New(mob/living/carbon/human/tackle_mob, min, max) + tackled_mob = tackle_mob min_tackles = min max_tackles = max - tackle_chance = chance -/datum/tackle_counter/proc/attempt_tackle(tackle_bonus = 0) +#define TACKLE_HEALTH_CONSIDERATION_CAP 20 +#define TACKLE_DAMAGE_CONSIDERATION_MAX 70 + +/datum/tackle_counter/proc/attempt_tackle() tackle_count++ if (tackle_count >= max_tackles) return TRUE - else if (tackle_count < min_tackles) + + if (tackle_count < min_tackles) return FALSE - else if (prob(tackle_chance + tackle_bonus)) + + var/tackle_mob_damage = 100 - max(tackled_mob.health, TACKLE_HEALTH_CONSIDERATION_CAP) + var/tackle_tier_cut_offs = TACKLE_DAMAGE_CONSIDERATION_MAX / (max_tackles - min_tackles) + var/tackle_tier_diff = tackle_mob_damage / tackle_tier_cut_offs + var/tackles_required = max_tackles - tackle_tier_diff + + if(tackle_count >= tackles_required) return TRUE return FALSE + +#undef TACKLE_HEALTH_CONSIDERATION_CAP +#undef TACKLE_DAMAGE_CONSIDERATION_MAX