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

Refactor fleet missions' code | Part 14 | Moon creation refactor #120

Merged
merged 19 commits into from
May 26, 2020

Conversation

mdziekon
Copy link
Owner

Summary:

All three possible combat missions (MissionAttack, MissionDestruction & MissionGroupAttack) share almost the same mechanism of moon creation and statistics update related to that event. This mechanism should be implemented in just one place and shared among them.

Changelog:

  • Move moon creation roll (calculating whether the moon has been created or not based on random roll) to a helper function
  • Simplify moon creation code in all attack missions
  • Fix a bug in regular & destruction attacks, where with moon creation chance below the max. 20%, the percentages would not be recorded towards one of the Tasks (key BATTLE_WINORDRAW_SOLO_TOTALLIMIT)
  • CreateOneMoonRecord.php has been refactored to simplify its branching
  • Admin's Add Moon page has been refactored in its rendering and command handling code

Notes:

  • A minor bug has been found in the destruction mission, where even though a moon has a chance to be created again after a successful destruction, it's not being created. The cause is pretty simple - the moon creator function (CreateOneMoonRecord) is not aware that it should skip the "moon existence" check, because the destruction was not yet applied to the DB.

Related issues or PRs:

@mdziekon mdziekon added pr:bugfix All pull requests related to fixing bugs pr:enhancement_request All pull requests related to enhancements proposals labels May 26, 2020
@mdziekon mdziekon merged commit 51ac64a into master May 26, 2020
@mdziekon mdziekon added this to Done in Basic modernisation via automation May 26, 2020
@mdziekon mdziekon deleted the mdziekon/91/fleet-mission-attack-refactor-part14 branch August 1, 2020 19:53
@mdziekon mdziekon added this to In progress in Flight Control refactor via automation Apr 8, 2022
@mdziekon mdziekon removed this from Done in Basic modernisation Apr 8, 2022
@mdziekon mdziekon moved this from In progress to Done in Flight Control refactor Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix All pull requests related to fixing bugs pr:enhancement_request All pull requests related to enhancements proposals
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant