OpenTTD Source 20260208-master-g43af8e94d0
disaster_vehicle.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD 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, version 2.
4 * OpenTTD 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.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef DISASTER_VEHICLE_H
11#define DISASTER_VEHICLE_H
12
13#include "vehicle_base.h"
14#include "aircraft.h"
15
34
38struct DisasterVehicle final : public SpecializedVehicle<DisasterVehicle, VEH_DISASTER> {
40 VehicleID big_ufo_destroyer_target = VehicleID::Invalid();
41 VehicleAirFlags flags{};
42 uint16_t state = 0;
43
48 ~DisasterVehicle() override = default;
49
50 void UpdatePosition(int x, int y, int z);
51 void UpdateDeltaXY() override;
52 void UpdateImage();
53 bool Tick() override;
54};
55
56#endif /* DISASTER_VEHICLE_H */
Base for aircraft.
Direction
Defines the 8 directions on the map.
DisasterSubType
Different sub types of disaster vehicles.
@ ST_ZEPPELINER_SHADOW
Shadow of the zeppelin.
@ ST_HELICOPTER_SHADOW
Shadow of helicopter.
@ ST_SMALL_UFO_SHADOW
Shadow of small UFO.
@ ST_SMALL_UFO
Small UFO, tries to find a road vehicle to destroy.
@ ST_BIG_UFO
Big UFO, finds a piece of railroad to "park" on.
@ ST_BIG_UFO_SHADOW
Shadow of the big UFO.
@ ST_ZEPPELINER
Zeppelin, crashes at airports.
@ ST_BIG_UFO_DESTROYER_SHADOW
Shadow of the aircraft.
@ ST_BIG_UFO_DESTROYER
Aircraft the will bomb the big UFO.
@ ST_BIG_SUBMARINE
Big submarine, pops up in the oceans but doesn't do anything.
@ ST_SMALL_SUBMARINE
Small submarine, pops up in the oceans but doesn't do anything.
@ ST_HELICOPTER
Helicopter destroying a factory.
@ ST_AIRPLANE
Airplane destroying an oil refinery.
@ ST_HELICOPTER_ROTORS
Rotors of helicopter.
@ ST_AIRPLANE_SHADOW
Shadow of airplane.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
void UpdateDeltaXY() override
Updates the x and y offsets and the size of the sprite used for this vehicle.
SpriteID image_override
Override for the default disaster vehicle sprite.
DisasterVehicle(VehicleID index)
For use by saveload.
VehicleAirFlags flags
Flags about the state of the vehicle,.
~DisasterVehicle() override=default
We want to 'destruct' the right class.
VehicleID big_ufo_destroyer_target
The big UFO that this destroyer is supposed to bomb.
bool Tick() override
Calls the tick handler of the vehicle.
uint16_t state
Action stage of the disaster vehicle.
SpecializedVehicle< DisasterVehicle, Type > SpecializedVehicleBase
Direction direction
facing
uint8_t subtype
subtype (Filled with values from AircraftSubType/DisasterSubType/EffectVehicleType/GroundVehicleSubty...
void UpdatePosition()
Update the position of the vehicle.
Definition vehicle.cpp:1674
Base class for all vehicles.
PoolID< uint32_t, struct VehicleIDTag, 0xFF000, 0xFFFFF > VehicleID
The type all our vehicle IDs have.