Generalised a species' types to allow any number of types

This commit is contained in:
Maruno17
2022-12-31 17:24:33 +00:00
parent 3a4b01e2dc
commit 3fe324d0da
24 changed files with 200 additions and 203 deletions

View File

@@ -51,10 +51,13 @@ class TriadCard
end
def bonus(opponent)
case Effectiveness.calculate_one(@type, opponent.type)
when Effectiveness::INEFFECTIVE then return -2
when Effectiveness::NOT_VERY_EFFECTIVE_ONE then return -1
when Effectiveness::SUPER_EFFECTIVE_ONE then return 1
effectiveness = Effectiveness.calculate(@type, opponent.type)
if Effectiveness.ineffective?(effectiveness)
return -2
elsif Effectiveness.not_very_effective?(effectiveness)
return -1
elsif Effectiveness.super_effective?(effectiveness)
return 1
end
return 0
end