| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#pragma once |
| 30 |
|
| 31 |
#include "c_array.h" |
| 32 |
#include "campaign_entry.h" |
| 33 |
#include "character.h" |
| 34 |
#include "mission.h" |
| 35 |
#include "sys_config.h" |
| 36 |
|
| 37 |
typedef struct |
| 38 |
{ |
| 39 |
char *Name; |
| 40 |
CArray subFolders; |
| 41 |
CArray list; |
| 42 |
} CampaignList; |
| 43 |
|
| 44 |
typedef struct |
| 45 |
{ |
| 46 |
CampaignList campaignList; |
| 47 |
CampaignList dogfightList; |
| 48 |
CampaignEntry quickPlayEntry; |
| 49 |
} CustomCampaigns; |
| 50 |
|
| 51 |
typedef struct |
| 52 |
{ |
| 53 |
char *Title; |
| 54 |
char *Author; |
| 55 |
char *Description; |
| 56 |
bool Ammo; |
| 57 |
bool SkipWeaponMenu; |
| 58 |
bool BuyAndSell; |
| 59 |
bool RandomPickups; |
| 60 |
int DoorOpenTicks; |
| 61 |
int Lives; |
| 62 |
int MaxLives; |
| 63 |
int PlayerHP; |
| 64 |
int PlayerMaxHP; |
| 65 |
int PlayerExcessHP; |
| 66 |
CArray Missions; |
| 67 |
CharacterStore characters; |
| 68 |
MusicChunk CustomSongs[MUSIC_COUNT]; |
| 69 |
void *CustomData; |
| 70 |
void (*CustomDataTerminate)(void *); |
| 71 |
} CampaignSetting; |
| 72 |
|
| 73 |
typedef struct |
| 74 |
{ |
| 75 |
CampaignSetting Setting; |
| 76 |
CampaignEntry Entry; |
| 77 |
int MissionIndex; |
| 78 |
bool IsLoaded; |
| 79 |
|
| 80 |
|
| 81 |
bool IsClient; |
| 82 |
bool IsError; |
| 83 |
bool OptionsSet; |
| 84 |
bool IsComplete; |
| 85 |
bool IsQuit; |
| 86 |
} Campaign; |
| 87 |
extern Campaign gCampaign; |
| 88 |
|
| 89 |
void CampaignInit(Campaign *campaign); |
| 90 |
void CampaignTerminate(Campaign *campaign); |
| 91 |
void CampaignSettingInit(CampaignSetting *setting); |
| 92 |
void CampaignSettingTerminate(CampaignSetting *c); |
| 93 |
void CampaignSettingTerminateAll(CampaignSetting *setting); |
| 94 |
|
| 95 |
int CampaignGetMaxLives(const Campaign *c); |
| 96 |
int CampaignGetLives(const Campaign *c); |
| 97 |
int CampaignGetMaxHP(const Campaign *c); |
| 98 |
int CampaignGetExcessHP(const Campaign *c); |
| 99 |
int CampaignGetHP(const Campaign *c); |
| 100 |
|
| 101 |
bool CampaignListIsEmpty(const CampaignList *c); |
| 102 |
|
| 103 |
void LoadAllCampaigns(CustomCampaigns *campaigns); |
| 104 |
void UnloadAllCampaigns(CustomCampaigns *campaigns); |
| 105 |
|
| 106 |
Mission *CampaignGetCurrentMission(Campaign *campaign); |
| 107 |
void CampaignSeedRandom(const Campaign *campaign); |
| 108 |
|
| 109 |
void CampaignAndMissionSetup(Campaign *campaign, struct MissionOptions *mo); |
| 110 |
void CampaignDeleteMission(Campaign *c, const size_t idx); |