Browse Source

Remove "Zen" hit recovery (#5724)

The description of Harmony says "Fastest", clearly implying that this is the fastest recovery bonus that is attainable for a given character and also an indication that the bonus is not cumulative with other items.
pull/5740/head
ikonomov 3 years ago committed by GitHub
parent
commit
d05992da75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      Source/player.cpp
  2. 23
      test/animationinfo_test.cpp
  3. 5
      test/player_test.cpp

5
Source/player.cpp

@ -2948,10 +2948,7 @@ void StartPlrHit(Player &player, int dam, bool forcehit)
Direction pd = player._pdir;
int8_t skippedAnimationFrames = 0;
constexpr ItemSpecialEffect ZenFlags = ItemSpecialEffect::FastHitRecovery | ItemSpecialEffect::FasterHitRecovery | ItemSpecialEffect::FastestHitRecovery;
if (HasAllOf(player._pIFlags, ZenFlags)) { // if multiple hitrecovery modes are present the skipping of frames can go so far, that they skip frames that would skip. so the additional skipping thats skipped. that means we can't add the different modes together.
skippedAnimationFrames = 4;
} else if (HasAnyOf(player._pIFlags, ItemSpecialEffect::FastestHitRecovery)) {
if (HasAnyOf(player._pIFlags, ItemSpecialEffect::FastestHitRecovery)) {
skippedAnimationFrames = 3;
} else if (HasAnyOf(player._pIFlags, ItemSpecialEffect::FasterHitRecovery)) {
skippedAnimationFrames = 2;

23
test/animationinfo_test.cpp

@ -408,25 +408,30 @@ TEST(AnimationInfo, BlockingSorcererWithFastBlock) // Skipped frames and ignored
});
}
TEST(AnimationInfo, HitRecoverySorcererZenMode) // Skipped frames and ignored delay for last Frame should be considered by distribution logic
TEST(AnimationInfo, HitRecoverySorcererHarmony) // Skipped frames and ignored delay for last Frame should be considered by distribution logic
{
RunAnimationTest(
{
new SetNewAnimationData(8, 1, AnimationDistributionFlags::None, 4),
new SetNewAnimationData(8, 1, AnimationDistributionFlags::None, 3),
new RenderingData(0.0f, 0),
new RenderingData(0.3f, 0),
new RenderingData(0.6f, 1),
new RenderingData(0.6f, 0),
new RenderingData(0.8f, 1),
new GameTickData(5, 0),
new RenderingData(0.0f, 2),
new GameTickData(4, 0),
new RenderingData(0.0f, 1),
new RenderingData(0.3f, 2),
new RenderingData(0.6f, 3),
new RenderingData(0.8f, 3),
new RenderingData(0.6f, 2),
new RenderingData(0.8f, 2),
new GameTickData(5, 0),
new RenderingData(0.0f, 3),
new RenderingData(0.3f, 3),
new RenderingData(0.6f, 4),
new RenderingData(0.8f, 4),
new GameTickData(6, 0),
new RenderingData(0.0f, 4),
new RenderingData(0.3f, 4),
new RenderingData(0.3f, 5),
new RenderingData(0.6f, 5),
new RenderingData(0.8f, 5),
new RenderingData(0.8f, 6),
new GameTickData(7, 0),
new RenderingData(0.0f, 6),
new RenderingData(0.3f, 6),

5
test/player_test.cpp

@ -34,7 +34,6 @@ constexpr ItemSpecialEffect Harmony = ItemSpecialEffect::FastestHitRecovery;
constexpr ItemSpecialEffect BalanceStability = Balance | Stability;
constexpr ItemSpecialEffect BalanceHarmony = Balance | Harmony;
constexpr ItemSpecialEffect StabilityHarmony = Stability | Harmony;
constexpr ItemSpecialEffect Zen = Balance | Stability | Harmony;
constexpr int Warrior = 6;
constexpr int Rogue = 7;
@ -74,10 +73,6 @@ BlockTestCase BlockData[] = {
{ 3, Warrior, StabilityHarmony },
{ 4, Rogue, StabilityHarmony },
{ 5, Sorcerer, StabilityHarmony },
{ 2, Warrior, Zen },
{ 3, Rogue, Zen },
{ 4, Sorcerer, Zen },
};
TEST(Player, PM_DoGotHit)

Loading…
Cancel
Save