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

Initial Enemy appearance message: Only visible enemies. #1370

Merged
merged 1 commit into from Jun 17, 2018

Conversation

Projects
None yet
3 participants
@Albeleon
Member

Albeleon commented Jun 5, 2018

This PR intends for, in the initial messages about enemy appearances, not including the ones that are hidden just like RM2000. For this:

    - A "Game_EnemyParty::GetVisibleEnemies" function is created.
    - A variable with the visible enemies is initialized right after "enemies" and saved in .cpp. Here I'm not sure whether it should be a private attribute in the header instead, please tell me which one is better.
    - Change in Scene_Battle_Rpg2k the references to GetEnemies for GetVisibleEnemies.
@Ghabry

This comment has been minimized.

Member

Ghabry commented Jun 6, 2018

I don't think this new function is necessary. Instead you could use the function GetActiveBattlers of Game_Party_Base which handles Hidden & Dead.

Initial Enemy appearance message: Only visible enemies.
This PR intends for, in the initial messages about enemy appearances, not including the ones that are hidden just like RM2000. For this:

        - The variable enemy_iterator has changed from std::vector<std::shared_ptr<Game_Enemy>>::const_iterator to std::vector<Game_Battler *>::const_iterator
        - A new protected variable called "visible_enemies" has been added. It will be initialized when the first message is going to be displayed. This will be used by all functions instead of GetEnemies.
@Albeleon

This comment has been minimized.

Member

Albeleon commented Jun 6, 2018

I tested with GetBattlers and while I have to create a protected variable for the Visible Enemies for the functions to refer to (or else each time GetBattlers is invoked it will be a different address, which would result in an error when trying to make an equivalence with their iterators), this way it's only one extra variable in scene_battle2k instead of adding anything redundant in Game_Enemyparty, and it works the same. Thanks for the suggestion.

@Ghabry

Ghabry approved these changes Jun 6, 2018

@carstene1ns carstene1ns added this to the 0.5.4 milestone Jun 17, 2018

@carstene1ns carstene1ns added the Battle label Jun 17, 2018

@carstene1ns carstene1ns merged commit 1d5aedc into EasyRPG:master Jun 17, 2018

7 checks passed

Android (armeabi-v7a) Build finished.
Details
GCW0 Build finished.
Details
GNU/Linux Build finished.
Details
OSX Build finished.
Details
Windows (x64) Build finished.
Details
Windows (x86) Build finished.
Details
web Build finished.
Details

@Albeleon Albeleon deleted the Albeleon:battle branch Jun 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment