Skip to content

Commit

Permalink
Merge pull request #2686 from planetarium/refactor/hammer
Browse files Browse the repository at this point in the history
Move GetHammerExp
  • Loading branch information
ipdae authored Jul 16, 2024
2 parents 566ef8b + 2e611f4 commit 1bb072f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Action/ItemEnhancementTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public void Execute_With_Hammer(bool oldStart)
_avatarState.inventory.AddItem(
ItemFactory.CreateMaterial(_tableSheets.MaterialItemSheet[hammerId]), 3);

var hammerExp = Equipment.GetHammerExp(hammerId, _tableSheets.EnhancementCostSheetV3) * 3;
var hammerExp = _tableSheets.EnhancementCostSheetV3.GetHammerExp(hammerId) * 3;

var result = new CombinationConsumable5.ResultModel()
{
Expand Down
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Model/Item/EquipmentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void GetHammerExp()
{
var id = costRow.Id;
Assert.True(costRow.Exp > 0L);
Assert.Equal(costRow.Exp, Equipment.GetHammerExp(id, costSheet));
Assert.Equal(costRow.Exp, costSheet.GetHammerExp(id));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Lib9c/Action/ItemEnhancement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public override IWorld Execute(IActionContext context)
{
if (avatarState.inventory.RemoveMaterial(hammerId, context.BlockIndex, hammerCount))
{
var exp = Equipment.GetHammerExp(hammerId, enhancementCostSheet);
var exp = enhancementCostSheet.GetHammerExp(hammerId);
hammerExp += exp * hammerCount;
}
else
Expand Down
5 changes: 0 additions & 5 deletions Lib9c/Model/Item/Equipment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ public long GetRealExp(EquipmentItemSheet itemSheet, EnhancementCostSheetV3 cost
r.Level == level).Exp;
}

public static long GetHammerExp(int hammerId, EnhancementCostSheetV3 costSheet)
{
return costSheet[hammerId].Exp;
}

public List<object> GetOptions()
{
var options = new List<object>();
Expand Down
5 changes: 5 additions & 0 deletions Lib9c/TableData/Cost/EnhancementCostSheetV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ public override void Set(IReadOnlyList<string> fields)
public EnhancementCostSheetV3() : base(nameof(EnhancementCostSheetV2))
{
}

public long GetHammerExp(int hammerId)
{
return this[hammerId].Exp;
}
}
}

0 comments on commit 1bb072f

Please sign in to comment.