phase 10: schools — Mechanic, Naturalist, Navigator with unlock system and bonuses

Add 3 new schools with real scientific principles (Lever & Moment, Photosynthesis,
Angular Measurement). Data-driven unlock conditions check codex elements, creature
discoveries, and completed runs. Each school provides passive gameplay bonuses
(projectile damage, movement speed, creature aggro range, reaction efficiency)
applied through system multiplier parameters. CradleScene shows all 4 schools with
locked ones grayed out and showing unlock hints. 24 new tests (511 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Денис Шкабатур
2026-02-12 18:35:15 +03:00
parent 1b2cc0cd86
commit 0cd995c817
10 changed files with 573 additions and 76 deletions

View File

@@ -25,8 +25,44 @@ export interface SchoolData {
playstyleRu: string;
/** Hex color for UI representation */
color: string;
/** Passive gameplay bonuses from this school's principle */
bonuses: Record<string, number>;
/** Condition to unlock this school (absent = always unlocked) */
unlockCondition?: SchoolUnlockCondition;
}
/** Condition that must be met to unlock a school */
export interface SchoolUnlockCondition {
/** What metric to check */
type: 'elements_discovered' | 'creatures_discovered' | 'runs_completed';
/** How many needed */
threshold: number;
/** Hint text (English) shown when locked */
hint: string;
/** Hint text (Russian) shown when locked */
hintRu: string;
}
/** Resolved school bonuses with all multipliers filled in (defaults = 1.0) */
export interface ResolvedSchoolBonuses {
/** Projectile damage multiplier */
projectileDamage: number;
/** Player movement speed multiplier */
movementSpeed: number;
/** Creature aggro/flee range multiplier (< 1 = less aggro) */
creatureAggroRange: number;
/** Reaction efficiency multiplier */
reactionEfficiency: number;
}
/** Default bonuses (no school effect) */
export const DEFAULT_SCHOOL_BONUSES: ResolvedSchoolBonuses = {
projectileDamage: 1.0,
movementSpeed: 1.0,
creatureAggroRange: 1.0,
reactionEfficiency: 1.0,
};
// ─── Run Phases ──────────────────────────────────────────────────
/** Phases of a single run in order */