Implement animations, pipeline for duplicates and merging.

This commit is contained in:
2026-07-07 14:10:31 +02:00
parent 30db1e1108
commit d504e0b916
22 changed files with 1947 additions and 117 deletions
+37
View File
@@ -55,6 +55,43 @@ namespace KernelPanic.Combat
return drawn;
}
public bool TryDrawCheapestFromTop(int lookCount, out CardInstance card)
{
card = null;
if (lookCount <= 0)
{
return false;
}
if (_drawPile.Count == 0)
{
ReshuffleDiscardIntoDraw();
}
if (_drawPile.Count == 0)
{
return false;
}
int inspectCount = System.Math.Min(lookCount, _drawPile.Count);
int selectedIndex = _drawPile.Count - 1;
int selectedCost = CombatManager.GetCardCost(_drawPile[selectedIndex]);
for (int offset = 1; offset < inspectCount; offset++)
{
int index = _drawPile.Count - 1 - offset;
int cost = CombatManager.GetCardCost(_drawPile[index]);
if (cost < selectedCost)
{
selectedCost = cost;
selectedIndex = index;
}
}
card = _drawPile[selectedIndex];
_drawPile.RemoveAt(selectedIndex);
return card != null;
}
public void Discard(CardInstance card)
{
if (card != null)