Tweak byregot scoring system, add bonuses to config

This commit is contained in:
Asriel Camora
2023-07-13 12:27:45 +02:00
parent 7787ae32d5
commit 9a75542e4b
8 changed files with 80 additions and 75 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ internal sealed class AdvancedTouchCombo : BaseAction
public override int CPCost(Simulator s) => 18 + 18 + 18;
public override bool CanUse(Simulator s) =>
// BasicTouch.DurabilityCost vv vv StandardTouch.DurabilityCost
base.CanUse(s) && StandardTouchCombo.VerifyDurability3(s, 10, 10);
// BasicTouch.DurabilityCost vv vv StandardTouch.DurabilityCost
base.CanUse(s) && VerifyDurability3(s, 10, 10);
private static readonly BasicTouch ActionA = new();
private static readonly StandardTouch ActionB = new();
+50
View File
@@ -80,4 +80,54 @@ 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);
}
+2 -2
View File
@@ -12,8 +12,8 @@ internal sealed class FocusedSynthesisCombo : BaseAction
public override int CPCost(Simulator s) => 7 + 5;
public override bool CanUse(Simulator s) =>
// Observe.DurabilityCost v
base.CanUse(s) && StandardTouchCombo.VerifyDurability2(s, 0);
// Observe.DurabilityCost v
base.CanUse(s) && VerifyDurability2(s, 0);
private static readonly Observe ActionA = new();
private static readonly FocusedSynthesis ActionB = new();
+2 -2
View File
@@ -12,8 +12,8 @@ internal sealed class FocusedTouchCombo : BaseAction
public override int CPCost(Simulator s) => 7 + 18;
public override bool CanUse(Simulator s) =>
// Observe.DurabilityCost v
base.CanUse(s) && StandardTouchCombo.VerifyDurability2(s, 0);
// Observe.DurabilityCost v
base.CanUse(s) && VerifyDurability2(s, 0);
private static readonly Observe ActionA = new();
private static readonly FocusedTouch ActionB = new();
-41
View File
@@ -25,45 +25,4 @@ internal sealed class StandardTouchCombo : BaseAction
public override string GetTooltip(Simulator s, bool addUsability) =>
$"{ActionA.GetTooltip(s, addUsability)}\n{ActionB.GetTooltip(s, addUsability)}";
public static bool VerifyDurability2(Simulator s, int durabilityA)
{
var d = s.Durability;
var wasteNots = s.HasEffect(EffectType.WasteNot) || s.HasEffect(EffectType.WasteNot2);
// -A
d -= (int)MathF.Ceiling(durabilityA * (wasteNots ? .5f : 1f));
if (d <= 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 VerifyDurability3(Simulator s, int durabilityA, int durabilityB)
{
var d = s.Durability;
var wasteNots = Math.Max(s.GetEffectDuration(EffectType.WasteNot), s.GetEffectDuration(EffectType.WasteNot2));
var manips = s.GetEffectDuration(EffectType.Manipulation);
d -= (int)MathF.Ceiling(durabilityA * wasteNots > 0 ? .5f : 1f);
if (d <= 0)
return false;
if (manips > 0)
d += 5;
if (wasteNots > 0)
wasteNots--;
d -= (int)MathF.Ceiling(durabilityB * wasteNots > 0 ? .5f : 1f);
if (d <= 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;
}
}