diff --git a/assets/common/abilities/bow/basic.ron b/assets/common/abilities/bow/basic.ron index cbc6e28040..fd47e9c51a 100644 --- a/assets/common/abilities/bow/basic.ron +++ b/assets/common/abilities/bow/basic.ron @@ -11,5 +11,4 @@ BasicRanged( projectile_light: None, projectile_gravity: Some(Gravity(0.2)), projectile_speed: 100.0, - can_continue: true, ) diff --git a/assets/common/abilities/bowsimple/basic.ron b/assets/common/abilities/bowsimple/basic.ron index cbc6e28040..fd47e9c51a 100644 --- a/assets/common/abilities/bowsimple/basic.ron +++ b/assets/common/abilities/bowsimple/basic.ron @@ -11,5 +11,4 @@ BasicRanged( projectile_light: None, projectile_gravity: Some(Gravity(0.2)), projectile_speed: 100.0, - can_continue: true, ) diff --git a/assets/common/abilities/debug/possess.ron b/assets/common/abilities/debug/possess.ron index 92f722ee9a..7554d1fa65 100644 --- a/assets/common/abilities/debug/possess.ron +++ b/assets/common/abilities/debug/possess.ron @@ -10,5 +10,4 @@ BasicRanged( }),*/ projectile_gravity: None, projectile_speed: 100.0, - can_continue: false, ) \ No newline at end of file diff --git a/assets/common/abilities/staff/firebomb.ron b/assets/common/abilities/staff/firebomb.ron index 16444d31a3..7b4724217d 100644 --- a/assets/common/abilities/staff/firebomb.ron +++ b/assets/common/abilities/staff/firebomb.ron @@ -14,5 +14,4 @@ BasicRanged( }),*/ projectile_gravity: Some(Gravity(0.3)), projectile_speed: 60.0, - can_continue: true, ) diff --git a/assets/common/abilities/staffsimple/firebomb.ron b/assets/common/abilities/staffsimple/firebomb.ron index 16444d31a3..7b4724217d 100644 --- a/assets/common/abilities/staffsimple/firebomb.ron +++ b/assets/common/abilities/staffsimple/firebomb.ron @@ -14,5 +14,4 @@ BasicRanged( }),*/ projectile_gravity: Some(Gravity(0.3)), projectile_speed: 60.0, - can_continue: true, ) diff --git a/assets/common/abilities/unique/quadlowranged/firebomb.ron b/assets/common/abilities/unique/quadlowranged/firebomb.ron index 160e6def79..4470e21596 100644 --- a/assets/common/abilities/unique/quadlowranged/firebomb.ron +++ b/assets/common/abilities/unique/quadlowranged/firebomb.ron @@ -14,5 +14,4 @@ BasicRanged( }),*/ projectile_gravity: Some(Gravity(5.0)), projectile_speed: 70.0, - can_continue: true, ) diff --git a/assets/common/abilities/unique/turret/arrows.ron b/assets/common/abilities/unique/turret/arrows.ron index f605922937..04845845d1 100644 --- a/assets/common/abilities/unique/turret/arrows.ron +++ b/assets/common/abilities/unique/turret/arrows.ron @@ -11,5 +11,4 @@ BasicRanged( projectile_light: None, projectile_gravity: Some(Gravity(0.1)), projectile_speed: 100.0, - can_continue: true, ) diff --git a/assets/common/abilities/unique/wendigomagic/frostbomb.ron b/assets/common/abilities/unique/wendigomagic/frostbomb.ron index 9f53c6deb9..6ba4652208 100644 --- a/assets/common/abilities/unique/wendigomagic/frostbomb.ron +++ b/assets/common/abilities/unique/wendigomagic/frostbomb.ron @@ -13,5 +13,4 @@ BasicRanged( }),*/ projectile_gravity: Some(Gravity(0.3)), projectile_speed: 60.0, - can_continue: true, ) diff --git a/client/src/lib.rs b/client/src/lib.rs index 4580f0ef0e..72c96efce5 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -994,7 +994,7 @@ impl Client { pub fn handle_input(&mut self, input: InputKind, pressed: bool) { if pressed { self.control_action(ControlAction::StartInput { - ability: input, + input, target: None, }); } else { diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index a84efef9ce..9de22f1034 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -75,7 +75,6 @@ pub enum CharacterAbility { projectile_light: Option, projectile_gravity: Option, projectile_speed: f32, - can_continue: bool, }, RepeaterRanged { energy_cost: f32, @@ -1121,6 +1120,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { timer: Duration::default(), stage_section: StageSection::Buildup, exhausted: false, + end: false, }), CharacterAbility::BasicRanged { buildup_duration, @@ -1130,7 +1130,6 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { projectile_light, projectile_gravity, projectile_speed, - can_continue, energy_cost: _, } => CharacterState::BasicRanged(basic_ranged::Data { static_data: basic_ranged::StaticData { @@ -1141,13 +1140,12 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { projectile_light: *projectile_light, projectile_gravity: *projectile_gravity, projectile_speed: *projectile_speed, - can_continue: *can_continue, ability_info, }, timer: Duration::default(), stage_section: StageSection::Buildup, exhausted: false, - continue_next: false, + end: false, }), CharacterAbility::Boost { movement_duration, @@ -1252,7 +1250,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { stage: 1, timer: Duration::default(), stage_section: StageSection::Buildup, - next_stage: false, + end: false, }), CharacterAbility::LeapMelee { energy_cost: _, @@ -1497,6 +1495,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState { }, timer: Duration::default(), stage_section: StageSection::Buildup, + end: false, }), CharacterAbility::BasicAura { buildup_duration, diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index 70d00e28aa..78db2fa100 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -112,7 +112,7 @@ pub enum ControlAction { Stand, Talk, StartInput { - ability: InputKind, + input: InputKind, target: Option, }, CancelInput(InputKind), diff --git a/common/src/states/basic_beam.rs b/common/src/states/basic_beam.rs index 4b6d5a3fc9..dc5b992496 100644 --- a/common/src/states/basic_beam.rs +++ b/common/src/states/basic_beam.rs @@ -3,7 +3,7 @@ use crate::{ Attack, AttackDamage, AttackEffect, CombatEffect, CombatRequirement, Damage, DamageSource, GroupTarget, }, - comp::{beam, CharacterState, EnergyChange, EnergySource, Ori, Pos, StateUpdate}, + comp::{beam, CharacterState, EnergyChange, EnergySource, InputKind, Ori, Pos, StateUpdate}, event::ServerEvent, states::{ behavior::{CharacterBehavior, JoinData}, @@ -56,6 +56,8 @@ pub struct Data { pub timer: Duration, /// What section the character stage is in pub stage_section: StageSection, + /// Whether or not the state should end + pub end: bool, } impl CharacterBehavior for Data { @@ -108,7 +110,9 @@ impl CharacterBehavior for Data { } }, StageSection::Cast => { - if ability_key_is_pressed(data, self.static_data.ability_info.key) + if + /* ability_key_is_pressed(data, self.static_data.ability_info.key) */ + !self.end && (self.static_data.energy_drain <= f32::EPSILON || update.energy.current() > 0) { @@ -205,6 +209,17 @@ impl CharacterBehavior for Data { update } + + fn cancel_input(&self, data: &JoinData, input: InputKind) -> StateUpdate { + let mut update = StateUpdate::from(data); + update.removed_inputs.push(input); + + if Some(input) == self.static_data.ability_info.input { + update.character = CharacterState::BasicBeam(Data { end: true, ..*self }); + } + + update + } } #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/common/src/states/basic_melee.rs b/common/src/states/basic_melee.rs index a4ce9a4d5a..16c01b3191 100644 --- a/common/src/states/basic_melee.rs +++ b/common/src/states/basic_melee.rs @@ -1,6 +1,6 @@ use crate::{ combat::{Attack, AttackDamage, AttackEffect, CombatBuff, CombatEffect, CombatRequirement}, - comp::{CharacterState, Melee, StateUpdate}, + comp::{CharacterState, InputKind, Melee, StateUpdate}, states::{ behavior::{CharacterBehavior, JoinData}, utils::*, @@ -44,6 +44,8 @@ pub struct Data { pub stage_section: StageSection, /// Whether the attack can deal more damage pub exhausted: bool, + /// Whether or not the state should end + pub end: bool, } impl CharacterBehavior for Data { @@ -162,9 +164,13 @@ impl CharacterBehavior for Data { }); } else { // Done - update.character = CharacterState::Wielding; - // Make sure attack component is removed - data.updater.remove::(data.entity); + if self.end || self.static_data.ability_info.input.is_none() { + update.character = CharacterState::Wielding; + // Make sure attack component is removed + data.updater.remove::(data.entity); + } else { + reset_state(self, data, &mut update); + } } }, _ => { @@ -177,4 +183,21 @@ impl CharacterBehavior for Data { update } + + fn cancel_input(&self, data: &JoinData, input: InputKind) -> StateUpdate { + let mut update = StateUpdate::from(data); + update.removed_inputs.push(input); + + if Some(input) == self.static_data.ability_info.input { + if let CharacterState::BasicMelee(c) = &mut update.character { + c.end = true; + } + } + + update + } +} + +fn reset_state(data: &Data, join: &JoinData, update: &mut StateUpdate) { + handle_input(join, update, data.static_data.ability_info.input.unwrap()); } diff --git a/common/src/states/basic_ranged.rs b/common/src/states/basic_ranged.rs index cb0142e939..128a017804 100644 --- a/common/src/states/basic_ranged.rs +++ b/common/src/states/basic_ranged.rs @@ -1,5 +1,7 @@ use crate::{ - comp::{Body, CharacterState, Gravity, LightEmitter, ProjectileConstructor, StateUpdate}, + comp::{ + Body, CharacterState, Gravity, InputKind, LightEmitter, ProjectileConstructor, StateUpdate, + }, event::ServerEvent, states::{ behavior::{CharacterBehavior, JoinData}, @@ -24,8 +26,6 @@ pub struct StaticData { pub projectile_speed: f32, /// What key is used to press ability pub ability_info: AbilityInfo, - /// Whether or not the ability can auto continue - pub can_continue: bool, } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -39,9 +39,8 @@ pub struct Data { pub stage_section: StageSection, /// Whether the attack fired already pub exhausted: bool, - /// If in buildup, whether the attack has continued form previous attack; if - /// in recover, whether the attack will continue to a new attack - pub continue_next: bool, + /// Whether or not the state should end + pub end: bool, } impl CharacterBehavior for Data { @@ -103,41 +102,24 @@ impl CharacterBehavior for Data { update.character = CharacterState::BasicRanged(Data { exhausted: true, - continue_next: false, ..*self }); } else if self.timer < self.static_data.recover_duration { - if ability_key_is_pressed(data, self.static_data.ability_info.key) { - // Recovers - update.character = CharacterState::BasicRanged(Data { - timer: self - .timer - .checked_add(Duration::from_secs_f32(data.dt.0)) - .unwrap_or_default(), - continue_next: self.static_data.can_continue, - ..*self - }); - } else { - // Recovers - update.character = CharacterState::BasicRanged(Data { - timer: self - .timer - .checked_add(Duration::from_secs_f32(data.dt.0)) - .unwrap_or_default(), - ..*self - }); - } - } else if self.continue_next { - // Restarts character state + // Recovers update.character = CharacterState::BasicRanged(Data { - timer: Duration::default(), - stage_section: StageSection::Buildup, - exhausted: false, + timer: self + .timer + .checked_add(Duration::from_secs_f32(data.dt.0)) + .unwrap_or_default(), ..*self - }) + }); } else { // Done - update.character = CharacterState::Wielding; + if self.end || self.static_data.ability_info.input.is_none() { + update.character = CharacterState::Wielding; + } else { + reset_state(self, data, &mut update); + } } }, _ => { @@ -148,4 +130,21 @@ impl CharacterBehavior for Data { update } + + fn cancel_input(&self, data: &JoinData, input: InputKind) -> StateUpdate { + let mut update = StateUpdate::from(data); + update.removed_inputs.push(input); + + if Some(input) == self.static_data.ability_info.input { + if let CharacterState::BasicRanged(c) = &mut update.character { + c.end = true; + } + } + + update + } +} + +fn reset_state(data: &Data, join: &JoinData, update: &mut StateUpdate) { + handle_input(join, update, data.static_data.ability_info.input.unwrap()); } diff --git a/common/src/states/behavior.rs b/common/src/states/behavior.rs index 391aaf09c1..c0722ba0e3 100644 --- a/common/src/states/behavior.rs +++ b/common/src/states/behavior.rs @@ -51,9 +51,7 @@ pub trait CharacterBehavior { ControlAction::Sneak => self.sneak(data), ControlAction::Stand => self.stand(data), ControlAction::Talk => self.talk(data), - ControlAction::StartInput { ability, target } => { - self.handle_input(data, ability, target) - }, + ControlAction::StartInput { input, target } => self.handle_input(data, input, target), ControlAction::CancelInput(input) => self.cancel_input(data, input), } } diff --git a/common/src/states/boost.rs b/common/src/states/boost.rs index a18b520700..5dbd911b15 100644 --- a/common/src/states/boost.rs +++ b/common/src/states/boost.rs @@ -52,7 +52,7 @@ impl CharacterBehavior for Data { if self.end || self.static_data.ability_info.input.is_none() { update.character = CharacterState::Wielding; } else { - reset_state(self, &mut update); + reset_state(self, data, &mut update); } } @@ -64,16 +64,15 @@ impl CharacterBehavior for Data { update.removed_inputs.push(input); if Some(input) == self.static_data.ability_info.input { - update.character = CharacterState::Boost(Data { end: true, ..*self }); + if let CharacterState::Boost(c) = &mut update.character { + c.end = true; + } } update } } -fn reset_state(data: &Data, update: &mut StateUpdate) { - update.character = CharacterState::Boost(Data { - timer: Duration::default(), - ..*data - }) +fn reset_state(data: &Data, join: &JoinData, update: &mut StateUpdate) { + handle_input(join, update, data.static_data.ability_info.input.unwrap()); } diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index da269675ba..9696503e43 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -1,6 +1,6 @@ use crate::{ combat::{Attack, AttackDamage, AttackEffect, CombatBuff, CombatEffect, CombatRequirement}, - comp::{CharacterState, Melee, StateUpdate}, + comp::{CharacterState, InputKind, Melee, StateUpdate}, states::{ behavior::{CharacterBehavior, JoinData}, utils::*, @@ -113,8 +113,8 @@ pub struct Data { pub timer: Duration, /// Checks what section a stage is in pub stage_section: StageSection, - /// Whether the state should go onto the next stage - pub next_stage: bool, + /// Whether or not the state should end + pub end: bool, } impl CharacterBehavior for Data { @@ -261,41 +261,23 @@ impl CharacterBehavior for Data { StageSection::Recover => { if self.timer < self.static_data.stage_data[stage_index].base_recover_duration { // Recovers - if ability_key_is_pressed(data, self.static_data.ability_info.key) { - // Checks if state will transition to next stage after recover - update.character = CharacterState::ComboMelee(Data { - static_data: self.static_data.clone(), - timer: self - .timer - .checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer)) - .unwrap_or_default(), - next_stage: true, - ..*self - }); - } else { - update.character = CharacterState::ComboMelee(Data { - static_data: self.static_data.clone(), - timer: self - .timer - .checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer)) - .unwrap_or_default(), - ..*self - }); - } - } else if self.next_stage { - // Transitions to buildup section of next stage update.character = CharacterState::ComboMelee(Data { static_data: self.static_data.clone(), - stage: (self.stage % self.static_data.num_stages) + 1, - timer: Duration::default(), - stage_section: StageSection::Buildup, - next_stage: false, + timer: self + .timer + .checked_add(Duration::from_secs_f32(data.dt.0 * speed_modifer)) + .unwrap_or_default(), + ..*self }); } else { // Done - update.character = CharacterState::Wielding; - // Make sure attack component is removed - data.updater.remove::(data.entity); + if self.end || self.static_data.ability_info.input.is_none() { + update.character = CharacterState::Wielding; + // Make sure attack component is removed + data.updater.remove::(data.entity); + } else { + reset_state(self, data, &mut update); + } } }, _ => { @@ -306,20 +288,27 @@ impl CharacterBehavior for Data { }, } - // Grant energy on successful hit - if let Some(attack) = data.melee_attack { - if attack.applied && attack.hit_count > 0 { - update.character = CharacterState::ComboMelee(Data { - static_data: self.static_data.clone(), - stage: self.stage, - timer: self.timer, - stage_section: self.stage_section, - next_stage: self.next_stage, - }); - data.updater.remove::(data.entity); + update + } + + fn cancel_input(&self, data: &JoinData, input: InputKind) -> StateUpdate { + let mut update = StateUpdate::from(data); + update.removed_inputs.push(input); + + if Some(input) == self.static_data.ability_info.input { + if let CharacterState::ComboMelee(c) = &mut update.character { + c.end = true; } } update } } + +fn reset_state(data: &Data, join: &JoinData, update: &mut StateUpdate) { + handle_input(join, update, data.static_data.ability_info.input.unwrap()); + + if let CharacterState::ComboMelee(c) = &mut update.character { + c.stage = (data.stage % data.static_data.num_stages) + 1; + } +} diff --git a/common/src/states/idle.rs b/common/src/states/idle.rs index a32728844e..89ef55d98b 100644 --- a/common/src/states/idle.rs +++ b/common/src/states/idle.rs @@ -1,7 +1,8 @@ use super::utils::*; use crate::{ - comp::{InventoryAction, StateUpdate}, + comp::{CharacterState, InputKind, InventoryAction, StateUpdate}, states::behavior::{CharacterBehavior, JoinData}, + uid::Uid, }; pub struct Data; @@ -19,6 +20,18 @@ impl CharacterBehavior for Data { update } + fn handle_input( + &self, + data: &JoinData, + _input: InputKind, + _target: Option, + ) -> StateUpdate { + let mut update = StateUpdate::from(data); + update.character = CharacterState::Wielding; + + update + } + fn wield(&self, data: &JoinData) -> StateUpdate { let mut update = StateUpdate::from(data); attempt_wield(data, &mut update); diff --git a/common/src/states/wielding.rs b/common/src/states/wielding.rs index 0bc4c069c9..0c904d17fd 100644 --- a/common/src/states/wielding.rs +++ b/common/src/states/wielding.rs @@ -26,14 +26,9 @@ impl CharacterBehavior for Data { update } - fn handle_input( - &self, - data: &JoinData, - ability: InputKind, - _target: Option, - ) -> StateUpdate { + fn handle_input(&self, data: &JoinData, input: InputKind, _target: Option) -> StateUpdate { let mut update = StateUpdate::from(data); - handle_input(&data, &mut update, ability); + handle_input(&data, &mut update, input); update } diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 0d2ffc1920..5b2e837755 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -1082,7 +1082,7 @@ impl<'a> AgentData<'a> { Tactic::Melee => { if dist_sqrd < (min_attack_dist * self.scale).powi(2) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1134,7 +1134,7 @@ impl<'a> AgentData<'a> { agent.action_timer += dt.0; } else { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1186,7 +1186,7 @@ impl<'a> AgentData<'a> { agent.action_timer += dt.0; } else { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1250,7 +1250,7 @@ impl<'a> AgentData<'a> { agent.action_timer = 0.0; } else { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1335,7 +1335,7 @@ impl<'a> AgentData<'a> { } else { controller.inputs.secondary.set_state(false); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1409,7 +1409,7 @@ impl<'a> AgentData<'a> { controller.inputs.secondary.set_state(true); } else { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1433,7 +1433,7 @@ impl<'a> AgentData<'a> { .unwrap_or_else(Vec2::zero) * speed; controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1476,7 +1476,7 @@ impl<'a> AgentData<'a> { // large hitbox controller.inputs.move_dir = Vec2::zero(); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1522,7 +1522,7 @@ impl<'a> AgentData<'a> { { controller.inputs.move_dir = Vec2::zero(); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1584,7 +1584,7 @@ impl<'a> AgentData<'a> { .try_normalized() .unwrap_or_else(Vec2::unit_y); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1645,7 +1645,7 @@ impl<'a> AgentData<'a> { agent.action_timer = 0.0; } else if agent.action_timer > 1.0 { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1687,7 +1687,7 @@ impl<'a> AgentData<'a> { && dist_sqrd > (2.0 * min_attack_dist * self.scale).powi(2) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1726,7 +1726,7 @@ impl<'a> AgentData<'a> { agent.action_timer += dt.0; } else { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1771,7 +1771,7 @@ impl<'a> AgentData<'a> { ) { if can_see_tgt(&*terrain, self.pos, tgt_pos, dist_sqrd) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1796,7 +1796,7 @@ impl<'a> AgentData<'a> { agent.action_timer += dt.0; } else if agent.action_timer < 3.0 { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1836,7 +1836,7 @@ impl<'a> AgentData<'a> { .try_normalized() .unwrap_or_else(Vec2::unit_y); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1848,7 +1848,7 @@ impl<'a> AgentData<'a> { .try_normalized() .unwrap_or_else(Vec2::unit_y); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1883,7 +1883,7 @@ impl<'a> AgentData<'a> { if dist_sqrd < (2.0 * min_attack_dist * self.scale).powi(2) { controller.inputs.move_dir = Vec2::zero(); controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1910,7 +1910,7 @@ impl<'a> AgentData<'a> { Tactic::Turret => { if can_see_tgt(&*terrain, self.pos, tgt_pos, dist_sqrd) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1922,7 +1922,7 @@ impl<'a> AgentData<'a> { controller.inputs.look_dir = self.ori.look_dir(); if can_see_tgt(&*terrain, self.pos, tgt_pos, dist_sqrd) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true); @@ -1940,7 +1940,7 @@ impl<'a> AgentData<'a> { ); if can_see_tgt(&*terrain, self.pos, tgt_pos, dist_sqrd) { controller.actions.push(ControlAction::StartInput { - ability: InputKind::Primary, + input: InputKind::Primary, target: None, }); //controller.inputs.primary.set_state(true);