22 #ifndef NANCY_ACTION_SCOPAPUZZLE_H 23 #define NANCY_ACTION_SCOPAPUZZLE_H 25 #include "graphics/font.h" 27 #include "engines/nancy/commontypes.h" 28 #include "engines/nancy/action/puzzlerecord.h" 55 void execute()
override;
58 bool isViewportRelative()
const override {
return true; }
61 Common::String getRecordTypeName()
const override {
return "ScopaPuzzle"; }
63 static const uint kNumPlayers = 2;
65 enum { kHuman = 0, kOpponent = 1 };
131 uint32 fadeInTime = 0;
132 uint32 fadeOutTime = 0;
133 bool isShown =
false;
134 bool isFading =
false;
138 void show(
bool instantly);
139 void hide(
bool instantly);
141 bool isVisible() {
return update() > 0.0f; }
145 CardMode mode = kHidden;
158 static const int32 kWaitForCard = -1;
165 CardMode mode = kFaceUp;
170 enum Type { kCard, kTime, kSound };
184 int16 nextStarterFlag = -1;
202 bool hasScoreLine =
false;
203 bool scoresMostCards =
false;
204 bool scoresMostCoins =
false;
205 bool scoresSevenOfCoins =
false;
206 bool scoresPrimes =
false;
219 static int getHandPile(uint playerID) {
return playerID * 3; }
220 static int getTakenPile(uint playerID) {
return playerID * 3 + 1; }
221 static int getTrickPile(uint playerID) {
return playerID * 3 + 2; }
222 static bool hasFixedPlaces(
int pile);
224 uint getOtherPlayer(uint playerID)
const {
return (playerID + 1) % kNumPlayers; }
225 uint countCards(
int pile)
const;
228 void setCardState(
int cardID, CardMode mode,
const Common::Rect &rect);
229 void setCardMode(
int cardID, CardMode mode);
231 void queueMove(
int srcPile, uint srcIndex, int32 delay,
int dstPile, CardMode mode);
234 void waitForTime(uint32 time,
int player = -1, int32 points = 0);
235 void waitForSound(
const RandomSoundBlock &sound,
int player = -1, int32 points = 0);
236 void startDealSound();
237 void stopDealSound();
244 PlayError checkPlay(
const Play &play)
const;
246 void makePlay(
const Play &play);
248 void moveTricksToTaken();
249 void takeLastCards();
250 void showPilePictures(
bool show);
251 void updateButtons();
254 void tallyPlayer(
Player &player,
int takenPile);
256 void layOutTakenCards(uint playerID);
257 void highlightLaidOutCards(Highlight highlight);
258 void movePrimes(uint playerID);
259 bool scorePlayerStep();
260 bool scorePrimesStep();
264 int getHoveredCard(
int pile,
const Common::Point &pos)
const;
265 void clickCard(
int pile, uint index);
266 void tryPlay(
bool sayWhyNotToDiscard);
268 void blendPixel(
int x,
int y, byte a, byte r, byte g, byte b);
270 void drawCardState(
int cardID,
CardState &state);
276 int32 _pointsToWin = 0;
277 int16 _roundOverFlag = -1;
278 int16 _redealFlag = -1;
279 int32 _primesFontID = 0;
280 int32 _primesColorID = 0;
281 Player _players[kNumPlayers];
286 int32 _thinkTime = 0;
288 int32 _layOutTime = 0;
301 int32 _fadeInTime = 0;
302 int32 _fadeOutTime = 0;
303 uint32 _highlightColor = 0;
314 Phase _phase = kDeal;
316 uint _starter = kHuman;
317 uint _currentPlayer = kHuman;
319 bool _needsRedeal =
false;
320 bool _hasCheckedScopa =
false;
321 bool _hasSaidLastCardsLong =
false;
322 bool _hasSaidNoLastScopa =
false;
323 bool _showsPrimes =
false;
324 bool _showsPrimeTotals =
false;
326 bool _showsTake =
false;
327 bool _showsDiscard =
false;
333 bool _hasChanged =
true;
334 bool _isFading =
false;
340 #endif // NANCY_ACTION_SCOPAPUZZLE_H Definition: managed_surface.h:51
TextAlign
Definition: font.h:48
Definition: scopapuzzle.h:209
Definition: scopapuzzle.h:160
Definition: scopapuzzle.h:47
Definition: scopapuzzle.h:151
Definition: scopapuzzle.h:180
Definition: scopapuzzle.h:144
Definition: commontypes.h:324
Definition: scopapuzzle.h:169
Out move(In first, In last, Out dst)
Definition: algorithm.h:109
Definition: scopapuzzle.h:130
Definition: puzzlerecord.h:37
Definition: commontypes.h:306
Definition: actionmanager.h:32