diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 46b6c857d481..8ca48a03e67d 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_MOB_KNOCKED_DOWN, 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 08f884d3a69d..45cf24fe3efa 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 @@ -196,7 +195,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 @@ -850,7 +848,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 + mutators.tackle_strength_bonus + hive.mutators.tackle_strength_bonus tacklestrength_max = caste.tacklestrength_max + mutators.tackle_strength_bonus + hive.mutators.tackle_strength_bonus diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index d57df232cda4..66951c19d4f6 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 074af92d69fa..2a665acc3894 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm @@ -26,9 +26,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 886ffcfe1ef2..6d3a1543c423 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 2e106743514a..64febdb1e17b 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -25,9 +25,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 d2c0b0e40e59..4c19e0efbc2e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm @@ -18,9 +18,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 8ec53d51046e..b9ca0fbecab2 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Defender.dm @@ -20,7 +20,7 @@ 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 c4c9b11b37e4..6657cbd74ff6 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Drone.dm @@ -23,7 +23,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 6868fd5ac589..4344cbb83b73 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 b00ec2a9c1eb..3828cca2b61e 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm @@ -24,9 +24,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 469b9a78d063..2864bc8b9346 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 @@ mutation_type = LURKER_NORMAL 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 9536ef1553e9..e3e344e0adb1 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 behavior_delegate_type = /datum/behavior_delegate/praetorian_base diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 6d082b327b48..47873e2ae63e 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 6d19a1b8feec..ce100dd49b9d 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 3a23afc145d1..5ae43ca678b1 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Runner.dm @@ -18,10 +18,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 a568a093b3a4..251d8097d595 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 9ad2f4909fb8..5872cf978cd7 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 04996af8f8db..cf355faf9f58 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 cfaedf013a44..8a114365b5de 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 f050a0dcfe8a..d5c241ce87b4 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/mutators/strains/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm index 86f50b47e080..e76f70c95085 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm @@ -38,7 +38,6 @@ drone.max_placeable = 3 drone.available_fruits = list(/obj/effect/alien/resin/fruit) drone.selected_fruit = /obj/effect/alien/resin/fruit - drone.tackle_chance_modifier -= 5 mutator_update_actions(drone) apply_behavior_holder(drone) mutator_set.recalculate_actions(description, flavor_description) 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..cc24bc7bb56d 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 80 + +/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