Rebalance most languages and revamp main game loop
This commit is contained in:
@@ -375,6 +375,28 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A fixed replacement draw; magnitude and source effect bonuses do not increase it.</summary>
|
||||
public sealed class FixedDrawEffect : ICardEffect
|
||||
{
|
||||
private readonly int _count;
|
||||
|
||||
public FixedDrawEffect(int count)
|
||||
{
|
||||
_count = count;
|
||||
}
|
||||
|
||||
public void Execute(CombatContext context)
|
||||
{
|
||||
int added = 0;
|
||||
// Use the same ordered, RAM-aware draw operation as ordinary draw effects.
|
||||
while (added < _count && context.DeckController.TryDrawToHand(context.HandController, out _))
|
||||
added++;
|
||||
string capped = added < _count && context.DeckController.AvailableToDrawCount > 0
|
||||
? " (not enough RAM)" : string.Empty;
|
||||
context.CombatManager.ReportEffectResult($"drew {added}{capped}");
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class AskUbuntuEffect : ICardEffect
|
||||
{
|
||||
internal const int BaseDrawCount = 2;
|
||||
@@ -892,6 +914,12 @@ namespace KernelPanic.Combat
|
||||
}
|
||||
|
||||
public static string GetRulesText(CardInstance card)
|
||||
=> GetRulesText(card, null, 1);
|
||||
|
||||
public static string GetRulesText(CardInstance card, KernelPanic.Run.RunConfig config)
|
||||
=> GetRulesText(card, config?.Distro?.Id, config?.DistroVersion ?? 1);
|
||||
|
||||
public static string GetRulesText(CardInstance card, string distroId, int distroVersion)
|
||||
{
|
||||
if (card?.Definition == null)
|
||||
{
|
||||
@@ -910,7 +938,8 @@ namespace KernelPanic.Combat
|
||||
|
||||
if (CardCatalog.TryGet(card.Definition.Id, out CardCatalogEntry entry))
|
||||
{
|
||||
return entry.GetRulesText(card);
|
||||
return entry.GetRulesText(card, distroId, distroVersion)
|
||||
+ (card.ExhaustOnPlay ? " Temporary copy: exhaust after play." : string.Empty);
|
||||
}
|
||||
|
||||
return string.IsNullOrWhiteSpace(card.Definition.Description)
|
||||
|
||||
Reference in New Issue
Block a user