EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
965 stars 183 forks source link

Maniac: Implement CallCommand and String Vars #3140

Closed Ghabry closed 7 months ago

Ghabry commented 8 months ago

Pending final change that depends on #3141

if (com.parameters.size() >= 5) {
    cmd.string = Main_Data::game_strings->GetWithModeBitfield(com.string, com.parameters[0], 3, com.parameters[4]);
} else {
    cmd.string = com.string;
}

btw, such code will be also needed for other commands just with a different index:

if (Player::IsPatchManiac() && com.parameters.size() >= A) {
    cmd.string = Main_Data::game_strings->GetWithModeBitfield(com.string, com.parameters[0], B, com.parameters[A - 1]);
} else {
    cmd.string = com.string;
}

Could need a helper function 🤔

Ghabry commented 8 months ago

I added variable lookup to commands that support this with Maniac Patch. Please review carefully that I did not mess up the numbers.