OpenTTD

disaster_vehicle.h
Go to the documentation of this file.
1 /* $Id: disaster_vehicle.h 26872 2014-09-21 11:12:42Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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 <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef DISASTER_VEHICLE_H
13 #define DISASTER_VEHICLE_H
14
15 #include "vehicle_base.h"
16
18 enum DisasterSubType {
19 ST_ZEPPELINER,
20 ST_ZEPPELINER_SHADOW,
21 ST_SMALL_UFO,
22 ST_SMALL_UFO_SHADOW,
23 ST_AIRPLANE,
24 ST_AIRPLANE_SHADOW,
25 ST_HELICOPTER,
26 ST_HELICOPTER_SHADOW,
27 ST_HELICOPTER_ROTORS,
28 ST_BIG_UFO,
29 ST_BIG_UFO_SHADOW,
30 ST_BIG_UFO_DESTROYER,
31 ST_BIG_UFO_DESTROYER_SHADOW,
32 ST_SMALL_SUBMARINE,
33 ST_BIG_SUBMARINE,
34 };
35
39 struct DisasterVehicle FINAL : public SpecializedVehicle<DisasterVehicle, VEH_DISASTER> {
40 SpriteID image_override;
41 VehicleID big_ufo_destroyer_target;
42 byte flags;
43
45 DisasterVehicle() : SpecializedVehicleBase() {}
46 DisasterVehicle(int x, int y, Direction direction, DisasterSubType subtype, VehicleID big_ufo_destroyer_target = VEH_INVALID);
48 virtual ~DisasterVehicle() {}
49
50 void UpdatePosition(int x, int y, int z);
51 void UpdateDeltaXY(Direction direction);
52 void UpdateImage();
53 bool Tick();
54 };
55
60 #define FOR_ALL_DISASTERVEHICLES(var) FOR_ALL_VEHICLES_OF_TYPE(DisasterVehicle, var)
61
62 #endif /* DISASTER_VEHICLE_H */
ST_BIG_UFO_DESTROYER_SHADOW
Shadow of the aircraft.
Definition: disaster_vehicle.h:31
ST_AIRPLANE
Airplane destroying an oil refinery.
Definition: disaster_vehicle.h:23
ST_BIG_UFO_SHADOW
Shadow of the big UFO.
Definition: disaster_vehicle.h:29
Vehicle::direction
DirectionByte direction
facing
Definition: vehicle_base.h:271
VEH_INVALID
Non-existing type of vehicle.
Definition: vehicle_type.h:35
DisasterVehicle::UpdateDeltaXY
void UpdateDeltaXY(Direction direction)
Updates the x and y offsets and the size of the sprite used for this vehicle.
Definition: disaster_vehicle.cpp:976
ST_SMALL_SUBMARINE
Small submarine, pops up in the oceans but doesn&#39;t do anything.
Definition: disaster_vehicle.h:32
DisasterVehicle::~DisasterVehicle
virtual ~DisasterVehicle()
We want to &#39;destruct&#39; the right class.
Definition: disaster_vehicle.h:48
Direction
Direction
Defines the 8 directions on the map.
Definition: direction_type.h:26
ST_SMALL_UFO
Small UFO, tries to find a road vehicle to destroy.
Definition: disaster_vehicle.h:21
Vehicle::subtype
byte subtype
subtype (Filled with values from #EffectVehicles/#TrainSubTypes/#AircraftSubTypes) ...
Definition: vehicle_base.h:327
ST_BIG_UFO
Big UFO, finds a piece of railroad to "park" on.
Definition: disaster_vehicle.h:28
SpecializedVehicle
Class defining several overloaded accessors so we don&#39;t have to cast vehicle types that often...
Definition: vehicle_base.h:993
ST_SMALL_UFO_SHADOW
Shadow of small UFO.
Definition: disaster_vehicle.h:22
VehicleID
uint32 VehicleID
The type all our vehicle IDs have.
Definition: vehicle_type.h:18
ST_HELICOPTER_ROTORS
Rotors of helicopter.
Definition: disaster_vehicle.h:27
DisasterVehicle::DisasterVehicle
DisasterVehicle()
For use by saveload.
Definition: disaster_vehicle.h:45
DisasterVehicle::image_override
SpriteID image_override
Override for the default disaster vehicle sprite.
Definition: disaster_vehicle.h:40
ST_BIG_UFO_DESTROYER
Aircraft the will bomb the big UFO.
Definition: disaster_vehicle.h:30
ST_HELICOPTER
Helicopter destroying a factory.
Definition: disaster_vehicle.h:25
Vehicle::UpdatePosition
void UpdatePosition()
Update the position of the vehicle.
Definition: vehicle.cpp:1547
DisasterVehicle::big_ufo_destroyer_target
VehicleID big_ufo_destroyer_target
The big UFO that this destroyer is supposed to bomb.
Definition: disaster_vehicle.h:41
DisasterVehicle::flags
byte flags
Flags about the state of the vehicle,.
Definition: disaster_vehicle.h:42
vehicle_base.h
Base class for all vehicles.
SpriteID
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition: gfx_type.h:19
ST_ZEPPELINER_SHADOW
Shadow of the zeppelin.
Definition: disaster_vehicle.h:20
DisasterVehicle
Disasters, like submarines, skyrangers and their shadows, belong to this class.
Definition: disaster_vehicle.h:39
ST_ZEPPELINER
Zeppelin, crashes at airports.
Definition: disaster_vehicle.h:19
ST_BIG_SUBMARINE
Big submarine, pops up in the oceans but doesn&#39;t do anything.
Definition: disaster_vehicle.h:33
ST_HELICOPTER_SHADOW
Shadow of helicopter.
Definition: disaster_vehicle.h:26
ST_AIRPLANE_SHADOW
Shadow of airplane.
Definition: disaster_vehicle.h:24
DisasterSubType
DisasterSubType
Different sub types of disaster vehicles.
Definition: disaster_vehicle.h:18
DisasterVehicle::Tick
bool Tick()
Calls the tick handler of the vehicle.
Definition: disaster_vehicle.cpp:694