UFO: Alien Invasion
cp_ufo.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2022 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #pragma once
26 
27 enum {
31 };
32 
33 #define UFO_GetGeoscapeIDX(ufo) ((ufo) - ccs.ufos)
34 
35 const char* UFO_TypeToName(const ufoType_t type);
39 bool UFO_CanDoMission(const ufoType_t uType, const char* mType);
40 int UFO_GetAvailableUFOsForMission(const interestCategory_t missionType, ufoType_t* ufoTypes, bool checkInterest = true);
41 int UFO_GetOneAvailableUFOForMission(const interestCategory_t missionType, bool checkInterest = true);
42 const char* UFO_GetName(const aircraft_t* ufocraft);
43 void UFO_SetRandomDest(aircraft_t* ufo);
44 void UFO_SetRandomDestAround(aircraft_t* ufocraft, const vec2_t pos);
45 void UFO_FleePhalanxAircraft(aircraft_t* ufo, const vec2_t v);
46 void UFO_CheckShootBack(const campaign_t* campaign, aircraft_t* ufo, aircraft_t* phalanxAircraft);
47 void UFO_CampaignRunUFOs(const campaign_t* campaign, int dt);
49 void UFO_DetectNewUFO(aircraft_t* ufocraft);
50 bool UFO_CampaignCheckEvents(void);
51 aircraft_t* UFO_AddToGeoscape(ufoType_t ufotype, const vec2_t destination, struct mission_s* mission);
54 bool UFO_SendPursuingAircraft(aircraft_t* ufo, aircraft_t* aircraft);
55 void UFO_NotifyPhalanxAircraftRemoved(const aircraft_t* const aircraft);
56 bool UFO_IsUFOSeenOnGeoscape(const aircraft_t* ufo);
57 aircraft_t* UFO_GetByIDX(const int idx);
60 const aircraft_t* UFO_GetTemplate(ufoType_t ufoType);
61 aircraft_t* UFO_CreateFromTemplate(const aircraft_t* ufoTemplate);
62 
63 void UFO_InitStartup(void);
64 void UFO_Shutdown(void);
void UFO_DetectNewUFO(aircraft_t *ufocraft)
Perform actions when a new UFO is detected.
Definition: cp_ufo.cpp:842
void UFO_CampaignRunUFOs(const campaign_t *campaign, int dt)
Make the UFOs run.
Definition: cp_ufo.cpp:601
QGL_EXTERN GLint GLenum type
Definition: r_gl.h:94
interestCategory_t
bool UFO_ShouldAppearOnGeoscape(const ufoType_t type)
Some UFOs may only appear if after some interest level in the current running campaign is reached...
Definition: cp_ufo.cpp:125
short ufoType_t
Definition: scripts.h:145
bool UFO_CampaignCheckEvents(void)
Check events for UFOs: Appears or disappears on radars.
Definition: cp_ufo.cpp:867
void UFO_InitStartup(void)
Init actions for ufo-subsystem.
Definition: cp_ufo.cpp:1011
const char * UFO_GetName(const aircraft_t *ufocraft)
Returns name of the UFO if UFO has been researched.
Definition: cp_ufo.cpp:243
const char * UFO_TypeToName(const ufoType_t type)
Translate UFO type to name.
Definition: cp_ufo.cpp:231
aircraft_t * UFO_GetNext(aircraft_t *lastUFO)
Iterates through the UFOs.
Definition: cp_ufo.cpp:41
void UFO_RemoveFromGeoscape(aircraft_t *ufo)
Remove the specified ufo from geoscape.
Definition: cp_ufo.cpp:817
const aircraft_t * UFO_GetTemplate(ufoType_t ufoType)
Get the template data for the given ufo type.
Definition: cp_ufo.cpp:695
void UFO_SetRandomDest(aircraft_t *ufo)
Give a random destination to the given UFO, and make him to move there.
Definition: cp_ufo.cpp:259
aircraft_t * UFO_GetNextOnGeoscape(aircraft_t *lastUFO)
Definition: cp_ufo.cpp:66
aircraft_t * UFO_CreateFromTemplate(const aircraft_t *ufoTemplate)
Creates a new ufo on the geoscape from the given aircraft template.
Definition: cp_ufo.cpp:741
bool UFO_SendPursuingAircraft(aircraft_t *ufo, aircraft_t *aircraft)
Make the specified UFO pursue a phalanx aircraft.
Definition: cp_ufo.cpp:532
bool UFO_CanDoMission(const ufoType_t uType, const char *mType)
Check if the UFO type is available for the given mission type.
Definition: cp_ufo.cpp:137
bool UFO_IsUFOSeenOnGeoscape(const aircraft_t *ufo)
Check if an aircraft should be seen on geoscape.
Definition: cp_ufo.cpp:989
QGL_EXTERN GLenum GLuint * dest
Definition: r_gl.h:101
const aircraft_t * UFO_GetByType(const ufoType_t type)
Get the aircraft template for a given UFO type.
Definition: cp_ufo.cpp:109
void UFO_NotifyPhalanxAircraftRemoved(const aircraft_t *const aircraft)
Notify to UFOs that a Phalanx aircraft has been destroyed.
Definition: cp_ufo.cpp:972
An aircraft with all it's data.
Definition: cp_aircraft.h:115
void UFO_SetRandomDestAround(aircraft_t *ufocraft, const vec2_t pos)
Give a random destination to the given UFO close to a position, and make him to move there...
Definition: cp_ufo.cpp:274
void UFO_CheckShootBack(const campaign_t *campaign, aircraft_t *ufo, aircraft_t *phalanxAircraft)
Check if the ufo can shoot back at phalanx aircraft.
Definition: cp_ufo.cpp:578
void UFO_Shutdown(void)
Closing actions for ufo-subsystem.
Definition: cp_ufo.cpp:1023
void UFO_SendToDestination(aircraft_t *ufo, const vec2_t dest)
Make the specified UFO go to destination.
Definition: cp_ufo.cpp:562
This is the technology parsed from research.ufo.
Definition: cp_research.h:139
void UFO_UpdateAlienInterestForAllBasesAndInstallations(void)
Update alien interest for all PHALANX bases.
Definition: cp_ufo.cpp:437
int UFO_GetOneAvailableUFOForMission(const interestCategory_t missionType, bool checkInterest=true)
Get a suitable UFO for the mission type.
Definition: cp_ufo.cpp:217
vec_t vec2_t[2]
Definition: ufotypes.h:38
int UFO_GetAvailableUFOsForMission(const interestCategory_t missionType, ufoType_t *ufoTypes, bool checkInterest=true)
Fill an array with available UFOs for the mission type.
Definition: cp_ufo.cpp:153
void UFO_FleePhalanxAircraft(aircraft_t *ufo, const vec2_t v)
QGL_EXTERN int GLboolean GLfloat * v
Definition: r_gl.h:120
aircraft_t * UFO_AddToGeoscape(ufoType_t ufotype, const vec2_t destination, struct mission_s *mission)
const technology_t * UFO_GetTechnologyFromType(const ufoType_t type)
Get the technology for a given UFO type.
Definition: cp_ufo.cpp:97
aircraft_t * UFO_GetByIDX(const int idx)
returns the UFO on the geoscape with a certain index
Definition: cp_ufo.cpp:85