forked from retrofw/cavestory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stageboss.h
executable file
·81 lines (62 loc) · 1.64 KB
/
stageboss.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef _STAGEBOSS_H
#define _STAGEBOSS_H
// Stage Bosses are "big" boss enemies used in some stages.
//
// The stage boss class runs at a conceptual level "above"
// normal AI routines, more like at the level of the game loop.
//
// This gives these complex bosses a good way to control more
// things than just a single object (some bosses for example have
// multiple parts which need to be coordinated, such as Omega).
//
// A pointer to the "main" object of a stage boss is stored by
// the derived class at game.stageboss.object.
//
// The script command <BSL0000 refers to opening a boss bar
// against game.stageboss.object.
enum BossType
{
BOSS_NONE = 0x00,
BOSS_OMEGA,
BOSS_BALFROG,
BOSS_MONSTER_X,
BOSS_CORE,
BOSS_IRONH,
BOSS_SISTERS,
BOSS_UNDEAD_CORE,
BOSS_HEAVY_PRESS,
BOSS_BALLOS
};
class StageBoss
{
public:
virtual void OnMapEntry() { }
virtual void OnMapExit() { }
// called every tick (for logic only, please don't draw from here)
virtual void Run() { }
virtual void RunAftermove() { }
virtual void SetState(int newstate);
};
class StageBossManager
{
public:
StageBossManager();
bool SetType(int newtype);
int Type();
// safe interface to the current StageBoss instance
// (they safely do nothing if called in a stage without a stage boss)
void OnMapEntry();
void OnMapExit();
void Run();
void RunAftermove();
void SetState(int newstate);
// pointer to the "main object" of a stage boss
// (the one to show the boss bar for)
// this is set by the derived class, and is cleared in OnMapExit
// of the derived class and on a SetType().
Object *object;
private:
StageBoss *fBoss;
int fBossType;
};
#endif