implement artifact win condition (REQ-WIN-ARTIFACT-COUNT, REQ-WIN-SCREEN)
- Add [artifacts] config section to world.toml with artifact_chance_formula (x = station level) and artifact_win_count - Roll artifact chance before each schematic drop; on success show 2 schematics + Artifact option instead of 3 - Selecting Artifact increments artifact count; reaching artifact_win_count triggers win screen - Display "Artifacts: x/y" in header bar via ArtifactCountChangedEvent - Win screen mirrors game-over screen with "Won!" caption and same Restart/Quit buttons Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DUsFgd2Ga6pmLz8giS8WUn
This commit is contained in:
@@ -301,6 +301,9 @@ WorldConfig ConfigLoader::loadWorld(const std::string& path)
|
||||
cfg.targeting.overclaimPenaltyFormula = requireFormula(tbl["targeting"]["overclaim_penalty_formula"], file, "targeting.overclaim_penalty_formula");
|
||||
cfg.targeting.hysteresis = requireDouble(tbl["targeting"]["target_hysteresis"], file, "targeting.target_hysteresis");
|
||||
|
||||
cfg.artifacts.artifactChanceFormula = requireFormula(tbl["artifacts"]["artifact_chance_formula"], file, "artifacts.artifact_chance_formula");
|
||||
cfg.artifacts.artifactWinCount = static_cast<int>(requireInt(tbl["artifacts"]["artifact_win_count"], file, "artifacts.artifact_win_count"));
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ struct WorldTargeting
|
||||
double hysteresis; // fractional margin a challenger must beat the current target by
|
||||
};
|
||||
|
||||
// Artifact win condition (REQ-WIN-ARTIFACT-COUNT, REQ-WIN-SCREEN).
|
||||
struct WorldArtifacts
|
||||
{
|
||||
Formula artifactChanceFormula; // x = station level, result clamped to [0,1]
|
||||
int artifactWinCount;
|
||||
};
|
||||
|
||||
struct WorldConfig
|
||||
{
|
||||
int heightTiles; // REQ-GW-HEIGHT
|
||||
@@ -65,4 +72,5 @@ struct WorldConfig
|
||||
WorldPush push;
|
||||
WorldWaves waves;
|
||||
WorldTargeting targeting;
|
||||
WorldArtifacts artifacts;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user