fix(simulation): correct CONTAMINATION_DELAY_TICKS from 1800 to 300
The constant was supposed to represent 30 game-minutes but the formula was wrong (30 × 10 tps × 60s = 1800). Correct derivation: 30 minutes × TICKS_PER_GAME_MINUTE (10) = 300. Now uses the canonical constant directly. Also fixes stale assertion message in integration test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
//!
|
||||
//! ## Contamination (#254)
|
||||
//!
|
||||
//! After `CONTAMINATION_DELAY_TICKS` (default 1800 = 30 game-minutes at
|
||||
//! 10 tps), the storyteller:
|
||||
//! After `CONTAMINATION_DELAY_TICKS` (default 300 = 30 game-minutes at
|
||||
//! 10 ticks/game-minute per D-031), the storyteller:
|
||||
//! 1. Sets `ContaminationActive` resource to true (one-shot)
|
||||
//! 2. Applies a tension delta to all `ActiveFork` triangles
|
||||
//! 3. Emits a `ContaminationEvent` for downstream systems (monologue, etc.)
|
||||
@@ -18,14 +18,14 @@ use bevy_ecs::prelude::*;
|
||||
|
||||
use crate::content::template::{TriangleClassification, TriangleState};
|
||||
use crate::simulation::tier::ActiveSim;
|
||||
use crate::simulation::time::SimulationTime;
|
||||
use crate::simulation::time::{SimulationTime, TICKS_PER_GAME_MINUTE};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Tick at which contamination activates (30 game-minutes × 10 tps × 60s = 1800).
|
||||
pub const CONTAMINATION_DELAY_TICKS: u64 = 1800;
|
||||
/// Tick at which contamination activates (30 game-minutes × 10 ticks/minute = 300).
|
||||
pub const CONTAMINATION_DELAY_TICKS: u64 = 30 * TICKS_PER_GAME_MINUTE;
|
||||
|
||||
/// Tension delta applied to ActiveFork triangles when contamination fires.
|
||||
pub const CONTAMINATION_PRESSURE_DELTA: u8 = 10;
|
||||
@@ -41,7 +41,7 @@ pub const CONFRONTATION_THRESHOLD: u8 = 75;
|
||||
/// Whether contamination has been activated by the storyteller.
|
||||
///
|
||||
/// Once set to `true`, it stays true for the remainder of the session.
|
||||
/// Persisted via save state (future — currently session-scoped).
|
||||
/// Persisted in `SaveStateV1` to prevent double-firing on save/load.
|
||||
#[derive(Resource, Debug, Clone, Default)]
|
||||
pub struct ContaminationActive(pub bool);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user