tbftss/src/defs.h

407 lines
7.5 KiB
C
Raw Normal View History

2015-10-20 13:51:49 +02:00
/*
2017-08-07 20:15:30 +02:00
Copyright (C) 2015-2017 Parallel Realities
2015-10-20 13:51:49 +02:00
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
2015-11-14 15:45:19 +01:00
#ifndef REVISION
#define REVISION 0
#endif
#ifndef DATA_DIR
#define DATA_DIR ""
#endif
2016-03-03 19:03:07 +01:00
#ifndef FIXED_RESOLUTION
#define FIXED_RESOLUTION 0
#endif
2016-02-27 19:13:05 +01:00
#define _(string) getTranslatedString(string)
2015-10-20 13:51:49 +02:00
#define PI 3.14159265358979323846
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define STRNCPY(dest, src, n) strncpy(dest, src, n); dest[n - 1] = '\0'
#define TO_RAIDANS(angleDegrees) (angleDegrees * PI / 180.0)
#define TO_DEGREES(angleRadians) (angleRadians * 180.0 / PI)
#define SAVE_FILENAME "game.save"
#define CONFIG_FILENAME "config.json"
2015-10-20 13:51:49 +02:00
#define SCREEN_WIDTH 1280
#define SCREEN_HEIGHT 720
#define MAX_KEYBOARD_KEYS 350
2016-05-15 09:19:26 +02:00
#define MAX_MOUSE_BUTTONS 6
2015-10-20 13:51:49 +02:00
#define FPS 60
2016-05-29 16:59:26 +02:00
#define LOGIC_RATE (1000.0 / FPS)
2015-10-20 13:51:49 +02:00
2015-12-20 17:13:35 +01:00
#define TEXT_TTL (1000 * 20)
2015-10-20 13:51:49 +02:00
#define MAX_NAME_LENGTH 32
#define MAX_DESCRIPTION_LENGTH 512
2016-02-27 13:14:05 +01:00
#define MAX_LINE_LENGTH 1024
2015-10-20 13:51:49 +02:00
#define MAX_FILENAME_LENGTH 1024
#define NUM_TEXTURE_BUCKETS 32
#define MAX_STARS 500
#define MAX_CHALLENGES 3
2015-10-20 13:51:49 +02:00
#define MAX_FONTS 32
#define NUM_TEXT_BUCKETS 64
#define MAX_FIGHTER_GUNS 12
2015-11-01 11:46:24 +01:00
#define MAX_TARGET_RANGE 65536
#define MAX_SYSTEM_POWER 100
2015-10-20 13:51:49 +02:00
2016-02-21 08:48:22 +01:00
#define BATTLE_AREA_CELLS 50
#define BATTLE_AREA_WIDTH (640 * BATTLE_AREA_CELLS)
#define BATTLE_AREA_HEIGHT (360 * BATTLE_AREA_CELLS)
#define BATTLE_AREA_EDGE 250
2015-11-01 23:19:39 +01:00
2015-10-21 20:21:45 +02:00
#define BF_NONE 0
#define BF_ENGINE (2 << 0)
#define BF_SYSTEM_DAMAGE (2 << 1)
2015-11-18 17:02:10 +01:00
#define BF_SHIELD_DAMAGE (2 << 2)
#define BF_EXPLODES (2 << 3)
2015-10-20 13:51:49 +02:00
2016-03-30 23:41:34 +02:00
#define EF_NONE 0
#define EF_NO_KILL (2 << 0)
#define EF_DISABLED (2 << 1)
#define EF_IMMORTAL (2 << 2)
#define EF_MISSION_TARGET (2 << 3)
#define EF_NO_MT_BOX (2 << 4)
#define EF_HAS_ROPE (2 << 5)
#define EF_COLLECTS_ITEMS (2 << 6)
#define EF_MUST_DISABLE (2 << 7)
#define EF_RETREATING (2 << 8)
#define EF_NO_EPIC (2 << 9)
#define EF_STATIC (2 << 10)
#define EF_TAKES_DAMAGE (2 << 11)
#define EF_SECONDARY_TARGET (2 << 12)
#define EF_AI_TARGET (2 << 13)
#define EF_AI_LEADER (2 << 14)
#define EF_ROPED_ATTACHED (2 << 15)
#define EF_NO_KILL_INC (2 << 16)
#define EF_SHORT_RADAR_RANGE (2 << 17)
#define EF_NO_PLAYER_TARGET (2 << 18)
#define EF_AI_IGNORE (2 << 19)
#define EF_NON_SOLID (2 << 20)
2016-05-15 09:19:26 +02:00
#define EF_NO_HEALTH_BAR (2 << 21)
#define EF_FRIENDLY_HEALTH_BAR (2 << 22)
#define EF_NO_THREAT (2 << 23)
#define EF_DROPS_ITEMS (2 << 24)
2016-05-17 20:02:58 +02:00
#define EF_COMMON_FIGHTER (2 << 25)
#define AIF_NONE 0
#define AIF_FOLLOWS_PLAYER (2 << 0)
2015-11-28 15:33:05 +01:00
#define AIF_MOVES_TO_PLAYER (2 << 1)
#define AIF_UNLIMITED_RANGE (2 << 2)
#define AIF_COLLECTS_ITEMS (2 << 3)
#define AIF_TOWS (2 << 4)
#define AIF_RETREATS (2 << 5)
#define AIF_GOAL_JUMPGATE (2 << 6)
2015-11-28 15:33:05 +01:00
#define AIF_AVOIDS_COMBAT (2 << 7)
#define AIF_DEFENSIVE (2 << 8)
#define AIF_MISSILE_BOAT (2 << 9)
2015-11-30 12:29:56 +01:00
#define AIF_AGGRESSIVE (2 << 10)
#define AIF_LONG_RANGE_FIRE (2 << 11)
#define AIF_MOVES_TO_LEADER (2 << 12)
#define AIF_EVADE (2 << 13)
2015-12-24 22:42:26 +01:00
#define AIF_WANDERS (2 << 14)
#define AIF_COVERS_RETREAT (2 << 15)
2016-03-29 23:45:46 +02:00
#define AIF_TARGET_FOCUS (2 << 16)
2016-04-01 15:19:03 +02:00
#define AIF_DROPS_MINES (2 << 17)
#define AIF_ASSASSIN (2 << 18)
#define AIF_SUSPICIOUS (2 << 19)
2016-05-20 10:51:34 +02:00
#define AIF_ZAK_SUSPICIOUS (2 << 20)
#define AIF_SURRENDERS (2 << 21)
#define AIF_SURRENDERING (2 << 22)
#define AIF_SURRENDERED (2 << 23)
/* player abilities */
#define BOOST_RECHARGE_TIME (FPS * 7)
2015-11-15 18:12:04 +01:00
#define BOOST_FINISHED_TIME (FPS * 0.75)
#define ECM_RECHARGE_TIME (FPS * 7)
#define MB_NORMAL 0
#define MB_IMPORTANT 1
#define MB_PANDORAN 2
#define SS_NORMAL 0
#define SS_SOL 1
#define SS_PANDORAN 2
2016-05-20 10:51:34 +02:00
#define MAX_SUSPICION_LEVEL 1500.0
#define MAX_ZAK_SUSPICION_LEVEL (FPS * 30)
2016-03-03 19:03:07 +01:00
enum
{
CONTROL_FIRE,
CONTROL_ACCELERATE,
CONTROL_BOOST,
CONTROL_ECM,
CONTROL_BRAKE,
CONTROL_TARGET,
CONTROL_MISSILE,
CONTROL_GUNS,
CONTROL_RADAR,
CONTROL_PREV_FIGHTER,
2016-03-05 09:42:35 +01:00
CONTROL_NEXT_FIGHTER,
2016-04-23 18:46:47 +02:00
CONTROL_SCREENSHOT,
2016-03-03 19:03:07 +01:00
CONTROL_MAX
};
2016-02-23 08:19:31 +01:00
enum
{
MD_NONE,
MD_OK,
MD_OK_CANCEL
};
2015-10-26 18:27:43 +01:00
enum
{
ET_FIGHTER,
ET_ITEM,
2015-11-09 23:46:57 +01:00
ET_WAYPOINT,
ET_COMPONENT_GUN,
ET_COMPONENT_ENGINE,
2016-05-15 09:19:26 +02:00
ET_COMPONENT,
ET_CAPITAL_SHIP,
ET_JUMPGATE,
2016-04-14 12:56:42 +02:00
ET_MINE,
ET_SHADOW_MINE
2015-10-26 18:27:43 +01:00
};
2015-10-20 13:51:49 +02:00
enum
{
TA_LEFT,
TA_RIGHT,
TA_CENTER
};
enum
{
ALIVE_ALIVE,
ALIVE_DYING,
2015-11-11 23:33:33 +01:00
ALIVE_DEAD,
ALIVE_ESCAPED
2015-10-20 13:51:49 +02:00
};
enum
{
SIDE_NONE,
SIDE_ALLIES,
2016-05-18 13:23:42 +02:00
SIDE_TZAC,
2015-10-20 13:51:49 +02:00
SIDE_PANDORAN,
SIDE_PIRATE,
SIDE_MERC,
2015-10-20 13:51:49 +02:00
SIDE_CSN,
SIDE_UNF,
SIDE_MAX
2015-10-20 13:51:49 +02:00
};
enum
{
BT_NONE,
BT_PARTICLE,
BT_PLASMA,
BT_LASER,
BT_MAG,
BT_ROCKET,
BT_MISSILE,
BT_MAX
};
enum
{
DT_ANY,
DT_NO_SPIN,
2016-03-27 12:21:23 +02:00
DT_INSTANT,
DT_SIMPLE
};
2015-10-20 13:51:49 +02:00
enum
{
EFFECT_POINT,
2015-10-20 13:51:49 +02:00
EFFECT_LINE,
EFFECT_TEXTURE,
2015-11-29 09:34:25 +01:00
EFFECT_HALO,
EFFECT_ECM
2015-10-20 13:51:49 +02:00
};
enum
{
SND_PARTICLE,
SND_PLASMA,
2015-11-18 17:02:10 +01:00
SND_LASER,
2015-10-20 13:51:49 +02:00
SND_MAG,
SND_ARMOUR_HIT,
SND_SHIELD_HIT,
2015-11-18 17:02:10 +01:00
SND_SHIELD_BREAK,
2015-10-20 13:51:49 +02:00
SND_EXPLOSION_1,
SND_EXPLOSION_2,
SND_EXPLOSION_3,
SND_EXPLOSION_4,
2016-04-01 11:49:41 +02:00
SND_EXPLOSION_5,
SND_GET_ITEM,
SND_MISSILE,
SND_INCOMING,
2016-02-20 16:04:15 +01:00
SND_SELECT_WEAPON,
SND_JUMP,
SND_ECM,
SND_MAG_HIT,
SND_POWER_DOWN,
2015-11-15 18:12:04 +01:00
SND_BOOST,
2015-11-29 13:55:36 +01:00
SND_RADIO,
2016-03-10 19:02:19 +01:00
SND_TROPHY,
2016-04-01 11:49:41 +02:00
SND_MINE_WARNING,
2016-04-03 15:04:56 +02:00
SND_TIME_WARNING,
2016-04-05 13:21:17 +02:00
SND_CAP_DEATH,
2015-10-20 13:51:49 +02:00
SND_GUI_CLICK,
SND_GUI_SELECT,
SND_GUI_CLOSE,
SND_GUI_DENIED,
2016-06-05 12:22:19 +02:00
SND_ZOOM,
SND_NEW_OBJECTIVE,
SND_NO_MISSILES,
SND_RECHARGED,
2016-06-07 09:29:52 +02:00
SND_TOW_ROPE,
SND_OBJECTIVE_COMPLETE,
SND_OBJECTIVE_FAILED,
SND_WAYPOINT,
2015-10-20 13:51:49 +02:00
SND_MAX
};
enum
{
OS_INCOMPLETE,
OS_COMPLETE,
OS_FAILED,
2016-02-28 14:45:17 +01:00
OS_CONDITION,
OS_MAX
2015-10-20 13:51:49 +02:00
};
enum
{
TT_DESTROY,
TT_DISABLE,
2015-11-11 23:33:33 +01:00
TT_WAYPOINT,
TT_ESCAPED,
TT_ITEM,
2016-05-15 12:59:37 +02:00
TT_STOLEN,
TT_MISC
};
2015-10-20 13:51:49 +02:00
enum
{
MS_START,
MS_IN_PROGRESS,
MS_PAUSED,
MS_COMPLETE,
MS_FAILED,
MS_TIME_UP
2015-10-20 13:51:49 +02:00
};
enum
{
2015-10-20 13:51:49 +02:00
WT_BUTTON,
2015-11-26 09:16:29 +01:00
WT_IMG_BUTTON,
WT_SELECT,
2016-03-04 23:11:13 +01:00
WT_SELECT_BUTTON,
2016-03-05 09:42:35 +01:00
WT_CONTROL_CONFIG
2015-10-20 13:51:49 +02:00
};
enum
{
CHALLENGE_ARMOUR,
CHALLENGE_TIME,
CHALLENGE_SHOT_ACCURACY,
CHALLENGE_ROCKET_ACCURACY,
CHALLENGE_MISSILE_ACCURACY,
2015-10-20 13:51:49 +02:00
CHALLENGE_NO_LOSSES,
CHALLENGE_1_LOSS,
CHALLENGE_LOSSES,
CHALLENGE_PLAYER_KILLS,
CHALLENGE_DISABLE,
2016-03-07 13:29:23 +01:00
CHALLENGE_ITEMS,
2016-05-15 09:19:26 +02:00
CHALLENGE_PLAYER_ITEMS,
2016-03-12 19:22:48 +01:00
CHALLENGE_RESCUE,
2016-04-13 12:02:08 +02:00
CHALLENGE_SURVIVE,
2016-05-25 13:25:13 +02:00
CHALLENGE_SURRENDER,
2016-06-01 10:32:10 +02:00
CHALLENGE_WAYPOINTS,
2016-02-29 11:47:10 +01:00
CHALLENGE_MAX
2015-10-20 13:51:49 +02:00
};
enum
{
2016-02-29 11:47:10 +01:00
STAT_PERCENT_COMPLETE,
STAT_MISSIONS_STARTED,
STAT_MISSIONS_COMPLETED,
STAT_OPTIONAL_COMPLETED,
2016-02-28 14:02:57 +01:00
STAT_CHALLENGES_STARTED,
STAT_CHALLENGES_COMPLETED,
STAT_SHOTS_FIRED,
STAT_SHOTS_HIT,
STAT_SHOT_ACCURACY,
STAT_ROCKETS_FIRED,
STAT_ROCKETS_HIT,
STAT_ROCKET_ACCURACY,
STAT_MISSILES_FIRED,
STAT_MISSILES_HIT,
STAT_MISSILE_ACCURACY,
STAT_ENEMIES_KILLED,
STAT_ENEMIES_KILLED_PLAYER,
STAT_ALLIES_KILLED,
STAT_PLAYER_KILLED,
2015-11-17 08:23:50 +01:00
STAT_ENEMIES_DISABLED,
2015-10-29 17:18:41 +01:00
STAT_ENEMIES_ESCAPED,
2015-11-17 08:23:50 +01:00
STAT_ECM,
STAT_BOOST,
STAT_MISSILES_EVADED,
STAT_MISSILES_STRUCK,
STAT_CIVILIANS_RESCUED,
STAT_CIVILIANS_KILLED,
STAT_TUG,
STAT_SHUTTLE,
STAT_NUM_TOWED,
STAT_ITEMS_COLLECTED,
2016-03-07 13:29:23 +01:00
STAT_ITEMS_COLLECTED_PLAYER,
2016-03-04 23:59:16 +01:00
STAT_WAYPOINTS_VISITED,
2015-11-17 08:23:50 +01:00
STAT_EPIC_KILL_STREAK,
2015-12-19 17:15:57 +01:00
STAT_CAPITAL_SHIPS_DESTROYED,
STAT_CAPITAL_SHIPS_LOST,
2016-04-03 09:37:09 +02:00
STAT_MINES_DESTROYED,
STAT_ENEMIES_SURRENDERED,
2015-11-17 08:23:50 +01:00
/* add stats before here, so as not to mess up the stats screen */
STAT_TIME,
STAT_MAX
};
2016-03-09 12:51:26 +01:00
enum
{
TROPHY_BRONZE,
TROPHY_SILVER,
TROPHY_GOLD,
TROPHY_PLATINUM,
2016-05-15 09:19:26 +02:00
TROPHY_UNEARNED,
2016-03-09 12:51:26 +01:00
TROPHY_MAX
};