mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
combat: tweaked roshwalr AI
This commit is contained in:
parent
8f4863be28
commit
13980861f8
@ -7,13 +7,13 @@ ComboMelee(
|
|||||||
base_poise_damage: 7.5,
|
base_poise_damage: 7.5,
|
||||||
poise_damage_increase: 0,
|
poise_damage_increase: 0,
|
||||||
knockback: 3.0,
|
knockback: 3.0,
|
||||||
range: 2.2,
|
range: 3,
|
||||||
angle: 30.0,
|
angle: 30.0,
|
||||||
base_buildup_duration: 1.2,
|
base_buildup_duration: 1.2,
|
||||||
base_swing_duration: 0.07,
|
base_swing_duration: 0.07,
|
||||||
hit_timing: 0.5,
|
hit_timing: 0.5,
|
||||||
base_recover_duration: 0.3,
|
base_recover_duration: 0.3,
|
||||||
forward_movement: 0.5,
|
forward_movement: 0.25,
|
||||||
damage_kind: Piercing,
|
damage_kind: Piercing,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@ -23,13 +23,13 @@ ComboMelee(
|
|||||||
base_poise_damage: 7.5,
|
base_poise_damage: 7.5,
|
||||||
poise_damage_increase: 0,
|
poise_damage_increase: 0,
|
||||||
knockback: 3.0,
|
knockback: 3.0,
|
||||||
range: 2.2,
|
range: 3,
|
||||||
angle: 30.0,
|
angle: 30.0,
|
||||||
base_buildup_duration: 0.2,
|
base_buildup_duration: 0.2,
|
||||||
base_swing_duration: 0.07,
|
base_swing_duration: 0.07,
|
||||||
hit_timing: 0.5,
|
hit_timing: 0.5,
|
||||||
base_recover_duration: 0.6,
|
base_recover_duration: 0.6,
|
||||||
forward_movement: 0.5,
|
forward_movement: 0.25,
|
||||||
damage_kind: Piercing,
|
damage_kind: Piercing,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -6,10 +6,10 @@ Shockwave(
|
|||||||
damage: 15.0,
|
damage: 15.0,
|
||||||
poise_damage: 10,
|
poise_damage: 10,
|
||||||
knockback: (strength: 3.0, direction: Up),
|
knockback: (strength: 3.0, direction: Up),
|
||||||
shockwave_angle: 75.0,
|
shockwave_angle: 270.0,
|
||||||
shockwave_vertical_angle: 15.0,
|
shockwave_vertical_angle: 15.0,
|
||||||
shockwave_speed: 20.0,
|
shockwave_speed: 20.0,
|
||||||
shockwave_duration: 0.5,
|
shockwave_duration: 0.8,
|
||||||
requires_ground: true,
|
requires_ground: true,
|
||||||
move_efficiency: 0.2,
|
move_efficiency: 0.2,
|
||||||
damage_kind: Piercing,
|
damage_kind: Piercing,
|
||||||
|
@ -3515,9 +3515,10 @@ impl<'a> AgentData<'a> {
|
|||||||
tgt_data: &TargetData,
|
tgt_data: &TargetData,
|
||||||
read_data: &ReadData,
|
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_RANGE: f32 = 12.5;
|
||||||
const SHOCKWAVE_TIMER: f32 = 10.0;
|
const SHOCKWAVE_TIMER: f32 = 15.0;
|
||||||
|
const MELEE_RANGE: f32 = 4.0;
|
||||||
|
|
||||||
enum ActionStateFCounters {
|
enum ActionStateFCounters {
|
||||||
FCounterRoshwalrAttack = 0,
|
FCounterRoshwalrAttack = 0,
|
||||||
@ -3529,7 +3530,7 @@ impl<'a> AgentData<'a> {
|
|||||||
{
|
{
|
||||||
// If already charging, keep charging if not in recover
|
// If already charging, keep charging if not in recover
|
||||||
controller.push_basic_input(InputKind::Ability(0));
|
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]
|
if agent.action_state.counters[ActionStateFCounters::FCounterRoshwalrAttack as usize]
|
||||||
> SHOCKWAVE_TIMER
|
> SHOCKWAVE_TIMER
|
||||||
{
|
{
|
||||||
@ -3541,15 +3542,12 @@ impl<'a> AgentData<'a> {
|
|||||||
agent.action_state.counters
|
agent.action_state.counters
|
||||||
[ActionStateFCounters::FCounterRoshwalrAttack as usize] = 0.0;
|
[ActionStateFCounters::FCounterRoshwalrAttack as usize] = 0.0;
|
||||||
}
|
}
|
||||||
} else if attack_data.in_min_range() {
|
} else if attack_data.dist_sqrd < MELEE_RANGE.powi(2) && attack_data.angle < 90.0{
|
||||||
// Basic attack if on top of them
|
// Basic attack if in melee range
|
||||||
controller.push_basic_input(InputKind::Primary);
|
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) {
|
} else if attack_data.dist_sqrd > SLOW_CHARGE_RANGE.powi(2) {
|
||||||
// Use slow charge if in range
|
// Use slow charge if outside the range
|
||||||
controller.push_basic_input(InputKind::Secondary);
|
controller.push_basic_input(InputKind::Secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user