@@ -2197,20 +2197,12 @@ bool Game_Interpreter::CommandChangeVehicleGraphic(lcf::rpg::EventCommand const&
21972197bool Game_Interpreter::CommandChangeSystemBGM (lcf::rpg::EventCommand const & com) { // code 10660
21982198 lcf::rpg::Music music;
21992199 int context = com.parameters [0 ];
2200- music.name = ToString (com.string );
2201- music.fadein = com.parameters [1 ];
2202- music.volume = com.parameters [2 ];
2203- music.tempo = com.parameters [3 ];
2204- music.balance = com.parameters [4 ];
22052200
2206- if (Player::IsPatchManiac () && com.parameters .size () > 5 ) {
2207- int opts = com.parameters [5 ];
2208- music.name = ToString (Main_Data::game_strings->GetWithMode (music.name , (opts & 0xF ), com.parameters [6 ], *Main_Data::game_variables));
2209- music.fadein = ValueOrVariableBitfield (opts, 1 , music.fadein );
2210- music.volume = ValueOrVariableBitfield (opts, 2 , music.volume );
2211- music.tempo = ValueOrVariableBitfield (opts, 3 , music.tempo );
2212- music.balance = ValueOrVariableBitfield (opts, 4 , music.balance );
2213- }
2201+ music.name = ToString (CommandStringOrVariableBitfield (com, 5 , 0 , 6 ));
2202+ music.fadein = ValueOrVariableBitfield (com, 5 , 1 , 1 );
2203+ music.volume = ValueOrVariableBitfield (com, 5 , 2 , 2 );
2204+ music.tempo = ValueOrVariableBitfield (com, 5 , 3 , 3 );
2205+ music.balance = ValueOrVariableBitfield (com, 5 , 4 , 4 );
22142206
22152207 Main_Data::game_system->SetSystemBGM (context, std::move (music));
22162208 return true ;
@@ -2219,29 +2211,18 @@ bool Game_Interpreter::CommandChangeSystemBGM(lcf::rpg::EventCommand const& com)
22192211bool Game_Interpreter::CommandChangeSystemSFX (lcf::rpg::EventCommand const & com) { // code 10670
22202212 lcf::rpg::Sound sound;
22212213 int context = com.parameters [0 ];
2222- sound.name = ToString (com.string );
2223- sound.volume = com.parameters [1 ];
2224- sound.tempo = com.parameters [2 ];
2225- sound.balance = com.parameters [3 ];
22262214
2227- if (Player::IsPatchManiac () && com.parameters .size () > 4 ) {
2228- int opts = com.parameters [4 ];
2229- sound.name = ToString (Main_Data::game_strings->GetWithMode (sound.name , (opts & 0xF ), com.parameters [5 ], *Main_Data::game_variables));
2230- sound.volume = ValueOrVariableBitfield (opts, 1 , sound.volume );
2231- sound.tempo = ValueOrVariableBitfield (opts, 2 , sound.tempo );
2232- sound.balance = ValueOrVariableBitfield (opts, 3 , sound.balance );
2233- }
2215+ sound.name = ToString (CommandStringOrVariableBitfield (com, 4 , 0 , 5 ));
2216+ sound.volume = ValueOrVariableBitfield (com, 4 , 1 , 1 );
2217+ sound.tempo = ValueOrVariableBitfield (com, 4 , 2 , 2 );
2218+ sound.balance = ValueOrVariableBitfield (com, 4 , 3 , 3 );
22342219
22352220 Main_Data::game_system->SetSystemSE (context, std::move (sound));
22362221 return true ;
22372222}
22382223
22392224bool Game_Interpreter::CommandChangeSystemGraphics (lcf::rpg::EventCommand const & com) { // code 10680
2240- std::string name = ToString (com.string );
2241-
2242- if (Player::IsPatchManiac () && com.parameters .size () > 2 ) {
2243- name = ToString (CommandStringOrVariableBitfield (com, 2 , 0 , 3 ));
2244- }
2225+ std::string name = ToString (CommandStringOrVariableBitfield (com, 2 , 0 , 3 ));
22452226
22462227 Main_Data::game_system->SetSystemGraphic (name,
22472228 static_cast <lcf::rpg::System::Stretch>(com.parameters [0 ]),
@@ -2354,13 +2335,8 @@ bool Game_Interpreter::CommandChangeEventLocation(lcf::rpg::EventCommand const&
23542335}
23552336
23562337bool Game_Interpreter::CommandTradeEventLocations (lcf::rpg::EventCommand const & com) { // Code 10870
2357- int event1_id = com.parameters [0 ];
2358- int event2_id = com.parameters [1 ];
2359-
2360- if (Player::IsPatchManiac () && com.parameters .size () > 2 ) {
2361- event1_id = ValueOrVariableBitfield (com.parameters [2 ], 0 , event1_id);
2362- event2_id = ValueOrVariableBitfield (com.parameters [2 ], 1 , event2_id);
2363- }
2338+ int event1_id = ValueOrVariableBitfield (2 , 0 , 0 );
2339+ int event2_id = ValueOrVariableBitfield (2 , 1 , 1 );
23642340
23652341 Game_Character *event1 = GetCharacter (event1_id, " TradeEventLocations" );
23662342 Game_Character *event2 = GetCharacter (event2_id, " TradeEventLocations" );
@@ -3402,11 +3378,7 @@ bool Game_Interpreter::CommandKeyInputProc(lcf::rpg::EventCommand const& com) {
34023378}
34033379
34043380bool Game_Interpreter::CommandChangeMapTileset (lcf::rpg::EventCommand const & com) { // code 11710
3405- int chipset_id = com.parameters [0 ];
3406-
3407- if (Player::IsPatchManiac () && com.parameters .size () > 1 ) {
3408- chipset_id = ValueOrVariable (com.parameters [1 ], com.parameters [0 ]);
3409- }
3381+ int chipset_id = ValueOrVariableBitfield (com, 1 , 0 , 0 );
34103382
34113383 if (chipset_id == Game_Map::GetChipset ()) {
34123384 return true ;
@@ -3426,27 +3398,15 @@ bool Game_Interpreter::CommandChangeMapTileset(lcf::rpg::EventCommand const& com
34263398
34273399bool Game_Interpreter::CommandChangePBG (lcf::rpg::EventCommand const & com) { // code 11720
34283400 Game_Map::Parallax::Params params;
3429- params.name = ToString (com.string );
3430-
3431- if (Player::IsPatchManiac () && com.parameters .size () > 7 ) {
3432- params.name = ToString (CommandStringOrVariableBitfield (com, 6 , 0 , 7 ));
3433- }
3401+ params.name = ToString (CommandStringOrVariableBitfield (com, 6 , 0 , 7 ));
34343402
34353403 params.scroll_horz = com.parameters [0 ] != 0 ;
34363404 params.scroll_vert = com.parameters [1 ] != 0 ;
34373405 params.scroll_horz_auto = com.parameters [2 ] != 0 ;
3438- params.scroll_horz_speed = com.parameters [3 ];
3439-
3440- if (Player::IsPatchManiac () && com.parameters .size () > 6 ) {
3441- params.scroll_horz_speed = ValueOrVariableBitfield (com.parameters [6 ], 4 , com.parameters [3 ]);
3442- }
3406+ params.scroll_horz_speed = ValueOrVariableBitfield (com, 6 , 4 , 3 );
34433407
34443408 params.scroll_vert_auto = com.parameters [4 ] != 0 ;
3445- params.scroll_vert_speed = com.parameters [5 ];
3446-
3447- if (Player::IsPatchManiac () && com.parameters .size () > 6 ) {
3448- params.scroll_vert_speed = ValueOrVariableBitfield (com.parameters [6 ], 6 , com.parameters [5 ]);
3449- }
3409+ params.scroll_vert_speed = ValueOrVariableBitfield (com, 6 , 6 , 5 );
34503410
34513411 Game_Map::Parallax::ChangeBG (params);
34523412
0 commit comments