ScummVM API documentation
ringworld2_outpost.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 TSAGE_RINGWORLD2_OUTPOST_H
23 #define TSAGE_RINGWORLD2_OUTPOST_H
24 
25 #include "tsage/events.h"
26 #include "tsage/core.h"
27 #include "tsage/scenes.h"
28 #include "tsage/globals.h"
29 #include "tsage/sound.h"
30 #include "tsage/ringworld2/ringworld2_logic.h"
31 
32 namespace TsAGE {
33 
34 namespace Ringworld2 {
35 
36 using namespace TsAGE;
37 
38 class Scene1337 : public SceneExt {
39  class OptionsDialog: public GfxDialog {
40  private:
41  GfxButton _autoplay;
42  GfxButton _restartGame;
43  GfxButton _quitGame;
44  GfxButton _continueGame;
45 
46  OptionsDialog();
47  ~OptionsDialog() override {}
48  virtual GfxButton *execute(GfxButton *defaultButton);
49  public:
50  static void show();
51  };
52 
53  class Card: public SceneHotspot {
54  public:
55  SceneObject _card;
56 
57  int _cardId;
58  Common::Point _stationPos;
59 
60  Card();
61  void synchronize(Serializer &s) override;
62  bool isIn(Common::Point pt);
63  };
64 
65  class GameBoardSide: public SceneHotspot {
66  public:
67  Card _handCard[4];
68  Card _outpostStation[8];
69  Card _delayCard;
70  Card _emptyStationPos;
71 
72  Common::Point _card1Pos;
73  Common::Point _card2Pos;
74  Common::Point _card3Pos;
75  Common::Point _card4Pos;
76  int _frameNum;
77 
78  GameBoardSide();
79  void synchronize(Serializer &s) override;
80  };
81 
82  class Action1337: public Action {
83  public:
84  void waitFrames(int32 frameCount);
85  };
86 
87  class Action1: public Action1337 {
88  public:
89  void signal() override;
90  };
91  class Action2: public Action1337 {
92  public:
93  void signal() override;
94  };
95  class Action3: public Action1337 {
96  public:
97  void signal() override;
98  };
99  class Action4: public Action1337 {
100  public:
101  void signal() override;
102  };
103  class Action5: public Action1337 {
104  public:
105  void signal() override;
106  };
107  class Action6: public Action1337 {
108  public:
109  void signal() override;
110  };
111  class Action7: public Action1337 {
112  public:
113  void signal() override;
114  };
115  class Action8: public Action1337 {
116  public:
117  void signal() override;
118  };
119  class Action9: public Action1337 {
120  public:
121  void signal() override;
122  };
123  class Action10: public Action1337 {
124  public:
125  void signal() override;
126  };
127  class Action11: public Action1337 {
128  public:
129  void signal() override;
130  };
131  class Action12: public Action1337 {
132  public:
133  void signal() override;
134  };
135  class Action13: public Action1337 {
136  public:
137  void signal() override;
138  };
139 public:
140  Action1 _action1;
141  Action2 _action2;
142  Action3 _action3;
143  Action4 _action4;
144  Action5 _action5;
145  Action6 _action6;
146  Action7 _action7;
147  Action8 _action8;
148  Action9 _action9;
149  Action10 _action10;
150  Action11 _action11;
151  Action12 _action12;
152  Action13 _action13;
153 
154  typedef void (Scene1337::*FunctionPtrType)();
155  FunctionPtrType _delayedFunction;
156 
157  bool _autoplay;
158  bool _shuffleEndedFl;
159  bool _showPlayerTurn;
160  bool _displayHelpFl;
161  bool _instructionsDisplayedFl;
162 
163  // Discarded cards are put in the available cards pile, with a higher index so there's no conflict
164  int _currentDiscardIndex;
165  int _availableCardsPile[100];
166  int _cardsAvailableNumb;
167  int _currentPlayerNumb;
168  int _actionPlayerIdx;
169  int _actionVictimIdx;
170  int _winnerId;
171  int _instructionsWaitCount;
172  int _cursorCurRes;
173  int _cursorCurStrip;
174  int _cursorCurFrame;
175 
176  ASound _aSound1;
177  ASound _aSound2;
178  GameBoardSide _gameBoardSide[4];
179  SceneActor _helpIcon;
180  SceneActor _stockPile;
181  SceneItem _actionItem;
182  SceneObject _currentPlayerArrow;
183 
184  Card *_actionCard1;
185  Card *_actionCard2;
186  Card *_actionCard3;
187  Card _animatedCard;
188  Card _shuffleAnimation;
189  Card _discardedPlatformCard;
190  Card _selectedCard;
191  Card _discardPile;
192  Card _stockCard;
193 
194  SceneObject _upperDisplayCard[8];
195  SceneObject _lowerDisplayCard[8];
196 
197  Scene1337();
198  void synchronize(Serializer &s) override;
199 
200  void actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt);
201  void setAnimationInfo(Card *card);
202  void handleNextTurn();
203  void handlePlayerTurn();
204  bool isStationCard(int cardId);
205  bool isStopConstructionCard(int cardId);
206  int getStationId(int playerId, int handCardId);
207  int findPlatformCardInHand(int playerId);
208  int findMeteorCardInHand(int playerId);
209  int findThieftCardInHand(int playerId);
210  int isDelayCard(int cardId);
211  int getStationCardId(int cardId);
212  void handlePlayer01Discard(int playerId);
213  void playThieftCard(int playerId, Card *card, int victimId);
214  int getPreventionCardId(int cardId);
215  bool isAttackPossible(int victimId, int cardId);
216  int getPlayerWithOutpost(int playerId);
217  bool checkAntiDelayCard(int delayCardId, int cardId);
218  void playStationCard(Card *station, Card *platform);
219  void playDelayCard(Card *card, Card *dest);
220  void playPlatformCard(Card *card, Card *dest);
221  void playAntiDelayCard(Card *card, Card *dest);
222  Card *getStationCard(int arg1);
223  void playCentralOutpostCard(Card *card, int playerId);
224  int getRandomCardFromHand(int playerId);
225  void discardCard(Card *card);
226  void subC4CD2();
227  void subC4CEC();
228  void playInterceptorCard(Card *subObj1, Card *subObj2);
229  void displayDialog(int dialogNumb);
230  void subPostInit();
231  void displayInstructions();
232  void suggestInstructions();
233  void shuffleCards();
234  void dealCards();
235  void showOptionsDialog();
236  void handleClick(int arg1, Common::Point pt);
237  void handlePlayer0();
238  void handlePlayer1();
239  void handlePlayer2();
240  void handlePlayer3();
241  void handleAutoplayPlayer2();
242  void updateCursorId(int arg1, bool arg2);
243  void setCursorData(int resNum, int rlbNum, int frameNum);
244  void subD18F5();
245  void subD1917();
246  void subD1940(bool flag);
247  void subD1975(int arg1, int arg2);
248 
249  void postInit(SceneObjectList *OwnerList = NULL) override;
250  void remove() override;
251  void process(Event &event) override;
252  void dispatch() override;
253 };
254 
255 } // End of namespace Ringworld2
256 } // End of namespace TsAGE
257 
258 #endif
Definition: core.h:443
Definition: ringworld2_logic.h:78
Definition: ringworld2_logic.h:263
Definition: core.h:736
Definition: core.h:134
Definition: graphics.h:318
Definition: core.h:407
Definition: sound.h:366
Definition: ringworld2_outpost.h:38
Definition: rect.h:45
Definition: events.h:47
Definition: blueforce_dialogs.h:30
Definition: graphics.h:237
Definition: saveload.h:63
Definition: core.h:519