Coded some Gen 9 ability/item/move effects

This commit is contained in:
Maruno17
2024-06-15 15:58:31 +01:00
parent 454d5a216a
commit 22b33ca6c2
35 changed files with 596 additions and 234 deletions

View File

@@ -484,8 +484,10 @@ class Battle
return allSameSideBattlers.select { |b| b.pbOwnedByPlayer? }.length
end
def pbCheckGlobalAbility(abil)
allBattlers.each { |b| return b if b.hasActiveAbility?(abil) }
def pbCheckGlobalAbility(abil, check_mold_breaker = false)
allBattlers.each do |b|
return b if b.hasActiveAbility?(abil) && (!check_mold_breaker || !b.beingMoldBroken?)
end
return nil
end
@@ -497,6 +499,13 @@ class Battle
return nil
end
# Returns an array containing the IDs of all active abilities.
def pbAllActiveAbilities
ret = []
allBattlers.each { |b| ret.push(b.ability_id) if b.abilityActive? }
return ret
end
# Given a battler index, and using battle side sizes, returns an array of
# battler indices from the opposing side that are in order of most "opposite".
# Used when choosing a target and pressing up/down to move the cursor to the