Rebalance most languages and revamp main game loop
This commit is contained in:
@@ -68,6 +68,8 @@ namespace KernelPanic.Combat
|
||||
int cardDamageFlat = CardScaling.Add(source.FlatCardDamageBonus,
|
||||
prospective && deferred ? combat.PreviewNextDnfDamageStack() : 0);
|
||||
bool allEnemies = entry.TargetsAllEnemies || entry.Effects.Any(effect => effect.AllEnemies);
|
||||
var python = combat.Python.PreviewState(card);
|
||||
if (PythonPipeline.IsPayload(card.Definition) && python.area) allEnemies = true;
|
||||
var targets = PreviewTargets(combat, card, target, queued, allEnemies);
|
||||
bool hasSelectedTarget = target != null || queued && card.TargetSnapshot.Any(t => t != null && !t.IsDefeated)
|
||||
|| combat.SelectedEnemyIndex >= 0 && combat.SelectedEnemyIndex < combat.Enemies.Count;
|
||||
@@ -79,7 +81,7 @@ namespace KernelPanic.Combat
|
||||
result.IsConditional = true;
|
||||
}
|
||||
if (lazy != 100 || card.Definition.Language == Language.Haskell)
|
||||
notes.Add($"Haskell {(lazyEntry == null ? "next stack" : "captured")}: x{lazy / 100m:0.0} damage and explicit Shield.");
|
||||
notes.Add($"Haskell {(lazyEntry == null ? "next stack" : "captured")}: x{(lazy / 100m).ToString("0.0#", System.Globalization.CultureInfo.InvariantCulture)} damage and explicit Shield.");
|
||||
if (combat.Compilation.Active)
|
||||
notes.Add($"Compilation {combat.Compilation.Level}/{combat.Compilation.Maximum}: {combat.Compilation.DamagePercent}% damage, {combat.Compilation.ShieldPercent}% explicit Shield.");
|
||||
if (magnitude > 0) notes.Add($"Card magnitude: +{magnitude}" + (growth > 0 ? $" (includes +{growth} non-crash growth)" : string.Empty) + ".");
|
||||
@@ -116,6 +118,29 @@ namespace KernelPanic.Combat
|
||||
int repeats = 1;
|
||||
switch (effect.Kind)
|
||||
{
|
||||
case CardEffectKind.Python:
|
||||
var operation = (PythonOperation)effect.SecondaryAmount;
|
||||
AddNote(notes, CardEffectFactory.GetRulesText(card, combat.RunConfig));
|
||||
if (operation is PythonOperation.Print or PythonOperation.List or PythonOperation.Update or PythonOperation.Zip)
|
||||
{
|
||||
damage = true;
|
||||
low = high = effect.Amount;
|
||||
if (operation == PythonOperation.List)
|
||||
low = high = CardScaling.Add(effect.Amount, (int)Math.Min(int.MaxValue, 2L * Math.Max(0, card.QueuePlayCount + (prospective ? 1 : 0) - 1)));
|
||||
if (operation == PythonOperation.Update && python.automation) low = high = 5;
|
||||
if (operation != PythonOperation.Zip) repeats = python.repeats;
|
||||
}
|
||||
if (operation is PythonOperation.Loop or PythonOperation.Cinnamon or PythonOperation.Unattended)
|
||||
{
|
||||
int shieldBase = operation == PythonOperation.Cinnamon && python.damageBefore ? 5 : effect.Amount;
|
||||
int shieldRepeats = operation == PythonOperation.Cinnamon ? python.repeats : 1;
|
||||
hasShield = true;
|
||||
int shieldValue = ScaledShield(shieldBase, sourceFlat, magnitude, lazy, combat);
|
||||
for (int i = 0; i < shieldRepeats; i++) targetShield = CardScaling.Add(targetShield, shieldValue);
|
||||
}
|
||||
if (PythonPipeline.IsPayload(card.Definition))
|
||||
AddNote(notes, $"Pipeline: {python.repeats} execution(s){(python.area ? ", all enemies" : "")}. Earlier payloads may change conditions; replays never repeat draw or installation.");
|
||||
break;
|
||||
case CardEffectKind.Damage:
|
||||
damage = true;
|
||||
break;
|
||||
@@ -185,6 +210,9 @@ namespace KernelPanic.Combat
|
||||
hasShield = true;
|
||||
targetShield = CardScaling.Add(targetShield, ScaledShield(effect.Amount, sourceFlat, magnitude, lazy, combat));
|
||||
break;
|
||||
case CardEffectKind.FixedDraw:
|
||||
AddNote(notes, $"Draw {effect.Amount} (fixed): magnitude and effect bonuses do not increase this draw; available RAM still limits it.");
|
||||
break;
|
||||
case CardEffectKind.HaskellMaybe:
|
||||
if (source.CurrentUptime >= source.MaxUptime)
|
||||
{
|
||||
@@ -324,7 +352,7 @@ namespace KernelPanic.Combat
|
||||
if (captured != null) return captured.MultiplierPercent;
|
||||
if (card.Definition.ResolutionTrack != ResolutionTrack.LazyStack || card.Definition.Language != Language.Haskell) return 100;
|
||||
int haskell = combat.LazyStack?.Entries.Count(item => item.Card.Definition?.Language == Language.Haskell) ?? 0;
|
||||
return 100 + 50 * Math.Min(3, haskell);
|
||||
return CombatTuning.HaskellStackMultiplierPercent(haskell);
|
||||
}
|
||||
|
||||
private static IReadOnlyList<CombatantState> PreviewTargets(CombatManager combat, CardInstance card,
|
||||
|
||||
Reference in New Issue
Block a user