Fixed Battle Tower/Cups/Palace, fixed bug when using Metronome, fixed bad AI for Conversion/Conversion 2

This commit is contained in:
Maruno17
2021-05-04 20:36:49 +01:00
parent b563e73027
commit 3d88b85f56
10 changed files with 151 additions and 140 deletions

View File

@@ -1311,23 +1311,25 @@ class PokeBattle_AI
end
#---------------------------------------------------------------------------
when "05E"
if user.ability == :MULTITYPE || user.ability == :RKSSYSTEM
if !user.canChangeType?
score -= 90
else
types = []
user.eachMove do |m|
next if m.id==@id
has_possible_type = false
user.eachMoveWithIndex do |m,i|
break if Settings::MECHANICS_GENERATION >= 6 && i>0
next if GameData::Type.get(m.type).pseudo_type
next if user.pbHasType?(m.type)
types.push(m.type) if !types.include?(m.type)
has_possible_type = true
break
end
score -= 90 if types.length==0
score -= 90 if !has_possible_type
end
#---------------------------------------------------------------------------
when "05F"
if user.ability == :MULTITYPE || user.ability == :RKSSYSTEM
if !user.canChangeType?
score -= 90
elsif !target.lastMoveUsed || GameData::Move.get(target.lastMoveUsed).pseudo_type
elsif !target.lastMoveUsed || !target.lastMoveUsedType ||
GameData::Type.get(target.lastMoveUsedType).pseudo_type
score -= 90
else
aType = nil
@@ -1339,13 +1341,14 @@ class PokeBattle_AI
if !aType
score -= 90
else
types = []
has_possible_type = false
GameData::Type.each do |t|
next if t.pseudo_type || user.pbHasType?(t.id) ||
!Effectiveness.resistant_type?(aType, t.id)
types.push(t.id)
!Effectiveness.resistant_type?(target.lastMoveUsedType, t.id)
has_possible_type = true
break
end
score -= 90 if types.length==0
score -= 90 if !has_possible_type
end
end
#---------------------------------------------------------------------------