Fixed partner trainers not having Bag items, fixed Flame Burst AI bug, added AI for Wonder Guard + switching

This commit is contained in:
Maruno17
2023-11-20 21:29:47 +00:00
parent d10892af47
commit e0dcdef321
7 changed files with 37 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ class Battle
end
else
items = pbGetOwnerItems(idxBattler)
items.delete_at(items.index(item))
items.delete_at(items.index(item)) if items
end
end

View File

@@ -81,7 +81,9 @@ class Battle
@mega_rings.each { |item| return GameData::Item.get(item).name if $bag.has?(item) }
else
trainer_items = pbGetOwnerItems(idxBattler)
@mega_rings.each { |item| return GameData::Item.get(item).name if trainer_items&.include?(item) }
if trainer_items
@mega_rings.each { |item| return GameData::Item.get(item).name if trainer_items.include?(item) }
end
end
end
return _INTL("Mega Ring")