Class RunState

Namespace
SurvivorsMaker.Run
Assembly
SurvivorsMaker.Run.dll

Everything that persists between waves. Systems in Run/ read and write it.

public sealed class RunState
Inheritance
RunState
Inherited Members

Constructors

RunState()

public RunState()

Fields

Arena

public ArenaDef Arena

Field Value

ArenaDef

BanishedItemIds

public List<string> BanishedItemIds

Field Value

List<string>

BanishedWeaponIds

public List<string> BanishedWeaponIds

Field Value

List<string>

BanishesUsed

public int BanishesUsed

Field Value

int

CarriedHealth

Field mode: health carried into the next wave; 0 = start full.

public int CarriedHealth

Field Value

int

CarriedTriggerCounters

public readonly List<TriggerCounterSnapshot> CarriedTriggerCounters

Field Value

List<TriggerCounterSnapshot>

Character

public CharacterDef Character

Field Value

CharacterDef

CharacterEffectStates

public List<EffectLeaseState> CharacterEffectStates

Field Value

List<EffectLeaseState>

Choices

public readonly List<LevelUpChoice> Choices

Field Value

List<LevelUpChoice>

CombatWallet

public StatWallet CombatWallet

Field Value

StatWallet

Content

public RunContent Content

Field Value

RunContent

ContinuingEffects

public List<WaveEffectLease> ContinuingEffects

Field Value

List<WaveEffectLease>

Currency

public int Currency

Field Value

int

Difficulty

public int Difficulty

Field Value

int

Experience

public float Experience

Field Value

float

GuaranteeUses

public List<GuaranteeUse> GuaranteeUses

Field Value

List<GuaranteeUse>

HandlerEffects

Per-character/item application payloads, separate from immutable definitions.

public List<WaveEffectLease> HandlerEffects

Field Value

List<WaveEffectLease>

InventoryRevision

public long InventoryRevision

Field Value

long

ItemInstances

public List<OwnedItemState> ItemInstances

Field Value

List<OwnedItemState>

Items

Items and chosen upgrades in the order they were gained.

public readonly List<ItemDef> Items

Field Value

List<ItemDef>

LastWaveCurrency

Currency from the last survived wave and how much of it was the completion reward.

public int LastWaveCurrency

Field Value

int

LastWaveReward

public int LastWaveReward

Field Value

int

Level

public int Level

Field Value

int

LevelUpPoolResult

public OfferPoolResult LevelUpPoolResult

Field Value

OfferPoolResult

Mode

public RunMode Mode

Field Value

RunMode

NextEffectCarryId

public long NextEffectCarryId

Field Value

long

NextItemInstanceId

public long NextItemInstanceId

Field Value

long

PendingLevelUps

public int PendingLevelUps

Field Value

int

Phase

public RunPhase Phase

Field Value

RunPhase

PlaytestInvulnerable

public bool PlaytestInvulnerable

Field Value

bool

PlaytestResumeWave

public bool PlaytestResumeWave

Field Value

bool

Random

Level-up and shop rolls. Waves use their own seeded random.

public SimRandom Random

Field Value

SimRandom

Request

public RunRequest Request

Field Value

RunRequest

Rerolls

public int Rerolls

Field Value

int

RunTriggers

public readonly List<TriggerState> RunTriggers

Field Value

List<TriggerState>

Settings

public RunSettings Settings

Field Value

RunSettings

Shop

public readonly List<ShopOffer> Shop

Field Value

List<ShopOffer>

ShopPoolResult

public OfferPoolResult ShopPoolResult

Field Value

OfferPoolResult

ShopVisit

public long ShopVisit

Field Value

long

SimSettings

public SimSettings SimSettings

Field Value

SimSettings

TierScratch

Scratch list for tier weights, reused to avoid allocations.

public readonly List<float> TierScratch

Field Value

List<float>

TotalIncome

Gross combat receipts, kept separately from the spendable net balance.

public long TotalIncome

Field Value

long

TotalKills

public int TotalKills

Field Value

int

TriggerEvents

public readonly List<RunTriggerFact> TriggerEvents

Field Value

List<RunTriggerFact>

TriggerSequence

public long TriggerSequence

Field Value

long

UsedCheats

public bool UsedCheats

Field Value

bool

Wave

The wave being played, or null between waves.

public WaveSimulation Wave

Field Value

WaveSimulation

WaveIndex

0-based index into Arena.Waves.

public int WaveIndex

Field Value

int

Weapons

Weapons in slot order.

public readonly List<WeaponItemDef> Weapons

Field Value

List<WeaponItemDef>

Properties

BanishesRemaining

public int BanishesRemaining { get; }

Property Value

int

CurrentCurrency

public int CurrentCurrency { get; }

Property Value

int

WaveNumber

public int WaveNumber { get; }

Property Value

int

Methods

AddItem(ItemDef)

Acquisition eligibility is validated by the caller; this owns the ordered pair mutation.

public RunResult AddItem(ItemDef definition)

Parameters

definition ItemDef

Returns

RunResult

Banish(int, OfferChannel)

Validates all conditions before consuming a charge or clearing an offer.

public RunResult Banish(int index, OfferChannel channel = OfferChannel.Shop)

Parameters

index int
channel OfferChannel

Returns

RunResult

BeginCombatWallet()

Initializes the wave wallet from run currency at a legal combat boundary.

public RunResult BeginCombatWallet()

Returns

RunResult

ExpireItems(int)

Removes item copies whose wave lifetime has ended and returns the number removed.

public int ExpireItems(int wave)

Parameters

wave int

Returns

int

InitializeItemInstances()

Imports a legacy list or appended suffix. Never guesses identity after removal/reorder.

public bool InitializeItemInstances()

Returns

bool

ItemInstancesAligned()

Checks that owned definitions and per-copy instance state have matching order and identity.

public bool ItemInstancesAligned()

Returns

bool

MergeItems(int, int, ItemDef)

Caller validates result eligibility first. No removal replacement rewards or attack state transfer.

public RunResult MergeItems(int target, int material, ItemDef result)

Parameters

target int
material int
result ItemDef

Returns

RunResult

RemoveItem(int)

Removes the indexed owned item together with its instance state, or rejects an invalid index.

public RunResult RemoveItem(int index)

Parameters

index int

Returns

RunResult

ReplaceItem(int, ItemDef)

Replaces an owned definition while keeping the paired item-instance list synchronized.

public RunResult ReplaceItem(int index, ItemDef definition)

Parameters

index int
definition ItemDef

Returns

RunResult

SettleCombatWallet()

Flow calls on success or defeat, instead of adding gross wave income.

public RunResult SettleCombatWallet()

Returns

RunResult

TryCreditCurrency(int)

Credits currency through the active combat wallet or run balance; failure leaves state unchanged.

public bool TryCreditCurrency(int amount)

Parameters

amount int

Returns

bool

TryDebitCurrency(int)

Debits available currency through the active combat wallet or run balance; failure leaves state unchanged.

public bool TryDebitCurrency(int amount)

Parameters

amount int

Returns

bool