The third Beacon now unseals the Security Booth, and entering it grants the Hissed Floppy Disk — a permanent run item: dash cooldown x0.85 (15% faster Evade) and a data trail dealing 8 base damage to enemies within 1.15 m of the dash path, once per enemy per Evade. The briefing stamp now opens only the Janitor and Locker rooms; the Booth stays sealed until all three monuments burn, so the disk is earned, not found. - Added floppy_disk.glb with its Blender generator (tools/blender/ build_floppy_disk.py) and a bobbing render path for Decor props carrying a model name; one disk authored in floor01.json - Rebuilt clearance-door visuals: fixed jamb/header frame, two leaves with a hot seam, red/green status bar and lit sill; open doors park their leaves - HUD objective switches to ENTER THE SECURITY BOOTH once the Beacons burn; disk buff stamp listed while held - Added --disk-test (beacons lit, start inside the Booth) and --door-test (start at the sealed door) QA flags - Tests: beacon_test extended with booth gating, disk claim, buff and one-hit-per-dash cases (17/17 pass)
97 lines
2.6 KiB
C++
97 lines
2.6 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "core/events.hpp"
|
|
#include "core/rng.hpp"
|
|
#include "game/beacon.hpp"
|
|
#include "game/blackout.hpp"
|
|
#include "game/buffs.hpp"
|
|
#include "game/corruption.hpp"
|
|
#include "game/director.hpp"
|
|
#include "game/enemies.hpp"
|
|
#include "game/floor.hpp"
|
|
#include "game/input.hpp"
|
|
#include "game/pickups.hpp"
|
|
#include "game/player.hpp"
|
|
#include "game/ritual.hpp"
|
|
#include "game/skills.hpp"
|
|
#include "game/weapons.hpp"
|
|
|
|
enum class GameState { Title, Playing, GameOver };
|
|
|
|
enum class OfferType { WeaponLevel, NewWeapon, Directive, Passive };
|
|
|
|
struct Offer {
|
|
OfferType type = OfferType::WeaponLevel;
|
|
int id = 0;
|
|
const char* name = "";
|
|
const char* description = "";
|
|
};
|
|
|
|
struct GameConfig {
|
|
float arena_half = 130.0f; // 260 m square Oldest House floor
|
|
int max_enemies = 260;
|
|
int max_weapons = 4;
|
|
bool no_player_damage = false; // dev stress mode (--no-damage)
|
|
};
|
|
|
|
// The whole simulation. Fixed 60 Hz ticks (see main.cpp). No raylib here:
|
|
// main fills InputState, the presenter reads the world and drains `events`.
|
|
class Game {
|
|
public:
|
|
explicit Game(std::uint64_t seed,
|
|
const std::string& level_path = Floor::kDefaultPath);
|
|
|
|
void update(const InputState& in, float dt);
|
|
void reset();
|
|
|
|
// World state (read by the presenter/UI).
|
|
GameState state = GameState::Playing;
|
|
Player player;
|
|
EnemySystem enemy_system;
|
|
WeaponSystem weapon_system;
|
|
SkillSystem skill_system; // player-triggered / autoplayed active skills
|
|
BlackoutSequence blackout; // projector-screen phone puzzle
|
|
bool blackout_auto = false; // dev --blackout-auto: answer phones automatically
|
|
PickupSystem pickup_system;
|
|
BuffSystem buff_system;
|
|
Corruption corruption;
|
|
Director director;
|
|
RitualSystem ritual_system;
|
|
BeaconSystem beacons;
|
|
Floor floor;
|
|
EventQueue events;
|
|
Rng rng;
|
|
GameConfig config;
|
|
|
|
float run_time = 0.0f;
|
|
int floor_number = 1;
|
|
int floor_clears = 0;
|
|
int clearance = 1; // diegetic stamp; gates the three side-room doors
|
|
float floor_banner = 0.0f;
|
|
const char* floor_banner_text = "";
|
|
float side_banner = 0.0f;
|
|
const char* side_banner_text = "";
|
|
int kills = 0;
|
|
int level = 1;
|
|
float xp = 0.0f;
|
|
float xp_to_next = 10.0f;
|
|
|
|
std::vector<Offer> pending_offers;
|
|
float offer_timer = 0.0f;
|
|
float idle_time = 0.0f;
|
|
|
|
private:
|
|
void death_pass();
|
|
void beacon_pass();
|
|
void side_room_pass();
|
|
void grant_ritual_skill();
|
|
void dash_trail_pass(Vec2 prev_pos);
|
|
|
|
std::uint64_t seed_ = 0;
|
|
int last_tier_ = 0;
|
|
bool side_reward_claimed_[Floor::kSideRoomCount] = {};
|
|
};
|