mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Removed being able to give an item to a Pokémon while in item storage
This commit is contained in:
@@ -597,49 +597,24 @@ class PokemonBagScreen
|
|||||||
loop do
|
loop do
|
||||||
item = @scene.pbChooseItem
|
item = @scene.pbChooseItem
|
||||||
break if item==0
|
break if item==0
|
||||||
commands = [_INTL("Withdraw"),_INTL("Give"),_INTL("Cancel")]
|
qty = storage.pbQuantity(item)
|
||||||
itemname = PBItems.getName(item)
|
if qty>1 && !pbIsImportantItem?(item)
|
||||||
command = @scene.pbShowCommands(_INTL("{1} is selected.",itemname),commands)
|
qty = @scene.pbChooseNumber(_INTL("How many do you want to withdraw?"),qty)
|
||||||
if command==0 # Withdraw
|
end
|
||||||
qty = storage.pbQuantity(item)
|
next if qty<=0
|
||||||
if qty>1 && !pbIsImportantItem?(item)
|
if @bag.pbCanStore?(item,qty)
|
||||||
qty = @scene.pbChooseNumber(_INTL("How many do you want to withdraw?"),qty)
|
if !storage.pbDeleteItem(item,qty)
|
||||||
|
raise "Can't delete items from storage"
|
||||||
end
|
end
|
||||||
if qty>0
|
if !@bag.pbStoreItem(item,qty)
|
||||||
if !@bag.pbCanStore?(item,qty)
|
raise "Can't withdraw items from storage"
|
||||||
pbDisplay(_INTL("There's no more room in the Bag."))
|
|
||||||
else
|
|
||||||
if !storage.pbDeleteItem(item,qty)
|
|
||||||
raise "Can't delete items from storage"
|
|
||||||
end
|
|
||||||
if !@bag.pbStoreItem(item,qty)
|
|
||||||
raise "Can't withdraw items from storage"
|
|
||||||
end
|
|
||||||
@scene.pbRefresh
|
|
||||||
dispqty = (pbIsImportantItem?(item)) ? 1 : qty
|
|
||||||
itemname = PBItems.getNamePlural(item) if dispqty>1
|
|
||||||
pbDisplay(_INTL("Withdrew {1} {2}.",dispqty,itemname))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
elsif command==1 # Give
|
|
||||||
if $Trainer.pokemonCount==0
|
|
||||||
@scene.pbDisplay(_INTL("There is no Pokémon."))
|
|
||||||
return 0
|
|
||||||
elsif pbIsImportantItem?(item)
|
|
||||||
@scene.pbDisplay(_INTL("The {1} can't be held.",itemname))
|
|
||||||
else
|
|
||||||
pbFadeOutIn {
|
|
||||||
sscene = PokemonParty_Scene.new
|
|
||||||
sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
|
|
||||||
if sscreen.pbPokemonGiveScreen(item)
|
|
||||||
# If the item was held, delete the item from storage
|
|
||||||
if !storage.pbDeleteItem(item,1)
|
|
||||||
raise "Can't delete item from storage"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@scene.pbRefresh
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
@scene.pbRefresh
|
||||||
|
dispqty = (pbIsImportantItem?(item)) ? 1 : qty
|
||||||
|
itemname = (dispqty>1) ? PBItems.getNamePlural(item) : PBItems.getName(item)
|
||||||
|
pbDisplay(_INTL("Withdrew {1} {2}.",dispqty,itemname))
|
||||||
|
else
|
||||||
|
pbDisplay(_INTL("There's no more room in the Bag."))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@scene.pbEndScene
|
@scene.pbEndScene
|
||||||
|
|||||||
Reference in New Issue
Block a user