ScummVM API documentation
savegame.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 ULTIMA3_DATA_SAVEGAME_H
23#define ULTIMA3_DATA_SAVEGAME_H
24
25#include "ultima/ultima3/data/roster.h"
26
27namespace Ultima {
28namespace Ultima3 {
29namespace Data {
30
31constexpr byte LOCATION_SOSARIA = 0;
32constexpr byte LOCATION_DUNGEON = 1;
33constexpr byte LOCATION_TOWN = 2;
34constexpr byte LOCATION_CASTLE = 3;
35constexpr byte LOCATION_AMBROSIA = 0xFF;
36
42struct Savegame {
43 RosterEntry _roster[ROSTER_COUNT];
44 byte _partyEntries[PARTY_MAX] = {};
45 int _partySize = 0;
46 byte _transport = 0;
47 byte _location = 0;
48 byte _posX = 0;
49 byte _posY = 0;
50
51 // Where the party was on the overworld, while they're somewhere else
52 byte _worldX = 0;
53 byte _worldY = 0;
54 byte _moveCount[4] = {};
55
56 // The phases of the two moons, from 0 to 7, and how long each has left in
57 // its current phase
58 byte _moonPhase[2] = { 0, 0 };
59 byte _moonCountdown[2] = { 0x0C, 4 };
60
61 // How much longer a light spell or torch lasts
62 byte _lightTurns = 0;
63
64 // Where in a dungeon the party is, the level and the way they face
65 byte _dungeonLevel = 0;
66 byte _facing = 0;
67
68 // Set once the party has seen the more powerful gear offered in the
69 // shops, making it available for readying and wearing
70 bool _allWeapons = false;
71 bool _allArmour = false;
72 bool _plusTwoWeapons = false;
73 bool _plusTwoArmour = false;
74
75 // Set once the world map has been loaded, which the map in a save then replaces
76 bool _mapLoaded = false;
77
81 RosterEntry &entry(int number) {
82 return _roster[number - 1];
83 }
84
85 RosterEntry &partyMember(int slot) {
86 return entry(_partyEntries[slot]);
87 }
88
93
97 void addToParty(int number);
98
103
104 void synchronize(Common::Serializer &s);
105
112
117
123
127 void formParty();
128};
129
130} // namespace Data
131} // namespace Ultima3
132} // namespace Ultima
133
134#endif
Definition: stream.h:745
Definition: serializer.h:80
Definition: stream.h:77
Definition: roster.h:66
Definition: savegame.h:42
RosterEntry & entry(int number)
Definition: savegame.h:81
void exportOriginal(Common::WriteStream &roster, Common::WriteStream &party)
bool importOriginal(Common::SeekableReadStream &roster, Common::SeekableReadStream &party)