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

feat: better calcs for whether we can survive shoot ghost #1499

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

midgleyc
Copy link
Member

Description

Protonic ghosts do damage based on max HP. If we are an muscle class with high max HP and low elemental resistance, the previous calculation lead to unexpected death.

How Has This Been Tested?

Ran with it, successfully skipped and killed ghosts as expected.

Might be a bit cautious but I think it's better than dying.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have based my pull request against the main branch or have a good reason not to.

@@ -1009,3 +1009,51 @@ boolean wantToForceDrop(monster enemy)
return forceDrop;
}

boolean canSurviveShootGhost(monster enemy, int shots) {
Copy link
Member

Choose a reason for hiding this comment

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

This is nice but shouldn't expected_damage(monster) return this information rather than requiring scripts to hardcode all this individually?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so.

expected_damage(monster) says "if the monster attacks us normally, what damage do we expect to take?". The round we use Shoot Ghost, and all subsequent rounds, the ghost does more damage. But we don't know, from an expected_damage call, whether the user intends to use Shoot Ghost or not. Also, Mafia doesn't store the skills used in a particular combat, so it doesn't know whether the user has used Shoot Ghost or not.

Copy link
Member

Choose a reason for hiding this comment

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

OK fair enough.

@Malibu-Stacey Malibu-Stacey merged commit c09cb0a into loathers:main Sep 21, 2024
1 check passed
@midgleyc midgleyc deleted the better-shoot-ghost branch September 21, 2024 09:16
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.

2 participants