mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
ability ball & incubators fix
This commit is contained in:
@@ -59,7 +59,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
|
||||
def pbReturnUnusedItemToBag(item,idxBattler)
|
||||
return if item!
|
||||
return if !item
|
||||
useType = GameData::Item.get(item).battle_use
|
||||
return if useType==0 || (useType>=6 && useType<=10) # Not consumed upon use
|
||||
if pbOwnedByPlayer?(idxBattler)
|
||||
|
||||
@@ -537,7 +537,8 @@ def pbUseItem(bag, item, bagscene = nil)
|
||||
break
|
||||
end
|
||||
pkmn = $Trainer.party[chosen]
|
||||
if pbCheckUseOnPokemon(item, pkmn, screen)
|
||||
if
|
||||
pbCheckUseOnPokemon(item, pkmn, screen)
|
||||
ret = ItemHandlers.triggerUseOnPokemon(item, pkmn, screen)
|
||||
if ret && useType == 1 # Usable on Pokémon, consumed
|
||||
bag.pbDeleteItem(item)
|
||||
@@ -633,7 +634,7 @@ def pbUseItemMessage(item)
|
||||
end
|
||||
|
||||
def pbCheckUseOnPokemon(_item, pkmn, _screen)
|
||||
return pkmn && !pkmn.egg?
|
||||
return pkmn #&& !pkmn.egg?
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
@@ -2155,6 +2155,10 @@ class PokemonStorageScreen
|
||||
pbDisplay(_INTL("{1} is already fused!", heldpoke.name))
|
||||
return
|
||||
end
|
||||
if(selected.egg? || heldpoke.egg?)
|
||||
pbDisplay(_INTL("It's impossible to fuse an egg!"))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
splicerItem = selectSplicer()
|
||||
|
||||
@@ -29,7 +29,8 @@ BallHandlers::ModifyCatchRate.add(:ABILITYBALL,proc{|ball,catchRate,battle,pokem
|
||||
next catchRate
|
||||
})
|
||||
BallHandlers::OnCatch.add(:ABILITYBALL,proc{|ball,battle,pokemon|
|
||||
#pokemon.ability=2
|
||||
species = getSpecies(dexNum(pokemon))
|
||||
pokemon.ability= species.hidden_abilities[-1]
|
||||
})
|
||||
|
||||
#VIRUS BALL 27 - give pokerus
|
||||
|
||||
@@ -319,7 +319,7 @@ ItemHandlers::UseOnPokemon.add(:RAGECANDYBAR, proc { |item, pokemon, scene|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INCUBATOR, proc { |item, pokemon, scene|
|
||||
if pokemon.isEgg?
|
||||
if pokemon.egg?
|
||||
if pokemon.eggsteps <= 1
|
||||
scene.pbDisplay(_INTL("The egg is already ready to hatch!"))
|
||||
next false
|
||||
@@ -1115,8 +1115,8 @@ ItemHandlers::UseOnPokemon.add(:RAGECANDYBAR, proc { |item, pokemon, scene|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INCUBATOR, proc { |item, pokemon, scene|
|
||||
if pokemon.isEgg?
|
||||
if pokemon.eggsteps <= 1
|
||||
if pokemon.egg?
|
||||
if pokemon.steps_to_hatch <= 1
|
||||
scene.pbDisplay(_INTL("The egg is already ready to hatch!"))
|
||||
next false
|
||||
else
|
||||
@@ -1124,7 +1124,7 @@ ItemHandlers::UseOnPokemon.add(:INCUBATOR, proc { |item, pokemon, scene|
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
scene.pbDisplay(_INTL("Your egg is ready to hatch!"))
|
||||
pokemon.eggsteps = 1
|
||||
pokemon.steps_to_hatch = 1
|
||||
next true
|
||||
end
|
||||
else
|
||||
@@ -1134,32 +1134,38 @@ ItemHandlers::UseOnPokemon.add(:INCUBATOR, proc { |item, pokemon, scene|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INCUBATOR_NORMAL, proc { |item, pokemon, scene|
|
||||
if pokemon.isEgg?
|
||||
steps = pokemon.eggsteps
|
||||
steps -= 2000 / (pokemon.nbIncubatorsUsed + 1).ceil
|
||||
if pokemon.egg?
|
||||
steps = pokemon.steps_to_hatch
|
||||
steps = (steps / 1.5).ceil
|
||||
# steps -= 2000 / (pokemon.nbIncubatorsUsed + 1).ceil
|
||||
if steps <= 1
|
||||
pokemon.eggsteps = 1
|
||||
pokemon.steps_to_hatch = 1
|
||||
else
|
||||
pokemon.eggsteps = steps
|
||||
pokemon.steps_to_hatch = steps
|
||||
end
|
||||
if pokemon.eggsteps <= 1
|
||||
scene.pbDisplay(_INTL("Incubating..."))
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
scene.pbDisplay(_INTL("The egg is ready to hatch!"))
|
||||
next false
|
||||
else
|
||||
scene.pbDisplay(_INTL("Incubating..."))
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
scene.pbDisplay(_INTL("..."))
|
||||
if pokemon.nbIncubatorsUsed >= 10
|
||||
scene.pbDisplay(_INTL("The egg is a bit closer to hatching"))
|
||||
else
|
||||
scene.pbDisplay(_INTL("The egg is closer to hatching"))
|
||||
end
|
||||
pokemon.incrIncubator()
|
||||
next true
|
||||
end
|
||||
scene.pbDisplay(_INTL("The egg is closer to hatching!"))
|
||||
|
||||
# if pokemon.steps_to_hatch <= 1
|
||||
# scene.pbDisplay(_INTL("Incubating..."))
|
||||
# scene.pbDisplay(_INTL("..."))
|
||||
# scene.pbDisplay(_INTL("..."))
|
||||
# scene.pbDisplay(_INTL("The egg is ready to hatch!"))
|
||||
# next false
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("Incubating..."))
|
||||
# scene.pbDisplay(_INTL("..."))
|
||||
# scene.pbDisplay(_INTL("..."))
|
||||
# if pokemon.nbIncubatorsUsed >= 10
|
||||
# scene.pbDisplay(_INTL("The egg is a bit closer to hatching"))
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("The egg is closer to hatching"))
|
||||
# end
|
||||
# pokemon.incrIncubator()
|
||||
# next true
|
||||
# end
|
||||
else
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
@@ -1260,6 +1266,11 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
poke2 = $Trainer.party[chosen]
|
||||
if (poke2.species_data.id_number <= NB_POKEMON) && poke2 != pokemon
|
||||
#check if fainted
|
||||
|
||||
if pokemon.egg? || poke2.egg?
|
||||
scene.pbDisplay(_INTL("It's impossible to fuse an egg!"))
|
||||
return false
|
||||
end
|
||||
if pokemon.hp == 0 || poke2.hp == 0
|
||||
scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||
return false
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user