Improving leader selection in land and naval battles #1889
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is meant to improve the selection of leaders in battles (ie who the game picks to be the leader, and apply their +atk and +def stats).
At the moment once a leader is chosen in a battle (whichever army starts the battle first), the leaders are more or less set in stone, and won't change even if a better leader is inserted together with another army.
The PR changes the following regarding selection logic:
1: When a new army joins the battle, it will re-calculate all the leader scores in the battle, and select the one with the highest score. This enables the player to not have to worry about which army they have to insert "first", as any "Better" generals will automatically take over once inserted.
2: The leader score calculation is changed so that it will ignore the opposite stat, ie if a leader is attacking, it will not factor in any +defence bonus in the calculation. This leads to less user frustation if they, say, have a very good attack general, but is -2 defence. This general might take over defensive battles instead of more qualified defensive generals in the same stack.