naev 0.11.5
faction.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "colour.h"
7#include "nlua.h"
8#include "opengl.h"
9
10extern int faction_player;
11
12#define FACTION_PLAYER faction_player
13#define FACTION_LOGO_SM 64
15typedef struct FactionGenerator_ {
16 int id;
17 double weight;
19
20/* Get stuff */
21int faction_isFaction( int f );
22int faction_exists( const char* name );
23int faction_get( const char* name );
24int* faction_getAll (void);
25int* faction_getAllVisible (void);
26int* faction_getKnown();
27int faction_isStatic( int id );
28int faction_isInvisible( int id );
29int faction_setInvisible( int id, int state );
30int faction_isKnown( int id );
31int faction_isDynamic( int id );
32const char* faction_name( int f );
33const char* faction_shortname( int f );
34const char* faction_longname( int f );
35const char* faction_mapname( int f );
36const char* faction_description( int f );
37const char* faction_default_ai( int f );
38const char** faction_tags( int f );
40double faction_lane_base_cost( int f );
41void faction_clearEnemy( int f );
42void faction_addEnemy( int f, int o );
43void faction_rmEnemy( int f, int o );
44void faction_clearAlly( int f );
45void faction_addAlly( int f, int o );
46void faction_rmAlly( int f, int o );
47nlua_env faction_getScheduler( int f );
48nlua_env faction_getEquipper( int f );
49const glTexture* faction_logo( int f );
50const glColour* faction_colour( int f );
51const int* faction_getEnemies( int f );
52const int* faction_getAllies( int f );
53int* faction_getGroup( int which );
54int faction_usesHiddenJumps( int f );
56
57/* Set stuff */
58int faction_setKnown( int id, int state );
59
60/* player stuff */
61void faction_modPlayer( int f, double mod, const char *source );
62void faction_modPlayerSingle( int f, double mod, const char *source );
63void faction_modPlayerRaw( int f, double mod );
64void faction_setPlayer( int f, double value );
65double faction_getPlayer( int f );
66double faction_getPlayerDef( int f );
67int faction_isPlayerFriend( int f );
68int faction_isPlayerEnemy( int f );
69const char *faction_getStandingText( int f );
70const char *faction_getStandingTextAtValue( int f, double value );
71const char *faction_getStandingBroad( int f, int bribed, int override );
72double faction_reputationMax( int f );
73const glColour* faction_getColour( int f );
74char faction_getColourChar( int f );
75
76/* Works with only factions */
77int areEnemies( int a, int b );
78int areAllies( int a, int b );
79
80/* load/free */
81int factions_load (void);
82void factions_free (void);
83void factions_reset (void);
84void faction_clearKnown (void);
85
86/* Dynamic factions. */
87void factions_clearDynamic (void);
88int faction_dynAdd( int base, const char* name, const char* display, const char* ai, const glColour* colour );
const char * faction_getStandingBroad(int f, int bribed, int override)
Gets the broad faction standing.
Definition faction.c:1129
const char * faction_longname(int f)
Gets the faction's long name (formal, human-readable).
Definition faction.c:348
const glColour * faction_getColour(int f)
Gets the colour of the faction based on it's standing with the player.
Definition faction.c:1035
int faction_isPlayerEnemy(int f)
Gets whether or not the player is an enemy of the faction.
Definition faction.c:1021
int faction_exists(const char *name)
Checks to see if a faction exists by name.
Definition faction.c:173
const char * faction_default_ai(int f)
Gets the name of the default AI profile for the faction's pilots.
Definition faction.c:399
const int * faction_getEnemies(int f)
Gets the list of enemies of a faction.
Definition faction.c:485
int faction_dynAdd(int base, const char *name, const char *display, const char *ai, const glColour *colour)
Dynamically add a faction.
Definition faction.c:1915
int faction_player
Definition faction.c:47
void faction_rmAlly(int f, int o)
Removes an ally from the faction's allies list.
Definition faction.c:703
int faction_isKnown(int id)
Is the faction known?
Definition faction.c:275
char faction_getColourChar(int f)
Gets the faction character associated to its standing with the player.
Definition faction.c:1052
int faction_isFaction(int f)
Checks whether or not a faction is valid.
Definition faction.c:1277
const glTexture * faction_logo(int f)
Gets the faction's logo (ideally 256x256).
Definition faction.c:453
nlua_env faction_getEquipper(int f)
Gets the equipper state associated to the faction scheduler.
Definition faction.c:740
int factions_load(void)
Loads up all the factions from the data file.
Definition faction.c:1610
void faction_clearEnemy(int f)
Clears all the enemies of a dynamic faction.
Definition faction.c:544
void factions_reset(void)
Resets player standing and flags of factions to default.
Definition faction.c:1597
void faction_rmEnemy(int f, int o)
Removes an enemy from the faction's enemies list.
Definition faction.c:610
int faction_isPlayerFriend(int f)
Gets whether or not the player is a friend of the faction.
Definition faction.c:1009
void faction_setPlayer(int f, double value)
Sets the player's standing with a faction.
Definition faction.c:940
int areEnemies(int a, int b)
Checks whether two factions are enemies.
Definition faction.c:1227
void factions_clearDynamic(void)
Clears dynamic factions.
Definition faction.c:1893
int * faction_getGroup(int which)
Returns an array of faction ids.
Definition faction.c:1836
const char * faction_name(int f)
Gets a factions "real" (internal) name.
Definition faction.c:306
const char * faction_shortname(int f)
Gets a factions short name (human-readable).
Definition faction.c:325
const char * faction_getStandingText(int f)
Gets the player's standing in human readable form.
Definition faction.c:1066
double faction_getPlayer(int f)
Gets the player's standing with a faction.
Definition faction.c:981
int faction_isDynamic(int id)
Is faction dynamic.
Definition faction.c:283
void factions_free(void)
Frees the factions.
Definition faction.c:1740
const int * faction_getAllies(int f)
Gets the list of allies of a faction.
Definition faction.c:515
void faction_modPlayerRaw(int f, double mod)
Modifies the player's standing without affecting others.
Definition faction.c:903
const FactionGenerator * faction_generators(int f)
Gets the faction's generators.
Definition faction.c:1883
int faction_usesHiddenJumps(int f)
Checks to see if a faction uses hidden jumps.
Definition faction.c:1873
int * faction_getKnown()
Gets all the known factions in an array (array.h).
Definition faction.c:219
int faction_isInvisible(int id)
Is the faction invisible?
Definition faction.c:250
const glColour * faction_colour(int f)
Gets the colour of the faction.
Definition faction.c:469
const char * faction_getStandingTextAtValue(int f, double value)
Gets the player's standing in human readable form.
Definition faction.c:1078
void faction_clearAlly(int f)
Clears all the ally of a dynamic faction.
Definition faction.c:637
double faction_lane_base_cost(int f)
Gets the faction's weight for patrolled safe-lane construction;.
Definition faction.c:438
void faction_modPlayer(int f, double mod, const char *source)
Modifies the player's standing with a faction.
Definition faction.c:843
const char ** faction_tags(int f)
Gets the tags the faction has.
Definition faction.c:414
double faction_getPlayerDef(int f)
Gets the player's default standing with a faction.
Definition faction.c:995
int * faction_getAll(void)
Returns all faction IDs in an array (array.h).
Definition faction.c:195
void faction_modPlayerSingle(int f, double mod, const char *source)
Modifies the player's standing without affecting others.
Definition faction.c:883
int faction_setInvisible(int id, int state)
Sets the faction's invisible state.
Definition faction.c:258
int faction_setKnown(int id, int state)
Sets the factions known state.
Definition faction.c:291
double faction_lane_length_per_presence(int f)
Gets the faction's weight for patrolled safe-lane construction (0 means they don't build lanes).
Definition faction.c:426
int * faction_getAllVisible(void)
Returns all non-invisible faction IDs in an array (array.h).
Definition faction.c:207
const char * faction_mapname(int f)
Gets the faction's map name (translated).
Definition faction.c:365
double faction_reputationMax(int f)
Gets the maximum reputation of a faction.
Definition faction.c:1179
void faction_addAlly(int f, int o)
Adds an ally to the faction's allies list.
Definition faction.c:657
nlua_env faction_getScheduler(int f)
Gets the state associated to the faction scheduler.
Definition faction.c:728
const char * faction_description(int f)
Gets the faction's description (translated).
Definition faction.c:382
void faction_clearKnown()
Clears the known factions.
Definition faction.c:232
int faction_isStatic(int id)
Is the faction static?
Definition faction.c:242
void faction_addEnemy(int f, int o)
Adds an enemy to the faction's enemies list.
Definition faction.c:564
int faction_get(const char *name)
Gets a faction ID by name.
Definition faction.c:184
int areAllies(int a, int b)
Checks whether two factions are allies or not.
Definition faction.c:1253
double weight
Definition faction.h:17
Abstraction for rendering sprite sheets.
Definition opengl_tex.h:36