Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chunks/commands for Jetrotal #478

Merged
merged 5 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions generator/csv/enums_easyrpg.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Structure,Entry,Value,Index
EventCommand,Code,EasyRpg_TriggerEventAt,2002
EventCommand,Code,EasyRpg_SmartMoveRoute,2003
EventCommand,Code,EasyRpg_SmartStepToward,2004
EventCommand,Code,EasyRpg_CallMovementAction,2050
EventCommand,Code,EasyRpg_WaitForSingleMovement,2051
EventCommand,Code,EasyRpg_AnimateVariable,2052
EventCommand,Code,EasyRpg_SetInterpreterFlag,2053
EventCommand,Code,EasyRpg_ProcessJson,2055
EventCommand,Code,EasyRpg_CloneMapEvent,2056
EventCommand,Code,EasyRpg_DestroyMapEvent,2057
EventCommand,Code,EasyRpg_StringPictureMenu,2058
EventCommand,Code,Maniac_GetSaveInfo,3001
EventCommand,Code,Maniac_Save,3002
EventCommand,Code,Maniac_Load,3003
Expand Down
4 changes: 4 additions & 0 deletions generator/csv/fields_easyrpg.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ SaveEventExecFrame,maniac_event_id,f,Int32,0x0F,0,0,0,Event ID
SaveEventExecFrame,maniac_event_page_id,f,Int32,0x10,0,0,0,Page ID when it is a map event
SaveEventExecFrame,maniac_loop_info_size,f,Int32,0x11,0,0,0,Amount of loop info groups
SaveEventExecFrame,maniac_loop_info,f,Vector<Int32>,0x12,,0,0,"One group of (Current loop count, end loop value) for each identation"
SaveEventExecState,easyrpg_active,f,Boolean,0xC9,False,0,0,When true state of an event is preserved in easyrpg_string and easyrpg_parameters
SaveEventExecState,easyrpg_string,f,DBString,0xCA,,0,0,Preserved string data of an event
SaveEventExecState,easyrpg_parameters,f,Vector<Int32>,0xCB,,0,0,Preserved int parameter of an event
SavePicture,easyrpg_flip,f,Enum<EasyRpgFlip>,0xC8,0,0,1,How to flip the picture
SavePicture,easyrpg_blend_mode,f,Int32,0xC9,0,0,1,Blend mode to use for blit. See Bitmap::BlendMode
SavePicture,easyrpg_type,f,Enum<EasyRpgPictureType>,0xCA,0,0,1,Type of this picture
Expand All @@ -27,6 +30,7 @@ SaveEasyRpgText,font_size,f,Int32,0x05,12,0,0,Font size
SaveEasyRpgText,letter_spacing,f,Int32,0x06,0,0,0,Additional spacing between letters
SaveEasyRpgText,line_spacing,f,Int32,0x07,4,0,0,Additional spacing between lines
SaveEasyRpgText,flags,f,SaveEasyRpgText_Flags,0x08,3,0,0,Various text settings
SaveMapEventBase,easyrpg_move_failure_count,f,Int32,0xC9,0,0,0,Tracks how often the current move operation in a move route failed
SaveSystem,maniac_strings,f,Vector<DBString>,0x24,,0,0,rpg::Strings
SaveSystem,maniac_frameskip,,Int32,0x88,0,0,0,"FatalMix Frameskip (0=None, 1=1/5, 2=1/3, 3=1/2)"
SaveSystem,maniac_picture_limit,,Int32,0x89,0,0,0,FatalMix Picture Limit
Expand Down
18 changes: 16 additions & 2 deletions src/generated/lcf/lsd/chunks.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ namespace LSD_Reader {
flash_current_level = 0x54,
/** int */
flash_time_left = 0x55,
/** Tracks how often the current move operation in a move route failed */
easyrpg_move_failure_count = 0xC9,
/** */
boarding = 0x65,
/** */
Expand Down Expand Up @@ -522,6 +524,8 @@ namespace LSD_Reader {
flash_current_level = 0x54,
/** int */
flash_time_left = 0x55,
/** Tracks how often the current move operation in a move route failed */
easyrpg_move_failure_count = 0xC9,
/** Which vehicle */
vehicle = 0x65,
/** From 0 to 255 - In flying vehicles; remaining distance to ascend */
Expand Down Expand Up @@ -733,7 +737,13 @@ namespace LSD_Reader {
/** */
keyinput_timed = 0x29,
/** Used for a wait command WaitForKeyInput rm2k3 feature to wait for decision key press. */
wait_key_enter = 0x2A
wait_key_enter = 0x2A,
/** When true state of an event is preserved in easyrpg_string and easyrpg_parameters */
easyrpg_active = 0xC9,
/** Preserved string data of an event */
easyrpg_string = 0xCA,
/** Preserved int parameter of an event */
easyrpg_parameters = 0xCB
};
};
struct ChunkSaveMapEventBase {
Expand Down Expand Up @@ -815,7 +825,9 @@ namespace LSD_Reader {
/** double */
flash_current_level = 0x54,
/** int */
flash_time_left = 0x55
flash_time_left = 0x55,
/** Tracks how often the current move operation in a move route failed */
easyrpg_move_failure_count = 0xC9
};
};
struct ChunkSaveMapEvent {
Expand Down Expand Up @@ -898,6 +910,8 @@ namespace LSD_Reader {
flash_current_level = 0x54,
/** int */
flash_time_left = 0x55,
/** Tracks how often the current move operation in a move route failed */
easyrpg_move_failure_count = 0xC9,
/** If true; this event is waiting for foreground execution. */
waiting_execution = 0x65,
/** Index of custom move route */
Expand Down
22 changes: 22 additions & 0 deletions src/generated/lcf/rpg/eventcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ namespace rpg {
Comment_2 = 22410,
ElseBranch_B = 23310,
EndBranch_B = 23311,
EasyRpg_TriggerEventAt = 2002,
EasyRpg_SmartMoveRoute = 2003,
EasyRpg_SmartStepToward = 2004,
EasyRpg_CallMovementAction = 2050,
EasyRpg_WaitForSingleMovement = 2051,
EasyRpg_AnimateVariable = 2052,
EasyRpg_SetInterpreterFlag = 2053,
EasyRpg_ProcessJson = 2055,
EasyRpg_CloneMapEvent = 2056,
EasyRpg_DestroyMapEvent = 2057,
EasyRpg_StringPictureMenu = 2058,
Maniac_GetSaveInfo = 3001,
Maniac_Save = 3002,
Maniac_Load = 3003,
Expand Down Expand Up @@ -313,6 +324,17 @@ namespace rpg {
Code::Comment_2, "Comment_2",
Code::ElseBranch_B, "ElseBranch_B",
Code::EndBranch_B, "EndBranch_B",
Code::EasyRpg_TriggerEventAt, "EasyRpg_TriggerEventAt",
Code::EasyRpg_SmartMoveRoute, "EasyRpg_SmartMoveRoute",
Code::EasyRpg_SmartStepToward, "EasyRpg_SmartStepToward",
Code::EasyRpg_CallMovementAction, "EasyRpg_CallMovementAction",
Code::EasyRpg_WaitForSingleMovement, "EasyRpg_WaitForSingleMovement",
Code::EasyRpg_AnimateVariable, "EasyRpg_AnimateVariable",
Code::EasyRpg_SetInterpreterFlag, "EasyRpg_SetInterpreterFlag",
Code::EasyRpg_ProcessJson, "EasyRpg_ProcessJson",
Code::EasyRpg_CloneMapEvent, "EasyRpg_CloneMapEvent",
Code::EasyRpg_DestroyMapEvent, "EasyRpg_DestroyMapEvent",
Code::EasyRpg_StringPictureMenu, "EasyRpg_StringPictureMenu",
Code::Maniac_GetSaveInfo, "Maniac_GetSaveInfo",
Code::Maniac_Save, "Maniac_Save",
Code::Maniac_Load, "Maniac_Load",
Expand Down
11 changes: 10 additions & 1 deletion src/generated/lcf/rpg/saveeventexecstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Headers
#include <stdint.h>
#include <vector>
#include "lcf/dbstring.h"
#include "lcf/rpg/saveeventexecframe.h"
#include "lcf/context.h"
#include <ostream>
Expand Down Expand Up @@ -49,6 +50,9 @@ namespace rpg {
int32_t keyinput_2k3up = 0;
bool keyinput_timed = false;
bool wait_key_enter = false;
bool easyrpg_active = false;
DBString easyrpg_string;
std::vector<int32_t> easyrpg_parameters;
};

inline bool operator==(const SaveEventExecState& l, const SaveEventExecState& r) {
Expand All @@ -73,7 +77,10 @@ namespace rpg {
&& l.keyinput_2k3right == r.keyinput_2k3right
&& l.keyinput_2k3up == r.keyinput_2k3up
&& l.keyinput_timed == r.keyinput_timed
&& l.wait_key_enter == r.wait_key_enter;
&& l.wait_key_enter == r.wait_key_enter
&& l.easyrpg_active == r.easyrpg_active
&& l.easyrpg_string == r.easyrpg_string
&& l.easyrpg_parameters == r.easyrpg_parameters;
}

inline bool operator!=(const SaveEventExecState& l, const SaveEventExecState& r) {
Expand All @@ -88,6 +95,8 @@ namespace rpg {
const auto ctx1 = Context<SaveEventExecState, ParentCtx>{ "stack", i, &obj, parent_ctx };
ForEachString(obj.stack[i], f, &ctx1);
}
const auto ctx24 = Context<SaveEventExecState, ParentCtx>{ "easyrpg_string", -1, &obj, parent_ctx };
f(obj.easyrpg_string, ctx24);
(void)obj;
(void)f;
(void)parent_ctx;
Expand Down
4 changes: 3 additions & 1 deletion src/generated/lcf/rpg/savemapeventbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ namespace rpg {
int32_t flash_blue = -1;
double flash_current_level = 0.0;
int32_t flash_time_left = 0;
int32_t easyrpg_move_failure_count = 0;
};

inline bool operator==(const SaveMapEventBase& l, const SaveMapEventBase& r) {
Expand Down Expand Up @@ -108,7 +109,8 @@ namespace rpg {
&& l.flash_green == r.flash_green
&& l.flash_blue == r.flash_blue
&& l.flash_current_level == r.flash_current_level
&& l.flash_time_left == r.flash_time_left;
&& l.flash_time_left == r.flash_time_left
&& l.easyrpg_move_failure_count == r.easyrpg_move_failure_count;
}

inline bool operator!=(const SaveMapEventBase& l, const SaveMapEventBase& r) {
Expand Down
24 changes: 24 additions & 0 deletions src/generated/lsd_saveeventexecstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,27 @@ static TypedField<rpg::SaveEventExecState, bool> static_wait_key_enter(
0,
0
);
static TypedField<rpg::SaveEventExecState, bool> static_easyrpg_active(
&rpg::SaveEventExecState::easyrpg_active,
LSD_Reader::ChunkSaveEventExecState::easyrpg_active,
"easyrpg_active",
0,
0
);
static TypedField<rpg::SaveEventExecState, DBString> static_easyrpg_string(
&rpg::SaveEventExecState::easyrpg_string,
LSD_Reader::ChunkSaveEventExecState::easyrpg_string,
"easyrpg_string",
0,
0
);
static TypedField<rpg::SaveEventExecState, std::vector<int32_t>> static_easyrpg_parameters(
&rpg::SaveEventExecState::easyrpg_parameters,
LSD_Reader::ChunkSaveEventExecState::easyrpg_parameters,
"easyrpg_parameters",
0,
0
);


template <>
Expand All @@ -200,6 +221,9 @@ Field<rpg::SaveEventExecState> const* Struct<rpg::SaveEventExecState>::fields[]
&static_keyinput_2k3up,
&static_keyinput_timed,
&static_wait_key_enter,
&static_easyrpg_active,
&static_easyrpg_string,
&static_easyrpg_parameters,
NULL
};

Expand Down
8 changes: 8 additions & 0 deletions src/generated/lsd_savemapevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ static TypedField<rpg::SaveMapEvent, int32_t> static_flash_time_left(
0,
0
);
static TypedField<rpg::SaveMapEvent, int32_t> static_easyrpg_move_failure_count(
&rpg::SaveMapEvent::easyrpg_move_failure_count,
LSD_Reader::ChunkSaveMapEvent::easyrpg_move_failure_count,
"easyrpg_move_failure_count",
0,
0
);
static TypedField<rpg::SaveMapEvent, bool> static_waiting_execution(
&rpg::SaveMapEvent::waiting_execution,
LSD_Reader::ChunkSaveMapEvent::waiting_execution,
Expand Down Expand Up @@ -364,6 +371,7 @@ Field<rpg::SaveMapEvent> const* Struct<rpg::SaveMapEvent>::fields[] = {
&static_flash_blue,
&static_flash_current_level,
&static_flash_time_left,
&static_easyrpg_move_failure_count,
&static_waiting_execution,
&static_original_move_route_index,
&static_triggered_by_decision_key,
Expand Down
8 changes: 8 additions & 0 deletions src/generated/lsd_savemapeventbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ static TypedField<rpg::SaveMapEventBase, int32_t> static_flash_time_left(
0,
0
);
static TypedField<rpg::SaveMapEventBase, int32_t> static_easyrpg_move_failure_count(
&rpg::SaveMapEventBase::easyrpg_move_failure_count,
LSD_Reader::ChunkSaveMapEventBase::easyrpg_move_failure_count,
"easyrpg_move_failure_count",
0,
0
);


template <>
Expand Down Expand Up @@ -336,6 +343,7 @@ Field<rpg::SaveMapEventBase> const* Struct<rpg::SaveMapEventBase>::fields[] = {
&static_flash_blue,
&static_flash_current_level,
&static_flash_time_left,
&static_easyrpg_move_failure_count,
NULL
};

Expand Down
8 changes: 8 additions & 0 deletions src/generated/lsd_savepartylocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ static TypedField<rpg::SavePartyLocation, int32_t> static_flash_time_left(
0,
0
);
static TypedField<rpg::SavePartyLocation, int32_t> static_easyrpg_move_failure_count(
&rpg::SavePartyLocation::easyrpg_move_failure_count,
LSD_Reader::ChunkSavePartyLocation::easyrpg_move_failure_count,
"easyrpg_move_failure_count",
0,
0
);
static TypedField<rpg::SavePartyLocation, bool> static_boarding(
&rpg::SavePartyLocation::boarding,
LSD_Reader::ChunkSavePartyLocation::boarding,
Expand Down Expand Up @@ -448,6 +455,7 @@ Field<rpg::SavePartyLocation> const* Struct<rpg::SavePartyLocation>::fields[] =
&static_flash_blue,
&static_flash_current_level,
&static_flash_time_left,
&static_easyrpg_move_failure_count,
&static_boarding,
&static_aboard,
&static_vehicle,
Expand Down
8 changes: 8 additions & 0 deletions src/generated/lsd_savevehiclelocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ static TypedField<rpg::SaveVehicleLocation, int32_t> static_flash_time_left(
0,
0
);
static TypedField<rpg::SaveVehicleLocation, int32_t> static_easyrpg_move_failure_count(
&rpg::SaveVehicleLocation::easyrpg_move_failure_count,
LSD_Reader::ChunkSaveVehicleLocation::easyrpg_move_failure_count,
"easyrpg_move_failure_count",
0,
0
);
static TypedField<rpg::SaveVehicleLocation, int32_t> static_vehicle(
&rpg::SaveVehicleLocation::vehicle,
LSD_Reader::ChunkSaveVehicleLocation::vehicle,
Expand Down Expand Up @@ -371,6 +378,7 @@ Field<rpg::SaveVehicleLocation> const* Struct<rpg::SaveVehicleLocation>::fields[
&static_flash_blue,
&static_flash_current_level,
&static_flash_time_left,
&static_easyrpg_move_failure_count,
&static_vehicle,
&static_remaining_ascent,
&static_remaining_descent,
Expand Down
7 changes: 7 additions & 0 deletions src/generated/rpg_saveeventexecstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ std::ostream& operator<<(std::ostream& os, const SaveEventExecState& obj) {
os << ", keyinput_2k3up="<< obj.keyinput_2k3up;
os << ", keyinput_timed="<< obj.keyinput_timed;
os << ", wait_key_enter="<< obj.wait_key_enter;
os << ", easyrpg_active="<< obj.easyrpg_active;
os << ", easyrpg_string="<< obj.easyrpg_string;
os << ", easyrpg_parameters=";
for (size_t i = 0; i < obj.easyrpg_parameters.size(); ++i) {
os << (i == 0 ? "[" : ", ") << obj.easyrpg_parameters[i];
}
os << "]";
os << "}";
return os;
}
Expand Down
1 change: 1 addition & 0 deletions src/generated/rpg_savemapeventbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ std::ostream& operator<<(std::ostream& os, const SaveMapEventBase& obj) {
os << ", flash_blue="<< obj.flash_blue;
os << ", flash_current_level="<< obj.flash_current_level;
os << ", flash_time_left="<< obj.flash_time_left;
os << ", easyrpg_move_failure_count="<< obj.easyrpg_move_failure_count;
os << "}";
return os;
}
Expand Down