OpenTTD Source 20260531-master-g0e951f3528
disaster_vehicle.cpp File Reference

All disaster/easter egg vehicles are handled here. More...

#include "stdafx.h"
#include "aircraft.h"
#include "disaster_vehicle.h"
#include "industry.h"
#include "station_base.h"
#include "command_func.h"
#include "news_func.h"
#include "town.h"
#include "company_func.h"
#include "strings_func.h"
#include "viewport_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
#include "effectvehicle_func.h"
#include "roadveh.h"
#include "train.h"
#include "ai/ai.hpp"
#include "game/game.hpp"
#include "company_base.h"
#include "core/random_func.hpp"
#include "core/backup_type.hpp"
#include "landscape_cmd.h"
#include "timer/timer.h"
#include "timer/timer_game_economy.h"
#include "table/strings.h"
#include "safeguards.h"

Go to the source code of this file.

Data Structures

struct  DisasterCreation
 Initialisation function and time period to run the different disasters. More...

Typedefs

using DisasterVehicleTickProc = bool(DisasterVehicle *v)
 Perform any actions for a given vehicle.
typedef void DisasterInitProc()

Functions

static void DisasterClearSquare (TileIndex tile)
static bool DisasterTick_Zeppeliner (DisasterVehicle *v)
 Zeppeliner handling, v->state states: 0: Zeppeliner initialization has found an airport, go there and crash 1: Create crash and animate falling down for extra dramatic effect 2: Create more smoke and leave debris on ground 3: Clear the runway after some time and remove crashed zeppeliner If not airport was found, only state 0 is reached until zeppeliner leaves map.
static bool DisasterTick_Ufo (DisasterVehicle *ufo)
 (Small) Ufo handling, v->state states: 0: Fly around to the middle of the map, then randomly, after a while target a road vehicle 1: Home in on a road vehicle and crash it >:) If not road vehicle was found, only state 0 is used and Ufo disappears after a while
static void DestructIndustry (Industry *i)
static bool DisasterTick_Aircraft (DisasterVehicle *v, uint16_t image_override, bool leave_at_top, StringID news_message, IndustryBehaviour behaviour)
 Aircraft handling, v->state states: 0: Fly towards the targeted industry 1: If within 15 tiles, fire away rockets and destroy industry 2: Industry explosions 3: Fly out of the map If the industry was removed in the meantime just fly to the end of the map.
static bool DisasterTick_Airplane (DisasterVehicle *v)
 Airplane handling.
static bool DisasterTick_Helicopter (DisasterVehicle *v)
 Helicopter handling.
static bool DisasterTick_Helicopter_Rotors (DisasterVehicle *v)
 Helicopter rotor blades; keep these spinning.
static bool DisasterTick_Big_Ufo (DisasterVehicle *v)
 (Big) Ufo handling, v->state states: 0: Fly around to the middle of the map, then randomly for a while and home in on a piece of rail 1: Land there and breakdown all trains in a radius of 12 tiles; and now we wait... because as soon as the Ufo lands, a fighter jet, a Skyranger, is called to clear up the mess.
static bool DisasterTick_Big_Ufo_Destroyer (DisasterVehicle *v)
 Skyranger destroying (Big) Ufo handling, v->state states: 0: Home in on landed Ufo and shoot it down.
static bool DisasterTick_Submarine (DisasterVehicle *v)
 Submarine, v->state states: Unused, just float around aimlessly and pop up at different places, turning around.
static bool DisasterTick_NULL (DisasterVehicle *v)
 No-op vehicle tick.
static void Disaster_Zeppeliner_Init ()
 Zeppeliner which crashes on an airport if one found, otherwise crashes on a random tile.
static void Disaster_Small_Ufo_Init ()
 Ufo which flies around aimlessly from the middle of the map a bit until it locates a road vehicle which it targets and then destroys.
static void Disaster_Airplane_Init ()
 Combat airplane which destroys an oil refinery.
