Skip to content

Commit

Permalink
Merge pull request #456 from Ghabry/renaming
Browse files Browse the repository at this point in the history
Encounter Rate/Steps Chunk Renaming
  • Loading branch information
fdelapena authored Apr 26, 2023
2 parents d1fc1b4 + 2a2e0d3 commit 2637def
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion generator/csv/enums.csv
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ EventCommand,Code,PlayMovie,11560
EventCommand,Code,KeyInputProc,11610
EventCommand,Code,ChangeMapTileset,11710
EventCommand,Code,ChangePBG,11720
EventCommand,Code,ChangeEncounterRate,11740
EventCommand,Code,ChangeEncounterSteps,11740
EventCommand,Code,TileSubstitution,11750
EventCommand,Code,TeleportTargets,11810
EventCommand,Code,ChangeTeleportAccess,11820
Expand Down
7 changes: 7 additions & 0 deletions generator/csv/enums_easyrpg.csv
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ EventCommand,Code,Maniac_ControlGlobalSave,3016
EventCommand,Code,Maniac_ChangePictureId,3017
EventCommand,Code,Maniac_SetGameOption,3018
EventCommand,Code,Maniac_CallCommand,3019
EventCommand,Code,Maniac_ControlStrings,3020
EventCommand,Code,Maniac_GetGameInfo,3021
EventCommand,Code,Maniac_EditPicture,3025
EventCommand,Code,Maniac_WritePicture,3026
EventCommand,Code,Maniac_AddMoveRoute,3027
EventCommand,Code,Maniac_EditTile,3028
EventCommand,Code,Maniac_ControlTextProcessing,3029
EventPage,ManiacEventInfo,action,0
EventPage,ManiacEventInfo,touched,1
EventPage,ManiacEventInfo,collision,2
Expand Down
4 changes: 2 additions & 2 deletions generator/csv/fields.csv
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ SavePartyLocation,pan_current_y,f,Int32,0x71,kPanYDefault,0,0,Number of 1/16 pix
SavePartyLocation,pan_finish_x,f,Int32,0x72,kPanXDefault,0,0,Number of 1/16 pixels to the left of player when current scroll finishes
SavePartyLocation,pan_finish_y,f,Int32,0x73,kPanYDefault,0,0,Number of 1/16 pixels above the player when current scroll finishes.
SavePartyLocation,pan_speed,f,Int32,0x79,kPanSpeedDefault,0,0,speed in the scrolls of the screen - shown in sixteenth pixels.
SavePartyLocation,encounter_steps,f,Int32,0x7C,0,0,0,int: sum of terrain.encounter_rate for each step
SavePartyLocation,total_encounter_rate,f,Int32,0x7C,0,0,0,int: sum of terrain.encounter_rate for each step
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.
SavePartyLocation,map_save_count,f,Int32,0x83,0,0,0,Mirrors save_count of current map. On mismatch events are not continued after load.
SavePartyLocation,database_save_count,f,Int32,0x84,0,0,0,?
Expand Down Expand Up @@ -984,7 +984,7 @@ SaveMapEvent,triggered_by_decision_key,f,Boolean,0x67,False,0,0,If true; this ev
SaveMapEvent,parallel_event_execstate,f,SaveEventExecState,0x6C,,1,0,chunks
SaveMapInfo,position_x,f,Int32,0x01,0,0,0,int
SaveMapInfo,position_y,f,Int32,0x02,0,0,0,int
SaveMapInfo,encounter_rate,f,Int32,0x03,-1,0,0,int
SaveMapInfo,encounter_steps,f,Int32,0x03,-1,0,0,int
SaveMapInfo,chipset_id,f,Int32,0x05,0,0,0,int
SaveMapInfo,events,f,Array<SaveMapEvent>,0x0B,,1,0,? array
SaveMapInfo,lower_tiles,f,Vector<UInt8>,0x15,"[x for x in range(0, 144)]",1,0,? [00 01 02 ... 8E 8F]
Expand Down
4 changes: 2 additions & 2 deletions src/generated/lcf/lsd/chunks.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ namespace LSD_Reader {
/** speed in the scrolls of the screen - shown in sixteenth pixels. */
pan_speed = 0x79,
/** int: sum of terrain.encounter_rate for each step */
encounter_steps = 0x7C,
total_encounter_rate = 0x7C,
/** 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. */
encounter_calling = 0x7D,
/** Mirrors save_count of current map. On mismatch events are not continued after load. */
Expand Down Expand Up @@ -911,7 +911,7 @@ namespace LSD_Reader {
/** int */
position_y = 0x02,
/** int */
encounter_rate = 0x03,
encounter_steps = 0x03,
/** int */
chipset_id = 0x05,
/** ? array */
Expand Down
11 changes: 9 additions & 2 deletions src/generated/lcf/rpg/eventcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace rpg {
KeyInputProc = 11610,
ChangeMapTileset = 11710,
ChangePBG = 11720,
ChangeEncounterRate = 11740,
ChangeEncounterSteps = 11740,
TileSubstitution = 11750,
TeleportTargets = 11810,
ChangeTeleportAccess = 11820,
Expand Down Expand Up @@ -175,7 +175,14 @@ namespace rpg {
Maniac_ControlGlobalSave = 3016,
Maniac_ChangePictureId = 3017,
Maniac_SetGameOption = 3018,
Maniac_CallCommand = 3019
Maniac_CallCommand = 3019,
Maniac_ControlStrings = 3020,
Maniac_GetGameInfo = 3021,
Maniac_EditPicture = 3025,
Maniac_WritePicture = 3026,
Maniac_AddMoveRoute = 3027,
Maniac_EditTile = 3028,
Maniac_ControlTextProcessing = 3029
};

int32_t code = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/generated/lcf/rpg/savemapinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace rpg {
public:
int32_t position_x = 0;
int32_t position_y = 0;
int32_t encounter_rate = -1;
int32_t encounter_steps = -1;
int32_t chipset_id = 0;
std::vector<SaveMapEvent> events;
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};
Expand All @@ -47,7 +47,7 @@ namespace rpg {
inline bool operator==(const SaveMapInfo& l, const SaveMapInfo& r) {
return l.position_x == r.position_x
&& l.position_y == r.position_y
&& l.encounter_rate == r.encounter_rate
&& l.encounter_steps == r.encounter_steps
&& l.chipset_id == r.chipset_id
&& l.events == r.events
&& l.lower_tiles == r.lower_tiles
Expand Down
4 changes: 2 additions & 2 deletions src/generated/lcf/rpg/savepartylocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace rpg {
int32_t pan_finish_x = kPanXDefault;
int32_t pan_finish_y = kPanYDefault;
int32_t pan_speed = kPanSpeedDefault;
int32_t encounter_steps = 0;
int32_t total_encounter_rate = 0;
bool encounter_calling = false;
int32_t map_save_count = 0;
int32_t database_save_count = 0;
Expand All @@ -94,7 +94,7 @@ namespace rpg {
&& l.pan_finish_x == r.pan_finish_x
&& l.pan_finish_y == r.pan_finish_y
&& l.pan_speed == r.pan_speed
&& l.encounter_steps == r.encounter_steps
&& l.total_encounter_rate == r.total_encounter_rate
&& l.encounter_calling == r.encounter_calling
&& l.map_save_count == r.map_save_count
&& l.database_save_count == r.database_save_count;
Expand Down
10 changes: 5 additions & 5 deletions src/generated/lsd_savemapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ static TypedField<rpg::SaveMapInfo, int32_t> static_position_y(
0,
0
);
static TypedField<rpg::SaveMapInfo, int32_t> static_encounter_rate(
&rpg::SaveMapInfo::encounter_rate,
LSD_Reader::ChunkSaveMapInfo::encounter_rate,
"encounter_rate",
static TypedField<rpg::SaveMapInfo, int32_t> static_encounter_steps(
&rpg::SaveMapInfo::encounter_steps,
LSD_Reader::ChunkSaveMapInfo::encounter_steps,
"encounter_steps",
0,
0
);
Expand Down Expand Up @@ -124,7 +124,7 @@ template <>
Field<rpg::SaveMapInfo> const* Struct<rpg::SaveMapInfo>::fields[] = {
&static_position_x,
&static_position_y,
&static_encounter_rate,
&static_encounter_steps,
&static_chipset_id,
&static_events,
&static_lower_tiles,
Expand Down
10 changes: 5 additions & 5 deletions src/generated/lsd_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ static TypedField<rpg::SavePartyLocation, int32_t> static_pan_speed(
0,
0
);
static TypedField<rpg::SavePartyLocation, int32_t> static_encounter_steps(
&rpg::SavePartyLocation::encounter_steps,
LSD_Reader::ChunkSavePartyLocation::encounter_steps,
"encounter_steps",
static TypedField<rpg::SavePartyLocation, int32_t> static_total_encounter_rate(
&rpg::SavePartyLocation::total_encounter_rate,
LSD_Reader::ChunkSavePartyLocation::total_encounter_rate,
"total_encounter_rate",
0,
0
);
Expand Down Expand Up @@ -460,7 +460,7 @@ Field<rpg::SavePartyLocation> const* Struct<rpg::SavePartyLocation>::fields[] =
&static_pan_finish_x,
&static_pan_finish_y,
&static_pan_speed,
&static_encounter_steps,
&static_total_encounter_rate,
&static_encounter_calling,
&static_map_save_count,
&static_database_save_count,
Expand Down
2 changes: 1 addition & 1 deletion src/generated/rpg_savemapinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ std::ostream& operator<<(std::ostream& os, const SaveMapInfo& obj) {
os << "SaveMapInfo{";
os << "position_x="<< obj.position_x;
os << ", position_y="<< obj.position_y;
os << ", encounter_rate="<< obj.encounter_rate;
os << ", encounter_steps="<< obj.encounter_steps;
os << ", chipset_id="<< obj.chipset_id;
os << ", events=";
for (size_t i = 0; i < obj.events.size(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/generated/rpg_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::ostream& operator<<(std::ostream& os, const SavePartyLocation& obj) {
os << ", pan_finish_x="<< obj.pan_finish_x;
os << ", pan_finish_y="<< obj.pan_finish_y;
os << ", pan_speed="<< obj.pan_speed;
os << ", encounter_steps="<< obj.encounter_steps;
os << ", total_encounter_rate="<< obj.total_encounter_rate;
os << ", encounter_calling="<< obj.encounter_calling;
os << ", map_save_count="<< obj.map_save_count;
os << ", database_save_count="<< obj.database_save_count;
Expand Down

0 comments on commit 2637def

Please sign in to comment.