6#define PCRE2_CODE_UNIT_WIDTH 8
11#include "mission_markers.h"
16typedef enum MissionAvailability_ {
27#define mis_isFlag( m, f ) ( ( m )->flags & ( f ) )
28#define mis_setFlag( m, f ) ( ( m )->flags |= ( f ) )
29#define mis_rmFlag( m, f ) ( ( m )->flags &= ~( f ) )
31#define MISSION_UNIQUE ( 1 << 0 )
36typedef struct MissionAvail_s {
37 MissionAvailability
loc;
64typedef struct MissionData_ {
83typedef struct Mission_ {
132 MissionAvailability loc );
136 const StarSystem *sys );
139const char *mission_availabilityStr( MissionAvailability loc );
154MissionMarkerType mission_markerTypeSpobToSystem( MissionMarkerType t );
155MissionMarkerType mission_markerTypeSystemToSpob( MissionMarkerType t );
156void mission_toLuaTable( lua_State *L,
const MissionData *m );
157const char **mission_loadFailed(
void );
159int misn_osdGetHide(
const Mission *misn );
160void misn_osdSetPriority(
Mission *misn,
int priority );
161int misn_osdGetPriority(
const Mission *misn );
182int mission_reload(
const char *name );
187int misn_tryRun(
Mission *misn,
const char *func );
188void misn_runStart(
Mission *misn,
const char *func );
189int misn_runFunc(
const Mission *misn,
const char *func,
int nargs );
190int misn_run(
Mission *misn,
const char *func );
int mission_accept(Mission *mission)
Small wrapper for misn_run.
int mission_compare(const void *arg1, const void *arg2)
Compares to missions to see which has more priority.
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.
void mission_cleanup(Mission *misn)
Cleans up a mission.
Mission * missions_genList(int faction, const Spob *pnt, const StarSystem *sys, MissionAvailability loc)
Generates a mission list. This runs create() so won't work with all missions.
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.
void misn_osdSetHide(Mission *misn, int hide)
Sets the hide state of the mission OSD.
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.