Skip to content

Commit

Permalink
Update CommandEasyRpgSetInterpreterFlag
Browse files Browse the repository at this point in the history
- Rename command
- Rename patches
- Reorder patches
- Remove comments
- Snake_Case
  • Loading branch information
jetrotal committed May 10, 2024
1 parent b5db4b3 commit 69c4d8f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
43 changes: 22 additions & 21 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ bool Game_Interpreter::ExecuteCommand(lcf::rpg::EventCommand const& com) {
return CommandManiacSetGameOption(com);
case Cmd::Maniac_CallCommand:
return CommandManiacCallCommand(com);
case static_cast<Game_Interpreter::Cmd>(2053): //Cmd::EasyRpg_SetFlag
return CommandSetFlag(com);
case static_cast<Game_Interpreter::Cmd>(2053): //Cmd::EasyRpg_SetInterpreterFlag
return CommandEasyRpgSetInterpreterFlag(com);
default:
return true;
}
Expand Down Expand Up @@ -4645,25 +4645,26 @@ bool Game_Interpreter::CommandManiacCallCommand(lcf::rpg::EventCommand const&) {
return true;
}

bool Game_Interpreter::CommandSetFlag(lcf::rpg::EventCommand const& com) {

std::string flagName = Utils::LowerCase(ToString(com.string));
int flagValue = ValueOrVariable(com.parameters[0], com.parameters[1]);

if (flagName == "rpg2k3commands") //2k3 commands on 2k games
Player::game_config.patch_rpg2k3_commands.Set(flagValue);
if (flagName == "dynrpg") // dynrpg patch
Player::game_config.patch_dynrpg.Set(flagValue);
if (flagName == "maniacs" || flagName == "maniac") // maniacs patch
Player::game_config.patch_maniac.Set(flagValue);
if (flagName == "keypatch") // ineluki's key patch
Player::game_config.patch_key_patch.Set(flagValue);
if (flagName == "unlockpics") // unlock calling while dialogs box are open
Player::game_config.patch_unlock_pics.Set(flagValue);
if (flagName == "commonthisevent") //common events can use "this event" as a parameter
Player::game_config.patch_common_this_event.Set(flagValue);
if (flagName == "2kbattle")//2k battle Mode
lcf::Data::system.easyrpg_use_rpg2k_battle_system = flagValue;
bool Game_Interpreter::CommandEasyRpgSetInterpreterFlag(lcf::rpg::EventCommand const& com) {

std::string flag_name = Utils::LowerCase(ToString(com.string));
int flag_value = ValueOrVariable(com.parameters[0], com.parameters[1]);

if (flag_name == "dynrpg")
Player::game_config.patch_dynrpg.Set(flag_value);
if (flag_name == "maniac")
Player::game_config.patch_maniac.Set(flag_value);
if (flag_name == "common-this")
Player::game_config.patch_common_this_event.Set(flag_value);
if (flag_name == "pic-unlock")
Player::game_config.patch_unlock_pics.Set(flag_value);
if (flag_name == "key-patch")
Player::game_config.patch_key_patch.Set(flag_value);
if (flag_name == "rpg2k3-cmds" || flag_name == "rpg2k3-commands")
Player::game_config.patch_rpg2k3_commands.Set(flag_value);

if (flag_name == "rpg2k-battle")
lcf::Data::system.easyrpg_use_rpg2k_battle_system = flag_value;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game_interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class Game_Interpreter
bool CommandManiacChangePictureId(lcf::rpg::EventCommand const& com);
bool CommandManiacSetGameOption(lcf::rpg::EventCommand const& com);
bool CommandManiacCallCommand(lcf::rpg::EventCommand const& com);
bool CommandSetFlag(lcf::rpg::EventCommand const& com);
bool CommandEasyRpgSetInterpreterFlag(lcf::rpg::EventCommand const& com);

int DecodeInt(lcf::DBArray<int32_t>::const_iterator& it);
const std::string DecodeString(lcf::DBArray<int32_t>::const_iterator& it);
Expand Down

0 comments on commit 69c4d8f

Please sign in to comment.