-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstageboss.cpp
More file actions
129 lines (105 loc) · 2.37 KB
/
Copy pathstageboss.cpp
File metadata and controls
129 lines (105 loc) · 2.37 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include "nx.h"
#include "stageboss.fdh"
#include "ai/boss/omega.h"
#include "ai/boss/balfrog.h"
#include "ai/boss/x.h"
#include "ai/boss/core.h"
#include "ai/boss/ironhead.h"
#include "ai/boss/sisters.h"
#include "ai/boss/undead_core.h"
#include "ai/boss/heavypress.h"
#include "ai/boss/ballos.h"
StageBossManager::StageBossManager()
{
fBoss = NULL;
fBossType = BOSS_NONE;
}
/*
void c------------------------------() {}
*/
bool StageBossManager::SetType(int newtype)
{
stat("StageBossManager::SetType(%d)", newtype);
if (fBoss)
{
delete fBoss;
if (game.stageboss.object)
{
staterr(" ** warning: game.stageboss.object not properly cleaned up in OnMapExit");
game.stageboss.object->Delete();
game.stageboss.object = NULL;
}
}
fBossType = newtype;
fBoss = NULL;
switch(newtype)
{
case BOSS_NONE: break;
case BOSS_OMEGA: fBoss = new OmegaBoss; break;
case BOSS_BALFROG: fBoss = new BalfrogBoss; break;
case BOSS_MONSTER_X: fBoss = new XBoss; break;
case BOSS_CORE: fBoss = new CoreBoss; break;
case BOSS_IRONH: fBoss = new IronheadBoss; break;
case BOSS_SISTERS: fBoss = new SistersBoss; break;
case BOSS_UNDEAD_CORE: fBoss = new UDCoreBoss; break;
case BOSS_HEAVY_PRESS: fBoss = new HeavyPress; break;
case BOSS_BALLOS: fBoss = new BallosBoss; break;
default:
staterr("StageBossManager::SetType: unhandled boss type %d", newtype);
fBossType = BOSS_NONE;
return 1;
}
return 0;
}
int StageBossManager::Type()
{
return fBossType;
}
/*
void c------------------------------() {}
*/
void StageBossManager::OnMapEntry()
{
if (fBoss) fBoss->OnMapEntry();
}
void StageBossManager::OnMapExit()
{
if (fBoss) fBoss->OnMapExit();
}
void StageBossManager::Run()
{
if (fBoss) fBoss->Run();
}
void StageBossManager::RunAftermove()
{
if (fBoss) fBoss->RunAftermove();
}
/*
void c------------------------------() {}
*/
void StageBossManager::SetState(int newstate)
{
if (fBoss)
{
fBoss->SetState(newstate);
}
else
{
staterr("StageBossManager::SetState(%d): no stageboss object in existance!", newstate);
}
}
/*
void c------------------------------() {}
*/
// these are default implementation, bosses can override them if they want to.
void StageBoss::SetState(int newstate)
{
if (game.stageboss.object)
{
game.stageboss.object->state = newstate;
}
else
{
staterr("StageBoss::SetState(%d): no stageboss object!", newstate);
}
}