static void Disaster_Helicopter_Init ()
 Combat helicopter that destroys a factory.
static void Disaster_Big_Ufo_Init ()
 Big Ufo which lands on a piece of rail and will consequently be shot down by a combat airplane, destroying the surroundings.
static void Disaster_Submarine_Init (DisasterSubType subtype)
 Initialise a submarine.
static void Disaster_Small_Submarine_Init ()
 Curious submarine #1, just floats around.
static void Disaster_Big_Submarine_Init ()
 Curious submarine #2, just floats around.
static void Disaster_CoalMine_Init ()
 Coal mine catastrophe, destroys a stretch of 30 tiles of land in a certain direction.
static void DoDisaster ()
 Create a random disaster, if there is one available.
static void ResetDisasterDelay ()
 Resets the introduction of the next disaster.
void StartupDisasters ()
 Starts up disasters.
void ReleaseDisastersTargetingIndustry (IndustryID i)
 Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore.
void ReleaseDisasterVehicle (VehicleID vehicle)
 Notify disasters that we are about to delete a vehicle.

Variables

uint16_t _disaster_delay
 Delay counter for considering the next disaster.
static constexpr DirectionIndexArray< SpriteID_disaster_images_1 {SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP}
 Sprites for blimp.
static constexpr DirectionIndexArray< SpriteID_disaster_images_2 {SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT}
 Sprites for small UFO.
static constexpr DirectionIndexArray< SpriteID_disaster_images_3 {SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15}
 Sprites for combat aircraft.
static constexpr DirectionIndexArray< SpriteID_disaster_images_4 {SPR_SUB_SMALL_NE, SPR_SUB_SMALL_NE, SPR_SUB_SMALL_SE, SPR_SUB_SMALL_SE, SPR_SUB_SMALL_SW, SPR_SUB_SMALL_SW, SPR_SUB_SMALL_NW, SPR_SUB_SMALL_NW}
 Sprites for small submarine.
static constexpr DirectionIndexArray< SpriteID_disaster_images_5 {SPR_SUB_LARGE_NE, SPR_SUB_LARGE_NE, SPR_SUB_LARGE_SE, SPR_SUB_LARGE_SE, SPR_SUB_LARGE_SW, SPR_SUB_LARGE_SW, SPR_SUB_LARGE_NW, SPR_SUB_LARGE_NW}
 Sprites for large submarine.
static constexpr DirectionIndexArray< SpriteID_disaster_images_6 {SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER}
 Sprites for large UFO.
static constexpr DirectionIndexArray< SpriteID_disaster_images_7 {SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER}
 Sprites for large UFO destroyer.
static constexpr DirectionIndexArray< SpriteID_disaster_images_8 {SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A}
 Sprites for combat helicopter.
static constexpr DirectionIndexArray< SpriteID_disaster_images_9 {SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1}
 Sprites for combat helicopter rotor.
static constexpr DirectionIndexArray< SpriteID_disaster_images []
 Sprites for each disaster vehicle.
static DisasterVehicleTickProc *const _disastervehicle_tick_procs []
static const DisasterCreation _disasters []
 Table per disaster subtype when to create disasters, and how to create them.
static const IntervalTimer< TimerGameEconomy_economy_disaster_daily ({TimerGameEconomy::Trigger::Day, TimerGameEconomy::Priority::Disaster}, [](auto) { if(--_disaster_delay !=0) return;ResetDisasterDelay();if(_settings_game.difficulty.disasters !=0) DoDisaster();})
 Daily trigger to check whether to add a new disaster.

Detailed Description

All disaster/easter egg vehicles are handled here.

The general flow of control for the disaster vehicles is as follows:

  1. Initialize the disaster in a disaster specific way (eg start position, possible target, etc.) Disaster_XXX_Init() function
  2. Add a subtype to a disaster, which is an index into the function array that handles the vehicle's ticks.
  3. Run the disaster vehicles each tick until their target has been reached, this happens in the DisasterTick_XXX() functions. In here, a vehicle's state is kept by v->state variable. Each achieved sub-target will increase this value, and the last one will remove the disaster itself.

