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

Add Health Heuristic #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cvennel
Copy link
Owner

@cvennel cvennel commented Jun 2, 2021

Health Heuristic

Health Heuristic
@@ -46,3 +46,8 @@ def attackable_players(self):
if player.location != self.location:
attackables.append(player)
return attackables

def should_heal_self(self):
if (self.maximum_health - self.selfcurrent_health) < 5:
Copy link
Owner Author

Choose a reason for hiding this comment

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

self.selfcurrent_health should be self.current_health

I think the less than should actually be a greater than. Imagine your current health is 9. Then (self.maximum_health - self.selfcurrent_health) = 1 and you would try to heal. But then if your current health is 4 then (self.maximum_health - self.selfcurrent_health) = 6 and you would stop trying to heal

@cvennel
Copy link
Owner Author

cvennel commented Jun 2, 2021

closes #2

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