botbowl icon indicating copy to clipboard operation
botbowl copied to clipboard

OutcomeType.CASUALTY reported twice when casualty is inflicted

Open mrbermell opened this issue 3 years ago • 0 comments

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 avatar Jan 10 '22 23:01 mrbermell