Definition in file disaster_vehicle.cpp.

Typedef Documentation

◆ DisasterInitProc

typedef void DisasterInitProc()

Definition at line 745 of file disaster_vehicle.cpp.

◆ DisasterVehicleTickProc

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 726 of file disaster_vehicle.cpp.

Function Documentation

◆ DestructIndustry()

void DestructIndustry ( Industry * i)
static

Definition at line 422 of file disaster_vehicle.cpp.

◆ Disaster_Airplane_Init()

◆ Disaster_Big_Submarine_Init()

void Disaster_Big_Submarine_Init ( )
static

Curious submarine #2, just floats around.

Definition at line 896 of file disaster_vehicle.cpp.

References Disaster_Submarine_Init(), and ST_BIG_SUBMARINE.

◆ Disaster_Big_Ufo_Init()

void Disaster_Big_Ufo_Init ( )
static

Big Ufo which lands on a piece of rail and will consequently be shot down by a combat airplane, destroying the surroundings.

Definition at line 846 of file disaster_vehicle.cpp.

References Vehicle::dest_tile, Map::MaxX(), NW, RandomTile, Vehicle::SetNext(), Map::SizeX(), Map::SizeY(), ST_BIG_UFO, ST_BIG_UFO_SHADOW, TILE_SIZE, TileX(), and TileXY().

◆ Disaster_CoalMine_Init()

void Disaster_CoalMine_Init ( )
static

◆ Disaster_Helicopter_Init()

◆ Disaster_Small_Submarine_Init()

void Disaster_Small_Submarine_Init ( )
static

Curious submarine #1, just floats around.

Definition at line 889 of file disaster_vehicle.cpp.

References Disaster_Submarine_Init(), and ST_SMALL_SUBMARINE.

◆ Disaster_Small_Ufo_Init()

void Disaster_Small_Ufo_Init ( )
static

Ufo which flies around aimlessly from the middle of the map a bit until it locates a road vehicle which it targets and then destroys.

Definition at line 777 of file disaster_vehicle.cpp.

References Vehicle::dest_tile, RandomTile, SE, Vehicle::SetNext(), Map::SizeX(), Map::SizeY(), ST_SMALL_UFO, ST_SMALL_UFO_SHADOW, TILE_SIZE, TileX(), and TileXY().

◆ Disaster_Submarine_Init()

void Disaster_Submarine_Init ( DisasterSubType subtype)
static

Initialise a submarine.

Parameters
subtypeThe sub type of submarine.

Definition at line 866 of file disaster_vehicle.cpp.

References _settings_game, HasBit(), IsWaterTile(), Map::MaxY(), NW, RandomTileSeed(), SE, TILE_SIZE, TileVirtXY(), and TileX().

Referenced by Disaster_Big_Submarine_Init(), and Disaster_Small_Submarine_Init().

◆ Disaster_Zeppeliner_Init()

void Disaster_Zeppeliner_Init ( )
static

Zeppeliner which crashes on an airport if one found, otherwise crashes on a random tile.

Definition at line 752 of file disaster_vehicle.cpp.

References AT_LARGE, AT_SMALL, INVALID_TILE, SpecializedStation< Station, false >::Iterate(), RandomTile, SE, Vehicle::SetNext(), ST_ZEPPELINER, ST_ZEPPELINER_SHADOW, TILE_SIZE, and TileX().

◆ DisasterClearSquare()

void DisasterClearSquare ( TileIndex tile)
static

Definition at line 59 of file disaster_vehicle.cpp.

◆ DisasterTick_Aircraft()

bool DisasterTick_Aircraft ( DisasterVehicle * v,
uint16_t image_override,
bool leave_at_top,
StringID news_message,
IndustryBehaviour behaviour )
static

