UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
cp_airfight.h
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18
See the GNU General Public License for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24
*/
25
26
#pragma once
27
28
#define BULLETS_PER_SHOT 1
29
#define MAX_MULTIPLE_PROJECTILES 10
30
36
#define AIRFIGHT_WEAPON_CAN_SHOOT 0
37
#define AIRFIGHT_WEAPON_CAN_NOT_SHOOT_AT_THE_MOMENT -1
38
#define AIRFIGHT_WEAPON_CAN_NEVER_SHOOT -2
39
40
#define AIRFIGHT_BASE_CAN_T_FIRE -1
41
43
typedef
struct
aircraftProjectile_s {
44
const
objDef_t
*
aircraftItem
;
45
int
idx
;
46
vec3_t
pos
[
MAX_MULTIPLE_PROJECTILES
];
47
vec3_t
projectedPos
[
MAX_MULTIPLE_PROJECTILES
];
48
vec3_t
oldDrawPos
[
MAX_MULTIPLE_PROJECTILES
];
49
int
numProjectiles
;
50
bool
hasMoved
;
51
int
numInterpolationPoints
;
52
vec3_t
idleTarget
;
54
aircraft_t
*
attackingAircraft
;
55
vec3_t
attackerPos
;
57
aircraft_t
*
aimedAircraft
;
59
int
time
;
60
float
angle
;
61
bool
bullets
;
62
bool
beam
;
63
bool
rocket
;
64
}
aircraftProjectile_t
;
65
66
void
AIRFIGHT_ExecuteActions
(
const
struct
campaign_s* campaign,
aircraft_t
* air,
aircraft_t
* ufo);
67
void
AIRFIGHT_ActionsAfterAirfight
(
const
struct
campaign_s* campaign,
aircraft_t
* shooter,
aircraft_t
* aircraft,
bool
phalanxWon);
68
void
AIRFIGHT_CampaignRunProjectiles
(
const
struct
campaign_s* campaign,
int
dt);
69
void
AIRFIGHT_CampaignRunBaseDefence
(
int
dt);
70
int
AIRFIGHT_CheckWeapon
(
const
aircraftSlot_t
* slot,
float
distance);
71
int
AIRFIGHT_ChooseWeapon
(
const
aircraftSlot_t
* slot,
int
maxSlot,
const
vec2_t
pos,
const
vec2_t
targetPos);
72
bool
AIRFIGHT_BaseCanTargetUFO
(
const
struct
base_s* base,
const
aircraft_t
* ufo);
73
void
AIRFIGHT_RemoveProjectileAimingAircraft
(
const
aircraft_t
* aircraft);
74
75
bool
AIRFIGHT_SaveXML
(
xmlNode_t
* parent);
76
bool
AIRFIGHT_LoadXML
(
xmlNode_t
* parent);
77
void
AIRFIGHT_InitStartup
(
void
);
AIRFIGHT_CampaignRunBaseDefence
void AIRFIGHT_CampaignRunBaseDefence(int dt)
Run base defences.
Definition
cp_airfight.cpp:829
AIRFIGHT_CampaignRunProjectiles
void AIRFIGHT_CampaignRunProjectiles(const struct campaign_s *campaign, int dt)
AIRFIGHT_ChooseWeapon
int AIRFIGHT_ChooseWeapon(const aircraftSlot_t *slot, int maxSlot, const vec2_t pos, const vec2_t targetPos)
Choose the weapon an attacking aircraft will use to fire on a target.
Definition
cp_airfight.cpp:235
AIRFIGHT_SaveXML
bool AIRFIGHT_SaveXML(xmlNode_t *parent)
Save callback for savegames in XML Format.
Definition
cp_airfight.cpp:892
MAX_MULTIPLE_PROJECTILES
#define MAX_MULTIPLE_PROJECTILES
Definition
cp_airfight.h:29
AIRFIGHT_BaseCanTargetUFO
bool AIRFIGHT_BaseCanTargetUFO(const struct base_s *base, const aircraft_t *ufo)
AIRFIGHT_RemoveProjectileAimingAircraft
void AIRFIGHT_RemoveProjectileAimingAircraft(const aircraft_t *aircraft)
Set all projectile aiming a given aircraft to an idle destination.
Definition
cp_airfight.cpp:414
AIRFIGHT_ActionsAfterAirfight
void AIRFIGHT_ActionsAfterAirfight(const struct campaign_s *campaign, aircraft_t *shooter, aircraft_t *aircraft, bool phalanxWon)
AIRFIGHT_ExecuteActions
void AIRFIGHT_ExecuteActions(const struct campaign_s *campaign, aircraft_t *air, aircraft_t *ufo)
AIRFIGHT_LoadXML
bool AIRFIGHT_LoadXML(xmlNode_t *parent)
Load callback for savegames in XML Format.
Definition
cp_airfight.cpp:937
AIRFIGHT_InitStartup
void AIRFIGHT_InitStartup(void)
Definition
cp_airfight.cpp:998
AIRFIGHT_CheckWeapon
int AIRFIGHT_CheckWeapon(const aircraftSlot_t *slot, float distance)
Check if the selected weapon can shoot.
Definition
cp_airfight.cpp:201
aircraft_t
An aircraft with all it's data.
Definition
cp_aircraft.h:115
aircraftProjectile_t
projectile used during fight between two or more aircraft
Definition
cp_airfight.h:43
aircraftProjectile_t::hasMoved
bool hasMoved
Definition
cp_airfight.h:50
aircraftProjectile_t::rocket
bool rocket
Definition
cp_airfight.h:63
aircraftProjectile_t::aircraftItem
const objDef_t * aircraftItem
Definition
cp_airfight.h:44
aircraftProjectile_t::numProjectiles
int numProjectiles
Definition
cp_airfight.h:49
aircraftProjectile_t::idleTarget
vec3_t idleTarget
Definition
cp_airfight.h:52
aircraftProjectile_t::bullets
bool bullets
Definition
cp_airfight.h:61
aircraftProjectile_t::idx
int idx
Definition
cp_airfight.h:45
aircraftProjectile_t::numInterpolationPoints
int numInterpolationPoints
Definition
cp_airfight.h:51
aircraftProjectile_t::oldDrawPos
vec3_t oldDrawPos[MAX_MULTIPLE_PROJECTILES]
Definition
cp_airfight.h:48
aircraftProjectile_t::aimedAircraft
aircraft_t * aimedAircraft
Definition
cp_airfight.h:57
aircraftProjectile_t::projectedPos
vec3_t projectedPos[MAX_MULTIPLE_PROJECTILES]
Definition
cp_airfight.h:47
aircraftProjectile_t::beam
bool beam
Definition
cp_airfight.h:62
aircraftProjectile_t::time
int time
Definition
cp_airfight.h:59
aircraftProjectile_t::angle
float angle
Definition
cp_airfight.h:60
aircraftProjectile_t::pos
vec3_t pos[MAX_MULTIPLE_PROJECTILES]
Definition
cp_airfight.h:46
aircraftProjectile_t::attackerPos
vec3_t attackerPos
Definition
cp_airfight.h:55
aircraftProjectile_t::attackingAircraft
aircraft_t * attackingAircraft
Definition
cp_airfight.h:54
aircraftSlot_t
slot of aircraft
Definition
cp_aircraft.h:78
objDef_t
Defines all attributes of objects used in the inventory.
Definition
inv_shared.h:264
vec3_t
vec_t vec3_t[3]
Definition
ufotypes.h:39
vec2_t
vec_t vec2_t[2]
Definition
ufotypes.h:38
xmlNode_t
#define xmlNode_t
Definition
xml.h:24
src
client
cgame
campaign
cp_airfight.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0