| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "../EnemyBase.h" |
| 4 |
|
| 5 |
namespace Jazz2::Actors::Bosses |
| 6 |
{ |
| 7 |
/** @brief Robot (boss) */ |
| 8 |
class Robot : public Enemies::EnemyBase |
| 9 |
{ |
| 10 |
DEATH_RUNTIME_OBJECT(Enemies::EnemyBase); |
| 11 |
|
| 12 |
public: |
| 13 |
Robot(); |
| 14 |
|
| 15 |
static void Preload(const ActorActivationDetails& details); |
| 16 |
|
| 17 |
void Activate(); |
| 18 |
void Deactivate(); |
| 19 |
|
| 20 |
protected: |
| 21 |
Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override; |
| 22 |
void OnUpdate(float timeMult) override; |
| 23 |
void OnHealthChanged(ActorBase* collider) override; |
| 24 |
bool OnPerish(ActorBase* collider) override; |
| 25 |
|
| 26 |
private: |
| 27 |
static constexpr std::int32_t StateTransition = -1; |
| 28 |
static constexpr std::int32_t StateWaiting = 0; |
| 29 |
static constexpr std::int32_t StateCopter = 1; |
| 30 |
static constexpr std::int32_t StateRunning1 = 2; |
| 31 |
static constexpr std::int32_t StateRunning2 = 3; |
| 32 |
static constexpr std::int32_t StatePreparingToRun = 4; |
| 33 |
|
| 34 |
#ifndef DOXYGEN_GENERATING_OUTPUT |
| 35 |
// Doxygen 1.12.0 outputs also private structs/unions even if it shouldn't |
| 36 |
class SpikeBall : public Enemies::EnemyBase |
| 37 |
{ |
| 38 |
protected: |
| 39 |
Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override; |
| 40 |
void OnUpdateHitbox() override; |
| 41 |
void OnEmitLights(SmallVectorImpl<LightEmitter>& lights) override; |
| 42 |
bool OnPerish(ActorBase* collider) override; |
| 43 |
void OnHitFloor(float timeMult) override; |
| 44 |
void OnHitWall(float timeMult) override; |
| 45 |
void OnHitCeiling(float timeMult) override; |
| 46 |
}; |
| 47 |
#endif |
| 48 |
|
| 49 |
std::int32_t _state; |
| 50 |
float _stateTime; |
| 51 |
std::int32_t _shots; |
| 52 |
Vector2f _originPos; |
| 53 |
|
| 54 |
void FollowNearestPlayer(std::int32_t newState, float time); |
| 55 |
void Shoot(); |
| 56 |
void Run(); |
| 57 |
}; |
| 58 |
} |