rogged/src/game_state.h
NotAShelf 5b640dcefd
render: use tileset atlas for all entity and tile rendering; anims
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Idb42cff72368e26d8d44db79ba9c413a6a6a6964
2026-04-28 15:33:19 +03:00

77 lines
2 KiB
C

#ifndef GAME_STATE_H
#define GAME_STATE_H
#include "common.h"
#include "tileset/tileset.h"
#include <raylib.h>
// Floating damage text
typedef enum { LABEL_NONE = 0, LABEL_DODGE, LABEL_BLOCK, LABEL_CRIT, LABEL_SLAIN, LABEL_PROC } FloatingLabel;
typedef struct {
int x, y;
int value;
int lifetime; // frames remaining
int is_critical;
FloatingLabel label; // label type instead of string
StatusEffectType effect_type; // used to pick color for proc labels
} FloatingText;
// AudioAssets
typedef struct {
Sound attack1, attack2, attack3;
Sound pickup;
Sound staircase;
Sound dodge1, dodge2, dodge3;
Sound crit;
} AudioAssets;
// GameState - encapsulates all game state for testability and save/load
typedef struct {
Player player;
Map map;
Dungeon dungeon;
Enemy enemies[MAX_ENEMIES];
int enemy_count;
Item items[MAX_ITEMS];
int item_count;
int game_over;
int game_won;
const char *last_message;
int message_timer;
int turn_count;
int awaiting_descend; // 0 = normal, 1 = waiting for Y/N
int show_inventory; // 0 = hidden, 1 = show overlay
int inv_selected; // currently selected inventory index
// action log
char action_log[5][128];
int log_count;
int log_head;
// visual effects
FloatingText floating_texts[8];
int floating_count;
int screen_shake; // frames of screen shake remaining
int shake_x;
int shake_y;
AudioAssets sounds;
// Statistics
int total_kills;
int items_collected;
int damage_dealt;
int damage_taken;
int crits_landed;
int times_hit;
int potions_used;
int floors_reached;
int final_score;
// Seed for this run
unsigned int run_seed;
// Tileset atlas for rendering
Tileset tileset;
// Slash effect timer for attack animations
int slash_timer; // frames remaining for slash effect
int slash_x, slash_y; // position of slash effect
DamageClass slash_dmg_class; // damage type for slash visual
} GameState;
#endif // GAME_STATE_H