Merge branch 'juliancoffee/ban-rolls' into 'master'

Rolls don't skip recovery anymore

See merge request veloren/veloren!4387
This commit is contained in:
Illia Denysenko 2024-03-20 20:49:42 +00:00
commit 32989ffe99
3 changed files with 12 additions and 6 deletions

View File

@ -1240,9 +1240,9 @@ impl CharacterAbility {
0.0 0.0
}; };
CharacterAbility::Roll { CharacterAbility::Roll {
// Energy cost increased by energy_cost: 12.0,
energy_cost: 12.0 + remaining_recover * 100.0, // Remaining recover flows into buildup
buildup_duration: 0.05, buildup_duration: 0.05 + remaining_recover,
movement_duration: 0.33, movement_duration: 0.33,
recover_duration: 0.125, recover_duration: 0.125,
roll_strength: 3.0, roll_strength: 3.0,

View File

@ -405,7 +405,13 @@ impl CharacterState {
} }
} }
pub fn is_dodge(&self) -> bool { matches!(self, CharacterState::Roll(_)) } pub fn is_dodge(&self) -> bool {
if let CharacterState::Roll(c) = self {
c.stage_section == StageSection::Movement
} else {
false
}
}
pub fn is_glide(&self) -> bool { matches!(self, CharacterState::Glide(_)) } pub fn is_glide(&self) -> bool { matches!(self, CharacterState::Glide(_)) }
@ -415,7 +421,7 @@ impl CharacterState {
pub fn attack_immunities(&self) -> Option<AttackFilters> { pub fn attack_immunities(&self) -> Option<AttackFilters> {
if let CharacterState::Roll(c) = self { if let CharacterState::Roll(c) = self {
Some(c.static_data.attack_immunities) (c.stage_section == StageSection::Movement).then_some(c.static_data.attack_immunities)
} else { } else {
None None
} }

View File

@ -60,7 +60,7 @@ impl CharacterBehavior for Data {
match self.stage_section { match self.stage_section {
StageSection::Buildup => { StageSection::Buildup => {
handle_move(data, &mut update, 1.0); handle_move(data, &mut update, 0.3);
if self.timer < self.static_data.buildup_duration { if self.timer < self.static_data.buildup_duration {
// Build up // Build up
update.character = CharacterState::Roll(Data { update.character = CharacterState::Roll(Data {