mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Generalised a species' types to allow any number of types
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user