Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do game over checks for event commands #1583

Merged
merged 1 commit into from Dec 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/game_interpreter.cpp
Expand Up @@ -1190,10 +1190,9 @@ bool Game_Interpreter::CommandChangePartyMember(RPG::EventCommand const& com) {
} else {
// Remove members
Main_Data::game_party->RemoveActor(id);

CheckGameOver();
}

CheckGameOver();
Game_Map::SetNeedRefresh(Game_Map::Refresh_Map);

// Continue
Expand All @@ -1211,6 +1210,7 @@ bool Game_Interpreter::CommandChangeExp(RPG::EventCommand const& com) { // Code
actor->ChangeExp(actor->GetExp() + value, com.parameters[5] != 0);
}

CheckGameOver();
return true;
}

Expand All @@ -1225,6 +1225,7 @@ bool Game_Interpreter::CommandChangeLevel(RPG::EventCommand const& com) { // Cod
actor->ChangeLevel(actor->GetLevel() + value, com.parameters[5] != 0);
}

CheckGameOver();
return true;
}

Expand Down Expand Up @@ -1274,6 +1275,8 @@ bool Game_Interpreter::CommandChangeParameters(RPG::EventCommand const& com) { /
break;
}
}

CheckGameOver();
return true;
}

Expand All @@ -1288,6 +1291,7 @@ bool Game_Interpreter::CommandChangeSkills(RPG::EventCommand const& com) { // Co
actor->LearnSkill(skill_id);
}

CheckGameOver();
return true;
}

Expand Down Expand Up @@ -1356,6 +1360,7 @@ bool Game_Interpreter::CommandChangeEquipment(RPG::EventCommand const& com) { //
}
}

CheckGameOver();
return true;
}

Expand All @@ -1382,10 +1387,7 @@ bool Game_Interpreter::CommandChangeHP(RPG::EventCommand const& com) { // Code 1
}
}

if (lethal) {
CheckGameOver();
}

CheckGameOver();
return true;
}

Expand All @@ -1403,6 +1405,7 @@ bool Game_Interpreter::CommandChangeSP(RPG::EventCommand const& com) { // Code 1
actor->SetSp(sp);
}

CheckGameOver();
return true;
}

Expand All @@ -1417,10 +1420,10 @@ bool Game_Interpreter::CommandChangeCondition(RPG::EventCommand const& com) { //
} else {
actor->AddState(state_id);
Game_Battle::SetNeedRefresh(true);
CheckGameOver();
}
}

CheckGameOver();
return true;
}

Expand All @@ -1431,6 +1434,7 @@ bool Game_Interpreter::CommandFullHeal(RPG::EventCommand const& com) { // Code 1
actor->SetSp(actor->GetMaxSp());
}

CheckGameOver();
Game_Battle::SetNeedRefresh(true);

return true;
Expand All @@ -1456,14 +1460,13 @@ bool Game_Interpreter::CommandSimulatedAttack(RPG::EventCommand const& com) { //
result = std::max(0, result);
actor->ChangeHp(-result);

CheckGameOver();

if (com.parameters[6] != 0) {
Game_Variables.Set(com.parameters[7], result);
Game_Map::SetNeedRefresh(Game_Map::Refresh_Map);
}
}

CheckGameOver();
return true;
}

Expand Down