Moved item data constants into module ItemData

This commit is contained in:
Maruno17
2020-10-17 00:56:30 +01:00
parent 2b4f1e1aba
commit 7e627453da
10 changed files with 104 additions and 95 deletions

View File

@@ -41,7 +41,7 @@ class PokeBattle_Battle
#=============================================================================
def pbConsumeItemInBag(item,idxBattler)
return if item==0
useType = pbGetItemData(item,ITEM_BATTLE_USE)
useType = pbGetItemData(item,ItemData::BATTLE_USE)
return if !useType || useType==0 || (useType>=6 && useType<=10) # Not consumed upon use
if pbOwnedByPlayer?(idxBattler)
if !$PokemonBag.pbDeleteItem(item)
@@ -60,7 +60,7 @@ class PokeBattle_Battle
def pbReturnUnusedItemToBag(item,idxBattler)
return if item==0
useType = pbGetItemData(item,ITEM_BATTLE_USE)
useType = pbGetItemData(item,ItemData::BATTLE_USE)
return if !useType || useType==0 || (useType>=6 && useType<=10) # Not consumed upon use
if pbOwnedByPlayer?(idxBattler)
if $PokemonBag && $PokemonBag.pbCanStore?(item)

View File

@@ -70,7 +70,7 @@ class PokeBattle_Battle
b.lastMoveFailed = false # Counts as a successful move for Stomping Tantrum
item = @choices[b.index][1]
next if !item || item<=0
useType = pbGetItemData(item,ITEM_BATTLE_USE)
useType = pbGetItemData(item,ItemData::BATTLE_USE)
next if !useType
case useType
when 1, 2, 6, 7 # Use on Pokémon/Pokémon's move