Aircraft handling, v->state states: 0: Fly towards the targeted industry 1: If within 15 tiles, fire away rockets and destroy industry 2: Industry explosions 3: Fly out of the map If the industry was removed in the meantime just fly to the end of the map.

Parameters
vThe disaster vehicle.
image_overrideThe image at the time the aircraft is firing.
leave_at_topTrue iff the vehicle leaves the map at the north side.
news_messageThe string that's used as news message.
behaviourOnly attack industries that have this behaviour set.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 446 of file disaster_vehicle.cpp.

References _settings_client, Accident, Vehicle::age, CreateEffectVehicleAbove(), Vehicle::dest_tile, EV_EXPLOSION_SMALL, GB(), GetEncodedString(), GetIndustryIndex(), GetIndustrySpec(), GetNewVehiclePos(), HasBit(), DisasterVehicle::image_override, Industry, IsTileType(), Industry::location, Map::MaxX(), TimerGameConst< struct Calendar >::MIN_DATE, Map::SizeX(), SND_12_EXPLOSION, DisasterVehicle::state, Vehicle::tick_counter, OrthogonalTileArea::tile, TILE_SIZE, TileVirtXY(), TileX(), TileY(), Industry::town, DisasterVehicle::UpdatePosition(), Vehicle::x_pos, GetNewVehiclePosResult::y, and Vehicle::y_pos.

Referenced by DisasterTick_Airplane(), and DisasterTick_Helicopter().

◆ DisasterTick_Airplane()

bool DisasterTick_Airplane ( DisasterVehicle * v)
static

Airplane handling.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 507 of file disaster_vehicle.cpp.

References AirplaneAttacks, and DisasterTick_Aircraft().

◆ DisasterTick_Big_Ufo()

bool DisasterTick_Big_Ufo ( DisasterVehicle * v)
static

(Big) Ufo handling, v->state states: 0: Fly around to the middle of the map, then randomly for a while and home in on a piece of rail 1: Land there and breakdown all trains in a radius of 12 tiles; and now we wait... because as soon as the Ufo lands, a fighter jet, a Skyranger, is called to clear up the mess.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 539 of file disaster_vehicle.cpp.

References Accident, Vehicle::age, ClosestTownFromTile(), Crashed, Delta(), Vehicle::dest_tile, Vehicle::direction, GetEncodedString(), GetNewVehiclePos(), GetSlopePixelZ(), Company::IsHumanID(), IsPlainRailTile(), IsValidTile(), TimerGameConst< struct Calendar >::MIN_DATE, RandomRange(), RandomTile, Vehicle::SetNext(), ST_BIG_UFO_DESTROYER, ST_BIG_UFO_DESTROYER_SHADOW, DisasterVehicle::state, SW, Vehicle::tick_counter, Vehicle::tile, TILE_SIZE, TileX(), TileY(), DisasterVehicle::UpdatePosition(), Vehicle::x_pos, GetNewVehiclePosResult::y, Vehicle::y_pos, and Vehicle::z_pos.

◆ DisasterTick_Big_Ufo_Destroyer()

bool DisasterTick_Big_Ufo_Destroyer ( DisasterVehicle * v)
static

Skyranger destroying (Big) Ufo handling, v->state states: 0: Home in on landed Ufo and shoot it down.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 641 of file disaster_vehicle.cpp.

References _settings_client, DisasterVehicle::big_ufo_destroyer_target, CreateEffectVehicleAbove(), CreateEffectVehicleRel(), Delta(), EV_EXPLOSION_LARGE, EV_EXPLOSION_SMALL, GB(), GetNewVehiclePos(), INVALID_TILE, Map::SizeX(), SND_12_EXPLOSION, DisasterVehicle::state, Vehicle::tick_counter, Vehicle::tile, TILE_SIZE, TileAddWrap(), DisasterVehicle::UpdatePosition(), Vehicle::x_pos, GetNewVehiclePosResult::y, and Vehicle::y_pos.

