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