scummvm/engines/avalanche/timer.h

179 lines
4.5 KiB
C
Raw Normal View History

2013-06-27 07:21:41 +00:00
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
2013-06-27 07:21:41 +00:00
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
2013-06-27 07:21:41 +00:00
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
* This code is based on the original source code of Lord Avalot d'Argent version 1.3.
* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
*/
2013-09-08 09:30:23 +00:00
/* Original name: TIMEOUT The scheduling unit. */
2013-06-27 07:21:41 +00:00
2013-09-08 09:30:23 +00:00
#ifndef AVALANCHE_TIMER_H
#define AVALANCHE_TIMER_H
2013-06-27 07:21:41 +00:00
namespace Avalanche {
class AvalancheEngine;
2013-06-27 07:21:41 +00:00
2013-09-08 09:30:23 +00:00
class Timer {
public:
2013-09-07 22:24:59 +00:00
// Reason runs between 1 and 28.
enum Reason {
kReasonDrawbridgeFalls = 2,
kReasonAvariciusTalks = 3,
kReasonGoToToilet = 4,
kReasonExplosion = 5,
kReasonBrummieStairs = 6,
kReasonCardiffsurvey = 7,
kReasonCwytalotInHerts = 8,
kReasonGettingTiedUp = 9,
kReasonHangingAround = 10, // Tied to the tree in Nottingham.
kReasonJacquesWakingUp = 11,
kReasonNaughtyDuke = 12,
kReasonJumping = 13,
kReasonSequencer = 14,
kReasonCrapulusSaysSpludwickOut = 15,
kReasonDawndelay = 16,
kReasonDrinks = 17,
kReasonDuLustieTalks = 18,
kReasonFallingDownOubliette = 19,
kReasonMeetingAvaroid = 20,
kReasonRisingUpOubliette = 21,
kReasonRobinHoodAndGeida = 22,
kReasonSittingDown = 23,
kReasonGhostRoomPhew = 1,
kReasonArkataShouts = 24,
kReasonWinning = 25,
kReasonFallingOver = 26,
kReasonSpludwickWalk = 27,
2013-09-07 22:24:59 +00:00
kReasonGeidaSings = 28
};
2013-06-27 07:21:41 +00:00
2013-09-08 08:48:22 +00:00
// Proc runs between 1 and 41.
enum Proc {
kProcOpenDrawbridge = 3,
kProcAvariciusTalks = 4,
kProcUrinate = 5,
kProcToilet = 6,
kProcBang = 7,
kProcBang2 = 8,
kProcStairs = 9,
kProcCardiffSurvey = 10,
kProcCardiffReturn = 11,
kProcCwytalotInHerts = 12,
kProcGetTiedUp = 13,
kProcGetTiedUp2 = 1,
kProcHangAround = 14,
kProcHangAround2 = 15,
kProcAfterTheShootemup = 32,
kProcJacquesWakesUp = 16,
kProcNaughtyDuke = 17,
kProcNaughtyDuke2 = 18,
kProcNaughtyDuke3 = 38,
kProcJump = 19,
kProcSequence = 20,
kProcCrapulusSpludOut = 21,
kProcDawnDelay = 22,
kProcBuyDrinks = 23,
kProcBuyWine = 24,
kProcCallsGuards = 25,
kProcGreetsMonk = 26,
kProcFallDownOubliette = 27,
kProcMeetAvaroid = 28,
kProcRiseUpOubliette = 29,
kProcRobinHoodAndGeida = 2,
kProcRobinHoodAndGeidaTalk = 30,
kProcAvalotReturns = 31,
kProcAvvySitDown = 33, // In Nottingham.
kProcGhostRoomPhew = 34,
kProcArkataShouts = 35,
kProcWinning = 36,
kProcAvalotFalls = 37,
kProcSpludwickGoesToCauldron = 39,
kProcSpludwickLeavesCauldron = 40,
kProcGiveLuteToGeida = 41
2013-06-27 07:21:41 +00:00
};
2013-09-08 09:30:23 +00:00
struct TimerType {
2013-09-08 08:48:22 +00:00
int32 _timeLeft;
byte _action;
byte _reason;
2013-09-08 08:48:22 +00:00
};
2013-06-27 07:21:41 +00:00
2013-09-08 09:30:23 +00:00
TimerType _times[7];
2013-09-08 09:30:23 +00:00
Timer(AvalancheEngine *vm);
2013-11-18 14:50:33 +00:00
void resetVariables();
void addTimer(int32 duration, byte action, byte reason);
void updateTimer();
2013-09-08 08:48:22 +00:00
void loseTimer(byte which);
2013-06-27 07:21:41 +00:00
// Procedures to do things at the end of amounts of time:
2013-09-08 08:48:22 +00:00
void openDrawbridge();
void avariciusTalks();
2013-06-27 07:21:41 +00:00
void urinate();
2013-09-08 08:48:22 +00:00
void toilet();
2013-06-27 07:21:41 +00:00
void bang();
void bang2();
void stairs();
2013-09-08 08:48:22 +00:00
void cardiffSurvey();
void cardiffReturn();
void cwytalotInHerts();
void getTiedUp();
void getTiedUp2();
void hangAround();
void hangAround2();
void afterTheShootemup();
void jacquesWakesUp();
void naughtyDuke();
void naughtyDuke2();
void naughtyDuke3();
2013-06-27 07:21:41 +00:00
void jump();
2013-09-08 08:48:22 +00:00
void crapulusSaysSpludOut();
void buyDrinks();
void buyWine();
void callsGuards();
void greetsMonk();
void fallDownOubliette();
void meetAvaroid();
void riseUpOubliette();
void robinHoodAndGeida();
void robinHoodAndGeidaTalk();
void avalotReturns();
void avvySitDown();
void ghostRoomPhew();
void arkataShouts();
2013-06-27 07:21:41 +00:00
void winning();
2013-09-08 08:48:22 +00:00
void avalotFalls();
void spludwickGoesToCauldron();
void spludwickLeavesCauldron();
void giveLuteToGeida();
2013-06-27 07:21:41 +00:00
private:
AvalancheEngine *_vm;
byte _shootEmUpScore;
};
2013-06-27 07:21:41 +00:00
} // End of namespace Avalanche.
2013-09-08 09:30:23 +00:00
#endif // AVALANCHE_TIMER_H