52 lines
1.1 KiB
C
52 lines
1.1 KiB
C
#pragma once
|
|
#include "faction.h"
|
|
#include "misn_lua.h"
|
|
|
|
#define MIS_AVAIL_COMPUTER 1
|
|
#define MIS_AVAIL_BAR 2
|
|
#define MIS_AVAIL_OUTFIT 3
|
|
#define MIS_AVAIL_SHIPYARD 4
|
|
#define MIS_AVAIL_LAND 5
|
|
|
|
// Flags.
|
|
#define mis_isFlag(m,f) ((m)->flags & (f))
|
|
#define mis_setFlag(m,f) ((m)->flags |= (f))
|
|
#define mis_rmFlag(m,f) ((m)->flags ^= (f))
|
|
|
|
typedef struct MissionData_ {
|
|
char* name; // the name of the mission.
|
|
|
|
// Availability.
|
|
struct {
|
|
int loc; // Location.
|
|
double chance; // Chance of it appearing.
|
|
|
|
// For specific cases.
|
|
char* planet;
|
|
char* system;
|
|
|
|
// For generic cases.
|
|
Faction* factions;
|
|
int nfactions;
|
|
} avail;
|
|
} MissionData;
|
|
|
|
// Active mission.
|
|
typedef struct Mission_ {
|
|
MissionData* data;
|
|
|
|
char* title; // Not to be confused with name..
|
|
char* desc; // Description of the mission.
|
|
char* reward; // Rewards - in text.
|
|
|
|
lua_State* L;
|
|
} Mission;
|
|
|
|
#define MISSION_MAX 6 // No sense in the player having unlimited missions..
|
|
extern Mission player_mission[MISSION_MAX];
|
|
|
|
// Load/Quit.
|
|
int missions_load(void);
|
|
void missions_free(void);
|
|
|