-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSAVE.bt
150 lines (124 loc) · 4.02 KB
/
SAVE.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//
// File: SAVE.bt
// Authors: Florian Eßl
// Version:
// Purpose: SRPG95 File format
// Category: Games
// File Mask: SAVE*.DAT
// ID Bytes:
// History: https://github.com/florianessl/srpg95-fileformat
//------------------------------------------------
#include "ObjectData.inc.bt"
typedef struct Unit {
int is_active;
int is_alive;
int played_this_turn; //has already moved
int is_foe;
int unk_int1; //I think this one is used as some sort of index variable in-game
// for moving around units when they get added/removed/revived
//Shouldn't matter for savegames
int pos_x;
int pos_y;
int obj_index;
int unit_id;
int class_id;
int level;
int exp;
int add_turn_used; //If magic of type "ADD_TURN" was already used. (Only possible once per unit & turn)
int is_in_team; //While in camp, this value sets if the character is currently
//selected as a team member
int is_guest;
int controlled_by_cpu;
int npc_must_stay_alive;
int unused_int1; //seems unused
int unused_int2; //seems unused
int walk_speed;
int hp_max;
int mp_max;
int strength_affected;
int magic_power_affected;
int agility_affected;
int stamina_affected;
int hp_current;
int mp_current;
int strength_base;
int magic_power_base;
int agility_base;
int stamina_base;
int attack_power;
int attack_speed;
int def_phys;
int def_magic;
int atk_modifier; //ATK can be affected by Raise & Degradation magics
int def_modifier; //DEF can be affected by Raise & Degradation magics
int unused_int3; //This one looks like it was supposed to play a similar role as
// the previous 2 values but it is seems unused
int unused_int4; //seems unused
int item_weapon;
int item_armor;
int item_other;
int weapon_range_low;
int weapon_range_high;
int stat_poison_rounds;
int stat_sleep_rounds;
int stat_atkdown_rounds;
int stat_defdown_rounds;
//These seem to be used for in-game-movement and are not relevant for savegames
int unused_int5; //unused
int mvmnt_unused; //after movement, how many steps were unused
int unk_int2; //16, 17, 18 seem to be used while in-game-movement is active
int unk_int3; // but are reset when done
int unk_int4;
int prev_pos_x; //only set if the character has already moved
int prev_pos_y; //only set if the character has already moved
int unk_int5; //a unit_id, probably another unit this one is currently facing
int unused_int6; //seems unused
int unused_int7; //seems unused
int unused_int8; //seems unused
int mvmnt_rules[70]; //Walk levels for geology data 0-69
int magic_learned[20]; //IDs of skills/magic learned
int count_magic_learned;
char unk2[36]; //probably used for movement & routing
};
typedef struct ItemHeld {
int item_id;
int count;
};
typedef struct GameData {
int in_camp;
int map_id; //zero-index
int screen_offset_x;
int screen_offset_y;
int next_map_id;
byte switches[500]; //Yup, one byte for each switch
int unk_int1;
int turn_no; //counts Ally & Enemy turns
ItemHeld items[100];
int item_count_total;
int gold;
int player_unit_count;
char bgm[48];
int colortint_red;
int colortint_green;
int colortint_blue;
int colortint_chroma;
int unk_int2;
char unk3_0[92];
short variables[200];
char unk4_0[100];
};
//SAVE%d.DAT
struct SAVE {
GameData game_data;
//0007D0
//2nd buffer
Unit field_units[100]; //first one is always empty (base 1 index)
//0101D0
//3rd buffer
Unit player_units[50];
//17EC0
//4th buffer
Object objects[100]; //first one is always empty (base 1 index)
} save;