MCPcopy Create free account
hub / github.com/AxlLind/AdventOfCode / dmg_against

Method dmg_against

2018/src/24.py:34–39  ·  view source on GitHub ↗
(self, u: 'Unit')

Source from the content-addressed store, hash-verified

32 return self.units * self.dmg
33
34 def dmg_against(self, u: 'Unit') -> int:
35 if self.dmgtype in u.immunities:
36 return 0
37 if self.dmgtype in u.weaknesses:
38 return self.dmg * 2 * self.units
39 return self.dmg * self.units
40
41def choose_targets(attackers: list[Unit], defenders: list[Unit]) -> dict[int,int]:
42 targets = dict[int,int]()

Callers 2

choose_targetsFunction · 0.80
fightFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected