Skip to content

Commit 2a2e0d3

Browse files
committed
Consistency for encounter variables
Fix #265
1 parent fa8c6e5 commit 2a2e0d3

10 files changed

Lines changed: 22 additions & 22 deletions

File tree

generator/csv/enums.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ EventCommand,Code,PlayMovie,11560
423423
EventCommand,Code,KeyInputProc,11610
424424
EventCommand,Code,ChangeMapTileset,11710
425425
EventCommand,Code,ChangePBG,11720
426-
EventCommand,Code,ChangeEncounterRate,11740
426+
EventCommand,Code,ChangeEncounterSteps,11740
427427
EventCommand,Code,TileSubstitution,11750
428428
EventCommand,Code,TeleportTargets,11810
429429
EventCommand,Code,ChangeTeleportAccess,11820

generator/csv/fields.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ SavePartyLocation,pan_current_y,f,Int32,0x71,kPanYDefault,0,0,Number of 1/16 pix
844844
SavePartyLocation,pan_finish_x,f,Int32,0x72,kPanXDefault,0,0,Number of 1/16 pixels to the left of player when current scroll finishes
845845
SavePartyLocation,pan_finish_y,f,Int32,0x73,kPanYDefault,0,0,Number of 1/16 pixels above the player when current scroll finishes.
846846
SavePartyLocation,pan_speed,f,Int32,0x79,kPanSpeedDefault,0,0,speed in the scrolls of the screen - shown in sixteenth pixels.
847-
SavePartyLocation,encounter_steps,f,Int32,0x7C,0,0,0,int: sum of terrain.encounter_rate for each step
847+
SavePartyLocation,total_encounter_rate,f,Int32,0x7C,0,0,0,int: sum of terrain.encounter_rate for each step
848848
SavePartyLocation,encounter_calling,f,Boolean,0x7D,False,0,0,Similar to 0x6C - is used to signal a different piece of code that an encounter is to be triggered; which may be cancelled by other conditions such as the player starting to interact with an event during the same frame.
849849
SavePartyLocation,map_save_count,f,Int32,0x83,0,0,0,Mirrors save_count of current map. On mismatch events are not continued after load.
850850
SavePartyLocation,database_save_count,f,Int32,0x84,0,0,0,?
@@ -984,7 +984,7 @@ SaveMapEvent,triggered_by_decision_key,f,Boolean,0x67,False,0,0,If true; this ev
984984
SaveMapEvent,parallel_event_execstate,f,SaveEventExecState,0x6C,,1,0,chunks
985985
SaveMapInfo,position_x,f,Int32,0x01,0,0,0,int
986986
SaveMapInfo,position_y,f,Int32,0x02,0,0,0,int
987-
SaveMapInfo,encounter_rate,f,Int32,0x03,-1,0,0,int
987+
SaveMapInfo,encounter_steps,f,Int32,0x03,-1,0,0,int
988988
SaveMapInfo,chipset_id,f,Int32,0x05,0,0,0,int
989989
SaveMapInfo,events,f,Array<SaveMapEvent>,0x0B,,1,0,? array
990990
SaveMapInfo,lower_tiles,f,Vector<UInt8>,0x15,"[x for x in range(0, 144)]",1,0,? [00 01 02 ... 8E 8F]

