Hi, I have been doing some edits on how pokemon are stored when they are captured.
It involves a limited local storage rather than magically teleporting a pokemon to the magical storage system.
While testing this, I came over something that I think is a bug.
When using a pokeball while in battle, and the storage is full - the ball is still consumed, even though the warning is shown, and thus the Itemhandeler returns false, meaning that the ball is not supposed to be consumed.
I re-wrote the Itemhandeler for the pokeballs to use my new feature, and seeing as the warning shows up, and the ball is not thrown, then it cannot be any problems with my edit.
Any idea for why the ball is still consumed?
Is it supposed to be?
How can I fix it?
edited item-handeler for pokeballs:
It involves a limited local storage rather than magically teleporting a pokemon to the magical storage system.
While testing this, I came over something that I think is a bug.
When using a pokeball while in battle, and the storage is full - the ball is still consumed, even though the warning is shown, and thus the Itemhandeler returns false, meaning that the ball is not supposed to be consumed.
I re-wrote the Itemhandeler for the pokeballs to use my new feature, and seeing as the warning shows up, and the ball is not thrown, then it cannot be any problems with my edit.
Any idea for why the ball is still consumed?
Is it supposed to be?
How can I fix it?
edited item-handeler for pokeballs:
Spoiler:
Code:
ItemHandlers::BattleUseOnBattler.addIf(proc{|item|
pbIsPokeBall?(item)},proc{|item,battler,scene| # Any Poké Ball
battle=battler.battle
if battler.pbOpposing1.hp>0 && battler.pbOpposing2.hp>0
if !pbIsSnagBall?(item)
scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!"))
return false
end
end
#KVAGRAM-EDIT--START--
if battle.pbPlayer.party.length>=6
msu_count = $PokemonStorage.getMSUspace
if (msu_count == 0)
scene.pbDisplay(_INTL("The MSU is full, it can not hold any more!"))
scene.pbDisplay(_INTL("You need to empty the MSU in a pokemon-bank."))
return false
elsif(msu_count < 0)
scene.pbDisplay(_INTL("You cannot hold more than 6 pokemon."))
scene.pbDisplay(_INTL("If only there was a way to hold more."))
return false
end
end
#KVAGRAM-EDIT----END--
#old code - kept for documentaion:
#if battle.pbPlayer.party.length>=6 && $PokemonStorage.full?
# scene.pbDisplay(_INTL("There is no room left in the PC!"))
# return false
#end
return true
})