Skip to content

Commit

Permalink
adjust knockback and pushback values
Browse files Browse the repository at this point in the history
  • Loading branch information
haihala committed Dec 28, 2023
1 parent 95b4682 commit 6b6207d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions client/characters/src/actions/attack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct Attack {
pub target_on_block: Vec<ActionEvent>,
}

// How much of push distance should be applied to attacker
const PUSH_RATIO: f32 = 1.0 / 4.0;

impl Default for Attack {
Expand Down Expand Up @@ -106,8 +107,8 @@ impl Default for CommonAttackProps {
fn default() -> Self {
Self {
damage: 5,
knock_back: 5.0,
push_back: 3.0,
knock_back: 3.0,
push_back: 5.0,
on_hit: StunType::Stun(20),
on_block: StunType::Stun(10),
}
Expand All @@ -117,16 +118,15 @@ impl Default for CommonAttackProps {
impl CommonAttackProps {
pub fn self_on_hit(self) -> Vec<ActionEvent> {
vec![
Movement::impulse(-Vec2::X * self.knock_back + PUSH_RATIO).into(),
ActionEvent::CameraTilt(Vec2::X * self.push_back * 0.008),
ActionEvent::CameraTilt(Vec2::X * 0.02),
ActionEvent::CameraShake,
ActionEvent::Hitstop,
]
}
pub fn self_on_block(self) -> Vec<ActionEvent> {
vec![
Movement::impulse(-Vec2::X * self.push_back * (1.0 - PUSH_RATIO)).into(),
ActionEvent::CameraTilt(-Vec2::X * self.push_back * 0.005),
Movement::impulse(-Vec2::X * self.push_back * PUSH_RATIO).into(),
ActionEvent::CameraTilt(-Vec2::X * 0.01),
ActionEvent::Hitstop,
]
}
Expand All @@ -135,7 +135,7 @@ impl CommonAttackProps {
vec![
ActionEvent::ModifyResource(ResourceType::Health, -self.damage),
self.get_stun(false),
Movement::impulse(-Vec2::X * self.knock_back * (1.0 - PUSH_RATIO)).into(),
Movement::impulse(-Vec2::X * self.knock_back).into(),
ActionEvent::Flash(FlashRequest::hit_flash()),
]
}
Expand All @@ -144,7 +144,7 @@ impl CommonAttackProps {
vec![
ActionEvent::ModifyResource(ResourceType::Health, -1), // Chip
self.get_stun(true),
Movement::impulse(-Vec2::X * self.push_back * PUSH_RATIO).into(),
Movement::impulse(-Vec2::X * self.push_back * (1.0 - PUSH_RATIO)).into(),
]
}

Expand Down
2 changes: 1 addition & 1 deletion client/characters/src/characters/mizku.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fn normals() -> impl Iterator<Item = (MizkuActionId, Action)> {
},
CommonAttackProps {
damage: 16,
knock_back: 2.0,
knock_back: 4.0,
on_hit: Launcher(6.0),
on_block: Stun(10),
..default()
Expand Down

0 comments on commit 6b6207d

Please sign in to comment.