mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'knightresspaladin/fix-circle-charge' into 'master'
Fixed CircleCharge and buffed Rugged Hide droppers See merge request veloren/veloren!2613
This commit is contained in:
commit
85b9f70469
@ -213,7 +213,7 @@
|
|||||||
abilities: [],
|
abilities: [],
|
||||||
),
|
),
|
||||||
Custom("Theropod Charge"): (
|
Custom("Theropod Charge"): (
|
||||||
primary: "common.abilities.custom.theropodbird.triplestrike",
|
primary: "common.abilities.custom.theropodbasic.triplestrike",
|
||||||
secondary: "common.abilities.custom.theropodbasic.dash",
|
secondary: "common.abilities.custom.theropodbasic.dash",
|
||||||
abilities: [],
|
abilities: [],
|
||||||
),
|
),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
DashMelee(
|
DashMelee(
|
||||||
energy_cost: 0,
|
energy_cost: 0,
|
||||||
base_damage: 50,
|
base_damage: 70,
|
||||||
scaled_damage: 150,
|
scaled_damage: 280,
|
||||||
base_poise_damage: 28,
|
base_poise_damage: 28,
|
||||||
scaled_poise_damage: 40,
|
scaled_poise_damage: 40,
|
||||||
base_knockback: 8.0,
|
base_knockback: 8.0,
|
||||||
|
@ -2,7 +2,7 @@ ComboMelee(
|
|||||||
stage_data: [
|
stage_data: [
|
||||||
(
|
(
|
||||||
stage: 1,
|
stage: 1,
|
||||||
base_damage: 75,
|
base_damage: 250,
|
||||||
damage_increase: 0,
|
damage_increase: 0,
|
||||||
base_poise_damage: 22,
|
base_poise_damage: 22,
|
||||||
poise_damage_increase: 0,
|
poise_damage_increase: 0,
|
||||||
@ -18,7 +18,7 @@ ComboMelee(
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
stage: 2,
|
stage: 2,
|
||||||
base_damage: 75,
|
base_damage: 370,
|
||||||
damage_increase: 0,
|
damage_increase: 0,
|
||||||
base_poise_damage: 0,
|
base_poise_damage: 0,
|
||||||
poise_damage_increase: 22,
|
poise_damage_increase: 22,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
DashMelee(
|
DashMelee(
|
||||||
energy_cost: 0,
|
energy_cost: 0,
|
||||||
base_damage: 150,
|
base_damage: 120,
|
||||||
scaled_damage: 40,
|
scaled_damage: 160,
|
||||||
base_poise_damage: 0,
|
base_poise_damage: 0,
|
||||||
scaled_poise_damage: 0,
|
scaled_poise_damage: 0,
|
||||||
base_knockback: 8.0,
|
base_knockback: 8.0,
|
||||||
|
@ -7,12 +7,12 @@ SpawnEntry (
|
|||||||
// Casual
|
// Casual
|
||||||
(100, (1, 1, "common.entity.wild.aggressive.bonerattler")),
|
(100, (1, 1, "common.entity.wild.aggressive.bonerattler")),
|
||||||
(100, (1, 1, "common.entity.wild.aggressive.sand_raptor")),
|
(100, (1, 1, "common.entity.wild.aggressive.sand_raptor")),
|
||||||
(100, (1, 1, "common.entity.wild.aggressive.ngoubou")),
|
|
||||||
(100, (1, 1, "common.entity.wild.aggressive.sandshark")),
|
(100, (1, 1, "common.entity.wild.aggressive.sandshark")),
|
||||||
// Rare
|
// Rare
|
||||||
(20, (1, 1, "common.entity.wild.aggressive.lavadrake")),
|
(20, (1, 1, "common.entity.wild.aggressive.lavadrake")),
|
||||||
(20, (1, 1, "common.entity.wild.aggressive.ntouka")),
|
(20, (1, 1, "common.entity.wild.aggressive.ntouka")),
|
||||||
(20, (1, 1, "common.entity.wild.aggressive.archaeos")),
|
(20, (1, 1, "common.entity.wild.aggressive.archaeos")),
|
||||||
|
(20, (1, 1, "common.entity.wild.aggressive.ngoubou")),
|
||||||
// Ultra_rare
|
// Ultra_rare
|
||||||
(1, (1, 1, "common.entity.wild.aggressive.roshwalr_boss")),
|
(1, (1, 1, "common.entity.wild.aggressive.roshwalr_boss")),
|
||||||
],
|
],
|
||||||
|
@ -492,9 +492,9 @@ impl Body {
|
|||||||
quadruped_medium::Species::Panda => 900,
|
quadruped_medium::Species::Panda => 900,
|
||||||
quadruped_medium::Species::Bear => 900,
|
quadruped_medium::Species::Bear => 900,
|
||||||
quadruped_medium::Species::Moose => 800,
|
quadruped_medium::Species::Moose => 800,
|
||||||
quadruped_medium::Species::Dreadhorn => 1300,
|
quadruped_medium::Species::Dreadhorn => 3700,
|
||||||
quadruped_medium::Species::Mammoth => 2500,
|
quadruped_medium::Species::Mammoth => 2500,
|
||||||
quadruped_medium::Species::Ngoubou => 1800,
|
quadruped_medium::Species::Ngoubou => 2900,
|
||||||
_ => 700,
|
_ => 700,
|
||||||
},
|
},
|
||||||
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
||||||
@ -553,6 +553,7 @@ impl Body {
|
|||||||
},
|
},
|
||||||
Body::Theropod(theropod) => match theropod.species {
|
Body::Theropod(theropod) => match theropod.species {
|
||||||
theropod::Species::Archaeos => 3500,
|
theropod::Species::Archaeos => 3500,
|
||||||
|
theropod::Species::Yale => 2800,
|
||||||
theropod::Species::Odonto => 3000,
|
theropod::Species::Odonto => 3000,
|
||||||
theropod::Species::Ntouka => 3000,
|
theropod::Species::Ntouka => 3000,
|
||||||
_ => 1100,
|
_ => 1100,
|
||||||
@ -614,13 +615,13 @@ impl Body {
|
|||||||
quadruped_medium::Species::Barghest => 50,
|
quadruped_medium::Species::Barghest => 50,
|
||||||
quadruped_medium::Species::Cattle => 30,
|
quadruped_medium::Species::Cattle => 30,
|
||||||
quadruped_medium::Species::Highland => 30,
|
quadruped_medium::Species::Highland => 30,
|
||||||
quadruped_medium::Species::Yak => 30,
|
quadruped_medium::Species::Yak => 50,
|
||||||
quadruped_medium::Species::Panda => 40,
|
quadruped_medium::Species::Panda => 40,
|
||||||
quadruped_medium::Species::Bear => 40,
|
quadruped_medium::Species::Bear => 40,
|
||||||
quadruped_medium::Species::Moose => 30,
|
quadruped_medium::Species::Moose => 30,
|
||||||
quadruped_medium::Species::Dreadhorn => 50,
|
quadruped_medium::Species::Dreadhorn => 60,
|
||||||
quadruped_medium::Species::Mammoth => 80,
|
quadruped_medium::Species::Mammoth => 80,
|
||||||
quadruped_medium::Species::Ngoubou => 60,
|
quadruped_medium::Species::Ngoubou => 70,
|
||||||
_ => 20,
|
_ => 20,
|
||||||
},
|
},
|
||||||
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
||||||
|
@ -2665,79 +2665,78 @@ impl<'a> AgentData<'a> {
|
|||||||
radius: u32,
|
radius: u32,
|
||||||
circle_time: u32,
|
circle_time: u32,
|
||||||
) {
|
) {
|
||||||
if attack_data.in_min_range() && thread_rng().gen_bool(0.5) {
|
if agent.action_state.counter >= circle_time as f32 {
|
||||||
controller.inputs.move_dir = Vec2::zero();
|
// if circle charge is in progress and time hasn't expired, continue charging
|
||||||
controller
|
controller
|
||||||
.actions
|
.actions
|
||||||
.push(ControlAction::basic_input(InputKind::Primary));
|
.push(ControlAction::basic_input(InputKind::Secondary));
|
||||||
} 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)
|
if attack_data.in_min_range() {
|
||||||
.xy()
|
if agent.action_state.counter > 0.0 {
|
||||||
.try_normalized()
|
// set timer and rotation counter to zero if in minimum range
|
||||||
.unwrap_or_else(Vec2::unit_y);
|
agent.action_state.counter = 0.0;
|
||||||
} else if attack_data.dist_sqrd
|
agent.action_state.int_counter = 0;
|
||||||
< ((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 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
|
|
||||||
.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_left {
|
|
||||||
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 {
|
} else {
|
||||||
agent.action_state.timer = 0.0;
|
// 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) {
|
||||||
|
// if in range to charge, circle, then charge
|
||||||
|
if agent.action_state.int_counter == 0 {
|
||||||
|
// if you haven't chosen a direction to go in, choose now
|
||||||
|
agent.action_state.int_counter = 1 + thread_rng().gen_bool(0.5) as u8;
|
||||||
|
}
|
||||||
|
if agent.action_state.counter < circle_time as f32 {
|
||||||
|
// circle if circle timer not ready
|
||||||
|
let move_dir = match agent.action_state.int_counter {
|
||||||
|
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(),
|
||||||
|
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 {
|
||||||
|
// if obstacle detected, stop circling
|
||||||
|
agent.action_state.counter = circle_time as f32;
|
||||||
|
}
|
||||||
|
controller.inputs.move_dir = move_dir;
|
||||||
|
// use counter as timer since timer may be modified in other parts of the code
|
||||||
|
agent.action_state.counter += read_data.dt.0;
|
||||||
|
}
|
||||||
|
// activating charge once circle timer expires is handled above
|
||||||
} else if attack_data.dist_sqrd < MAX_PATH_DIST.powi(2) {
|
} 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);
|
self.path_toward_target(agent, controller, tgt_data, read_data, true, false, None);
|
||||||
} else {
|
} else {
|
||||||
self.path_toward_target(agent, controller, tgt_data, read_data, false, false, None);
|
self.path_toward_target(agent, controller, tgt_data, read_data, false, false, None);
|
||||||
|
Loading…
Reference in New Issue
Block a user