From 91ac4af88f6fd8f975b1bbbea99b5a30aee347c6 Mon Sep 17 00:00:00 2001 From: Knightress Paladin Date: Thu, 15 Jul 2021 22:34:08 -0700 Subject: [PATCH] Fixed CircleCharge and buffed Rugged Hide droppers --- .../common/abilities/ability_set_manifest.ron | 2 +- .../abilities/custom/quadmedcharge/dash.ron | 4 +- .../custom/quadmedcharge/doublestrike.ron | 4 +- .../abilities/custom/theropodbasic/dash.ron | 4 +- common/src/comp/body.rs | 11 +- server/src/sys/agent.rs | 109 +++++++++--------- 6 files changed, 67 insertions(+), 67 deletions(-) diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 095b305219..98e226b276 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -213,7 +213,7 @@ abilities: [], ), Custom("Theropod Charge"): ( - primary: "common.abilities.custom.theropodbird.triplestrike", + primary: "common.abilities.custom.theropodbasic.triplestrike", secondary: "common.abilities.custom.theropodbasic.dash", abilities: [], ), diff --git a/assets/common/abilities/custom/quadmedcharge/dash.ron b/assets/common/abilities/custom/quadmedcharge/dash.ron index 4799603ad0..95f94277c1 100644 --- a/assets/common/abilities/custom/quadmedcharge/dash.ron +++ b/assets/common/abilities/custom/quadmedcharge/dash.ron @@ -1,7 +1,7 @@ DashMelee( energy_cost: 0, - base_damage: 50, - scaled_damage: 150, + base_damage: 70, + scaled_damage: 280, base_poise_damage: 28, scaled_poise_damage: 40, base_knockback: 8.0, diff --git a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron index d535ccb97a..30fa68b6aa 100644 --- a/assets/common/abilities/custom/quadmedcharge/doublestrike.ron +++ b/assets/common/abilities/custom/quadmedcharge/doublestrike.ron @@ -2,7 +2,7 @@ ComboMelee( stage_data: [ ( stage: 1, - base_damage: 75, + base_damage: 250, damage_increase: 0, base_poise_damage: 22, poise_damage_increase: 0, @@ -18,7 +18,7 @@ ComboMelee( ), ( stage: 2, - base_damage: 75, + base_damage: 370, damage_increase: 0, base_poise_damage: 0, poise_damage_increase: 22, diff --git a/assets/common/abilities/custom/theropodbasic/dash.ron b/assets/common/abilities/custom/theropodbasic/dash.ron index 32dbdf450e..0835777247 100644 --- a/assets/common/abilities/custom/theropodbasic/dash.ron +++ b/assets/common/abilities/custom/theropodbasic/dash.ron @@ -1,7 +1,7 @@ DashMelee( energy_cost: 0, - base_damage: 150, - scaled_damage: 40, + base_damage: 120, + scaled_damage: 160, base_poise_damage: 0, scaled_poise_damage: 0, base_knockback: 8.0, diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 182bc80e5c..0e52fc50c8 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -492,9 +492,9 @@ impl Body { quadruped_medium::Species::Panda => 900, quadruped_medium::Species::Bear => 900, quadruped_medium::Species::Moose => 800, - quadruped_medium::Species::Dreadhorn => 1300, + quadruped_medium::Species::Dreadhorn => 3700, quadruped_medium::Species::Mammoth => 2500, - quadruped_medium::Species::Ngoubou => 1800, + quadruped_medium::Species::Ngoubou => 2900, _ => 700, }, Body::BirdMedium(bird_medium) => match bird_medium.species { @@ -553,6 +553,7 @@ impl Body { }, Body::Theropod(theropod) => match theropod.species { theropod::Species::Archaeos => 3500, + theropod::Species::Yale => 2800, theropod::Species::Odonto => 3000, theropod::Species::Ntouka => 3000, _ => 1100, @@ -614,13 +615,13 @@ impl Body { quadruped_medium::Species::Barghest => 50, quadruped_medium::Species::Cattle => 30, quadruped_medium::Species::Highland => 30, - quadruped_medium::Species::Yak => 30, + quadruped_medium::Species::Yak => 50, quadruped_medium::Species::Panda => 40, quadruped_medium::Species::Bear => 40, quadruped_medium::Species::Moose => 30, - quadruped_medium::Species::Dreadhorn => 50, + quadruped_medium::Species::Dreadhorn => 60, quadruped_medium::Species::Mammoth => 80, - quadruped_medium::Species::Ngoubou => 60, + quadruped_medium::Species::Ngoubou => 70, _ => 20, }, Body::BirdMedium(bird_medium) => match bird_medium.species { diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 1560349d32..ded5aa2d05 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -271,7 +271,9 @@ impl<'a> System<'a> for Sys { let event_emitter = event_bus.emitter(); - if !matches!(char_state, CharacterState::LeapMelee(_)) { + if !matches!(char_state, CharacterState::LeapMelee(_)) + | !matches!(char_state, CharacterState::ChargedMelee(_)) + { // Default to looking in orientation direction // (can be overridden below) // @@ -2651,27 +2653,57 @@ impl<'a> AgentData<'a> { radius: u32, circle_time: u32, ) { - if attack_data.in_min_range() && thread_rng().gen_bool(0.5) { - controller.inputs.move_dir = Vec2::zero(); + if agent.action_state.timer >= circle_time as f32 { + // if circle charge is in progress and time hasn't expired, continue charging controller .actions - .push(ControlAction::basic_input(InputKind::Primary)); + .push(ControlAction::basic_input(InputKind::Secondary)); + } + if attack_data.in_min_range() { + // set timer and counter to zero if in minimum range + agent.action_state.timer = 0.0; + agent.action_state.counter = 0.0; + if thread_rng().gen_bool(0.5) { + // choose whether to melee attack + controller + .actions + .push(ControlAction::basic_input(InputKind::Primary)); + controller.inputs.move_dir = Vec2::zero(); + } } else if attack_data.dist_sqrd < (radius as f32 * attack_data.min_attack_dist).powi(2) { - controller.inputs.move_dir = (self.pos.0 - tgt_data.pos.0) - .xy() - .try_normalized() - .unwrap_or_else(Vec2::unit_y); - } else if attack_data.dist_sqrd - < ((radius as f32 + 1.0) * attack_data.min_attack_dist).powi(2) - && attack_data.dist_sqrd > (radius as f32 * attack_data.min_attack_dist).powi(2) - { + // if in range to charge, circle, then charge + if agent.action_state.timer == 0.0 { + // if you haven't chosen a direction to go in, choose now + agent.action_state.counter = 1.0 + thread_rng().gen_bool(0.5) as i32 as f32; + } if agent.action_state.timer < circle_time as f32 { - let move_dir = (tgt_data.pos.0 - self.pos.0) - .xy() - .rotated_z(0.47 * PI) - .try_normalized() - .unwrap_or_else(Vec2::unit_y); - let obstacle_left = read_data + // circle if circle timer not ready + let move_dir = match agent.action_state.counter as i32 { + 1 => + // circle left if counter is 1 + { + (tgt_data.pos.0 - self.pos.0) + .xy() + .rotated_z(0.47 * PI) + .try_normalized() + .unwrap_or_else(Vec2::unit_y) + }, + 2 => + // circle right if counter is 2 + { + (tgt_data.pos.0 - self.pos.0) + .xy() + .rotated_z(-0.47 * PI) + .try_normalized() + .unwrap_or_else(Vec2::unit_y) + }, + _ => + // if some illegal value slipped in, get zero vector + { + vek::Vec2::zero() + }, + }; + let obstacle = read_data .terrain .ray( self.pos.0 + Vec3::unit_z(), @@ -2681,49 +2713,16 @@ impl<'a> AgentData<'a> { .cast() .1 .map_or(true, |b| b.is_some()); - if obstacle_left { + if obstacle { + // if obstacle detected, stop circling agent.action_state.timer = circle_time as f32; } controller.inputs.move_dir = move_dir; agent.action_state.timer += read_data.dt.0; - } else if agent.action_state.timer < circle_time as f32 + 0.5 { - controller - .actions - .push(ControlAction::basic_input(InputKind::Secondary)); - agent.action_state.timer += read_data.dt.0; - } else if agent.action_state.timer < 2.0 * circle_time as f32 + 0.5 { - let move_dir = (tgt_data.pos.0 - self.pos.0) - .xy() - .rotated_z(-0.47 * PI) - .try_normalized() - .unwrap_or_else(Vec2::unit_y); - let obstacle_right = read_data - .terrain - .ray( - self.pos.0 + Vec3::unit_z(), - self.pos.0 + move_dir.with_z(0.0) * 2.0 + Vec3::unit_z(), - ) - .until(Block::is_solid) - .cast() - .1 - .map_or(true, |b| b.is_some()); - if obstacle_right { - agent.action_state.timer = 2.0 * circle_time as f32 + 0.5; - } - controller.inputs.move_dir = move_dir; - agent.action_state.timer += read_data.dt.0; - } else if agent.action_state.timer < 2.0 * circle_time as f32 + 1.0 { - if agent.action_state.timer < 2.0 * circle_time as f32 { - agent.action_state.timer = 2.0 * circle_time as f32; - } - controller - .actions - .push(ControlAction::basic_input(InputKind::Secondary)); - agent.action_state.timer += read_data.dt.0; - } else { - agent.action_state.timer = 0.0; } + // activating charge once circle timer expires is handled above } else if attack_data.dist_sqrd < MAX_PATH_DIST.powi(2) { + // if too far away from target, move towards them self.path_toward_target(agent, controller, tgt_data, read_data, true, false, None); } else { self.path_toward_target(agent, controller, tgt_data, read_data, false, false, None);