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