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