def pbTypeModifier(type,attacker,opponent) [COLOR=Green]# in PokeBattle_Move[/COLOR]
return [COLOR=Red]8[/COLOR] if type<0 [COLOR=Green]# return normally effective if the move's type is not defined--this line
# prevents some error messages that would end execution[/COLOR]
return [COLOR=Red]8[/COLOR] if isConst?(type,PBTypes,:GROUND) && opponent.pbHasType?(:FLYING) &&
opponent.hasWorkingItem(:IRONBALL) [COLOR=Green]# return normally effective if the move's type
# is Ground and the opponent has Flying as a type as well as an Iron Ball equipped
# (the function calls above may differ depending on your version of Essentials--mine is v15.1)[/COLOR]
... [COLOR=Green]# the rest of the function
[COLOR=Black] return mod1*mod2[COLOR=Red]*mod3[/COLOR][/COLOR]
[/COLOR] end
def pbTypeModMessages(type,attacker,opponent) [COLOR=Green]# in PokeBattle_Move[/COLOR]
return [COLOR=Red]8[/COLOR] if type<0
... [COLOR=Green]# the rest of the function
[/COLOR] end
[COLOR=Green]# the following is in PBTypes_Extra[/COLOR]
def PBTypes.isNotVeryEffective?(attackType,opponentType1,opponentType2=nil[COLOR=Red],opponentType3=nil[/COLOR])
e=PBTypes.getCombinedEffectiveness(attackType,opponentType1,opponentType2[COLOR=Red],opponentType3[/COLOR])
return e>0 && e<[COLOR=Red]8[/COLOR]
end
def PBTypes.isNormalEffective?(attackType,opponentType1,opponentType2=nil[COLOR=Red],opponentType3=nil[/COLOR])
e=PBTypes.getCombinedEffectiveness(attackType,opponentType1,opponentType2[COLOR=Red],opponentType3[/COLOR])
return e==[COLOR=Red]8[/COLOR]
end
def PBTypes.isIneffective?(attackType,opponentType1,opponentType2=nil[COLOR=Red],opponentType3=nil[/COLOR])
e=PBTypes.getCombinedEffectiveness(attackType,opponentType1,opponentType2[COLOR=Red],opponentType3[/COLOR])
return e==0
end
def PBTypes.isSuperEffective?(attackType,opponentType1,opponentType2=nil[COLOR=Red],opponentType3=nil[/COLOR])
e=PBTypes.getCombinedEffectiveness(attackType,opponentType1,opponentType2[COLOR=Red],opponentType3[/COLOR])
return e>[COLOR=Red]8[/COLOR]
end