Make combo actions much more clear

This commit is contained in:
Asriel Camora
2023-07-14 23:45:07 +04:00
parent 79377b5e89
commit 23dd60bb34
10 changed files with 116 additions and 166 deletions
+5 -50
View File
@@ -44,6 +44,11 @@ public abstract class BaseAction
if (IncreasesStepCount)
s.IncreaseStepCount();
s.ActionStates.MutateState(this);
s.ActionCount++;
s.ActiveEffects.DecrementDuration();
}
public virtual void UseSuccess(Simulator s)
@@ -80,54 +85,4 @@ public abstract class BaseAction
builder.AppendLine($"{s.CalculateSuccessRate(SuccessRate(s)) * 100:##}%% Success Rate");
return builder.ToString();
}
private static bool VerifyDurability2(int durabilityA, int durability, Effects effects)
{
var wasteNots = effects.HasEffect(EffectType.WasteNot) || effects.HasEffect(EffectType.WasteNot2);
// -A
durability -= (int)MathF.Ceiling(durabilityA * (wasteNots ? .5f : 1f));
if (durability <= 0)
return false;
// If we can do the first action and still have durability left to survive to the next
// step (even before the Manipulation modifier), we can certainly do the next action.
return true;
}
public static bool VerifyDurability2(SimulationState s, int durabilityA) =>
VerifyDurability2(durabilityA, s.Durability, s.ActiveEffects);
public static bool VerifyDurability2(Simulator s, int durabilityA) =>
VerifyDurability2(durabilityA, s.Durability, s.ActiveEffects);
public static bool VerifyDurability3(int durabilityA, int durabilityB, int durability, Effects effects)
{
var wasteNots = Math.Max(effects.GetDuration(EffectType.WasteNot), effects.GetDuration(EffectType.WasteNot2));
var manips = effects.HasEffect(EffectType.Manipulation);
durability -= (int)MathF.Ceiling(durabilityA * wasteNots > 0 ? .5f : 1f);
if (durability <= 0)
return false;
if (manips)
durability += 5;
if (wasteNots > 0)
wasteNots--;
durability -= (int)MathF.Ceiling(durabilityB * wasteNots > 0 ? .5f : 1f);
if (durability <= 0)
return false;
// If we can do the second action and still have durability left to survive to the next
// step (even before the Manipulation modifier), we can certainly do the next action.
return true;
}
public static bool VerifyDurability3(Simulator s, int durabilityA, int durabilityB) =>
VerifyDurability3(durabilityA, durabilityB, s.Durability, s.ActiveEffects);
public static bool VerifyDurability3(SimulationState s, int durabilityA, int durabilityB) =>
VerifyDurability3(durabilityA, durabilityB, s.Durability, s.ActiveEffects);
}