Skip to content

Commit

Permalink
Merge pull request #1370 from Albeleon/battle
Browse files Browse the repository at this point in the history
Initial Enemy appearance message: Only visible enemies.
  • Loading branch information
carstene1ns authored Jun 17, 2018
2 parents 5f7b64d + 474141f commit 1d5aedc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/scene_battle_rpg2k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ int Scene_Battle_Rpg2k::GetDelayForLine() {
}

void Scene_Battle_Rpg2k::SetWaitForEnemyAppearanceMessages() {
if ((enemy_iterator == Main_Data::game_enemyparty->GetEnemies().end() &&
if ((enemy_iterator == visible_enemies.end() &&
!battle_message_window->GetHiddenLineCount()) ||
battle_message_window->IsPageFilled()) {
encounter_message_sleep_until = Player::GetFrames() + GetDelayForWindow();
Expand All @@ -861,7 +861,8 @@ void Scene_Battle_Rpg2k::SetWaitForEnemyAppearanceMessages() {

bool Scene_Battle_Rpg2k::DisplayMonstersInMessageWindow() {
if (encounter_message_first_monster) {
enemy_iterator = Main_Data::game_enemyparty->GetEnemies().begin();
Main_Data::game_enemyparty->GetActiveBattlers(visible_enemies);
enemy_iterator = visible_enemies.begin();
encounter_message_first_monster = false;
}

Expand All @@ -885,7 +886,7 @@ bool Scene_Battle_Rpg2k::DisplayMonstersInMessageWindow() {
return false;
}

if (enemy_iterator == Main_Data::game_enemyparty->GetEnemies().end()) {
if (enemy_iterator == visible_enemies.end()) {
battle_message_window->Clear();
if (Game_Temp::battle_first_strike && !encounter_message_first_strike) {
battle_message_window->Push(Data::terms.special_combat);
Expand Down
3 changes: 2 additions & 1 deletion src/scene_battle_rpg2k.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class Scene_Battle_Rpg2k : public Scene_Battle {
std::unique_ptr<Window_BattleMessage> battle_message_window;
std::vector<std::string> battle_result_messages;
std::vector<std::string>::iterator battle_result_messages_it;
std::vector<std::shared_ptr<Game_Enemy> >::const_iterator enemy_iterator;
std::vector<Game_Battler *> visible_enemies;
std::vector<Game_Battler *>::const_iterator enemy_iterator;
int battle_action_wait;
int battle_action_state;

Expand Down

0 comments on commit 1d5aedc

Please sign in to comment.