src/generated/lcf/lsd/chunks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ namespace LSD_Reader {
429429
/** speed in the scrolls of the screen - shown in sixteenth pixels. */
430430
pan_speed = 0x79,
431431
/** int: sum of terrain.encounter_rate for each step */
432-
encounter_steps = 0x7C,
432+
total_encounter_rate = 0x7C,
433433
/** Similar to 0x6C - is used to signal a different piece of code that an encounter is to be triggered; which may be cancelled by other conditions such as the player starting to interact with an event during the same frame. */
434434
encounter_calling = 0x7D,
435435
/** Mirrors save_count of current map. On mismatch events are not continued after load. */
@@ -911,7 +911,7 @@ namespace LSD_Reader {
911911
/** int */
912912
position_y = 0x02,
913913
/** int */
914-
encounter_rate = 0x03,
914+
encounter_steps = 0x03,
915915
/** int */
916916
chipset_id = 0x05,
917917
/** ? array */

src/generated/lcf/rpg/eventcommand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace rpg {
109109
KeyInputProc = 11610,
110110
ChangeMapTileset = 11710,
111111
ChangePBG = 11720,
112-
ChangeEncounterRate = 11740,
112+
ChangeEncounterSteps = 11740,
113113
TileSubstitution = 11750,
114114
TeleportTargets = 11810,
115115
ChangeTeleportAccess = 11820,

src/generated/lcf/rpg/savemapinfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace rpg {
3030
public:
3131
int32_t position_x = 0;
3232
int32_t position_y = 0;
33-
int32_t encounter_rate = -1;
33+
int32_t encounter_steps = -1;
3434
int32_t chipset_id = 0;
3535
std::vector<SaveMapEvent> events;
3636
std::vector<uint8_t> lower_tiles = {0, 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};
@@ -47,7 +47,7 @@ namespace rpg {
4747
inline bool operator==(const SaveMapInfo& l, const SaveMapInfo& r) {
4848
return l.position_x == r.position_x
4949
&& l.position_y == r.position_y
50-
&& l.encounter_rate == r.encounter_rate
50+
&& l.encounter_steps == r.encounter_steps
5151
&& l.chipset_id == r.chipset_id
5252
&& l.events == r.events
5353
&& l.lower_tiles == r.lower_tiles

src/generated/lcf/rpg/savepartylocation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace rpg {
6767
int32_t pan_finish_x = kPanXDefault;
6868
int32_t pan_finish_y = kPanYDefault;
6969
int32_t pan_speed = kPanSpeedDefault;
70-
int32_t encounter_steps = 0;
70+
int32_t total_encounter_rate = 0;
7171
bool encounter_calling = false;
7272
int32_t map_save_count = 0;
7373
int32_t database_save_count = 0;
@@ -94,7 +94,7 @@ namespace rpg {
9494
&& l.pan_finish_x == r.pan_finish_x
9595
&& l.pan_finish_y == r.pan_finish_y
9696
&& l.pan_speed == r.pan_speed
97-
&& l.encounter_steps == r.encounter_steps
97+
&& l.total_encounter_rate == r.total_encounter_rate
9898
&& l.encounter_calling == r.encounter_calling
9999
&& l.map_save_count == r.map_save_count
100100
&& l.database_save_count == r.database_save_count;

src/generated/lsd_savemapinfo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ static TypedField<rpg::SaveMapInfo, int32_t> static_position_y(
3434
0,
3535
0
3636
);
37-
static TypedField<rpg::SaveMapInfo, int32_t> static_encounter_rate(
38-
&rpg::SaveMapInfo::encounter_rate,
39-
LSD_Reader::ChunkSaveMapInfo::encounter_rate,
40-
"encounter_rate",
37+
static TypedField<rpg::SaveMapInfo, int32_t> static_encounter_steps(
38+
&rpg::SaveMapInfo::encounter_steps,
39+
LSD_Reader::ChunkSaveMapInfo::encounter_steps,
40+
"encounter_steps",
4141
0,
4242
0
4343
);
@@ -124,7 +124,7 @@ template <>
124124
Field<rpg::SaveMapInfo> const* Struct<rpg::SaveMapInfo>::fields[] = {
125125
&static_position_x,
126126
&static_position_y,
127-
&static_encounter_rate,
127+
&static_encounter_steps,
128128
&static_chipset_id,
129129
&static_events,
130130
&static_lower_tiles,

src/generated/lsd_savepartylocation.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ static TypedField<rpg::SavePartyLocation, int32_t> static_pan_speed(
377377
0,
378378
0
379379
);
380-
static TypedField<rpg::SavePartyLocation, int32_t> static_encounter_steps(
381-
&rpg::SavePartyLocation::encounter_steps,
382-
LSD_Reader::ChunkSavePartyLocation::encounter_steps,
383-
"encounter_steps",
380+
static TypedField<rpg::SavePartyLocation, int32_t> static_total_encounter_rate(
381+
&rpg::SavePartyLocation::total_encounter_rate,
382+
LSD_Reader::ChunkSavePartyLocation::total_encounter_rate,
383+
"total_encounter_rate",
384384
0,
385385
0
386386
);
@@ -460,7 +460,7 @@ Field<rpg::SavePartyLocation> const* Struct<rpg::SavePartyLocation>::fields[] =
460460
&static_pan_finish_x,
461461
&static_pan_finish_y,
462462
&static_pan_speed,
463-
&static_encounter_steps,
463+
&static_total_encounter_rate,
464464
&static_encounter_calling,
465465
&static_map_save_count,
466466
&static_database_save_count,

src/generated/rpg_savemapinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ std::ostream& operator<<(std::ostream& os, const SaveMapInfo& obj) {
1919
os << "SaveMapInfo{";
2020
os << "position_x="<< obj.position_x;
2121
os << ", position_y="<< obj.position_y;
22-
os << ", encounter_rate="<< obj.encounter_rate;
22+
os << ", encounter_steps="<< obj.encounter_steps;
2323
os << ", chipset_id="<< obj.chipset_id;
2424
os << ", events=";
2525
for (size_t i = 0; i < obj.events.size(); ++i) {

src/generated/rpg_savepartylocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ std::ostream& operator<<(std::ostream& os, const SavePartyLocation& obj) {
3232
os << ", pan_finish_x="<< obj.pan_finish_x;
3333
os << ", pan_finish_y="<< obj.pan_finish_y;
3434
os << ", pan_speed="<< obj.pan_speed;
35-
os << ", encounter_steps="<< obj.encounter_steps;
35+
os << ", total_encounter_rate="<< obj.total_encounter_rate;
3636
os << ", encounter_calling="<< obj.encounter_calling;
3737
os << ", map_save_count="<< obj.map_save_count;
3838
os << ", database_save_count="<< obj.database_save_count;

0 commit comments

Comments
 (0)