Correct beam offsets used. Fix scaling damage on hammer M1. Add can_strafe function to body.

This commit is contained in:
Sam 2020-11-24 17:23:29 -06:00
parent 8ab2d2524a
commit 5461f002fe
6 changed files with 23 additions and 21 deletions

View File

@ -2,7 +2,7 @@ ComboMelee(
stage_data: [(
stage: 1,
base_damage: 130,
max_damage: 130,
max_damage: 150,
damage_increase: 10,
knockback: 0.0,
range: 4.5,

View File

@ -621,6 +621,8 @@ impl Body {
_ => Vec3::unit_z(),
}
}
pub fn can_strafe(&self) -> bool { matches!(self, Body::Humanoid(_)) }
}
impl Component for Body {

View File

@ -99,8 +99,8 @@ impl CharacterBehavior for Data {
});
// Gets offsets
let body_offsets = Vec3::new(
data.body.radius() * 3.0 * data.inputs.look_dir.x,
data.body.radius() * 3.0 * data.inputs.look_dir.y,
(data.body.radius() + 1.0) * data.inputs.look_dir.x,
(data.body.radius() + 1.0) * data.inputs.look_dir.y,
data.body.eye_height(),
) * 0.55;
// Build up

View File

@ -232,7 +232,7 @@ pub fn handle_forced_movement(
pub fn handle_orientation(data: &JoinData, update: &mut StateUpdate, rate: f32) {
// Set direction based on move direction
let ori_dir = if (update.character.is_aimed() && data.body.is_humanoid())
let ori_dir = if (update.character.is_aimed() && data.body.can_strafe())
|| update.character.is_attack()
{
data.inputs.look_dir.xy()

View File

@ -337,7 +337,7 @@ impl<'a> System<'a> for Sys {
Bow,
Staff,
StoneGolemBoss,
CircleCharge { radius: u8, circle_time: u8 },
CircleCharge { radius: u32, circle_time: u32 },
QuadLowRanged,
TailSlap,
QuadLowQuick,
@ -411,18 +411,18 @@ impl<'a> System<'a> for Sys {
let eye_offset = body.map_or(0.0, |b| b.eye_height());
let mut tgt_eye_offset =
bodies.get(*target).map_or(0.0, |b| b.eye_height());
// Special case for jumping attacks to jump at the body
// of the target and not the ground around the target
// For the ranged it is to shoot at the feet and not
// the head to get splash damage
if tactic == Tactic::QuadMedJump {
tgt_eye_offset += 1.0;
} else if matches!(tactic, Tactic::QuadLowRanged) {
tgt_eye_offset -= 1.0;
}
let tgt_eye_offset = bodies.get(*target).map_or(0.0, |b| b.eye_height()) +
// Special case for jumping attacks to jump at the body
// of the target and not the ground around the target
// For the ranged it is to shoot at the feet and not
// the head to get splash damage
if tactic == Tactic::QuadMedJump {
1.0
} else if matches!(tactic, Tactic::QuadLowRanged) {
-1.0
} else {
0.0
};
// Hacky distance offset for ranged weapons
let distance_offset = match tactic {
@ -467,7 +467,7 @@ impl<'a> System<'a> for Sys {
.unwrap_or(true);
if 1.0 - agent.psyche.aggro > damage && flees {
if let Some(body) = body {
if body.is_humanoid() {
if body.can_strafe() {
controller.actions.push(ControlAction::Unwield);
}
}
@ -529,7 +529,7 @@ impl<'a> System<'a> for Sys {
inputs.move_z = bearing.z;
}
if dist_sqrd < 16.0f32.powf(2.0)
if dist_sqrd < 16.0f32.powi(2)
&& thread_rng().gen::<f32>() < 0.02
{
inputs.roll.set_state(true);

View File

@ -25,8 +25,8 @@ impl Animation for AlphaAnimation {
let mut next = (*skeleton).clone();
let (movement1base, movement2base, movement3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(4.0), 0.0),
Some(StageSection::Buildup) => ((anim_time as f32).sqrt(), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, (anim_time as f32).powi(4), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32),
_ => (0.0, 0.0, 0.0),
};