26 lines
783 B
C++
26 lines
783 B
C++
#pragma once
|
|
|
|
#include "core/events.hpp"
|
|
#include "core/math.hpp"
|
|
#include "core/pool.hpp"
|
|
#include "core/rng.hpp"
|
|
#include "game/buffs.hpp"
|
|
#include "game/enemies.hpp"
|
|
#include "game/player.hpp"
|
|
|
|
struct XpShard {
|
|
Vec2 pos{};
|
|
float value = 1.0f;
|
|
};
|
|
|
|
struct PickupSystem {
|
|
DensePool<XpShard> shards{2048};
|
|
|
|
void clear() { shards.clear(); }
|
|
void spawn(Vec2 pos, float value, Rng& rng);
|
|
// Magnet pull toward the player inside pickup_radius; collects on contact.
|
|
// World objects of power: magnet catch applies their effect on contact —
|
|
// the player, or the nearest enemy if one is nearby (§4.6).
|
|
void update(float dt, const Player& player, EventQueue& events, float& xp_gained,
|
|
BuffSystem& buff_system, EnemySystem& enemies);
|
|
};
|