ScummVM API documentation
scene2030.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 HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SCENE2030_H
23#define HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SCENE2030_H
24
25#include "hollywood/monsters/scenes/playable/playable_scene.h"
26
27namespace Hollywood {
28
29class HollywoodEngine;
30
31class Scene2030 : public PlayableScene {
32public:
34
35private:
36 enum LayerId {
37 kRightMerchantLayer,
38 kLeftMerchantLayer
39 };
40
41 void initializeCustomPreviewState() override;
42 void runCustomEntrySequence() override;
43 void runExitSideEffectsAfterLoop() override;
44 void prepareCustomGameplayLoop() override;
45 void advanceCustomGameplayLoop(uint32 delta) override;
46 void advanceTransitionAnimation(uint32 delta) override;
47 void realtimeSpeechEnded(byte speechId, bool completed) override;
48 bool dispatchCustomSceneAction(uint16 handlerId) override;
49 byte primarySpeechAnimationBaseFrame(byte animationGroup) const override;
50 uint32 primarySpeechAnimationFrameMillis(byte animationGroup) const override;
51 byte primarySpeechVolumePercent(byte animationGroup) const override;
52 void setPrimarySpeechAnimationFrame(byte animationGroup, byte frameIndex) override;
53 AmbientAudioProfile ambientAudioProfile() const override;
54
55 void resetMerchantLayers();
56 void advanceMerchantLayers(uint32 delta);
57 void advanceLeftMerchantTick();
58 void advanceRightMerchantTick();
59 void updateRandomMerchantCallouts(uint32 delta);
60 bool startMerchantCalloutSpeech(bool rightMerchant);
61 void stopMerchantCalloutSpeech();
62 void resetMerchantCalloutState();
63 void openMerchantForInteraction(bool rightMerchant);
64 void closeMerchantAfterInteraction(bool rightMerchant);
65 void waitForMerchantState(bool rightMerchant, byte targetState);
66 void beginSecondarySpeechLineAndOpenMerchant(uint16 rowIndex, byte frameIndex, bool rightMerchant);
67 void runMerchantPrimarySpeechLine(uint16 rowIndex, byte frameIndex, bool rightMerchant);
68 bool merchantSpeechGroupIsRight(byte animationGroup) const;
69 bool merchantSpeechGroupIsLeft(byte animationGroup) const;
70 void runEntryFromChapterStart();
71 void runEntryFromPyramid();
72 void runEntryFromSphinx();
73 void runEntryPathWithFade(int startX, int startY, byte startFacing, int targetX, int targetY);
74 void runSphinxExitTransition();
75 void runTransitionClip(uint chunkIndex, bool includeActiveActor, bool fadeIn);
76 void drawTransitionClipFrame(uint chunkIndex, byte frameIndex, Graphics::Surface &transitionBackground);
77 void drawClipFrameDeltaToSurface(uint chunkIndex, uint tableEntryCount, byte frameIndex, Graphics::Surface &destination);
78 void runMerchantShopDialogue();
79 void initializeMerchantShopDialogueRecords(Common::Array<DialogueChoiceRecord> &records) const;
80 void setMerchantShopDialogueRecord(Common::Array<DialogueChoiceRecord> &records, uint index,
81 byte enabled, byte nextNodeIndex, byte transitionMode, byte playerTextRowId,
82 byte responseFrameIndex, byte disableAfterUse) const;
83 uint16 merchantShopProductPrice(byte productRowId) const;
84 void runLeftMerchantPurchase(byte productRowId);
85 void subtractEgyptianMoney(uint16 amount);
86 void runRightMerchantTalkSequence();
87 void runRightMerchantRejectedTradeSequence();
88 void runRightStallTradeOverlay();
89 void runRightMerchantBuyItemOverlay();
90 void runSynchronizedMerchantOverlay(uint chunkIndex, uint descriptorCount,
91 const byte *overlayFrameMap, const byte *merchantFrameMap, uint frameCount,
92 bool rightMerchant);
93 void runRightMerchantSaleSequence(byte soldItemId, uint16 moneyAmount, byte merchantFrameIndex, byte secondaryFrameIndex);
94 void addEgyptianMoney(uint16 amount);
95 ResourceSpriteLayer &leftMerchantLayer() { return _sceneLayers.layer(kLeftMerchantLayer); }
96 ResourceSpriteLayer &rightMerchantLayer() { return _sceneLayers.layer(kRightMerchantLayer); }
97
98 TimedAnimationChannel _leftMerchantChannel;
99 TimedAnimationChannel _rightMerchantChannel;
100 byte _leftMerchantState;
101 byte _rightMerchantState;
102 byte _merchantCalloutSide;
103 bool _merchantInteractionActive;
104 bool _leftMerchantSequenceLocked;
105 bool _rightMerchantSequenceLocked;
106 uint32 _merchantCalloutTimerAccumulator;
107};
108
109} // End of namespace Hollywood
110
111#endif // HOLLYWOOD_MONSTERS_SCENES_PLAYABLE_SCENE2030_H
Definition: array.h:52
Definition: hollywood.h:47
Definition: playable_scene.h:84
Definition: scene2030.h:31
Definition: surface.h:67
Definition: ambient_audio.h:44
Definition: animation_layers.h:33
Definition: animation_channels.h:34