Made bow leap more graceful and set energy costs and removed jitter for no leap

This commit is contained in:
jiminycrick 2020-09-25 09:29:10 -07:00
parent ae4b259250
commit 9ebda3c353
3 changed files with 11 additions and 11 deletions

View File

@ -233,12 +233,10 @@ impl Tool {
recover_duration: Duration::from_millis(600),
base_damage: (160.0 * self.base_power()) as u32,
range: 3.5,
max_angle: 120.0,
max_angle: 100.0,
knockback: 15.0,
//leap_speed: 20.0,
leap_speed: 16.0,
leap_vert_speed: 6.0,
//leap_vert_speed: 16.0,
},
],
Hammer(_) => vec![
@ -274,9 +272,7 @@ impl Tool {
max_angle: 360.0,
knockback: 25.0,
leap_speed: 24.0,
//leap_speed: 24.0,
leap_vert_speed: 4.0,
//leap_vert_speed: 8.0,
},
],
Farming(_) => vec![BasicMelee {
@ -328,7 +324,7 @@ impl Tool {
max_projectile_speed: 500.0,
},
RepeaterRanged {
energy_cost: 10,
energy_cost: 450,
holdable: true,
movement_duration: Duration::from_millis(200),
prepare_duration: Duration::from_millis(50),

View File

@ -85,8 +85,10 @@ impl CharacterBehavior for Data {
leap: self.leap,
});
} else if self.recover_duration != Duration::default() {
// Hover
update.vel.0 = Vec3::new(data.vel.0[0], data.vel.0[1], 0.0);
if self.leap {
// Hover
update.vel.0 = Vec3::new(data.vel.0[0], data.vel.0[1], data.vel.0[2] + 0.5);
}
// Recovery
update.character = CharacterState::RepeaterRanged(Data {
@ -107,8 +109,10 @@ impl CharacterBehavior for Data {
leap: self.leap,
});
} else if self.reps_remaining > 0 {
// Hover
update.vel.0 = Vec3::new(data.vel.0[0], data.vel.0[1], 0.0);
if self.leap {
// Hover
update.vel.0 = Vec3::new(data.vel.0[0], data.vel.0[1], data.vel.0[2] + 0.5);
}
// Fire
let mut projectile = self.projectile.clone();

View File

@ -140,7 +140,7 @@ impl<'a> SlotKey<HotbarSource<'a>, HotbarImageSource<'a>> for HotbarSlot {
),
HotbarImage::BowJumpBurst => (
image_key,
(energy.current() < 200).then_some(Color::Rgba(0.3, 0.3, 0.3, 0.8)),
(energy.current() < 450).then_some(Color::Rgba(0.3, 0.3, 0.3, 0.8)),
),
_ => (
image_key,