Skip to content

Commit

Permalink
Revert "Merge pull request #2799 from planetarium/bump-lib9c-0.3.0"
Browse files Browse the repository at this point in the history
This reverts commit 7f54740, reversing
changes made to 5ccbf31.
  • Loading branch information
sonohoshi committed Jul 20, 2023
1 parent acd4c42 commit 2d1cead
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 7 deletions.
98 changes: 98 additions & 0 deletions nekoyume/Assets/Tests/EditMode/Battle/AttackCountHelperTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System;
using Nekoyume.Battle;
using NUnit.Framework;

namespace Tests.EditMode.Battle
{
public class AttackCountHelperTest
{
[Test]
public void GetCountMax()
{
var level = 1;
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, AttackCountHelper.GetCountMax(level));
level = 20;
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 1, AttackCountHelper.GetCountMax(level));
level = 100;
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 2, AttackCountHelper.GetCountMax(level));
level = 250;
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 3, AttackCountHelper.GetCountMax(level));
level = 999;
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, AttackCountHelper.GetCountMax(level));
}

[Test]
public void GetDamageMultiplier()
{
for (var i = 0; i < 2; i++)
{
var level = i == 0
? 1
: 999;
var attackCount = 0;
var attackCountMax = AttackCountHelper.GetCountMax(level);

switch (level)
{
case 1:
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, attackCountMax);
break;
case 999:
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, attackCountMax);
break;
}

for (var j = 0; j < attackCountMax + 1; j++)
{
attackCount++;
if (attackCount <= attackCountMax)
{
var info = AttackCountHelper.CachedInfo[attackCountMax][attackCount];
Assert.AreEqual(info.DamageMultiplier, AttackCountHelper.GetDamageMultiplier(attackCount, attackCountMax));

continue;
}

Assert.Throws<ArgumentOutOfRangeException>(() => AttackCountHelper.GetDamageMultiplier(attackCount, attackCountMax));
}
}
}

[Test]
public void GetAdditionalCriticalChance()
{
for (var i = 0; i < 2; i++)
{
var level = i == 0
? 1
: 999;
var attackCount = 0;
var attackCountMax = AttackCountHelper.GetCountMax(level);

switch (level)
{
case 1:
Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, attackCountMax);
break;
case 999:
Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, attackCountMax);
break;
}

for (var j = 0; j < attackCountMax + 1; j++)
{
attackCount++;
if (attackCount <= attackCountMax)
{
var info = AttackCountHelper.CachedInfo[attackCountMax][attackCount];
Assert.AreEqual(info.AdditionalCriticalChance, AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax));

continue;
}

Assert.Throws<ArgumentOutOfRangeException>(() => AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax));
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions nekoyume/Assets/_Scripts/Game/Character/CharacterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,9 @@ private IEnumerator CoAnimationCastBlow(
IReadOnlyList<Model.BattleStatus.Skill.SkillInfo> infos)
{
var info = infos.First();
var target = info.Target;
var copy = new Model.BattleStatus.Skill.SkillInfo(target.Id, target.IsDead, target.Thorn, info.Effect,
var copy = new Model.BattleStatus.Skill.SkillInfo(info.Target, info.Effect,
info.Critical, info.SkillCategory,
info.WaveTurn, ElementalType.Normal, info.SkillTargetType, info.Buff, target);
info.WaveTurn, ElementalType.Normal, info.SkillTargetType, info.Buff);
yield return StartCoroutine(CoAnimationCast(copy));

var pos = transform.position;
Expand Down
5 changes: 2 additions & 3 deletions nekoyume/Assets/_Scripts/Game/Character/RaidCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,9 @@ private IEnumerator CoAnimationCastAttack(bool isCritical)
private IEnumerator CoAnimationCastBlow(IReadOnlyList<Skill.SkillInfo> infos)
{
var info = infos.First();
var target = info.Target;
var copy = new Skill.SkillInfo(target.Id, target.IsDead, target.Thorn, info.Effect,
var copy = new Skill.SkillInfo(info.Target, info.Effect,
info.Critical, info.SkillCategory,
info.WaveTurn, ElementalType.Normal, info.SkillTargetType, info.Buff, target);
info.WaveTurn, ElementalType.Normal, info.SkillTargetType, info.Buff);
yield return StartCoroutine(CoAnimationCast(copy));

var pos = transform.position;
Expand Down
2 changes: 1 addition & 1 deletion nekoyume/Assets/_Scripts/Lib9c/lib9c
Submodule lib9c updated 40 files
+0 −34 .Lib9c.Tests/Action/HitHelperTest.cs
+2 −32 .Lib9c.Tests/Model/Skill/CombatTest.cs
+9 −12 .Lib9c.Tests/Model/Skill/NormalAttackTest.cs
+14 −26 Lib9c/Action/HackAndSlash.cs
+76 −51 Lib9c/Battle/AttackCountHelper.cs
+81 −32 Lib9c/Battle/HitHelper.cs
+0 −1 Lib9c/Battle/ISimulator.cs
+4 −6 Lib9c/Battle/RaidBoss.cs
+4 −4 Lib9c/Battle/Simulator.cs
+14 −18 Lib9c/Battle/StageSimulator.cs
+2 −2 Lib9c/Battle/StageSimulatorV1.cs
+1 −1 Lib9c/Battle/StageSimulatorV2.cs
+1 −1 Lib9c/Battle/StageSimulatorV3.cs
+3 −6 Lib9c/Battle/Wave.cs
+6 −12 Lib9c/Model/BattleStatus/Skill.cs
+2 −3 Lib9c/Model/Buff/Bleed.cs
+2 −2 Lib9c/Model/Character/ArenaCharacter.cs
+37 −64 Lib9c/Model/Character/CharacterBase.cs
+5 −17 Lib9c/Model/Character/Player.cs
+7 −3 Lib9c/Model/Quest/CollectQuest.cs
+8 −3 Lib9c/Model/Quest/CombinationEquipmentQuest.cs
+9 −4 Lib9c/Model/Quest/CombinationQuest.cs
+6 −2 Lib9c/Model/Quest/GeneralQuest.cs
+7 −2 Lib9c/Model/Quest/GoldQuest.cs
+9 −4 Lib9c/Model/Quest/ItemEnhancementQuest.cs
+8 −4 Lib9c/Model/Quest/ItemGradeQuest.cs
+8 −4 Lib9c/Model/Quest/ItemTypeCollectQuest.cs
+7 −3 Lib9c/Model/Quest/MonsterQuest.cs
+10 −8 Lib9c/Model/Quest/Quest.cs
+7 −3 Lib9c/Model/Quest/TradeQuest.cs
+6 −5 Lib9c/Model/Skill/AreaAttack.cs
+3 −5 Lib9c/Model/Skill/AttackSkill.cs
+5 −4 Lib9c/Model/Skill/BlowAttack.cs
+5 −4 Lib9c/Model/Skill/BuffRemovalAttack.cs
+2 −2 Lib9c/Model/Skill/BuffSkill.cs
+5 −4 Lib9c/Model/Skill/DoubleAttack.cs
+7 −6 Lib9c/Model/Skill/HealSkill.cs
+5 −4 Lib9c/Model/Skill/NormalAttack.cs
+6 −4 Lib9c/Model/Skill/Skill.cs
+7 −5 Lib9c/Model/State/RedeemCodeState.cs

0 comments on commit 2d1cead

Please sign in to comment.