◆ DisasterTick_Helicopter()

bool DisasterTick_Helicopter ( DisasterVehicle * v)
static

Helicopter handling.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 513 of file disaster_vehicle.cpp.

References ChopperAttacks, and DisasterTick_Aircraft().

◆ DisasterTick_Helicopter_Rotors()

bool DisasterTick_Helicopter_Rotors ( DisasterVehicle * v)
static

Helicopter rotor blades; keep these spinning.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 519 of file disaster_vehicle.cpp.

References HasBit(), Vehicle::sprite_cache, MutableSpriteCache::sprite_seq, Vehicle::tick_counter, and Vehicle::UpdatePositionAndViewport().

◆ DisasterTick_NULL()

bool DisasterTick_NULL ( DisasterVehicle * v)
static

No-op vehicle tick.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 716 of file disaster_vehicle.cpp.

◆ DisasterTick_Submarine()

bool DisasterTick_Submarine ( DisasterVehicle * v)
static

Submarine, v->state states: Unused, just float around aimlessly and pop up at different places, turning around.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 688 of file disaster_vehicle.cpp.

References Vehicle::age, Chance16(), ChangeDir(), Vehicle::direction, DirToDiagDir(), GB(), GetNewVehiclePos(), GetTileTrackStatus(), HasBit(), Invalid, IsValidTile(), Left90, Right90, Vehicle::tick_counter, Vehicle::tile, TileOffsByDiagDir(), TRACK_BIT_ALL, TrackdirBitsToTrackBits(), TRANSPORT_WATER, DisasterVehicle::UpdatePosition(), GetNewVehiclePosResult::y, and Vehicle::z_pos.

◆ DisasterTick_Ufo()

bool DisasterTick_Ufo ( DisasterVehicle * ufo)
static

◆ DisasterTick_Zeppeliner()

bool DisasterTick_Zeppeliner ( DisasterVehicle * v)
static

Zeppeliner handling, v->state states: 0: Zeppeliner initialization has found an airport, go there and crash 1: Create crash and animate falling down for extra dramatic effect 2: Create more smoke and leave debris on ground 3: Clear the runway after some time and remove crashed zeppeliner If not airport was found, only state 0 is reached until zeppeliner leaves map.

Perform any actions for a given vehicle.

Parameters
vThe vehicle to check.
Returns
true iff the vehicle still exists, i.e. has not been destroyed.

Definition at line 234 of file disaster_vehicle.cpp.

References _settings_client, Accident, Vehicle::age, Station::airport, Airport::blocks, CreateEffectVehicleRel(), EV_CRASH_SMOKE, EV_EXPLOSION_LARGE, EV_EXPLOSION_SMALL, GB(), BaseStation::GetByTile(), GetEncodedString(), GetNewVehiclePos(), GetSlopePixelZ(), GetStationIndex(), GetTileOwner(), HasBit(), DisasterVehicle::image_override, IsAirportTile(), IsValidTile(), TimerGameConst< struct Calendar >::MIN_DATE, AI::NewEvent(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), RunwayIn, Map::SizeY(), SND_12_EXPLOSION, DisasterVehicle::state, Vehicle::tick_counter, Vehicle::tile, TILE_SIZE, DisasterVehicle::UpdatePosition(), Vehicle::x_pos, GetNewVehiclePosResult::y, Vehicle::y_pos, Vehicle::z_pos, and Zeppeliner.

◆ DoDisaster()

void DoDisaster ( )
static

Create a random disaster, if there is one available.

Definition at line 951 of file disaster_vehicle.cpp.

References _disasters, RandomRange(), and TimerGameCalendar::year.

◆ ReleaseDisastersTargetingIndustry()

void ReleaseDisastersTargetingIndustry ( IndustryID i)

Marks all disasters targeting this industry in such a way they won't call Industry::Get(v->dest_tile) on invalid industry anymore.

Parameters
ideleted industry

