mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +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.
|
# This method only counts the player's Pokémon, not a partner trainer's.
|
||||||
def pbPlayerBattlerCount
|
def pbPlayerBattlerCount
|
||||||
return allSameSideBattlers(idxBattler).select { |b| b.pbOwnedByPlayer? }.length
|
return allSameSideBattlers.select { |b| b.pbOwnedByPlayer? }.length
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCheckGlobalAbility(abil)
|
def pbCheckGlobalAbility(abil)
|
||||||
|
|||||||
@@ -431,19 +431,20 @@ class Battle::Battler
|
|||||||
# Returns whether the specified item will be unlosable for this Pokémon.
|
# Returns whether the specified item will be unlosable for this Pokémon.
|
||||||
def unlosableItem?(check_item)
|
def unlosableItem?(check_item)
|
||||||
return false if !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]
|
return false if @effects[PBEffects::Transform]
|
||||||
# Items that change a Pokémon's form
|
# Items that change a Pokémon's form
|
||||||
if mega? # Check if item was needed for this Mega Evolution
|
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
|
else # Check if item could cause a Mega Evolution
|
||||||
GameData::Species.each do |data|
|
GameData::Species.each do |data|
|
||||||
next if data.species != @species || data.unmega_form != @form
|
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
|
||||||
end
|
end
|
||||||
# Other unlosable items
|
# Other unlosable items
|
||||||
return GameData::Item.get(check_item).unlosable?(@species, self.ability)
|
return item_data.unlosable?(@species, self.ability)
|
||||||
end
|
end
|
||||||
|
|
||||||
def eachMove
|
def eachMove
|
||||||
|
|||||||
Reference in New Issue
Block a user