mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Fixed X items not working, fixed Knock Off being able to remove usable Mega Stones
This commit is contained in:
@@ -485,7 +485,7 @@ class Battle
|
||||
|
||||
# This method only counts the player's Pokémon, not a partner trainer's.
|
||||
def pbPlayerBattlerCount
|
||||
return allSameSideBattlers(idxBattler).select { |b| b.pbOwnedByPlayer? }.length
|
||||
return allSameSideBattlers.select { |b| b.pbOwnedByPlayer? }.length
|
||||
end
|
||||
|
||||
def pbCheckGlobalAbility(abil)
|
||||
|
||||
@@ -431,19 +431,20 @@ class Battle::Battler
|
||||
# Returns whether the specified item will be unlosable for this Pokémon.
|
||||
def unlosableItem?(check_item)
|
||||
return false if !check_item
|
||||
return true if GameData::Item.get(check_item).is_mail?
|
||||
item_data = GameData::Item.get(check_item)
|
||||
return true if item_data.is_mail?
|
||||
return false if @effects[PBEffects::Transform]
|
||||
# Items that change a Pokémon's form
|
||||
if mega? # Check if item was needed for this Mega Evolution
|
||||
return true if @pokemon.species_data.mega_stone == check_item
|
||||
return true if @pokemon.species_data.mega_stone == item_data.id
|
||||
else # Check if item could cause a Mega Evolution
|
||||
GameData::Species.each do |data|
|
||||
next if data.species != @species || data.unmega_form != @form
|
||||
return true if data.mega_stone == check_item
|
||||
return true if data.mega_stone == item_data.id
|
||||
end
|
||||
end
|
||||
# Other unlosable items
|
||||
return GameData::Item.get(check_item).unlosable?(@species, self.ability)
|
||||
return item_data.unlosable?(@species, self.ability)
|
||||
end
|
||||
|
||||
def eachMove
|
||||
|
||||
Reference in New Issue
Block a user