More AI code for deciding when to switch

This commit is contained in:
Maruno17
2023-04-17 19:08:42 +01:00
parent 7f6f57dec3
commit d277658965
11 changed files with 468 additions and 171 deletions

View File

@@ -248,7 +248,7 @@ class Battle::Move::UserFaintsExplosive
def pbMoveFailed?(user, targets)
if @battle.rules["selfkoclause"]
# Check whether no unfainted Pokemon remain in either party
count = @battle.pbAbleNonActiveCount(user.idxOwnSide)
count = @battle.pbAbleNonActiveCount(user.idxOwnSide)
count += @battle.pbAbleNonActiveCount(user.idxOpposingSide)
if count == 0
@battle.pbDisplay("But it failed!")
@@ -257,7 +257,7 @@ class Battle::Move::UserFaintsExplosive
end
if @battle.rules["selfdestructclause"]
# Check whether no unfainted Pokemon remain in either party
count = @battle.pbAbleNonActiveCount(user.idxOwnSide)
count = @battle.pbAbleNonActiveCount(user.idxOwnSide)
count += @battle.pbAbleNonActiveCount(user.idxOpposingSide)
if count == 0
@battle.pbDisplay(_INTL("{1}'s team was disqualified!", user.pbThis))