Implement more QoL features and rebalances
This commit is contained in:
@@ -57,6 +57,26 @@ namespace KernelPanic.Run
|
||||
public bool IsSuspended { get; private set; }
|
||||
public RunJourney Journey { get; private set; } = new();
|
||||
public bool CampaignChoicePending => Journey.AtMilestone(_wavesCleared);
|
||||
public bool BuildRewardPending => Journey.pendingRewardWave > 0;
|
||||
public const int BuildRewardBits = 8;
|
||||
|
||||
public bool ClaimBuildReward(CardInstance card, CardUpgradeKind kind, bool takeBits = false)
|
||||
{
|
||||
if (!isRunActive || IsSuspended || !_repositoryVisitActive || !BuildRewardPending) return false;
|
||||
if (!takeBits && (card?.Definition == null || !_runDeck.Contains(card)
|
||||
|| card.Definition.IsToken || card.Definition.IsJunk
|
||||
|| (kind != CardUpgradeKind.MagnitudeUp && kind != CardUpgradeKind.DrawRider)
|
||||
|| (kind == CardUpgradeKind.DrawRider && card.DrawRider > 0))) return false;
|
||||
if (!takeBits && !ApplyCardUpgrade(card, kind)) return false;
|
||||
if (takeBits) _bits += BuildRewardBits;
|
||||
Journey.claimedRewardWave = Journey.pendingRewardWave;
|
||||
Journey.pendingRewardWave = 0;
|
||||
Journey.lastReward = takeBits ? $"Build reward: +{BuildRewardBits} Bits."
|
||||
: $"Build reward: {card.Definition.DisplayName} gained " +
|
||||
(kind == CardUpgradeKind.DrawRider ? "+1 draw on resolution." : $"+{CombatTuning.UpgradeMagnitudeBonus} effect magnitude.");
|
||||
RepositoryChanged?.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SelectRoute(WaveRoute route)
|
||||
{
|
||||
@@ -78,7 +98,7 @@ namespace KernelPanic.Run
|
||||
// Called exactly once by the guarded combat transition, never by UI callbacks.
|
||||
public void PrepareNextEncounter(CombatantState player)
|
||||
{
|
||||
if (!_repositoryVisitActive || !isRunActive || IsSuspended || CampaignChoicePending) return;
|
||||
if (!_repositoryVisitActive || !isRunActive || IsSuspended || CampaignChoicePending || BuildRewardPending) return;
|
||||
Journey.activeRoute = Journey.selectedRoute;
|
||||
if (Journey.campaign && Journey.activeRoute == WaveRoute.Repair && player != null)
|
||||
player.CurrentUptime = Mathf.Min(player.MaxUptime, player.CurrentUptime + RunJourney.RepairUptime);
|
||||
@@ -150,7 +170,7 @@ namespace KernelPanic.Run
|
||||
bandwidth = _accruedBandwidth, entropy = _accruedEntropy,
|
||||
maxUptimeBonus = _maxUptimeBonus, maxCyclesBonus = _maxCyclesBonus, ramBonus = _ramBonus,
|
||||
rerolls = _rerollsThisVisit, shopRandomDraws = _repositoryRandom.Draws,
|
||||
version = 2, journey = Journey.Copy(),
|
||||
version = 3, journey = Journey.Copy(),
|
||||
combat = combat.CaptureBoundaryState()
|
||||
};
|
||||
foreach (PackageInstance package in CurrentConfig.EquippedPackages)
|
||||
@@ -387,6 +407,8 @@ namespace KernelPanic.Run
|
||||
}
|
||||
}
|
||||
Journey.selectedRoute = WaveRoute.Repair;
|
||||
if (Journey.campaign && Journey.encounterRevision > 0 && (clearedWave == 2 || clearedWave == 4))
|
||||
Journey.pendingRewardWave = clearedWave;
|
||||
_wavesCleared = Mathf.Max(_wavesCleared, clearedWave);
|
||||
if (CurrentConfig?.IsTutorial != true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user