Definition at line 993 of file disaster_vehicle.cpp.

References ST_AIRPLANE, and ST_HELICOPTER.

Referenced by Industry::~Industry().

◆ ReleaseDisasterVehicle()

void ReleaseDisasterVehicle ( VehicleID vehicle)

Notify disasters that we are about to delete a vehicle.

So make them head elsewhere.

Parameters
vehicledeleted vehicle

Definition at line 1008 of file disaster_vehicle.cpp.

References Vehicle::age, Vehicle::dest_tile, Disaster, GetAircraftFlightLevelBounds(), TimerGameConst< struct Calendar >::MIN_DATE, RandomTile, ST_SMALL_UFO, DisasterVehicle::state, Vehicle::subtype, BaseVehicle::type, and Vehicle::z_pos.

Referenced by Vehicle::PreDestructor().

◆ ResetDisasterDelay()

void ResetDisasterDelay ( )
static

Resets the introduction of the next disaster.

Definition at line 967 of file disaster_vehicle.cpp.

References _disaster_delay, and GB().

Referenced by StartupDisasters().

◆ StartupDisasters()

void StartupDisasters ( )

Starts up disasters.

Definition at line 983 of file disaster_vehicle.cpp.

References ResetDisasterDelay().

Referenced by _GenerateWorld().

Variable Documentation

◆ _disaster_delay

uint16_t _disaster_delay

Delay counter for considering the next disaster.

Definition at line 57 of file disaster_vehicle.cpp.

Referenced by ResetDisasterDelay().

◆ _disaster_images

DirectionIndexArray<SpriteID> _disaster_images[]
staticconstexpr
Initial value:
= {
}
static constexpr DirectionIndexArray< SpriteID > _disaster_images_2
Sprites for small UFO.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_7
Sprites for large UFO destroyer.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_8
Sprites for combat helicopter.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_1
Sprites for blimp.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_4
Sprites for small submarine.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_5
Sprites for large submarine.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_6
Sprites for large UFO.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_9
Sprites for combat helicopter rotor.
static constexpr DirectionIndexArray< SpriteID > _disaster_images_3
Sprites for combat aircraft.

Sprites for each disaster vehicle.

Definition at line 110 of file disaster_vehicle.cpp.

◆ _disaster_images_1

DirectionIndexArray<SpriteID> _disaster_images_1 {SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP, SPR_BLIMP}
staticconstexpr

Sprites for blimp.

Definition at line 91 of file disaster_vehicle.cpp.

◆ _disaster_images_2

DirectionIndexArray<SpriteID> _disaster_images_2 {SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT, SPR_UFO_SMALL_SCOUT}
staticconstexpr

Sprites for small UFO.

Definition at line 93 of file disaster_vehicle.cpp.

◆ _disaster_images_3

DirectionIndexArray<SpriteID> _disaster_images_3 {SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15, SPR_F_15}
staticconstexpr

Sprites for combat aircraft.

Definition at line 95 of file disaster_vehicle.cpp.

◆ _disaster_images_4

DirectionIndexArray<SpriteID> _disaster_images_4 {SPR_SUB_SMALL_NE, SPR_SUB_SMALL_NE, SPR_SUB_SMALL_SE, SPR_SUB_SMALL_SE, SPR_SUB_SMALL_SW, SPR_SUB_SMALL_SW, SPR_SUB_SMALL_NW, SPR_SUB_SMALL_NW}
staticconstexpr

Sprites for small submarine.

Definition at line 97 of file disaster_vehicle.cpp.

◆ _disaster_images_5

DirectionIndexArray<SpriteID> _disaster_images_5 {SPR_SUB_LARGE_NE, SPR_SUB_LARGE_NE, SPR_SUB_LARGE_SE, SPR_SUB_LARGE_SE, SPR_SUB_LARGE_SW, SPR_SUB_LARGE_SW, SPR_SUB_LARGE_NW, SPR_SUB_LARGE_NW}
staticconstexpr

