Parrying no longer requires releasing the block button, and instead can parry if block happened in buildup.

This commit is contained in:
Sam 2021-04-23 15:01:09 -04:00
parent 73cb6d19ff
commit b9d6bd2fd2
5 changed files with 6 additions and 14 deletions

View File

@ -1,5 +1,5 @@
SpinMelee( SpinMelee(
buildup_duration: 0.6, buildup_duration: 0.35,
swing_duration: 0.4, swing_duration: 0.4,
recover_duration: 0.5, recover_duration: 0.5,
base_damage: 160, base_damage: 160,

View File

@ -131,11 +131,12 @@ impl Attack {
{ {
if ori.look_vec().angle_between(-*dir) < data.static_data.max_angle.to_radians() if ori.look_vec().angle_between(-*dir) < data.static_data.max_angle.to_radians()
{ {
let parry = matches!(data.stage_section, StageSection::Buildup);
emit_outcome(Outcome::Block { emit_outcome(Outcome::Block {
parry: data.parry, parry,
pos: target.pos, pos: target.pos,
}); });
if data.parry && matches!(data.stage_section, StageSection::Buildup) { if parry {
1.0 1.0
} else { } else {
data.static_data.block_strength data.static_data.block_strength

View File

@ -1277,7 +1277,6 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
}, },
timer: Duration::default(), timer: Duration::default(),
stage_section: StageSection::Buildup, stage_section: StageSection::Buildup,
parry: false,
}), }),
CharacterAbility::Roll { CharacterAbility::Roll {
energy_cost: _, energy_cost: _,

View File

@ -30,8 +30,6 @@ pub struct Data {
pub timer: Duration, pub timer: Duration,
/// What section the character stage is in /// What section the character stage is in
pub stage_section: StageSection, pub stage_section: StageSection,
/// Whether the block was cancelled early enough to become a parry
pub parry: bool,
} }
impl CharacterBehavior for Data { impl CharacterBehavior for Data {
@ -49,18 +47,13 @@ impl CharacterBehavior for Data {
.timer .timer
.checked_add(Duration::from_secs_f32(data.dt.0)) .checked_add(Duration::from_secs_f32(data.dt.0))
.unwrap_or_default(), .unwrap_or_default(),
parry: self.parry || !input_is_pressed(data, InputKind::Block),
..*self ..*self
}); });
} else { } else {
// Transitions to swing section of stage // Transitions to swing section of stage
update.character = CharacterState::BasicBlock(Data { update.character = CharacterState::BasicBlock(Data {
timer: Duration::default(), timer: Duration::default(),
stage_section: if self.parry { stage_section: StageSection::Swing,
StageSection::Recover
} else {
StageSection::Swing
},
..*self ..*self
}); });
} }

View File

@ -429,8 +429,7 @@ impl SfxMgr {
][rand::thread_rng().gen_range(1..2)]; ][rand::thread_rng().gen_range(1..2)];
if *parry { if *parry {
audio.play_sfx(file_ref_parry, *pos, Some(2.0)); audio.play_sfx(file_ref_parry, *pos, Some(2.0));
} } else {
else {
audio.play_sfx(file_ref_block, *pos, Some(2.0)); audio.play_sfx(file_ref_block, *pos, Some(2.0));
} }
}, },