6#define PCRE2_CODE_UNIT_WIDTH 8
15#include "mission_markers.h"
18typedef enum MissionAvailability_ {
28#define mis_isFlag(m,f) ((m)->flags & (f))
29#define mis_setFlag(m,f) ((m)->flags |= (f))
30#define mis_rmFlag(m,f) ((m)->flags &= ~(f))
32#define MISSION_UNIQUE (1<<0)
37typedef struct MissionAvail_s {
38 MissionAvailability
loc;
62typedef struct MissionData_ {
81typedef struct Mission_ {
119 const Spob *pnt,
const StarSystem *sys, MissionAvailability loc );
121void missions_run( MissionAvailability loc,
int faction,
const Spob *pnt,
const StarSystem *sys );
124const char *mission_availabilityStr( MissionAvailability loc );
138MissionMarkerType mission_markerTypeSpobToSystem( MissionMarkerType t );
139MissionMarkerType mission_markerTypeSystemToSpob( MissionMarkerType t );
140void mission_toLuaTable( lua_State *L,
const MissionData *m );
141const char **mission_loadFailed (
void);
162int mission_reload(
const char *name );
167int misn_tryRun(
Mission *misn,
const char *func );
168void misn_runStart(
Mission *misn,
const char *func );
169int misn_runFunc(
const Mission *misn,
const char *func,
int nargs );
170int misn_run(
Mission *misn,
const char *func );
int mission_accept(Mission *mission)
Small wrapper for misn_run.
int missions_saveTempCommodity(xmlTextWriterPtr writer, const Commodity *c)
Saves a temporary commodity's defintion into the current node.
Mission ** player_missions
const StarSystem * mission_getSystemMarker(const Mission *misn)
Gets the first system that has been marked by a mission.
Mission * missions_genList(int *n, int faction, const Spob *pnt, const StarSystem *sys, MissionAvailability loc)
Generates a mission list. This runs create() so won't work with all missions.
void mission_cleanup(Mission *misn)
Cleans up a mission.
int mission_addMarker(Mission *misn, int id, int objid, MissionMarkerType type)
Adds a system marker to a mission.
const StarSystem * mission_sysComputerMark(const Mission *misn)
Marks the system of the computer mission to reflect where it will head to.
const MissionData * mission_getFromName(const char *name)
Gets mission data from a name.
void missions_free(void)
Frees all the mission data.
int mission_alreadyRunning(const MissionData *misn)
Checks to see if mission is already running.
int mission_linkCargo(Mission *misn, unsigned int cargo_id)
Links cargo to the mission for posterior cleanup.
void missions_activateClaims(void)
Activates mission claims.
void mission_sysMark(void)
Marks all active systems that need marking.
void missions_run(MissionAvailability loc, int faction, const Spob *pnt, const StarSystem *sys)
Runs missions matching location, all Lua side and one-shot.
int missions_loadActive(xmlNodePtr parent)
Loads the player's active missions from a save.
void mission_shift(int pos)
Puts the specified mission at the end of the player_missions array.
int missions_load(void)
Loads all the mission data.
Commodity * missions_loadTempCommodity(xmlNodePtr cur)
Loads a temporary commodity.
int mission_start(const char *name, unsigned int *id)
Starts a mission.
int mission_getID(const char *name)
Gets id from mission name.
int missions_saveActive(xmlTextWriterPtr writer)
Saves the player's active missions.
int mission_unlinkCargo(Mission *misn, unsigned int cargo_id)
Unlinks cargo from the mission, removes it from the player.
const MissionData * mission_list(void)
Returns all the missions.
int missions_loadCommodity(xmlNodePtr parent)
Loads the player's special mission commodities.
int mission_test(const char *name)
Tests the conditionals of a mission.
void missions_cleanup(void)
Cleans up all the player's active missions.
const MissionData * mission_get(int id)
Gets a MissionData based on ID.
Defines the availability of a mission.
Represents an active mission.
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Abstraction for rendering sprite sheets.