Mario Kart 64
Loading...
Searching...
No Matches
Boat.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <libultraship.h>
4
#include "
Actor.h
"
5
#include <vector>
6
#include "
RegisterContent.h
"
7
#include "
engine/SpawnParams.h
"
8
#include "
engine/CoreMath.h
"
9
#include "
engine/World.h
"
10
11
extern
"C"
{
12
#include "
main.h
"
13
#include "
vehicles.h
"
14
}
15
16
class
ABoat
:
public
AActor
{
17
public
:
18
19
enum
SpawnMode
: uint16_t {
20
POINT
,
// Spawn boat at a specific path point
21
AUTO
,
// Automatically distribute boats based on a specific path point
22
};
23
24
const
char
*
Type
=
"mk:paddle_boat"
;
25
size_t
Index
;
26
bool
IsActive
;
// The paddle wheel boat only shows up if the number of players is < 3
27
Vec3f
Position
;
28
Vec3f
Velocity
;
29
u16
WaypointIndex
;
30
s16
ActorIndex
;
31
f32
Speed
;
32
s16
RotY
= 0;
33
s32
SomeFlags
;
34
35
int32_t
SmokeParticles
[128];
36
int32_t
NextParticlePtr
= 0;
37
int16_t
AnotherSmokeTimer
= 0;
38
int16_t
SmokeTimer
= 0;
39
40
explicit
ABoat
(
const
SpawnParams
& params);
41
42
~ABoat
() {
43
_count
--;
44
}
45
46
static
size_t
GetCount
() {
47
return
_count
;
48
}
49
50
// This is simply a helper function to keep Spawning code clean
51
static
inline
ABoat
*
Spawn
(f32 speed, uint32_t pathIndex, uint32_t pathPoint,
ABoat::SpawnMode
spawnMode) {
52
SpawnParams
params = {
53
.Name =
"mk:paddle_boat"
,
54
.Type =
static_cast<
uint16_t
>
(spawnMode),
55
.
PathIndex
= pathIndex,
56
.
PathPoint
= pathPoint,
57
.
Speed
= speed,
58
};
59
return
static_cast<
ABoat
*
>
(
AddActorToWorld<ABoat>
(params));
60
}
61
62
ABoat::SpawnMode
SpawnType
=
ABoat::SpawnMode::AUTO
;
63
uint32_t
PathIndex
= 0;
64
uint32_t
PathPoint
= 0;
65
66
virtual
void
SetSpawnParams
(
SpawnParams
& params)
override
;
67
virtual
void
Tick
()
override
;
68
virtual
void
Draw
(
Camera
* camera)
override
;
69
virtual
void
VehicleCollision
(s32 playerId,
Player
* player)
override
;
70
virtual
s32
AddSmoke
(
size_t
,
Vec3f
, f32);
71
virtual
bool
IsMod
()
override
;
72
virtual
void
DrawEditorProperties
()
override
;
73
private
:
74
static
size_t
_count
;
75
static
std::map<uint32_t, std::vector<uint32_t>>
BoatCounts
;
76
};
Actor.h
CoreMath.h
RegisterContent.h
AddActorToWorld
static AActor * AddActorToWorld(const SpawnParams ¶ms)
Definition
RegisterContent.h:13
SpawnParams.h
World.h
AActor::AActor
AActor()
Definition
Actor.cpp:13
ABoat::Index
size_t Index
Definition
Boat.h:25
ABoat::PathPoint
uint32_t PathPoint
Definition
Boat.h:64
ABoat::SmokeTimer
int16_t SmokeTimer
Definition
Boat.h:38
ABoat::Spawn
static ABoat * Spawn(f32 speed, uint32_t pathIndex, uint32_t pathPoint, ABoat::SpawnMode spawnMode)
Definition
Boat.h:51
ABoat::Position
Vec3f Position
Definition
Boat.h:27
ABoat::NextParticlePtr
int32_t NextParticlePtr
Definition
Boat.h:36
ABoat::AddSmoke
virtual s32 AddSmoke(size_t, Vec3f, f32)
Definition
Boat.cpp:216
ABoat::SomeFlags
s32 SomeFlags
Definition
Boat.h:33
ABoat::_count
static size_t _count
Definition
Boat.h:74
ABoat::SpawnMode
SpawnMode
Definition
Boat.h:19
ABoat::AUTO
@ AUTO
Definition
Boat.h:21
ABoat::POINT
@ POINT
Definition
Boat.h:20
ABoat::AnotherSmokeTimer
int16_t AnotherSmokeTimer
Definition
Boat.h:37
ABoat::IsActive
bool IsActive
Definition
Boat.h:26
ABoat::ABoat
ABoat(const SpawnParams ¶ms)
Definition
Boat.cpp:22
ABoat::SmokeParticles
int32_t SmokeParticles[128]
Definition
Boat.h:35
ABoat::PathIndex
uint32_t PathIndex
Definition
Boat.h:63
ABoat::DrawEditorProperties
virtual void DrawEditorProperties() override
Definition
Boat.cpp:225
ABoat::Speed
f32 Speed
Definition
Boat.h:31
ABoat::ActorIndex
s16 ActorIndex
Definition
Boat.h:30
ABoat::BoatCounts
static std::map< uint32_t, std::vector< uint32_t > > BoatCounts
Definition
Boat.h:75
ABoat::Tick
virtual void Tick() override
Definition
Boat.cpp:90
ABoat::~ABoat
~ABoat()
Definition
Boat.h:42
ABoat::GetCount
static size_t GetCount()
Definition
Boat.h:46
ABoat::Velocity
Vec3f Velocity
Definition
Boat.h:28
ABoat::SpawnType
ABoat::SpawnMode SpawnType
Definition
Boat.h:62
ABoat::SetSpawnParams
virtual void SetSpawnParams(SpawnParams ¶ms) override
Definition
Boat.cpp:75
ABoat::IsMod
virtual bool IsMod() override
Definition
Boat.cpp:86
ABoat::RotY
s16 RotY
Definition
Boat.h:32
ABoat::Draw
virtual void Draw(Camera *camera) override
Definition
Boat.cpp:83
ABoat::WaypointIndex
u16 WaypointIndex
Definition
Boat.h:29
ABoat::VehicleCollision
virtual void VehicleCollision(s32 playerId, Player *player) override
Definition
Boat.cpp:187
ABoat::Type
const char * Type
Definition
Boat.h:24
Vec3f
f32 Vec3f[3]
Definition
common_structs.h:10
main.h
Camera
Definition
camera.h:35
Player
Definition
common_structs.h:264
SpawnParams
Definition
SpawnParams.h:30
vehicles.h
src
engine
vehicles
Boat.h
Generated by
1.13.2