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

OutcomeType.CASUALTY reported twice when casualty is inflicted #199

Open
mrbermell opened this issue Jan 10, 2022 · 0 comments
Open

OutcomeType.CASUALTY reported twice when casualty is inflicted #199

mrbermell opened this issue Jan 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mrbermell
Copy link
Collaborator

Both Injury-procedure and Casualty procedure reports the outcome type CASUALTY. Since this particular outcome is used to calculate reward in a2c this behavior is a bit off. I propose we add a new outcome type called CASUALTY_TYPE or similar to be used in the Casualty-procedure.

Current implementation:

class Injury(Procedure):
    def step(self, action):
        # .... 
        if roll.get_result() >= 10:
            self.game.report(Outcome(OutcomeType.CASUALTY, player=self.player, opp_player=self.inflictor, rolls=[roll]))

class Casualty(Procedure):
    def step(self, action):
        # ... 
        if self.roll is None:
            # ... 
            self.game.report(Outcome(OutcomeType.CASUALTY, player=self.player, opp_player=self.inflictor, team=self.player.team, n=self.effect.name, rolls=cas_rolls))
@mrbermell mrbermell added the bug Something isn't working label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant