mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Merge branch 'dev' into ai
This commit is contained in:
@@ -309,16 +309,17 @@ def pbDecideWinnerEffectiveness(move, otype1, otype2, ability, scores)
|
||||
data = GameData::Move.get(move)
|
||||
return 0 if data.base_damage == 0
|
||||
atype = data.type
|
||||
typemod = Effectiveness::NORMAL_EFFECTIVE_ONE**2
|
||||
typemod = 1.0
|
||||
if ability != :LEVITATE || data.type != :GROUND
|
||||
mod1 = Effectiveness.calculate_one(atype, otype1)
|
||||
mod2 = (otype1 == otype2) ? Effectiveness::NORMAL_EFFECTIVE_ONE : Effectiveness.calculate_one(atype, otype2)
|
||||
mod1 = Effectiveness.calculate(atype, otype1)
|
||||
mod2 = (otype1 == otype2) ? 1.0 : Effectiveness.calculate(atype, otype2)
|
||||
if ability == :WONDERGUARD
|
||||
mod1 = Effectiveness::NORMAL_EFFECTIVE_ONE if mod1 <= Effectiveness::NORMAL_EFFECTIVE_ONE
|
||||
mod2 = Effectiveness::NORMAL_EFFECTIVE_ONE if mod2 <= Effectiveness::NORMAL_EFFECTIVE_ONE
|
||||
mod1 = 1.0 if !Effectiveness.super_effective?(mod1)
|
||||
mod2 = 1.0 if !Effectiveness.super_effective?(mod2)
|
||||
end
|
||||
typemod = mod1 * mod2
|
||||
end
|
||||
typemod *= 4 # Because dealing with 2 types
|
||||
return scores[0] if typemod == 0 # Ineffective
|
||||
return scores[1] if typemod == 1 # Doubly not very effective
|
||||
return scores[2] if typemod == 2 # Not very effective
|
||||
|
||||
Reference in New Issue
Block a user