mirror of
https://gitlab.com/veloren/veloren.git
synced 2025-07-25 21:02:31 +00:00
change whiff_recovery_modifier to whiffed_recover_duration
This commit is contained in:
@ -3,6 +3,7 @@ RiposteMelee(
|
||||
buildup_duration: 0.3,
|
||||
swing_duration: 0.9,
|
||||
recover_duration: 0.3,
|
||||
whiffed_recover_duration: 0.6,
|
||||
block_strength: 50.0,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
|
@ -3,7 +3,7 @@ RiposteMelee(
|
||||
buildup_duration: 0.4,
|
||||
swing_duration: 0.1,
|
||||
recover_duration: 0.2,
|
||||
whiff_recovery_modifier: 0.2,
|
||||
whiffed_recover_duration: 0.4,
|
||||
block_strength: 5.0,
|
||||
melee_constructor: (
|
||||
kind: Bash(
|
||||
|
@ -3,7 +3,7 @@ RiposteMelee(
|
||||
buildup_duration: 0.7,
|
||||
swing_duration: 0.3,
|
||||
recover_duration: 0.2,
|
||||
whiff_recovery_modifier: 0.2,
|
||||
whiffed_recover_duration: 0.4,
|
||||
block_strength: 5.0,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
|
@ -3,7 +3,7 @@ RiposteMelee(
|
||||
buildup_duration: 0.4,
|
||||
swing_duration: 0.1,
|
||||
recover_duration: 0.2,
|
||||
whiff_recovery_modifier: 0.2,
|
||||
whiffed_recover_duration: 0.4,
|
||||
block_strength: 5.0,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
|
@ -1102,7 +1102,7 @@ pub enum CharacterAbility {
|
||||
buildup_duration: f32,
|
||||
swing_duration: f32,
|
||||
recover_duration: f32,
|
||||
whiff_recovery_modifier: f32,
|
||||
whiffed_recover_duration: f32,
|
||||
block_strength: f32,
|
||||
melee_constructor: MeleeConstructor,
|
||||
#[serde(default)]
|
||||
@ -1825,7 +1825,7 @@ impl CharacterAbility {
|
||||
ref mut buildup_duration,
|
||||
ref mut swing_duration,
|
||||
ref mut recover_duration,
|
||||
whiff_recovery_modifier: _,
|
||||
ref mut whiffed_recover_duration,
|
||||
ref mut block_strength,
|
||||
ref mut melee_constructor,
|
||||
meta: _,
|
||||
@ -1833,6 +1833,7 @@ impl CharacterAbility {
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*whiffed_recover_duration /= stats.speed;
|
||||
*energy_cost /= stats.energy_efficiency;
|
||||
*block_strength *= stats.power;
|
||||
*melee_constructor = melee_constructor.adjusted_by_stats(stats);
|
||||
@ -2989,7 +2990,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
||||
buildup_duration,
|
||||
swing_duration,
|
||||
recover_duration,
|
||||
whiff_recovery_modifier,
|
||||
whiffed_recover_duration,
|
||||
block_strength,
|
||||
melee_constructor,
|
||||
meta: _,
|
||||
@ -2998,7 +2999,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
||||
buildup_duration: Duration::from_secs_f32(*buildup_duration),
|
||||
swing_duration: Duration::from_secs_f32(*swing_duration),
|
||||
recover_duration: Duration::from_secs_f32(*recover_duration),
|
||||
whiff_recovery_modifier: *whiff_recovery_modifier,
|
||||
whiffed_recover_duration: Duration::from_secs_f32(*whiffed_recover_duration),
|
||||
block_strength: *block_strength,
|
||||
melee_constructor: *melee_constructor,
|
||||
ability_info,
|
||||
|
@ -872,7 +872,11 @@ impl CharacterState {
|
||||
CharacterState::RiposteMelee(data) => Some(DurationsInfo {
|
||||
buildup: Some(data.static_data.buildup_duration),
|
||||
action: Some(data.static_data.swing_duration),
|
||||
recover: Some(data.static_data.recover_duration),
|
||||
recover: Some(if data.whiffed {
|
||||
data.static_data.whiffed_recover_duration
|
||||
} else {
|
||||
data.static_data.recover_duration
|
||||
}),
|
||||
..Default::default()
|
||||
}),
|
||||
CharacterState::RapidMelee(data) => Some(DurationsInfo {
|
||||
|
@ -18,8 +18,8 @@ pub struct StaticData {
|
||||
pub swing_duration: Duration,
|
||||
/// How long the state has until exiting
|
||||
pub recover_duration: Duration,
|
||||
/// Modifer for recovery speed when the parry is missed
|
||||
pub whiff_recovery_modifier: f32,
|
||||
/// How long the state has until exiting if the ability missed
|
||||
pub whiffed_recover_duration: Duration,
|
||||
/// Base value that incoming damage is reduced by and converted to poise
|
||||
/// damage
|
||||
pub block_strength: f32,
|
||||
@ -96,25 +96,23 @@ impl CharacterBehavior for Data {
|
||||
}
|
||||
},
|
||||
StageSection::Recover => {
|
||||
if self.timer < self.static_data.recover_duration {
|
||||
// Recovery
|
||||
if let CharacterState::RiposteMelee(c) = &mut update.character {
|
||||
if let CharacterState::RiposteMelee(c) = &mut update.character {
|
||||
let recover_duration = if c.whiffed {
|
||||
self.static_data.whiffed_recover_duration
|
||||
} else {
|
||||
self.static_data.recover_duration
|
||||
};
|
||||
if self.timer < recover_duration {
|
||||
// Recovery
|
||||
c.timer = tick_attack_or_default(
|
||||
data,
|
||||
self.timer,
|
||||
Some(
|
||||
data.stats.recovery_speed_modifier
|
||||
* if c.whiffed {
|
||||
self.static_data.whiff_recovery_modifier
|
||||
} else {
|
||||
1.0
|
||||
},
|
||||
),
|
||||
Some(data.stats.recovery_speed_modifier),
|
||||
);
|
||||
} else {
|
||||
// Done
|
||||
end_melee_ability(data, &mut update);
|
||||
}
|
||||
} else {
|
||||
// Done
|
||||
end_melee_ability(data, &mut update);
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
|
@ -3859,7 +3859,12 @@ impl FigureMgr {
|
||||
stage_time / s.static_data.swing_duration.as_secs_f32()
|
||||
},
|
||||
StageSection::Recover => {
|
||||
stage_time / s.static_data.recover_duration.as_secs_f32()
|
||||
let recover_duration = if s.whiffed {
|
||||
s.static_data.whiffed_recover_duration.as_secs_f32()
|
||||
} else {
|
||||
s.static_data.recover_duration.as_secs_f32()
|
||||
};
|
||||
stage_time / recover_duration
|
||||
},
|
||||
_ => 0.0,
|
||||
};
|
||||
@ -4557,7 +4562,12 @@ impl FigureMgr {
|
||||
stage_time / s.static_data.swing_duration.as_secs_f32()
|
||||
},
|
||||
StageSection::Recover => {
|
||||
stage_time / s.static_data.recover_duration.as_secs_f32()
|
||||
let recover_duration = if s.whiffed {
|
||||
s.static_data.whiffed_recover_duration.as_secs_f32()
|
||||
} else {
|
||||
s.static_data.recover_duration.as_secs_f32()
|
||||
};
|
||||
stage_time / recover_duration
|
||||
},
|
||||
_ => 0.0,
|
||||
};
|
||||
|
Reference in New Issue
Block a user