Debian Codegraph @

Sources/Jazz2/Actors/Enemies/Bosses/Uterus.h

raw
1 #pragma once
2
3 #include "BossBase.h"
4 #include "../Crab.h"
5
6 namespace Jazz2::Actors::Bosses
7 {
8 /** @brief Uterus (boss) */
9 class Uterus : public BossBase
10 {
11 DEATH_RUNTIME_OBJECT(BossBase);
12
13 public:
14 Uterus();
15 ~Uterus();
16
17 static void Preload(const ActorActivationDetails& details);
18
19 protected:
20 Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override;
21 bool OnActivatedBoss() override;
22 void OnUpdate(float timeMult) override;
23 void OnUpdateHitbox() 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 StateOpen = 1;
30 static constexpr std::int32_t StateClosed = 2;
31
32 static constexpr std::int32_t ShieldPartCount = 6;
33
34 #ifndef DOXYGEN_GENERATING_OUTPUT
35 // Doxygen 1.12.0 outputs also private structs/unions even if it shouldn't
36 class ShieldPart : public EnemyBase
37 {
38 friend class Uterus;
39
40 public:
41 float Phase;
42 float FallTime;
43
44 bool OnHandleCollision(std::shared_ptr<ActorBase> other) override;
45
46 void Recover(float phase);
47
48 protected:
49 Task<bool> OnActivatedAsync(const ActorActivationDetails& details) override;
50 void OnUpdate(float timeMult) override;
51 void OnUpdateHitbox() override;
52 bool OnPerish(ActorBase* collider) override;
53 };
54 #endif
55
56 std::int32_t _state;
57 float _stateTime;
58 std::uint8_t _endText;
59 std::shared_ptr<ShieldPart> _shields[ShieldPartCount];
60 Vector2f _originPos, _lastPos;
61 float _spawnCrabTime;
62 float _anglePhase;
63 bool _hasShield;
64
65 void FollowNearestPlayer(float timeMult);
66 };
67 }