Skip to content

Commit

Permalink
New Commands: 2053 - SetFlag
Browse files Browse the repository at this point in the history
```JS
@raw 2053, "flag Name", on_off_Value_IsVariable, on_off_Value
```

```JS
@raw 2053, "rpg2k3commands", 0, 1 //2k3 commands on 2k games

@raw 2053, "dynrpg", 0, 1 // dynrpg patch

@raw 2053, "maniacs", 0, 1 // maniacs patch

@raw 2053, "keypatch", 0, 1 // ineluki's key patch

@raw 2053, "unlockpics", 0, 1 // call pics while dialog box is open

@raw 2053, "commonthisevent", 0, 1 //common events can use "this event"

@raw 2053, "2kbattle", 0, 1 //Battle System from rm2k

```

Update game_interpreter.cpp
  • Loading branch information
jetrotal committed Oct 21, 2023
1 parent ad6e823 commit 1f14e3e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +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);
default:
return true;
}
Expand Down Expand Up @@ -4643,6 +4645,29 @@ 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;

return true;
}

Game_Interpreter& Game_Interpreter::GetForegroundInterpreter() {
return Game_Battle::IsBattleRunning()
? Game_Battle::GetInterpreter()
Expand Down
1 change: 1 addition & 0 deletions src/game_interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +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);

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 1f14e3e

Please sign in to comment.