Add NixOS and Go
This commit is contained in:
@@ -16,7 +16,7 @@ namespace KernelPanic.Combat
|
||||
Cleanse, ShuffleToken, UpgradeHandCards, GenerateCard, NoOp, UpdateManager,
|
||||
ShieldRepeatDamage, Timeshift, DnfAutoremove, FirstToPackage, Rawhide,
|
||||
IncomingAttackHalve, ConsultWiki, RandomCommonLanguageCard, MinimalInstall, SizeofDamage,
|
||||
RepairCorruptedCards, AskUbuntu, FixedDraw, Python
|
||||
RepairCorruptedCards, AskUbuntu, FixedDraw, Python, Go
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -60,6 +60,7 @@ namespace KernelPanic.Combat
|
||||
CardEffectKind.Draw => new DrawEffect(Amount),
|
||||
CardEffectKind.FixedDraw => new FixedDrawEffect(Amount),
|
||||
CardEffectKind.Python => new PythonEffect((PythonOperation)SecondaryAmount, Amount),
|
||||
CardEffectKind.Go => new GoEffect((GoOperation)SecondaryAmount, Amount, MaxAmount),
|
||||
CardEffectKind.AskUbuntu => new AskUbuntuEffect(),
|
||||
CardEffectKind.ChanceDamage => new ChanceDamageEffect(Amount, SecondaryAmount, Language),
|
||||
CardEffectKind.PreviousLanguageDamage => new PreviousLanguageDamageEffect(Amount, SecondaryAmount, Language),
|
||||
@@ -269,6 +270,23 @@ namespace KernelPanic.Combat
|
||||
Add("shop_c_valgrind", None, false, "repair up to {amount:0} corrupted cards in your active deck. gain {shield:1} Shield.",
|
||||
Fx(CardEffectKind.RepairCorruptedCards, 3), Shield(6));
|
||||
|
||||
Add("nixos_rebuild_switch_card", None, false, "gain {shield:0} Shield. draw 1. does not switch governor.", Shield(4), Fx(CardEffectKind.FixedDraw, 1));
|
||||
Add("nixos_nix_shell", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 2, 3));
|
||||
Add("nixos_flake_update", Single, false, "deal {amount:0}.", Damage(3, Language.Haskell));
|
||||
Add("nixos_store_gc", None, false, "gain {shield:0} Shield. draw 1.", Shield(5), Fx(CardEffectKind.FixedDraw, 1));
|
||||
Add("nixos_rollback", None, false, "restore {amount:0} Uptime. extend a selected goroutine by 1 tick if possible (cap 5).", Go(GoOperation.Rollback, 4));
|
||||
Add("lang_go_worker", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 3, 3));
|
||||
Add("lang_go_func", Single, false, "deploy {amount:0} damage/tick for 2 ticks, starting next round.", Go(GoOperation.Deploy, 1, 2));
|
||||
Add("lang_go_context_timeout", None, false, "extend a selected active goroutine by 2 ticks (cap 5).", Go(GoOperation.Extend, 2));
|
||||
Add("shop_go_time_ticker", Single, false, "deploy {amount:0} damage/tick for 3 ticks, starting next round.", Go(GoOperation.Deploy, 2, 3));
|
||||
Add("shop_go_waitgroup", None, false, "gain 3 Shield per active goroutine (base cap 9).", Go(GoOperation.WaitGroup));
|
||||
Add("shop_go_gosched", None, false, "draw 1. if a goroutine is active, gain {shield:0} Shield.", Go(GoOperation.Gosched, 1));
|
||||
Add("shop_go_context_cancel", None, false, "terminate a selected active goroutine. gain {shield:0} Shield.", Go(GoOperation.Cancel, 4));
|
||||
Add("shop_go_build", Single, false, "deal {amount:0} immediately.", Damage(7, Language.Go));
|
||||
Add("shop_go_channel_send", None, false, "extend all active goroutines by 1 tick (cap 5). requires extension capacity.", Go(GoOperation.ExtendAll, 1));
|
||||
Add("shop_go_select", Single, false, "deal 3 damage per active goroutine as one hit (base cap 9).", Go(GoOperation.Select));
|
||||
Add("shop_go_num_goroutines", None, false, "draw 1 per active goroutine (fixed cap 3; limited by free RAM).", Go(GoOperation.NumGoroutines));
|
||||
|
||||
var byId = new Dictionary<string, CardCatalogEntry>(StringComparer.Ordinal);
|
||||
foreach (CardCatalogEntry entry in entries) byId.Add(entry.Id, entry);
|
||||
Entries = entries.AsReadOnly();
|
||||
@@ -284,6 +302,8 @@ namespace KernelPanic.Combat
|
||||
private static CardEffectSpec Damage(int amount, Language language, int max = -1, bool all = false, bool trueDamage = false)
|
||||
=> new(CardEffectKind.Damage, amount, max, language: language, allEnemies: all, trueDamage: trueDamage);
|
||||
private static CardEffectSpec Shield(int amount) => new(CardEffectKind.Shield, amount);
|
||||
private static CardEffectSpec Go(GoOperation operation, int amount = 0, int ticks = 0) =>
|
||||
new(CardEffectKind.Go, amount, ticks, (int)operation, Language.Go);
|
||||
private static CardEffectSpec Draw(int amount) => new(CardEffectKind.Draw, amount);
|
||||
private static CardEffectSpec Py(PythonOperation operation, int amount = 0, bool all = false) =>
|
||||
new(CardEffectKind.Python, amount, secondaryAmount: (int)operation, language: Language.Python, allEnemies: all);
|
||||
|
||||
@@ -9,9 +9,11 @@ namespace KernelPanic.Combat
|
||||
public sealed class CardPreview
|
||||
{
|
||||
public string Summary { get; internal set; } = string.Empty;
|
||||
public string CriticalSummary { get; internal set; } = string.Empty;
|
||||
public string Details { get; internal set; } = string.Empty;
|
||||
public int MinimumDamage { get; internal set; }
|
||||
public int MaximumDamage { get; internal set; }
|
||||
public int NormalMaximumDamage { get; internal set; }
|
||||
public int Shield { get; internal set; }
|
||||
public int Heal { get; internal set; }
|
||||
public int RepairCapacity { get; internal set; }
|
||||
@@ -104,12 +106,13 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
|
||||
int minAcrossTargets = int.MaxValue, maxAcrossTargets = 0;
|
||||
int normalMaxAcrossTargets = 0, criticalMinAcrossTargets = int.MaxValue;
|
||||
int explicitShield = 0, heal = 0, repairCapacity = 0;
|
||||
bool hasShield = false, hasDamage = false, rust = false, critical = false, random = false, trueDamage = false;
|
||||
int hitCount = 0;
|
||||
foreach (var previewTarget in targets)
|
||||
{
|
||||
int targetMin = 0, targetMax = 0;
|
||||
int targetMin = 0, targetMax = 0, targetNormalMax = 0, targetCriticalMin = 0;
|
||||
int targetShield = 0, targetHeal = 0, targetHits = 0, targetRepairCapacity = 0;
|
||||
foreach (var effect in entry.Effects)
|
||||
{
|
||||
@@ -118,6 +121,31 @@ namespace KernelPanic.Combat
|
||||
int repeats = 1;
|
||||
switch (effect.Kind)
|
||||
{
|
||||
case CardEffectKind.Go:
|
||||
var goOperation = (GoOperation)effect.SecondaryAmount;
|
||||
switch (goOperation)
|
||||
{
|
||||
case GoOperation.Deploy:
|
||||
damage = true; low = high = effect.Amount;
|
||||
AddNote(notes, $"Per tick; {effect.MaxAmount} ticks starting next round. Three active slots. Damage uses live modifiers each tick.");
|
||||
break;
|
||||
case GoOperation.Select: damage = true; low = high = 3 * combat.Go.Count; break;
|
||||
case GoOperation.WaitGroup:
|
||||
hasShield = true; targetShield = ScaledShield(Math.Min(9, 3 * combat.Go.Count), sourceFlat, magnitude, lazy, combat); break;
|
||||
case GoOperation.Cancel:
|
||||
if (combat.Go.Count > 0) { hasShield = true; targetShield = ScaledShield(effect.Amount, sourceFlat, magnitude, lazy, combat); }
|
||||
break;
|
||||
case GoOperation.Gosched:
|
||||
if (combat.Go.Count > 0) { hasShield = true; targetShield = ScaledShield(1, sourceFlat, magnitude, lazy, combat); }
|
||||
AddNote(notes, "Draw 1 (fixed), limited by free RAM."); break;
|
||||
case GoOperation.NumGoroutines: AddNote(notes, $"Draw {Math.Min(3, combat.Go.Count)} (fixed), limited by free RAM."); break;
|
||||
case GoOperation.Rollback:
|
||||
if (combat.CanPlayerReceiveCardHeal(card)) targetHeal = Math.Min(source.MaxUptime - source.CurrentUptime, ScaledBase(effect.Amount, sourceFlat, magnitude));
|
||||
break;
|
||||
}
|
||||
AddNote(notes, CardEffectFactory.GetRulesText(card, combat.RunConfig));
|
||||
if (combat.GoPlayBlockReason(card) is string blocked) AddNote(notes, blocked);
|
||||
break;
|
||||
case CardEffectKind.Python:
|
||||
var operation = (PythonOperation)effect.SecondaryAmount;
|
||||
AddNote(notes, CardEffectFactory.GetRulesText(card, combat.RunConfig));
|
||||
@@ -226,7 +254,7 @@ namespace KernelPanic.Combat
|
||||
case CardEffectKind.MinimalInstall:
|
||||
hasShield = true;
|
||||
int exhausted = Math.Min(effect.Amount, HandAfterPlay(combat, card).Count());
|
||||
targetShield = CardScaling.Add(targetShield, CardScaling.Scale(exhausted * effect.SecondaryAmount, lazy, combat.Compilation.ShieldPercent));
|
||||
targetShield = CardScaling.Add(targetShield, CardScaling.Scale(exhausted * effect.SecondaryAmount, lazy, combat.Compilation.ShieldPercent, source.GovernorShieldPercent));
|
||||
AddNote(notes, $"Exhausts {exhausted} cards with the current hand; grants {exhausted * effect.MaxAmount} Cycles. Exhaust package hooks may add benefits.");
|
||||
break;
|
||||
case CardEffectKind.Timeshift:
|
||||
@@ -254,14 +282,20 @@ namespace KernelPanic.Combat
|
||||
var maximum = DamageRequest.PreviewCard(source, previewTarget, high, effect.Language, effect.TrueDamage, effect.CanCrit, lazy, combat.Compilation.DamagePercent);
|
||||
int minHit = combat.DamagePipeline.PreviewIncomingDamage(minimum, false, archStacks, damageMultiplier, cardMultiplier);
|
||||
int maxHit = combat.DamagePipeline.PreviewIncomingDamage(maximum, true, archStacks, damageMultiplier, cardMultiplier);
|
||||
int normalMaxHit = combat.DamagePipeline.PreviewIncomingDamage(maximum, false, archStacks, damageMultiplier, cardMultiplier);
|
||||
int criticalMinHit = combat.DamagePipeline.PreviewIncomingDamage(minimum, true, archStacks, damageMultiplier, cardMultiplier);
|
||||
for (int hit = 0; hit < repeats; hit++)
|
||||
{
|
||||
targetMin = CardScaling.Add(targetMin, minHit);
|
||||
targetMax = CardScaling.Add(targetMax, maxHit);
|
||||
targetNormalMax = CardScaling.Add(targetNormalMax, normalMaxHit);
|
||||
targetCriticalMin = CardScaling.Add(targetCriticalMin, criticalMinHit);
|
||||
}
|
||||
}
|
||||
minAcrossTargets = Math.Min(minAcrossTargets, targetMin);
|
||||
maxAcrossTargets = Math.Max(maxAcrossTargets, targetMax);
|
||||
normalMaxAcrossTargets = Math.Max(normalMaxAcrossTargets, targetNormalMax);
|
||||
criticalMinAcrossTargets = Math.Min(criticalMinAcrossTargets, targetCriticalMin);
|
||||
explicitShield = Math.Max(explicitShield, targetShield);
|
||||
heal = Math.Max(heal, targetHeal);
|
||||
repairCapacity = Math.Max(repairCapacity, targetRepairCapacity);
|
||||
@@ -289,10 +323,11 @@ namespace KernelPanic.Combat
|
||||
notes.Add($"Repair up to {repairCapacity} corrupted {(repairCapacity == 1 ? "card" : "cards")} across your run deck; {combat.CorruptedCardCount} currently corrupted. Repairs prioritize your hand. Repair count scales with card magnitude only.");
|
||||
result.MinimumDamage = hasDamage ? minAcrossTargets : 0;
|
||||
result.MaximumDamage = hasDamage ? maxAcrossTargets : 0;
|
||||
result.NormalMaximumDamage = hasDamage ? normalMaxAcrossTargets : 0;
|
||||
result.HasDamage = hasDamage;
|
||||
if (hasDamage)
|
||||
{
|
||||
notes.Add("Damage is incoming damage before target Shield and remaining Uptime; critical hits are included in the range.");
|
||||
notes.Add("Damage is incoming damage before target Shield and remaining Uptime. Critical damage is shown separately.");
|
||||
if (!hasSelectedTarget && !allEnemies && entry.RequiresSingleTarget)
|
||||
notes.Add("Select a target; the range currently covers living targets.");
|
||||
if (allEnemies) notes.Add("Damage shown per target; defenses can differ between enemies.");
|
||||
@@ -313,13 +348,22 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
}
|
||||
var parts = new List<string>();
|
||||
if (hasDamage) parts.Add($"{Range(result.MinimumDamage, result.MaximumDamage)} damage" + (allEnemies ? "/target" : string.Empty));
|
||||
if (hasDamage)
|
||||
{
|
||||
parts.Add($"{Range(result.MinimumDamage, result.NormalMaximumDamage)} damage" + (allEnemies ? "/target" : string.Empty)
|
||||
+ (card.Definition.ResolutionTrack == ResolutionTrack.Goroutine ? "/tick" : string.Empty)
|
||||
+ (!random && result.MinimumDamage != result.NormalMaximumDamage ? " (varies by target)" : string.Empty));
|
||||
if (critical && (criticalMinAcrossTargets != minAcrossTargets || maxAcrossTargets != normalMaxAcrossTargets))
|
||||
result.CriticalSummary = (hitCount > 1 ? "All hits crit: " : "Crit: ")
|
||||
+ Range(criticalMinAcrossTargets, maxAcrossTargets) + " damage" + (allEnemies ? "/target" : string.Empty);
|
||||
}
|
||||
if (hasShield || result.Shield > 0) parts.Add($"+{result.Shield} Shield");
|
||||
if (heal > 0) parts.Add($"+{heal} Uptime");
|
||||
if (repairCapacity > 0) parts.Add($"repair up to {repairCapacity}");
|
||||
if (parts.Count == 0) parts.Add("Utility · see rules");
|
||||
result.Summary = string.Join(" · ", parts);
|
||||
result.Details = result.Summary + "\n" + string.Join("\n", notes);
|
||||
result.Details = result.Summary + (result.CriticalSummary.Length > 0 ? "\n" + result.CriticalSummary : string.Empty)
|
||||
+ "\n" + string.Join("\n", notes);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -335,7 +379,7 @@ namespace KernelPanic.Combat
|
||||
CardScaling.Add(CardScaling.Add(amount, sourceFlat), magnitude);
|
||||
|
||||
private static int ScaledShield(int amount, int sourceFlat, int magnitude, int lazy, CombatManager combat) =>
|
||||
CardScaling.Scale(ScaledBase(amount, sourceFlat, magnitude), lazy, combat.Compilation.ShieldPercent);
|
||||
CardScaling.Scale(ScaledBase(amount, sourceFlat, magnitude), lazy, combat.Compilation.ShieldPercent, combat.PlayerState.GovernorShieldPercent);
|
||||
|
||||
private static string Range(int minimum, int maximum) => minimum == maximum ? minimum.ToString() : $"{minimum}–{maximum}";
|
||||
|
||||
|
||||
@@ -43,6 +43,6 @@ namespace KernelPanic.Combat
|
||||
public int LazyMultiplierPercent { get; internal set; } = 100;
|
||||
|
||||
public int ScaleExplicitShield(int amount) => CardScaling.Scale(amount,
|
||||
LazyMultiplierPercent, CombatManager?.Compilation.ShieldPercent ?? 100);
|
||||
LazyMultiplierPercent, CombatManager?.Compilation.ShieldPercent ?? 100, Source?.GovernorShieldPercent ?? 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace KernelPanic.Combat
|
||||
/// <summary>
|
||||
/// Owns the combat turn phase state machine and coordinates combat lifecycle transitions.
|
||||
/// </summary>
|
||||
public sealed class CombatManager : MonoBehaviour
|
||||
public sealed partial class CombatManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private TurnPhase currentPhase = TurnPhase.Boot;
|
||||
|
||||
@@ -141,6 +141,8 @@ namespace KernelPanic.Combat
|
||||
private void Awake()
|
||||
{
|
||||
Python.Bind(this);
|
||||
Go.Terminated -= OnGoroutineTerminated;
|
||||
Go.Terminated += OnGoroutineTerminated;
|
||||
_runManager = GetComponent<RunManager>();
|
||||
_damagePipeline.ResistanceResolver = ResolveDamageResistance;
|
||||
_damagePipeline.PreviewResistanceResolver = ResolveDamageResistance;
|
||||
@@ -267,6 +269,7 @@ namespace KernelPanic.Combat
|
||||
{
|
||||
if (currentPhase == TurnPhase.Execute && !IsCombatPaused && !TutorialReading && TutorialGuide?.CanEndTurn != false)
|
||||
{
|
||||
_pendingGoroutineCard = null; SelectedGoroutine = null;
|
||||
_pendingTargetCard = null;
|
||||
_selectedEnemyIndex = -1;
|
||||
SetPhase(TurnPhase.Interpret);
|
||||
@@ -415,7 +418,11 @@ namespace KernelPanic.Combat
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_pendingGoroutineCard != null && _pendingGoroutineCard != card)
|
||||
{ _pendingGoroutineCard = null; SelectedGoroutine = null; }
|
||||
|
||||
bool fedoraBonus = CanApplyFedoraBonus(card);
|
||||
if (!ValidateGoPlay(card)) return false;
|
||||
int cost = GetEffectiveCardCost(card);
|
||||
if (fedoraBonus)
|
||||
{
|
||||
@@ -513,6 +520,13 @@ namespace KernelPanic.Combat
|
||||
|
||||
switch (track)
|
||||
{
|
||||
case ResolutionTrack.Goroutine:
|
||||
GameEvents.RaiseCardResolving(new CardResolvedEvent(card, track));
|
||||
ExecuteCardEffects(card, ResolveTargets(card));
|
||||
ResolveCardRiders(card);
|
||||
GameEvents.RaiseCardResolved(new CardResolvedEvent(card, track));
|
||||
_selectedEnemyIndex = -1;
|
||||
break;
|
||||
case ResolutionTrack.InterpreterQueue:
|
||||
card.MarkQueued();
|
||||
_interpreterQueue.Enqueue(card);
|
||||
@@ -827,7 +841,8 @@ namespace KernelPanic.Combat
|
||||
IEnumerable<CardInstance>[] groups =
|
||||
{
|
||||
_handController?.Cards, _deckController?.DrawPile, _deckController?.DiscardPile,
|
||||
_deckController?.ExhaustPile, _interpreterQueue?.Cards, _lazyStack?.Cards, _runManager?.RunDeck
|
||||
_deckController?.ExhaustPile, _interpreterQueue?.Cards, _lazyStack?.Cards,
|
||||
Go.Active.Select(work => work.SourceCard), _runManager?.RunDeck
|
||||
};
|
||||
foreach (var group in groups)
|
||||
{
|
||||
@@ -1216,6 +1231,8 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
|
||||
_handController = new HandController(_playerState.Ram);
|
||||
Nix.BeginWave(IsDistro("nixos") ? _runConfig.DistroVersion : 0);
|
||||
ApplyGovernorModifiers();
|
||||
_selectedEnemyIndex = -1;
|
||||
_pendingTargetCard = null;
|
||||
_cardsPlayedThisWave = 0;
|
||||
@@ -1238,7 +1255,8 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
}
|
||||
|
||||
_deckController.Initialize(startingCards);
|
||||
if (_runConfig.IsLanguageTraining) _deckController.InitializeInDrawOrder(startingCards);
|
||||
else _deckController.Initialize(startingCards);
|
||||
_interpreterQueue.Clear();
|
||||
_enemies.Clear();
|
||||
_enemiesPendingExit.Clear();
|
||||
@@ -1305,6 +1323,8 @@ namespace KernelPanic.Combat
|
||||
|
||||
private IEnumerator InterpretQueueSequenced()
|
||||
{
|
||||
yield return TickGoroutinesSequenced();
|
||||
if (CheckWinOrLoss()) yield break;
|
||||
Python.BeginPhase(_turnNumberThisWave);
|
||||
while (VisualResolutionPending && !_runLost && !_awaitingWaveContinue) yield return null;
|
||||
if (CheckWinOrLoss()) yield break;
|
||||
@@ -1393,6 +1413,8 @@ namespace KernelPanic.Combat
|
||||
|
||||
private void ClearDeferredCards()
|
||||
{
|
||||
Go.Clear();
|
||||
_pendingGoroutineCard = null; SelectedGoroutine = null;
|
||||
Python.Clear();
|
||||
foreach (var card in _lazyStack.Cards.Concat(_interpreterQueue.Cards).Distinct())
|
||||
{
|
||||
@@ -1493,6 +1515,7 @@ namespace KernelPanic.Combat
|
||||
{
|
||||
int openingDraw = Mathf.Min(CombatTuning.OpeningHandSize, _handController == null ? _playerState.Ram : _handController.RamCapacity);
|
||||
if (_runConfig?.IsTutorial == true) openingDraw = Mathf.Min(_runManager.RunDeck.Count, _handController.RamCapacity);
|
||||
if (_runConfig?.TrainingLanguage is Language trainingLanguage) openingDraw = LanguageTraining.OpeningDraw(trainingLanguage);
|
||||
yield return DrawCardsToHandSequenced(openingDraw, "opening hand");
|
||||
}
|
||||
|
||||
@@ -2773,6 +2796,14 @@ namespace KernelPanic.Combat
|
||||
|
||||
private void SpawnEncounter()
|
||||
{
|
||||
if (_runConfig?.TrainingLanguage is Language trainingLanguage)
|
||||
{
|
||||
CurrentEncounter = new EncounterPlan("Language practice", "Try the guided combo, then finish the fight.", 0,
|
||||
"orphan_process", "orphan_process");
|
||||
for (int slot = 0; slot < 2; slot++)
|
||||
_enemies.Add(new EnemyInstance(EnemyArchetypeCatalog.Get("orphan_process"), LanguageTraining.TargetUptime(trainingLanguage, slot)));
|
||||
return;
|
||||
}
|
||||
if (_runConfig?.IsTutorial == true || _runManager?.Journey.campaign == true)
|
||||
{
|
||||
CurrentEncounter = _runConfig.IsTutorial ? TutorialCampaign.Plan(_runConfig.TutorialLesson)
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace KernelPanic.Combat
|
||||
public int JavaScriptFlatDamageBonus { get; set; }
|
||||
public int DamageMultiplierPercent { get; set; } = 100;
|
||||
public int CurrentCardDamageMultiplierPercent { get; set; } = 100;
|
||||
public int GovernorDamagePercent { get; set; } = 100;
|
||||
public int GovernorShieldPercent { get; set; } = 100;
|
||||
public int IncomingAttackHalfCharges { get; set; }
|
||||
public int ArchBtwStacks { get; set; }
|
||||
public int ArchBtwDamagePerStack { get; set; } = 1;
|
||||
|
||||
@@ -204,8 +204,8 @@ namespace KernelPanic.Combat
|
||||
|
||||
int multiplier = Mathf.Max(0, sourceMultiplierPercent ?? request.Source?.DamageMultiplierPercent ?? 100);
|
||||
int currentCardMultiplier = Mathf.Max(0, cardMultiplierPercent ?? request.Source?.CurrentCardDamageMultiplierPercent ?? 100);
|
||||
if (request.IsCardDamage && (request.LazyMultiplierPercent != 100 || request.CompilationPercent != 100))
|
||||
return CardScaling.Scale(amount, request.LazyMultiplierPercent, request.CompilationPercent, multiplier, currentCardMultiplier);
|
||||
if (request.IsCardDamage && (request.LazyMultiplierPercent != 100 || request.CompilationPercent != 100 || request.Source?.GovernorDamagePercent != 100))
|
||||
return CardScaling.Scale(amount, request.LazyMultiplierPercent, request.CompilationPercent, multiplier, currentCardMultiplier, request.Source?.GovernorDamagePercent ?? 100);
|
||||
return Mathf.RoundToInt(amount * (multiplier / 100f) * (currentCardMultiplier / 100f));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,12 @@ namespace KernelPanic.Combat
|
||||
return drawn;
|
||||
}
|
||||
|
||||
public void InitializeInDrawOrder(IEnumerable<CardInstance> cards)
|
||||
{
|
||||
_drawPile.Clear(); _discardPile.Clear(); _exhaustPile.Clear();
|
||||
if (cards != null) _drawPile.AddRange(cards.Where(card => card != null).Reverse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the top card into the hand if its RAM cost fits. A blocked card remains on top,
|
||||
/// so callers should stop drawing on failure instead of skipping to cheaper cards.
|
||||
|
||||
@@ -10,7 +10,10 @@ namespace KernelPanic.Combat
|
||||
{
|
||||
var lines = new List<string>();
|
||||
if (combat?.PlayerState == null) return lines;
|
||||
lines.Add("Native cards and Python preparation already executed. End turn runs ready Python automation, then Python FIFO, Haskell LIFO, surviving enemies, and cleanup.");
|
||||
lines.Add("Native cards and Python preparation already executed. End turn runs eligible Go goroutines, ready Python automation, Python FIFO, Haskell LIFO, surviving enemies, and cleanup.");
|
||||
foreach (var work in combat.Go.Active)
|
||||
lines.Add($"GO / PID {work.Id:000} / {work.SourceCard.Definition.DisplayName} / {work.RemainingTicks} ticks remaining / "
|
||||
+ (work.DeploymentRound >= combat.RoundNumber ? "waiting until next round" : "ticks before Python; live damage modifiers apply"));
|
||||
if (combat.Python.AutomationCount > 0 || combat.Python.RepeatCount > 0 || combat.Python.AreaCount > 0)
|
||||
foreach (string script in combat.Python.Readout) lines.Add(script);
|
||||
int order = 0;
|
||||
|
||||
Reference in New Issue
Block a user