Skip to content

Commit

Permalink
FlashEvent - Maniac Patch Parameters
Browse files Browse the repository at this point in the history
Supporting usage of variables when
game uses maniac patch
and parameters size is bigger than 7.
  • Loading branch information
jetrotal committed Jan 7, 2025
1 parent 7976386 commit c5b60b4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/game_interpreter_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,17 @@ bool Game_Interpreter_Map::CommandShowBattleAnimation(lcf::rpg::EventCommand con
}

bool Game_Interpreter_Map::CommandFlashSprite(lcf::rpg::EventCommand const& com) { // code 11320
int event_id = com.parameters[0];
int r = com.parameters[1];
int g = com.parameters[2];
int b = com.parameters[3];
int p = com.parameters[4];
auto getFlashParam = [&](int index) {
return (com.parameters.size() <= 8 && Player::IsPatchManiac())
? ValueOrVariableBitfield(com.parameters[7], index, com.parameters[index])
: com.parameters[index];
};

const int event_id = getFlashParam(0);
const int r = getFlashParam(1);
const int g = getFlashParam(2);
const int b = getFlashParam(3);
const int p = getFlashParam(4);

int tenths = com.parameters[5];
bool wait = com.parameters[6] > 0;
Expand Down

0 comments on commit c5b60b4

Please sign in to comment.