mission-result.ts

Acheron — Purpose

Post-run data contract. The engine builds a MissionResult at mission end (death or objective complete) and hands it off to the results screen, progression system, and economy. Companion output shape to run-config (the engine’s input contract). Every field is required — no optional data.

Matches archive buildMissionResult() v2.2 from 07g-mission.js.

Cocytus — Contract metadata

FieldValue
__version'2.2' (literal)
__contract'MissionResult' (literal)

Both are literal-string type tags. Cross-version readers must check __version before reading other fields.

Lethe — Top-level shape

MissionResult has eight required nested blocks:

BlockWhat it carries
identityWhich node was played (id, heat, type, ship, seed)
outcomeWin/loss, cause of death, end-phase, boss multiplier, revive/daily/rare flags
performance0-100 score, reward tier, objectives, timer, time bonus, death-defiance
progressionLevel, tier, artifacts, weapons, upgrades, events, newly-unlocked artifact ids
combatKills by type, total kills, boss id, damage dealt/taken, ability uses, per-weapon stats
economyCoins collected, final multiplier state (damage/hp/shield)
explorationDistance, max distance from genesis, POIs visited, sub-zone entered

Phlegethon — Field reference

identity

FieldTypeMeaning
nodeIdstringGalaxy node played
heatnumberHeat tier of the node
missionTypestringMission type (e.g. boss, objective, survival)
shipIdstringShip loadout used
seednumberRNG seed (reproducibility)

outcome

FieldTypeMeaning
survivedbooleanTrue if the player lived to end-state
bossKilledbooleanTrue if mission boss died
causeOfDeathstring | nullSource string when dead, null when alive
missionPhaseAtEndstringPhase label when the run ended (default 'playing')
bossDifficultyMultnumberMultiplier applied to the boss; default 1.0
reviveTokenUsedbooleanPlayer consumed a revive token
dailyBonusActivebooleanDaily bonus was applied to this run
wasRareSignalbooleanNode was a rare-signal variant

performance

FieldTypeMeaning
scorenumberAggregate 0-100 score
rewardTierstring'bronze' | 'silver' | 'gold' | 'diamond'
objectivesCompletednumberPrimary objectives cleared
objectivesTotalnumberTotal primary objectives
bonusObjectivesnumberBonus objectives cleared
timeElapsedSecondsnumberWall-clock time alive
timerRemainingSecondsnumberTime left on mission timer
timeBonusEarnedbooleanTime bonus condition met
deathDefianceUsedbooleanDeath-defiance trigger fired

progression

FieldTypeMeaning
levelReachednumberFinal player level
tierReachednumberHighest mission difficulty tier (4-min escalation counter, starts at 1, increments each time the timer expires and difficulty ramps)
artifactsCollectednumberArtifacts picked up
weaponsFoundnumberWeapons obtained
weaponsAtEndArray<{ id: string; level: number }>Loadout snapshot at end
highestWeaponLevelnumberMax level any weapon hit
upgradesChosennumberLevel-up upgrades selected
eventsCompletednumberWorld events finished
newlyUnlockedArtifactIdsstring[]Artifacts that hit legendary tier this run for the first time — were not already unlocked as starting-artifact options. Drives the run-stats “ALIEN ARTIFACTS UNLOCKED” reveal
artifactBestTierThisRunRecord<string, number>Highest runtime tier (0-4) reached for each artifact this run. Flushed into artifactUnlocksStore.bestTier so the picker can show tier history for not-yet-legendary artifacts

combat

FieldTypeMeaning
enemiesKilledByTypeRecord<string, number>Kill counts keyed by enemy type id
totalKillsnumberSum across all enemy types
bossIdstringBoss id (empty string if no boss)
damageDealtnumberTotal damage out
damageTakennumberTotal damage in
abilityUsesnumberAbility activation count
weaponStatsArray<{ id: string; dmg: number; shots: number; hits: number }>Per-weapon telemetry. Populated at mission end

economy

FieldTypeMeaning
coinsCollectednumberRaw coin pickups (pre-meta-multiplier)
finalMultipliers.damagePctnumberDamage multiplier state at end
finalMultipliers.hpPctnumberHP multiplier state at end
finalMultipliers.shieldPctnumberShield multiplier state at end

exploration

FieldTypeMeaning
distanceTravelednumberCumulative travel distance
maxDistanceFromGenesisnumberFarthest point reached from spawn
poisVisitednumberPoints-of-interest entered
subZoneEnteredbooleanPlayer crossed into a sub-zone

Styx — Exports

SymbolKindUse
MissionResultinterfaceThe contract type
createEmptyResult(nodeId, heat, missionType, shipId, seed)functionReturns a fully-zeroed MissionResult. Identity fields filled from args; everything else gets neutral defaults (false / 0 / null / 'playing' / 'bronze' / 1 / 1.0 / [] / {} / ''). Engine mutates the result during the run and at mission end

createEmptyResult defaults

SectionDefaults
outcomesurvived: false, bossKilled: false, causeOfDeath: null, missionPhaseAtEnd: 'playing', bossDifficultyMult: 1.0, flags false
performancescore: 0, rewardTier: 'bronze', all counters 0, flags false
progressionlevelReached: 1, tierReached: 1, highestWeaponLevel: 1, arrays/records empty, counters 0
combattotalKills: 0, bossId: '', damages/uses 0, arrays/records empty
economycoinsCollected: 0, all multipliers 0
explorationall 0 / false

Acheron — Consumers

  • Results screen — renders score, reward tier, objectives, kills, time.
  • Progression system — applies XP, levels, newly-unlocked artifacts (newlyUnlockedArtifactIds, artifactBestTierThisRunartifactUnlocksStore.bestTier).
  • Economy — credits coinsCollected after meta-multipliers.

Cocytus — Companion contracts

  • Input contract: run-config — what the engine receives.
  • Output contract: this file (mission-result) — what the engine returns.

Together they fully bracket a run: shell hands in a RunConfig, engine hands back a MissionResult.


EXTRACT-CANDIDATE: The 'bronze' | 'silver' | 'gold' | 'diamond' reward-tier set is encoded as a free-form string on performance.rewardTier (comment-only). Promoting to a string-literal union (or shared enum/type) would let TypeScript reject typos at boss/results boundaries and would make the tier list one canonical declaration instead of a doc comment.