Pacing: - Spin cooldown 0.55 -> 0.95 s (-3%/level instead of -8%); damage ramp +28%/level - Weakened fire-rate offers (Rapid Cycling +8%, Board Favor +4%, Maintenance +5%) - Stretched XP curve to 10+6*level and offer cadence to 3 s (5 s idle) - Calmed early director income and spawn interval; docs updated Crystal/buff decoupling: - Kills drop XP shards only; removed the per-kill random buff world object - PickupSystem owns shards alone; BuffSystem catches world objects with its own 2.8 m radius, independent of shard pickup magnet/upgrades - Explicit guaranteed world-object spawns for rituals and side rooms; effect-less bait consumed without a buff - ShardCollected only emitted for actual shard/XP rewards - Updated design docs, RPG_LITE and README
89 lines
2.3 KiB
C++
89 lines
2.3 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "core/events.hpp"
|
|
#include "core/rng.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/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;
|
|
PickupSystem pickup_system;
|
|
BuffSystem buff_system;
|
|
Corruption corruption;
|
|
Director director;
|
|
RitualSystem ritual_system;
|
|
Floor floor;
|
|
EventQueue events;
|
|
Rng rng;
|
|
GameConfig config;
|
|
|
|
float run_time = 0.0f;
|
|
bool has_key = false;
|
|
int floor_number = 1;
|
|
int floor_clears = 0;
|
|
int clearance = 1; // diegetic stamp; gates the three side-room doors
|
|
float floor_banner = 0.0f;
|
|
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 floor_pass();
|
|
void side_room_pass();
|
|
void grant_ritual_skill();
|
|
|
|
std::uint64_t seed_ = 0;
|
|
int last_tier_ = 0;
|
|
bool side_reward_claimed_[Floor::kSideRoomCount] = {};
|
|
};
|