mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Changed logic for entering combo melee state depending on whether or not it was a stance
This commit is contained in:
parent
fd05795b4c
commit
c37925d1e2
@ -1974,7 +1974,13 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
|||||||
exhausted: false,
|
exhausted: false,
|
||||||
skip_recover: false,
|
skip_recover: false,
|
||||||
timer: Duration::default(),
|
timer: Duration::default(),
|
||||||
stage_section: Some(StageSection::Buildup),
|
// If ability is a stance, enter the stance without beginning a strike, otherwise
|
||||||
|
// immediately begin the strike
|
||||||
|
stage_section: if *is_stance {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(StageSection::Buildup)
|
||||||
|
},
|
||||||
completed_strikes: 0,
|
completed_strikes: 0,
|
||||||
}),
|
}),
|
||||||
CharacterAbility::LeapMelee {
|
CharacterAbility::LeapMelee {
|
||||||
|
@ -158,7 +158,8 @@ impl CharacterBehavior for Data {
|
|||||||
c.timer = tick_attack_or_default(data, self.timer, None);
|
c.timer = tick_attack_or_default(data, self.timer, None);
|
||||||
}
|
}
|
||||||
} else if self.skip_recover {
|
} else if self.skip_recover {
|
||||||
next_strike(&mut update)
|
end_strike(&mut update);
|
||||||
|
next_strike(&mut update);
|
||||||
} else {
|
} else {
|
||||||
// Transitions to recover section of stage
|
// Transitions to recover section of stage
|
||||||
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
||||||
@ -175,6 +176,7 @@ impl CharacterBehavior for Data {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If is a stance, stay in combo melee, otherwise return to wielding
|
// If is a stance, stay in combo melee, otherwise return to wielding
|
||||||
|
end_strike(&mut update);
|
||||||
if self.static_data.is_stance {
|
if self.static_data.is_stance {
|
||||||
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
||||||
c.timer = Duration::default();
|
c.timer = Duration::default();
|
||||||
@ -223,12 +225,17 @@ impl CharacterBehavior for Data {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn end_strike(update: &mut StateUpdate) {
|
||||||
|
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
||||||
|
c.completed_strikes += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn next_strike(update: &mut StateUpdate) {
|
fn next_strike(update: &mut StateUpdate) {
|
||||||
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
if let CharacterState::ComboMelee2(c) = &mut update.character {
|
||||||
c.exhausted = false;
|
c.exhausted = false;
|
||||||
c.skip_recover = false;
|
c.skip_recover = false;
|
||||||
c.timer = Duration::default();
|
c.timer = Duration::default();
|
||||||
c.stage_section = Some(StageSection::Buildup);
|
c.stage_section = Some(StageSection::Buildup);
|
||||||
c.completed_strikes += 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user