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

dont allow bot to deploy industrial mech in to water depth 2 or greater #4764

Merged
merged 6 commits into from
Sep 21, 2023

Conversation

kuronekochomusuke
Copy link
Collaborator

@kuronekochomusuke kuronekochomusuke commented Sep 9, 2023

  • dont allow bot to deploy industrial mech in to water depth 2 or greater
  • add isLocationDeadly() for locations that can be delployed or moved into, but being in them is deadly. So it is a bad idea for the bot to delploy to them.
  • highlight deadly deployment positions for players industrial mech in to water depth 2 or greater
  • princess try to get out of water when flagged to die
  • dont destroy unit if they get out of water

image
image

fixes #4550

@kuronekochomusuke kuronekochomusuke marked this pull request as draft September 9, 2023 18:11
@kuronekochomusuke kuronekochomusuke added the In Development (Draft) An additional way to mark something as a draft. Make it stand out more. label Sep 9, 2023
@kuronekochomusuke kuronekochomusuke marked this pull request as ready for review September 16, 2023 18:17
@kuronekochomusuke kuronekochomusuke removed the In Development (Draft) An additional way to mark something as a draft. Make it stand out more. label Sep 16, 2023
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 good. A couple of questions.

&& !movingUnit.hasEnvironmentalSealing()
&& (movingUnit.getEngine().getEngineType() == Engine.COMBUSTION_ENGINE)
&& hex.depth() >= 2
&& step.equals(lastStep)) {
Copy link
Member

Choose a reason for hiding this comment

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

So a mech can move through super deep water and not flood the engine as long as it ends the movement with the engine above water?

Copy link
Collaborator

@gsparks3 gsparks3 Sep 17, 2023

Choose a reason for hiding this comment

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

The full rules from the footnote on TW page 52 are interesting, and unusual compared to the rules for various other non-fully-sealed units winding up underwater. To stay underwater indefinitely, Industrialmechs need environmental sealing and an underwater-capable engine type. However, IMs that don't meet these requirements can still enter a hex where they will be fully underwater, but they are destroyed if they remain fully underwater in the end phase of the turn after they initially entered the water. In other words, a non-sealed ICE IM could walk into depth 2 water and end its movement there on one turn and survive as long as it managed to climb out the next turn. They would be considered destroyed if they failed to leave the deep water after one turn.

Copy link
Member

Choose a reason for hiding this comment

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

Heh, so maybe then the criteria should be "if the move path both starts and ends under water", rather than just "if the move path ends under water".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think going into depth 2 water is also dangerous, so it should be weighted also. you many not be allowed to move out of it and end up dead earlier than if you were out of water.

I should also add a smaller weight for going into depth 1 water, since if you then go prone there for 2 rounds you will die.

* Returns true if the specified hex contains some sort of deadly
* terrain.
*/
public boolean isLocationDeadly(Coords c) {
Copy link
Member

Choose a reason for hiding this comment

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

I assume implementing this for other unit types is a "future development" type thing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea, also to make it similar to isLocationProhibited()

@NickAragua NickAragua merged commit 99db8a0 into MegaMek:master Sep 21, 2023
4 checks passed
@kuronekochomusuke kuronekochomusuke deleted the isLocationDeadly branch October 25, 2023 22:12
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.

Princess should not deploy units underwater that cannot survive there
3 participants