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

Fixes #3727 Magma crust breakthrough and liquid magma damage not working as expected #3991

Merged
merged 5 commits into from
Nov 28, 2022

Conversation

pheonixstorm
Copy link
Collaborator

From the original report, A is fixed. Magma crust breaking will only get checked per hex, not per moveStep. The popup showed the correct number but processMovement did not know this rule. In fact in testing this, this has been a bug since at least 0.47 and possibly before.

Per rules on p34/35 TO:AR damage should be applied if a mech starts its turn in magma, walks into a magma hex, or breaks a crust hex. Additionally, if a unit starts and ends its turn in a magma hex it should take additional damage.

TODO: units starting and ending their movement in a magma hex should take additional damage
units walking into a magma hex should not make a bog down check. RAW only mention jumping into the hex needing a bog down roll.

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Base: 23.05% // Head: 23.04% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (84155d5) compared to base (f26446a).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3991      +/-   ##
============================================
- Coverage     23.05%   23.04%   -0.01%     
  Complexity     4813     4813              
============================================
  Files          2263     2263              
  Lines        248456   248534      +78     
  Branches      46183    46199      +16     
============================================
  Hits          57283    57283              
- Misses       189714   189792      +78     
  Partials       1459     1459              
Impacted Files Coverage Δ
megamek/src/megamek/server/GameManager.java 0.22% <0.00%> (-0.01%) ⬇️
megamek/src/megamek/server/ServerHelper.java 0.00% <0.00%> (ø)
...rc/megamek/common/weapons/battlearmor/ISBARL5.java 96.42% <0.00%> (-3.58%) ⬇️
...ek/common/weapons/battlearmor/ISBAPlasmaRifle.java 96.42% <0.00%> (-3.58%) ⬇️
...rc/megamek/common/weapons/battlearmor/ISBARL1.java 96.66% <0.00%> (-3.34%) ⬇️
...rc/megamek/common/weapons/battlearmor/ISBARL2.java 96.66% <0.00%> (-3.34%) ⬇️
...rc/megamek/common/weapons/battlearmor/ISBARL3.java 96.66% <0.00%> (-3.34%) ⬇️
...rc/megamek/common/weapons/battlearmor/ISBARL4.java 96.66% <0.00%> (-3.34%) ⬇️
...rc/megamek/common/weapons/battlearmor/CLBALBX.java 64.44% <0.00%> (-1.47%) ⬇️
megamek/src/megamek/client/ui/swing/ClientGUI.java 0.00% <0.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…xtra 2d6 damage. Also added report to reflect this.
Moved checkEnteringMagma into if statement to stop turning from causing additional magma damage
@pheonixstorm pheonixstorm changed the title (WIP) Fixes #3727 Magma crust breakthrough and liquid magma damage not working as expected Fixes #3727 Magma crust breakthrough and liquid magma damage not working as expected Nov 22, 2022
@pheonixstorm
Copy link
Collaborator Author

The bugs have been fixed. I will split the Bog down changes into its own PR once some of the other coders are around to help me understand the code better.

This can be reviewed and approved at any time now.

Copy link
Member

@NickAragua NickAragua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, one question.

*/
public static void checkEnteringMagma(Hex hex, int elevation, Entity entity, GameManager gameManager) {

if ((hex.terrainLevel(Terrains.MAGMA) == 2) && (elevation == 0) && (entity.getMovementMode() != EntityMovementMode.HOVER)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this cause airborne aerospace units to take magma damage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the code is a near copy of the crust check code at line 431. I also tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants