More rewrites of AI for some function codes

This commit is contained in:
Maruno17
2022-11-08 22:54:16 +00:00
parent b31400b9ae
commit 8f014135e5
4 changed files with 201 additions and 70 deletions

View File

@@ -872,7 +872,7 @@ class Battle::Move::AddGhostTypeToTarget < Battle::Move
def canMagicCoat?; return true; end
def pbFailsAgainstTarget?(user, target, show_message)
if !GameData::Type.exists?(:GHOST) || target.pbHasType?(:GHOST) || !target.canChangeType?
if !target.canChangeType? || !GameData::Type.exists?(:GHOST) || target.pbHasType?(:GHOST)
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end
@@ -893,7 +893,7 @@ class Battle::Move::AddGrassTypeToTarget < Battle::Move
def canMagicCoat?; return true; end
def pbFailsAgainstTarget?(user, target, show_message)
if !GameData::Type.exists?(:GRASS) || target.pbHasType?(:GRASS) || !target.canChangeType?
if !target.canChangeType? || !GameData::Type.exists?(:GRASS) || target.pbHasType?(:GRASS)
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
end