combat: tweaked roshwalr AI

This commit is contained in:
Eternalisime 2022-11-11 16:37:58 +01:00
parent 8f4863be28
commit 13980861f8
3 changed files with 14 additions and 16 deletions

View File

@ -7,13 +7,13 @@ ComboMelee(
base_poise_damage: 7.5,
poise_damage_increase: 0,
knockback: 3.0,
range: 2.2,
range: 3,
angle: 30.0,
base_buildup_duration: 1.2,
base_swing_duration: 0.07,
hit_timing: 0.5,
base_recover_duration: 0.3,
forward_movement: 0.5,
forward_movement: 0.25,
damage_kind: Piercing,
),
(
@ -23,13 +23,13 @@ ComboMelee(
base_poise_damage: 7.5,
poise_damage_increase: 0,
knockback: 3.0,
range: 2.2,
range: 3,
angle: 30.0,
base_buildup_duration: 0.2,
base_swing_duration: 0.07,
hit_timing: 0.5,
base_recover_duration: 0.6,
forward_movement: 0.5,
forward_movement: 0.25,
damage_kind: Piercing,
),
],

View File

@ -6,10 +6,10 @@ Shockwave(
damage: 15.0,
poise_damage: 10,
knockback: (strength: 3.0, direction: Up),
shockwave_angle: 75.0,
shockwave_angle: 270.0,
shockwave_vertical_angle: 15.0,
shockwave_speed: 20.0,
shockwave_duration: 0.5,
shockwave_duration: 0.8,
requires_ground: true,
move_efficiency: 0.2,
damage_kind: Piercing,

View File

@ -3515,9 +3515,10 @@ impl<'a> AgentData<'a> {
tgt_data: &TargetData,
read_data: &ReadData,
) {
const SLOW_CHARGE_RANGE: f32 = 20.0;
const SLOW_CHARGE_RANGE: f32 = 12.5;
const SHOCKWAVE_RANGE: f32 = 12.5;
const SHOCKWAVE_TIMER: f32 = 10.0;
const SHOCKWAVE_TIMER: f32 = 15.0;
const MELEE_RANGE: f32 = 4.0;
enum ActionStateFCounters {
FCounterRoshwalrAttack = 0,
@ -3529,7 +3530,7 @@ impl<'a> AgentData<'a> {
{
// If already charging, keep charging if not in recover
controller.push_basic_input(InputKind::Ability(0));
} else if attack_data.dist_sqrd < SHOCKWAVE_RANGE.powi(2) && attack_data.angle < 45.0 {
} else if attack_data.dist_sqrd < SHOCKWAVE_RANGE.powi(2) && attack_data.angle < 270.0 {
if agent.action_state.counters[ActionStateFCounters::FCounterRoshwalrAttack as usize]
> SHOCKWAVE_TIMER
{
@ -3541,15 +3542,12 @@ impl<'a> AgentData<'a> {
agent.action_state.counters
[ActionStateFCounters::FCounterRoshwalrAttack as usize] = 0.0;
}
} else if attack_data.in_min_range() {
// Basic attack if on top of them
} else if attack_data.dist_sqrd < MELEE_RANGE.powi(2) && attack_data.angle < 90.0{
// Basic attack if in melee range
controller.push_basic_input(InputKind::Primary);
} else {
// Use slow charge if too far for other abilities
controller.push_basic_input(InputKind::Secondary);
}
} else if attack_data.dist_sqrd < SLOW_CHARGE_RANGE.powi(2) {
// Use slow charge if in range
} else if attack_data.dist_sqrd > SLOW_CHARGE_RANGE.powi(2) {
// Use slow charge if outside the range
controller.push_basic_input(InputKind::Secondary);
}