phantasia

Phantasia - 2D SDL3 RPG prototype.
git clone git://git.beep.wimdupont.com/phantasia.git
Log | Files | Refs | README | LICENSE

content.h (2769B)


      1 #ifndef PH_GAME_CONTENT_H
      2 #define PH_GAME_CONTENT_H
      3 
      4 #include "engine/area.h"
      5 #include "engine/audio.h"
      6 #include "engine/battle.h"
      7 #include "engine/render.h"
      8 #include "engine/world.h"
      9 
     10 enum { PH_SHOP_STOCK_MAX = 8, PH_SHOP_TALK_LINES = 2 };
     11 
     12 typedef enum {
     13 	PH_SHOP_ITEMS,
     14 	PH_SHOP_SPELLS,
     15 } PhShopKind;
     16 
     17 typedef struct {
     18 	int id;
     19 	const char *name;
     20 	PhShopKind kind;
     21 	int stock[PH_SHOP_STOCK_MAX];
     22 	int stock_count;
     23 	const char *talk[PH_SHOP_TALK_LINES];
     24 } PhShopDef;
     25 
     26 typedef enum {
     27 	PH_INTERACTION_NONE,
     28 	PH_INTERACTION_SHOP,
     29 } PhInteractionKind;
     30 
     31 typedef struct {
     32 	int id;
     33 	PhInteractionKind kind;
     34 	int content_id;
     35 } PhInteractionDef;
     36 
     37 enum {
     38 	PH_AUDIO_NONE,
     39 	PH_MUSIC_MEADOW,
     40 	PH_MUSIC_TOWN,
     41 	PH_MUSIC_BATTLE,
     42 	PH_SOUND_ATTACK,
     43 	PH_SOUND_HIT,
     44 	PH_SOUND_SPELL,
     45 	PH_SOUND_MENU,
     46 	PH_SOUND_PICKUP,
     47 	PH_SOUND_DROP,
     48 	PH_SOUND_STEP,
     49 	PH_SOUND_INTERACT,
     50 	PH_SOUND_TRADE,
     51 	PH_AUDIO_COUNT,
     52 };
     53 
     54 enum {
     55 	PH_ASSET_NONE,
     56 	PH_ASSET_TILESET,
     57 	PH_ASSET_HERO,
     58 	PH_ASSET_ITEMS,
     59 	PH_ASSET_CRITTERS,
     60 	PH_ASSET_COUNT,
     61 };
     62 
     63 enum {
     64 	PH_DEF_PLAYER = 1,
     65 	PH_DEF_SLIME,
     66 	PH_DEF_SHOPKEEPER,
     67 	PH_DEF_MAGICK_KEEPER,
     68 	PH_ENTITY_DEF_COUNT = 4,
     69 };
     70 
     71 enum {
     72 	PH_ITEM_RUSTED_SPEAR = 1,
     73 	PH_ITEM_WAYFARER_BLADE,
     74 	PH_ITEM_TRAVELER_COAT,
     75 	PH_ITEM_HEALING_POTION,
     76 	PH_ITEM_ETHER,
     77 	PH_ITEM_DEF_COUNT = 5,
     78 };
     79 
     80 enum {
     81 	PH_AREA_MEADOW = 1,
     82 	PH_AREA_STONEHOLLOW,
     83 	PH_AREA_MIRA_SHOP,
     84 	PH_AREA_MAGICK_SHOP,
     85 	PH_AREA_COUNT = 4,
     86 	PH_START_AREA = PH_AREA_MEADOW,
     87 };
     88 
     89 enum {
     90 	PH_SHOP_STONEHOLLOW = 1,
     91 	PH_SHOP_MAGICK,
     92 	PH_SHOP_COUNT = 2,
     93 };
     94 
     95 enum {
     96 	PH_INTERACTION_MIRA = 1,
     97 	PH_INTERACTION_MAGUS,
     98 	PH_INTERACTION_COUNT = 2,
     99 };
    100 
    101 enum {
    102 	PH_SPELL_FLASH = 1,
    103 	PH_SPELL_HEAL,
    104 	PH_SPELL_EMBER,
    105 	PH_SPELL_DAZE,
    106 	PH_SPELL_INFERNO,
    107 	PH_SPELL_METEOR,
    108 	PH_SPELL_DEF_COUNT = 6,
    109 	PH_PLAYER_SPELL_COUNT = 2,
    110 };
    111 
    112 enum {
    113 	PH_TILE_DEF_COUNT = 29,
    114 	PH_MARKER_DEF_COUNT = 18,
    115 };
    116 
    117 extern const PhAssetDef ph_asset_defs[PH_ASSET_COUNT];
    118 extern const PhAudioDef ph_audio_defs[PH_AUDIO_COUNT];
    119 extern const PhAreaDef ph_area_defs[PH_AREA_COUNT];
    120 extern const PhTileDef ph_tile_defs[PH_TILE_DEF_COUNT];
    121 extern const PhEntityDef ph_entity_defs[PH_ENTITY_DEF_COUNT];
    122 extern const PhItemDef ph_item_defs[PH_ITEM_DEF_COUNT];
    123 extern const PhSpellDef ph_spell_defs[PH_SPELL_DEF_COUNT];
    124 extern const PhSpellBook ph_player_spellbook;
    125 extern const PhMarkerDef ph_marker_defs[PH_MARKER_DEF_COUNT];
    126 extern const PhWorldSetup ph_game_world;
    127 extern const PhShopDef ph_shop_defs[PH_SHOP_COUNT];
    128 extern const PhInteractionDef ph_interaction_defs[PH_INTERACTION_COUNT];
    129 
    130 const PhShopDef *ph_game_shop_def(int shop_id);
    131 const PhInteractionDef *ph_game_interaction_def(int interaction_id);
    132 int ph_game_area_music(int area_id);
    133 int ph_game_battle_sound(PhBattleEvent event);
    134 int ph_game_world_sound(const PhWorld *world, const PhWorldEvent *event);
    135 
    136 #endif