mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Fixed error in PokeBattle_Battler#pbHasMoveType?
This commit is contained in:
@@ -384,13 +384,13 @@ class PokeBattle_Battler
|
||||
alias hasWorkingItem hasActiveItem?
|
||||
|
||||
# Returns whether the specified item will be unlosable for this Pokémon.
|
||||
def unlosableItem?(item)
|
||||
return false if item<=0
|
||||
return true if pbIsMail?(item)
|
||||
def unlosableItem?(check_item)
|
||||
return false if check_item <= 0
|
||||
return true if pbIsMail?(check_item)
|
||||
return false if @effects[PBEffects::Transform]
|
||||
# Items that change a Pokémon's form
|
||||
return true if @pokemon && @pokemon.getMegaForm(true) > 0 # Mega Stone
|
||||
return pbIsUnlosableItem?(item,@species,@ability)
|
||||
return pbIsUnlosableItem?(check_item, @species, @ability)
|
||||
end
|
||||
|
||||
def eachMove
|
||||
@@ -401,22 +401,22 @@ class PokeBattle_Battler
|
||||
@moves.each_with_index { |m, i| yield m, i if m && m.id != 0 }
|
||||
end
|
||||
|
||||
def pbHasMove?(id)
|
||||
id = getID(PBMoves,id)
|
||||
return false if !id || id<=0
|
||||
eachMove { |m| return true if m.id==id }
|
||||
def pbHasMove?(move_id)
|
||||
move_id = getID(PBMoves, move_id)
|
||||
return false if !move_id || move_id <= 0
|
||||
eachMove { |m| return true if m.id == move_id }
|
||||
return false
|
||||
end
|
||||
|
||||
def pbHasMoveType?(type)
|
||||
type = getConst(PBTypes,type)
|
||||
return false if !type || type<0
|
||||
eachMove { |m| return true if m.type==type }
|
||||
def pbHasMoveType?(check_type)
|
||||
check_type = getConst(PBTypes, check_type)
|
||||
return false if !check_type || check_type < 0
|
||||
eachMove { |m| return true if m.type == check_type }
|
||||
return false
|
||||
end
|
||||
|
||||
def pbHasMoveFunction?(*arg)
|
||||
return false if !code
|
||||
return false if !arg
|
||||
eachMove do |m|
|
||||
arg.each { |code| return true if m.function == code }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user