mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Refactored PokeBattle_Pokemon#hasItem?
This commit is contained in:
@@ -594,11 +594,12 @@ class PokeBattle_Pokemon
|
|||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Items
|
# Items
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Returns whether this Pokémon has a hold item.
|
# Returns whether this Pokémon is holding an item. If an item id is passed,
|
||||||
def hasItem?(value=0)
|
# returns whether the Pokémon is holding that item.
|
||||||
itm = self.item
|
def hasItem?(item = 0)
|
||||||
return itm>0 if value==0
|
held_item = self.item
|
||||||
return itm==getID(PBItems,value)
|
return held_item > 0 if item == 0
|
||||||
|
return held_item == getID(PBItems,item)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sets this Pokémon's item. Accepts symbols.
|
# Sets this Pokémon's item. Accepts symbols.
|
||||||
|
|||||||
Reference in New Issue
Block a user