Sprites for large submarine.

Definition at line 99 of file disaster_vehicle.cpp.

◆ _disaster_images_6

DirectionIndexArray<SpriteID> _disaster_images_6 {SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER, SPR_UFO_HARVESTER}
staticconstexpr

Sprites for large UFO.

Definition at line 101 of file disaster_vehicle.cpp.

◆ _disaster_images_7

DirectionIndexArray<SpriteID> _disaster_images_7 {SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER, SPR_XCOM_SKYRANGER}
staticconstexpr

Sprites for large UFO destroyer.

Definition at line 103 of file disaster_vehicle.cpp.

◆ _disaster_images_8

DirectionIndexArray<SpriteID> _disaster_images_8 {SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A, SPR_AH_64A}
staticconstexpr

Sprites for combat helicopter.

Definition at line 105 of file disaster_vehicle.cpp.

◆ _disaster_images_9

DirectionIndexArray<SpriteID> _disaster_images_9 {SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1, SPR_ROTOR_MOVING_1}
staticconstexpr

Sprites for combat helicopter rotor.

Definition at line 107 of file disaster_vehicle.cpp.

◆ _disasters

const DisasterCreation _disasters[]
static
Initial value:
= {
}
StrongType::Typedef< int32_t, struct YearTag< struct Calendar >, StrongType::Compare, StrongType::Integer > Year
static void Disaster_Airplane_Init()
Combat airplane which destroys an oil refinery.
static void Disaster_Small_Ufo_Init()
Ufo which flies around aimlessly from the middle of the map a bit until it locates a road vehicle whi...
static void Disaster_Helicopter_Init()
Combat helicopter that destroys a factory.
static void Disaster_Big_Submarine_Init()
Curious submarine #2, just floats around.
static void Disaster_Small_Submarine_Init()
Curious submarine #1, just floats around.
static void Disaster_Zeppeliner_Init()
Zeppeliner which crashes on an airport if one found, otherwise crashes on a random tile.
static void Disaster_Big_Ufo_Init()
Big Ufo which lands on a piece of rail and will consequently be shot down by a combat airplane,...
static void Disaster_CoalMine_Init()
Coal mine catastrophe, destroys a stretch of 30 tiles of land in a certain direction.

Table per disaster subtype when to create disasters, and how to create them.

Definition at line 939 of file disaster_vehicle.cpp.

Referenced by DoDisaster().

◆ _disastervehicle_tick_procs

DisasterVehicleTickProc* const _disastervehicle_tick_procs[]
static
Initial value:
= {
}
static bool DisasterTick_Big_Ufo_Destroyer(DisasterVehicle *v)
Skyranger destroying (Big) Ufo handling, v->state states: 0: Home in on landed Ufo and shoot it down.
static bool DisasterTick_Big_Ufo(DisasterVehicle *v)
(Big) Ufo handling, v->state states: 0: Fly around to the middle of the map, then randomly for a whil...
static bool DisasterTick_Zeppeliner(DisasterVehicle *v)
Zeppeliner handling, v->state states: 0: Zeppeliner initialization has found an airport,...
static bool DisasterTick_Helicopter_Rotors(DisasterVehicle *v)
Helicopter rotor blades; keep these spinning.
static bool DisasterTick_Airplane(DisasterVehicle *v)
Airplane handling.
static bool DisasterTick_NULL(DisasterVehicle *v)
No-op vehicle tick.
static bool DisasterTick_Ufo(DisasterVehicle *ufo)
(Small) Ufo handling, v->state states: 0: Fly around to the middle of the map, then randomly,...
static bool DisasterTick_Submarine(DisasterVehicle *v)
Submarine, v->state states: Unused, just float around aimlessly and pop up at different places,...
static bool DisasterTick_Helicopter(DisasterVehicle *v)
Helicopter handling.

Definition at line 728 of file disaster_vehicle.cpp.