mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
use splicers from field
This commit is contained in:
@@ -399,7 +399,6 @@ ItemHandlers::UseInField.add(:DREAMMIRROR, proc { |item|
|
|||||||
next 1
|
next 1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
ItemHandlers::UseFromBag.add(:MAGICBOOTS, proc { |item|
|
ItemHandlers::UseFromBag.add(:MAGICBOOTS, proc { |item|
|
||||||
if $DEBUG
|
if $DEBUG
|
||||||
if Kernel.pbConfirmMessageSerious(_INTL("Take off the Magic Boots?"))
|
if Kernel.pbConfirmMessageSerious(_INTL("Take off the Magic Boots?"))
|
||||||
@@ -472,8 +471,44 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
|||||||
next false
|
next false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ItemHandlers::UseInField.add(:DNASPLICERS, proc { |item|
|
||||||
|
fusion_success = useSplicerFromField(false, false)
|
||||||
|
next 3 if fusion_success
|
||||||
|
next false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
ItemHandlers::UseInField.add(:SUPERSPLICERS, proc { |item|
|
||||||
|
fusion_success = useSplicerFromField(true, true)
|
||||||
|
next 3 if fusion_success
|
||||||
|
next false
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
ItemHandlers::UseInField.add(:INFINITESPLICERS, proc { |item|
|
||||||
|
fusion_success = useSplicerFromField(false, false)
|
||||||
|
next true if fusion_success
|
||||||
|
next false
|
||||||
|
})
|
||||||
|
|
||||||
|
ItemHandlers::UseInField.add(:INFINITESPLICERS2, proc { |item|
|
||||||
|
fusion_success = useSplicerFromField(true, true)
|
||||||
|
next true if fusion_success
|
||||||
|
next false
|
||||||
|
})
|
||||||
|
|
||||||
|
def useSplicerFromField(supersplicers, superSplicer_arg2)
|
||||||
|
scene = PokemonParty_Scene.new
|
||||||
|
scene.pbStartScene($Trainer.party,"Select a Pokémon")
|
||||||
|
screen = PokemonPartyScreen.new(scene, $Trainer.party)
|
||||||
|
chosen = screen.pbChoosePokemon("Select a Pokémon")
|
||||||
|
pokemon = $Trainer.party[chosen]
|
||||||
|
fusion_success = pbDNASplicing(pokemon, scene, supersplicers, superSplicer_arg2)
|
||||||
|
screen.pbEndScene
|
||||||
|
scene.dispose
|
||||||
|
return fusion_success
|
||||||
|
end
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||||
if !pokemon.isFusion?
|
if !pokemon.isFusion?
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
@@ -500,7 +535,7 @@ def reverseFusion(pokemon)
|
|||||||
pokemon.exp_when_fused_body = head_exp
|
pokemon.exp_when_fused_body = head_exp
|
||||||
pokemon.exp_when_fused_head = body_exp
|
pokemon.exp_when_fused_head = body_exp
|
||||||
|
|
||||||
pokemon.head_shiny,pokemon.body_shiny = pokemon.body_shiny,pokemon.head_shiny
|
pokemon.head_shiny, pokemon.body_shiny = pokemon.body_shiny, pokemon.head_shiny
|
||||||
#play animation
|
#play animation
|
||||||
pbFadeOutInWithMusic(99999) {
|
pbFadeOutInWithMusic(99999) {
|
||||||
fus = PokemonEvolutionScene.new
|
fus = PokemonEvolutionScene.new
|
||||||
@@ -1280,6 +1315,7 @@ def getPokemonPositionInParty(pokemon)
|
|||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#don't remember why there's two Supersplicers arguments.... probably a mistake
|
||||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||||
playingBGM = $game_system.getPlayingBGM
|
playingBGM = $game_system.getPlayingBGM
|
||||||
dexNumber = pokemon.species_data.id_number
|
dexNumber = pokemon.species_data.id_number
|
||||||
@@ -1312,7 +1348,7 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
selectedHead =selectFusion(pokemon, poke2, supersplicers)
|
selectedHead = selectFusion(pokemon, poke2, supersplicers)
|
||||||
if selectedHead == -1 #cancelled
|
if selectedHead == -1 #cancelled
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -1322,7 +1358,7 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
|||||||
end
|
end
|
||||||
selectedBase = selectedHead == pokemon ? poke2 : pokemon
|
selectedBase = selectedHead == pokemon ? poke2 : pokemon
|
||||||
|
|
||||||
firstOptionSelected= selectedHead == pokemon
|
firstOptionSelected = selectedHead == pokemon
|
||||||
if !firstOptionSelected
|
if !firstOptionSelected
|
||||||
chosen = getPokemonPositionInParty(pokemon)
|
chosen = getPokemonPositionInParty(pokemon)
|
||||||
if chosen == -1
|
if chosen == -1
|
||||||
@@ -1356,21 +1392,19 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def selectFusion(pokemon, poke2, supersplicers = false)
|
def selectFusion(pokemon, poke2, supersplicers = false)
|
||||||
return nil if !pokemon.is_a?(Pokemon) || !poke2.is_a?(Pokemon)
|
return nil if !pokemon.is_a?(Pokemon) || !poke2.is_a?(Pokemon)
|
||||||
return nil if pokemon.egg? || poke2.egg?
|
return nil if pokemon.egg? || poke2.egg?
|
||||||
|
|
||||||
selectorWindow = FusionPreviewScreen.new(poke2, pokemon, supersplicers)#PictureWindow.new(picturePath)
|
selectorWindow = FusionPreviewScreen.new(poke2, pokemon, supersplicers) #PictureWindow.new(picturePath)
|
||||||
selectedHead = selectorWindow.getSelection
|
selectedHead = selectorWindow.getSelection
|
||||||
selectorWindow.dispose
|
selectorWindow.dispose
|
||||||
return selectedHead
|
return selectedHead
|
||||||
end
|
end
|
||||||
# firstOptionSelected= selectedHead == pokemon
|
|
||||||
# selectedBody = selectedHead == pokemon ? poke2 : pokemon
|
|
||||||
# newid = (selectedBody.species_data.id_number) * NB_POKEMON + selectedHead.species_data.id_number
|
|
||||||
|
|
||||||
|
|
||||||
|
# firstOptionSelected= selectedHead == pokemon
|
||||||
|
# selectedBody = selectedHead == pokemon ? poke2 : pokemon
|
||||||
|
# newid = (selectedBody.species_data.id_number) * NB_POKEMON + selectedHead.species_data.id_number
|
||||||
|
|
||||||
# def pbFuse(pokemon, poke2, supersplicers = false)
|
# def pbFuse(pokemon, poke2, supersplicers = false)
|
||||||
# newid = (pokemon.species_data.id_number) * NB_POKEMON + poke2.species_data.id_number
|
# newid = (pokemon.species_data.id_number) * NB_POKEMON + poke2.species_data.id_number
|
||||||
@@ -1392,7 +1426,6 @@ end
|
|||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
||||||
def pbFuse(pokemon, poke2, supersplicers = false)
|
def pbFuse(pokemon, poke2, supersplicers = false)
|
||||||
newid = (pokemon.species_data.id_number) * NB_POKEMON + poke2.species_data.id_number
|
newid = (pokemon.species_data.id_number) * NB_POKEMON + poke2.species_data.id_number
|
||||||
fus = PokemonFusionScene.new
|
fus = PokemonFusionScene.new
|
||||||
@@ -1456,7 +1489,6 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
|||||||
pokemon.exp_when_fused_head = nil
|
pokemon.exp_when_fused_head = nil
|
||||||
pokemon.exp_when_fused_body = nil
|
pokemon.exp_when_fused_body = nil
|
||||||
|
|
||||||
|
|
||||||
if pokemon.shiny?
|
if pokemon.shiny?
|
||||||
pokemon.shiny = false
|
pokemon.shiny = false
|
||||||
if pokemon.bodyShiny? && pokemon.headShiny?
|
if pokemon.bodyShiny? && pokemon.headShiny?
|
||||||
@@ -1472,7 +1504,8 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
|||||||
poke2.shiny = true
|
poke2.shiny = true
|
||||||
pokemon.shiny = false
|
pokemon.shiny = false
|
||||||
poke2.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
|
poke2.natural_shiny = true if pokemon.natural_shiny && !pokemon.debug_shiny
|
||||||
else #shiny was obtained already fused
|
else
|
||||||
|
#shiny was obtained already fused
|
||||||
if rand(2) == 0
|
if rand(2) == 0
|
||||||
pokemon.shiny = true
|
pokemon.shiny = true
|
||||||
else
|
else
|
||||||
@@ -1484,19 +1517,17 @@ def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
|||||||
pokemon.ability_index = pokemon.body_original_ability_index if pokemon.body_original_ability_index
|
pokemon.ability_index = pokemon.body_original_ability_index if pokemon.body_original_ability_index
|
||||||
poke2.ability_index = pokemon.head_original_ability_index if pokemon.head_original_ability_index
|
poke2.ability_index = pokemon.head_original_ability_index if pokemon.head_original_ability_index
|
||||||
|
|
||||||
pokemon.debug_shiny=true if pokemon.debug_shiny && pokemon.body_shiny
|
pokemon.debug_shiny = true if pokemon.debug_shiny && pokemon.body_shiny
|
||||||
poke2.debug_shiny=true if pokemon.debug_shiny && poke2.head_shiny
|
poke2.debug_shiny = true if pokemon.debug_shiny && poke2.head_shiny
|
||||||
|
|
||||||
|
|
||||||
pokemon.body_shiny=false
|
|
||||||
pokemon.head_shiny=false
|
|
||||||
|
|
||||||
|
pokemon.body_shiny = false
|
||||||
|
pokemon.head_shiny = false
|
||||||
|
|
||||||
if !pokemon.shiny?
|
if !pokemon.shiny?
|
||||||
pokemon.debug_shiny=false
|
pokemon.debug_shiny = false
|
||||||
end
|
end
|
||||||
if !poke2.shiny?
|
if !poke2.shiny?
|
||||||
poke2.debug_shiny=false
|
poke2.debug_shiny = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if $Trainer.party.length >= 6
|
if $Trainer.party.length >= 6
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user