ScummVM API documentation
bbant.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BBVS_MINIGAMES_BBANT_H
23 #define BBVS_MINIGAMES_BBANT_H
24 
25 #include "bbvs/minigames/minigame.h"
26 
27 namespace Bbvs {
28 
29 class MinigameBbAnt : public Minigame {
30 public:
31  MinigameBbAnt(BbvsEngine *vm) : Minigame(vm) {};
32  bool run(bool fromMainGame) override;
33 public:
34 
35  struct Obj {
36  int kind;
37  int x, y, priority;
38  int xIncr, yIncr;
39  const ObjAnimation *anim;
40  int frameIndex;
41  int ticks;
42  int otherObjIndex;
43  int animIndex;
44  int animIndexIncr;
45  int status;
46  int field30;
47  int damageCtr;
48  int smokeCtr;
49  int counter;
50  int hasSmoke;
51  const ObjAnimation *anim2;
52  int frameIndex2;
53  int ticks2;
54  int status2;
55  int flag;
56  };
57 
58  enum {
59  kMaxObjectsCount = 256,
60  kScaleDim = 28
61  };
62 
63  struct ObjInit {
64  const ObjAnimation *anim1;
65  const ObjAnimation *anim2;
66  const ObjAnimation *anim3;
67  int x, y;
68  };
69 
70  Obj _objects[kMaxObjectsCount];
71 
72  int _score, _hiScore;
73 
74  int _totalBugsCount;
75  int _bugsChanceByKind[6], _bugsCountByKind[6];
76  int _skullBugCtr;
77 
78  int _stompX, _stompY;
79  int _stompDelay1;
80  int _stompCounter1;
81  int _stompCounter2;
82 
83  int _stompCount;
84  int _hasLastStompObj;
85  Obj *_lastStompObj;
86 
87  int _counter1;
88  int _countdown10;
89  int _counter4;
90  int _levelTimeDelay;
91  int _levelTimeLeft;
92 
93  int _countdown4;
94  int _countdown3;
95  int _countdown6;
96  int _countdown5;
97  int _countdown7;
98 
99  byte _scaleBuf[kScaleDim * kScaleDim];
100 
101  const ObjAnimation *getAnimation(int animIndex);
102  const ObjInit *getObjInit(int index);
103  const ObjAnimation * const *getObjKindAnimTable(int kind);
104  const ObjAnimation *getObjAnim(int index);
105 
106  void buildDrawList0(DrawList &drawList);
107  void buildDrawList1(DrawList &drawList);
108  void buildDrawList2(DrawList &drawList);
109  void buildDrawList3(DrawList &drawList);
110  void drawMagnifyingGlass(DrawList &drawList);
111 
112  void drawSprites();
113  void drawSprites0();
114  void drawSprites1();
115  void drawSprites2();
116  void drawSprites3();
117 
118  Obj *getFreeObject();
119 
120  void initObjects();
121  void initObjects0();
122  void initObjects1();
123 
124  void initVars();
125  void initVars1();
126  void initVars2();
127  void initVars3();
128 
129  bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
130  bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
131  bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
132  bool updateStatus2(int mouseX, int mouseY, uint mouseButtons);
133  bool updateStatus3(int mouseX, int mouseY, uint mouseButtons);
134 
135  void getRandomBugObjValues(int &x, int &y, int &animIndexIncr, int &field30);
136  void insertBugSmokeObj(int x, int y, int bugObjIndex);
137  void insertSmokeObj(int x, int y);
138  void resetObj(int objIndex);
139  void insertStompObj(int x, int y);
140  void removeStompObj(Obj *obj);
141  void insertBugObj(int kind, int animIndexIncr, int always0, int x, int y, int field30, int always1);
142  void removeBugObj(int objIndex);
143  void updateBugObjAnim(int objIndex);
144  void updateObjAnim2(int objIndex);
145  void insertRandomBugObj(int kind);
146  bool isBugOutOfScreen(int objIndex);
147  void updateObjAnim3(int objIndex);
148  void updateBugObj1(int objIndex);
149  void updateObjKind2(int objIndex);
150  void updateObjKind3(int objIndex);
151  void updateObjKind4(int objIndex);
152  void updateObjKind5(int objIndex);
153  void updateStompObj(int objIndex);
154  void updateSmokeObj(int objIndex);
155  void updateFootObj(int objIndex);
156  bool isBugAtCandy(int objIndex, int &candyObjIndex);
157  bool isMagGlassAtBug(int objIndex);
158  bool isMagGlassAtBeavisLeg(int objIndex);
159  bool testObj5(int objIndex);
160  void updateObjs(uint mouseButtons);
161 
162  void update();
163 
164  void scale2x(int x, int y);
165 
166  void loadSounds();
167 
168 };
169 
170 } // End of namespace Bbvs
171 
172 #endif // BBVS_MINIGAMES_BBANT_H
Definition: graphics.h:38
Definition: minigame.h:47
Definition: minigame.h:40
Definition: bbvs.h:42
Definition: bbvs.h:248
Definition: bbant.h:35
Definition: bbant.h:29
Definition: bbant.h:63