MCPcopy Create free account
hub / github.com/EasyRPG/Player / CommandChangeCondition

Method CommandChangeCondition

src/game_interpreter.cpp:1880–1900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1878}
1879
1880bool Game_Interpreter::CommandChangeCondition(lcf::rpg::EventCommand const& com) { // Code 10480
1881 bool remove = com.parameters[2] != 0;
1882 int state_id = com.parameters[3];
1883
1884 for (const auto& actor : GetActors(com.parameters[0], com.parameters[1])) {
1885 if (remove) {
1886 // RPG_RT: On the map, will remove battle states even if actor has
1887 // state inflicted by equipment.
1888 actor->RemoveState(state_id, !Game_Battle::IsBattleRunning());
1889 } else {
1890 // RPG_RT always adds states from event commands, even battle states.
1891 actor->AddState(state_id, true);
1892 }
1893 if (actor->GetActorBattleSprite()) {
1894 actor->GetActorBattleSprite()->DetectStateChange();
1895 }
1896 }
1897
1898 CheckGameOver();
1899 return true;
1900}
1901
1902bool Game_Interpreter::CommandFullHeal(lcf::rpg::EventCommand const& com) { // Code 10490
1903 for (const auto& actor : GetActors(com.parameters[0], com.parameters[1])) {

Callers

nothing calls this directly

Calls 4

RemoveStateMethod · 0.80
AddStateMethod · 0.80
GetActorBattleSpriteMethod · 0.80
DetectStateChangeMethod · 0.80

Tested by

no test coverage detected