Optimizations (from @wolfcomp)

This commit is contained in:
Asriel Camora
2024-03-15 09:49:03 -07:00
parent ea963f9e1b
commit 3223bdcbfb
43 changed files with 691 additions and 354 deletions
+14 -9
View File
@@ -2,19 +2,24 @@ namespace Craftimizer.Simulator.Actions;
internal sealed class TricksOfTheTrade : BaseAction
{
public override ActionCategory Category => ActionCategory.Other;
public override int Level => 13;
public override uint ActionId => 100371;
public TricksOfTheTrade()
{
Category = ActionCategory.Other;
Level = 13;
ActionId = 100371;
DurabilityCost = 0;
}
public override int DurabilityCost => 0;
public override void CPCost(Simulator s, ref int cost)
{
cost = 0;
}
public override int CPCost(Simulator s) => 0;
public override bool CouldUse(Simulator s) =>
public override bool CouldUse(Simulator s, ref int cost) =>
(s.Condition == Condition.Good || s.Condition == Condition.Excellent || s.HasEffect(EffectType.HeartAndSoul))
&& base.CouldUse(s);
&& base.CouldUse(s, ref cost);
public override void UseSuccess(Simulator s)
public override void UseSuccess(Simulator s, ref int eff)
{
s.RestoreCP(20);
if (s.Condition != Condition.Good && s.Condition != Condition.Excellent)