mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Moved item data constants into module ItemData
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,7 +7,7 @@ class PokeBattle_AI
|
||||
item, idxTarget = pbEnemyItemToUse(idxBattler)
|
||||
return false if item==0
|
||||
# Determine target of item (always the Pokémon choosing the action)
|
||||
useType = pbGetItemData(item,ITEM_BATTLE_USE)
|
||||
useType = pbGetItemData(item,ItemData::BATTLE_USE)
|
||||
if useType && (useType==1 || useType==6) # Use on Pokémon
|
||||
idxTarget = @battle.battlers[idxTarget].pokemonIndex # Party Pokémon
|
||||
end
|
||||
|
||||
@@ -200,7 +200,7 @@ class PokeBattle_Scene
|
||||
# Start Bag screen
|
||||
itemScene = PokemonBag_Scene.new
|
||||
itemScene.pbStartScene($PokemonBag,true,Proc.new { |item|
|
||||
useType = pbGetItemData(item,ITEM_BATTLE_USE)
|
||||
useType = pbGetItemData(item,ItemData::BATTLE_USE)
|
||||
next useType && useType>0
|
||||
},false)
|
||||
# Loop while in Bag screen
|
||||
@@ -211,7 +211,7 @@ class PokeBattle_Scene
|
||||
break if item==0
|
||||
# Choose a command for the selected item
|
||||
itemName = PBItems.getName(item)
|
||||
useType = pbGetItemData(item,ITEM_BATTLE_USE)
|
||||
useType = pbGetItemData(item,ItemData::BATTLE_USE)
|
||||
cmdUse = -1
|
||||
commands = []
|
||||
commands[cmdUse = commands.length] = _INTL("Use") if useType && useType!=0
|
||||
|
||||
Reference in New Issue
Block a user