ScummVM API documentation
cheats.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 HARVESTER_CHEATS_H
23#define HARVESTER_CHEATS_H
24
25#include "common/str.h"
26
27namespace Common {
28struct KeyState;
29}
30
31namespace Harvester {
32
33class HarvesterEngine;
34class Script;
35class ScriptExecutionContext;
36struct InteractionResult;
37
38enum CheatInputResult {
39 kCheatInputIgnored = 0,
40 kCheatInputPartial,
41 kCheatInputComplete
42};
43
45 bool activated = false;
46 bool inventoryChanged = false;
47 bool playerStateChanged = false;
48 bool clearInteractionState = false;
49 bool hasInteraction = false;
50};
51
53public:
54 explicit CheatSystem(HarvesterEngine &engine);
55
56 CheatInputResult processKey(const Common::KeyState &key, Script &script,
57 const ScriptExecutionContext &executionContext, InteractionResult &interaction,
58 CheatActivation &activation);
59 void reset();
60 bool isPlayerDamageDisabled() const { return _playerDamageDisabled; }
61
62private:
63 enum CheatId {
64 kCheatMaxHealth = 0,
65 kCheatAllWeapons,
66 kCheatAllItems,
67 kCheatLodgeLevel2,
68 kCheatLodgeLevel3,
69 kCheatLodgeFinalLevel,
70 kCheatInvincibility,
71 kCheatLodgeLevel1
72 };
73
74 CheatInputResult matchKey(uint16 ascii, CheatId &cheatId);
75 static const char *describe(CheatId cheatId);
76 void execute(CheatId cheatId, Script &script, const ScriptExecutionContext &executionContext,
77 InteractionResult &interaction, CheatActivation &activation);
78
79 HarvesterEngine &_engine;
80 Common::String _inputBuffer;
81 bool _playerDamageDisabled = false;
82};
83
84} // End of namespace Harvester
85
86#endif // HARVESTER_CHEATS_H
Definition: str.h:59
Definition: cheats.h:52
Definition: harvester.h:47
Definition: script.h:269
Definition: script.h:342
Definition: algorithm.h:29
Definition: keyboard.h:294
Definition: cheats.h:44
Definition: script.h:311