mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Merged species Type1/Type2 into Types, did the same for Pokemon and Battler
This commit is contained in:
@@ -2458,8 +2458,8 @@ class Battle::AI
|
||||
when "UseTargetDefenseInsteadOfTargetSpDef"
|
||||
#---------------------------------------------------------------------------
|
||||
when "FailsUnlessTargetSharesTypeWithUser"
|
||||
if !target.pbHasType?(user.type1) &&
|
||||
!target.pbHasType?(user.type2)
|
||||
if !(user.types[0] && target.pbHasType?(user.types[0])) &&
|
||||
!(user.types[1] && target.pbHasType?(user.types[1]))
|
||||
score -= 90
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@@ -82,10 +82,10 @@ class Battle::AI
|
||||
# For switching. Determines the effectiveness of a potential switch-in against
|
||||
# an opposing battler.
|
||||
def pbCalcTypeModPokemon(battlerThis,_battlerOther)
|
||||
mod1 = Effectiveness.calculate(battlerThis.type1,target.type1,target.type2)
|
||||
mod1 = Effectiveness.calculate(battlerThis.types[0], target.types[0], target.types[1])
|
||||
mod2 = Effectiveness::NORMAL_EFFECTIVE
|
||||
if battlerThis.type1!=battlerThis.type2
|
||||
mod2 = Effectiveness.calculate(battlerThis.type2,target.type1,target.type2)
|
||||
if battlerThis.types.length > 1
|
||||
mod2 = Effectiveness.calculate(battlerThis.types[1], target.types[0], target.types[1])
|
||||
mod2 = mod2.to_f / Effectivenesss::NORMAL_EFFECTIVE
|
||||
end
|
||||
return mod1*mod2
|
||||
@@ -275,7 +275,7 @@ class Battle::AI
|
||||
baseDmg = (baseDmg.to_f*mult/Effectiveness::NORMAL_EFFECTIVE).round
|
||||
else
|
||||
mult = Effectiveness.calculate(:FLYING,
|
||||
target.type1,target.type2,target.effects[PBEffects::Type3])
|
||||
target.types[0], target.types[1], target.effects[PBEffects::Type3])
|
||||
baseDmg = (baseDmg.to_f*mult/Effectiveness::NORMAL_EFFECTIVE).round
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user