mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fusing from PC
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -71,6 +71,9 @@ class PokemonStorage
|
|||||||
for i in 0...allWallpapers.length
|
for i in 0...allWallpapers.length
|
||||||
@unlockedWallpapers[i] = false
|
@unlockedWallpapers[i] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@fusionMode=false
|
||||||
|
@fusionItem=nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def allWallpapers
|
def allWallpapers
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ class PokemonBoxArrow < SpriteWrapper
|
|||||||
@handsprite.changeBitmap("fist")
|
@handsprite.changeBitmap("fist")
|
||||||
@spriteX = self.x
|
@spriteX = self.x
|
||||||
@spriteY = self.y
|
@spriteY = self.y
|
||||||
|
@splicerType=0
|
||||||
end
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
@@ -183,6 +184,28 @@ class PokemonBoxArrow < SpriteWrapper
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def getSplicerIcon
|
||||||
|
case @splicerType
|
||||||
|
when 2
|
||||||
|
return AnimatedBitmap.new("Graphics/Pictures/boxinfinitesplicer")
|
||||||
|
when 1
|
||||||
|
return AnimatedBitmap.new("Graphics/Pictures/boxsupersplicer")
|
||||||
|
end
|
||||||
|
return AnimatedBitmap.new("Graphics/Pictures/boxsplicer")
|
||||||
|
end
|
||||||
|
|
||||||
|
def setSplicerType(type)
|
||||||
|
@splicerType = type
|
||||||
|
end
|
||||||
|
|
||||||
|
def setFusing(fusing)
|
||||||
|
@fusing = fusing
|
||||||
|
end
|
||||||
|
|
||||||
|
def fusing?
|
||||||
|
return @fusing
|
||||||
|
end
|
||||||
|
|
||||||
def heldPokemon
|
def heldPokemon
|
||||||
@heldpkmn = nil if @heldpkmn && @heldpkmn.disposed?
|
@heldpkmn = nil if @heldpkmn && @heldpkmn.disposed?
|
||||||
@holding = false if !@heldpkmn
|
@holding = false if !@heldpkmn
|
||||||
@@ -606,6 +629,21 @@ class PokemonStorageScene
|
|||||||
@command = 1
|
@command = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pbReleaseInstant(selected,heldpoke)
|
||||||
|
box=selected[0]
|
||||||
|
index=selected[1]
|
||||||
|
if heldpoke
|
||||||
|
sprite=@sprites["arrow"].heldPokemon
|
||||||
|
elsif box==-1
|
||||||
|
sprite=@sprites["boxparty"].getPokemon(index)
|
||||||
|
else
|
||||||
|
sprite=@sprites["box"].getPokemon(index)
|
||||||
|
end
|
||||||
|
if sprite
|
||||||
|
sprite.dispose
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def pbStartBox(screen,command)
|
def pbStartBox(screen,command)
|
||||||
@screen = screen
|
@screen = screen
|
||||||
@storage = screen.storage
|
@storage = screen.storage
|
||||||
@@ -1493,6 +1531,22 @@ class PokemonStorageScene
|
|||||||
def update
|
def update
|
||||||
pbUpdateSpriteHash(@sprites)
|
pbUpdateSpriteHash(@sprites)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def setFusing(fusing,item=0)
|
||||||
|
sprite=@sprites["arrow"].setFusing(fusing)
|
||||||
|
if item == :INFINITESPLICERS
|
||||||
|
@sprites["arrow"].setSplicerType(2)
|
||||||
|
elsif item == :SUPERSPLICERS
|
||||||
|
@sprites["arrow"].setSplicerType(1)
|
||||||
|
else
|
||||||
|
@sprites["arrow"].setSplicerType(0)
|
||||||
|
end
|
||||||
|
pbRefresh
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -1509,6 +1563,8 @@ class PokemonStorageScreen
|
|||||||
@pbHeldPokemon = nil
|
@pbHeldPokemon = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pbStartScreen(command)
|
def pbStartScreen(command)
|
||||||
@heldpkmn = nil
|
@heldpkmn = nil
|
||||||
if command==0 # Organise
|
if command==0 # Organise
|
||||||
@@ -1545,12 +1601,16 @@ class PokemonStorageScreen
|
|||||||
pbHold(selected)
|
pbHold(selected)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
if @fusionMode
|
||||||
|
pbFusionCommands(selected)
|
||||||
|
else
|
||||||
commands = []
|
commands = []
|
||||||
cmdMove = -1
|
cmdMove = -1
|
||||||
cmdSummary = -1
|
cmdSummary = -1
|
||||||
cmdWithdraw = -1
|
cmdWithdraw = -1
|
||||||
cmdItem = -1
|
cmdItem = -1
|
||||||
cmdMark = -1
|
cmdFuse = -1
|
||||||
|
cmdUnfuse = -1
|
||||||
cmdRelease = -1
|
cmdRelease = -1
|
||||||
cmdDebug = -1
|
cmdDebug = -1
|
||||||
cmdCancel = -1
|
cmdCancel = -1
|
||||||
@@ -1562,9 +1622,16 @@ class PokemonStorageScreen
|
|||||||
commands[cmdMove=commands.length] = _INTL("Move")
|
commands[cmdMove=commands.length] = _INTL("Move")
|
||||||
end
|
end
|
||||||
commands[cmdSummary=commands.length] = _INTL("Summary")
|
commands[cmdSummary=commands.length] = _INTL("Summary")
|
||||||
|
if pokemon != nil
|
||||||
|
if dexNum(pokemon.species) > NB_POKEMON
|
||||||
|
commands[cmdUnfuse=commands.length] = _INTL("Unfuse")
|
||||||
|
else
|
||||||
|
commands[cmdFuse=commands.length] = _INTL("Fuse")
|
||||||
|
end
|
||||||
|
end
|
||||||
commands[cmdWithdraw=commands.length] = (selected[0]==-1) ? _INTL("Store") : _INTL("Withdraw")
|
commands[cmdWithdraw=commands.length] = (selected[0]==-1) ? _INTL("Store") : _INTL("Withdraw")
|
||||||
commands[cmdItem=commands.length] = _INTL("Item")
|
commands[cmdItem=commands.length] = _INTL("Item")
|
||||||
commands[cmdMark=commands.length] = _INTL("Mark")
|
|
||||||
commands[cmdRelease=commands.length] = _INTL("Release")
|
commands[cmdRelease=commands.length] = _INTL("Release")
|
||||||
commands[cmdDebug=commands.length] = _INTL("Debug") if $DEBUG
|
commands[cmdDebug=commands.length] = _INTL("Debug") if $DEBUG
|
||||||
commands[cmdCancel=commands.length] = _INTL("Cancel")
|
commands[cmdCancel=commands.length] = _INTL("Cancel")
|
||||||
@@ -1581,13 +1648,16 @@ class PokemonStorageScreen
|
|||||||
(selected[0]==-1) ? pbStore(selected,@heldpkmn) : pbWithdraw(selected,@heldpkmn)
|
(selected[0]==-1) ? pbStore(selected,@heldpkmn) : pbWithdraw(selected,@heldpkmn)
|
||||||
elsif cmdItem>=0 && command==cmdItem # Item
|
elsif cmdItem>=0 && command==cmdItem # Item
|
||||||
pbItem(selected,@heldpkmn)
|
pbItem(selected,@heldpkmn)
|
||||||
elsif cmdMark>=0 && command==cmdMark # Mark
|
elsif cmdFuse>=0 && command==cmdFuse # fuse
|
||||||
pbMark(selected,@heldpkmn)
|
pbFuseFromPC(selected,@heldpkmn)
|
||||||
|
elsif cmdUnfuse>=0 && command==cmdUnfuse # unfuse
|
||||||
|
pbUnfuseFromPC(selected)
|
||||||
elsif cmdRelease>=0 && command==cmdRelease # Release
|
elsif cmdRelease>=0 && command==cmdRelease # Release
|
||||||
pbRelease(selected,@heldpkmn)
|
pbRelease(selected,@heldpkmn)
|
||||||
elsif cmdDebug>=0 && command==cmdDebug # Debug
|
elsif cmdDebug>=0 && command==cmdDebug # Debug
|
||||||
pbPokemonDebug((@heldpkmn) ? @heldpkmn : pokemon,selected,heldpoke)
|
pbPokemonDebug((@heldpkmn) ? @heldpkmn : pokemon,selected,heldpoke)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1614,20 +1684,24 @@ class PokemonStorageScreen
|
|||||||
pbBoxCommands
|
pbBoxCommands
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
if @fusionMode
|
||||||
|
pbFusionCommands(selected)
|
||||||
|
else
|
||||||
pokemon = @storage[selected[0],selected[1]]
|
pokemon = @storage[selected[0],selected[1]]
|
||||||
next if !pokemon
|
next if !pokemon
|
||||||
command = pbShowCommands(_INTL("{1} is selected.",pokemon.name),[
|
command = pbShowCommands(_INTL("{1} is selected.",pokemon.name),[
|
||||||
_INTL("Withdraw"),
|
_INTL("Withdraw"),
|
||||||
_INTL("Summary"),
|
_INTL("Summary"),
|
||||||
_INTL("Mark"),
|
|
||||||
_INTL("Release"),
|
_INTL("Release"),
|
||||||
_INTL("Cancel")
|
_INTL("Cancel")
|
||||||
])
|
])
|
||||||
case command
|
case command
|
||||||
when 0 then pbWithdraw(selected, nil)
|
when 0 then pbWithdraw(selected, nil)
|
||||||
when 1 then pbSummary(selected, nil)
|
when 1 then pbSummary(selected, nil)
|
||||||
when 2 then pbMark(selected, nil)
|
#when 2 then pbMark(selected, nil)
|
||||||
when 3 then pbRelease(selected, nil)
|
when 2 then pbRelease(selected, nil)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2020,4 +2094,189 @@ class PokemonStorageScreen
|
|||||||
@scene.pbCloseBox
|
@scene.pbCloseBox
|
||||||
return retval
|
return retval
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Fusion stuff
|
||||||
|
#
|
||||||
|
|
||||||
|
def pbFuseFromPC(selected,heldpoke)
|
||||||
|
box=selected[0]
|
||||||
|
index=selected[1]
|
||||||
|
poke_body = @storage[box,index]
|
||||||
|
poke_head = heldpoke
|
||||||
|
if heldpoke
|
||||||
|
if dexNum(heldpoke.species) > NB_POKEMON
|
||||||
|
pbDisplay(_INTL("{1} is already fused!",heldpoke.name))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
splicerItem = selectSplicer()
|
||||||
|
if splicerItem == nil
|
||||||
|
cancelFusion()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
isSuperSplicer = isSuperSplicer?(splicerItem)
|
||||||
|
|
||||||
|
if !heldpoke
|
||||||
|
@fusionMode = true
|
||||||
|
@fusionItem = splicerItem
|
||||||
|
@scene.setFusing(true,@fusionItem)
|
||||||
|
pbHold(selected)
|
||||||
|
pbDisplay(_INTL("Select a Pokémon to fuse it with"))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if !poke_body
|
||||||
|
pbDisplay(_INTL("Select a Pokémon to fuse it with"))
|
||||||
|
@fusionMode = true
|
||||||
|
@fusionItem = splicerItem
|
||||||
|
@scene.setFusing(true,@fusionItem)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def deleteHeldPokemon(heldpoke,selected)
|
||||||
|
@scene.pbReleaseInstant(selected,heldpoke)
|
||||||
|
@heldpkmn = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def cancelFusion
|
||||||
|
@splicerItem =nil
|
||||||
|
@scene.setFusing(false)
|
||||||
|
@fusionMode = false
|
||||||
|
end
|
||||||
|
|
||||||
|
def canDeleteItem(item)
|
||||||
|
return item == :SUPERSPLICERS || item == :DNASPLICERS
|
||||||
|
end
|
||||||
|
|
||||||
|
def isSuperSplicer?(item)
|
||||||
|
return item == :SUPERSPLICERS || item == :INFINITESPLICERS2
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def pbFusionCommands(selected)
|
||||||
|
heldpoke=pbHeldPokemon
|
||||||
|
pokemon=@storage[selected[0],selected[1]]
|
||||||
|
|
||||||
|
if !pokemon
|
||||||
|
command=pbShowCommands("Select an action",["Cancel","Stop fusing"])
|
||||||
|
case command
|
||||||
|
when 1 #stop
|
||||||
|
cancelFusion()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
commands=[
|
||||||
|
_INTL("Fuse"),
|
||||||
|
_INTL("Swap")
|
||||||
|
]
|
||||||
|
commands.push(_INTL("Stop fusing"))
|
||||||
|
commands.push(_INTL("Cancel"))
|
||||||
|
|
||||||
|
if !heldpoke
|
||||||
|
pbPlace(selected)
|
||||||
|
@fusionMode =false
|
||||||
|
@scene.setFusing(false)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
command=pbShowCommands("Select an action",commands)
|
||||||
|
case command
|
||||||
|
when 0 #Fuse
|
||||||
|
if !pokemon
|
||||||
|
pbDisplay(_INTL("No Pokémon selected!"))
|
||||||
|
return
|
||||||
|
else
|
||||||
|
if dexNum(pokemon.species) > NB_POKEMON
|
||||||
|
pbDisplay(_INTL("This Pokémon is already fused!"))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
isSuperSplicer = isSuperSplicer?(@fusionItem)
|
||||||
|
|
||||||
|
if pbFuse(pokemon,heldpoke,isSuperSplicer)
|
||||||
|
if canDeleteItem(@fusionItem)
|
||||||
|
$PokemonBag.pbDeleteItem(@fusionItem)
|
||||||
|
end
|
||||||
|
deleteHeldPokemon(heldpoke,selected)
|
||||||
|
@scene.setFusing(false)
|
||||||
|
@fusionMode = false
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# print "fusion cancelled"
|
||||||
|
# @fusionMode = false
|
||||||
|
end
|
||||||
|
when 1 #swap
|
||||||
|
if pokemon
|
||||||
|
if dexNum(pokemon.species) <= NB_POKEMON
|
||||||
|
pbSwap(selected)
|
||||||
|
else
|
||||||
|
pbDisplay(_INTL("This Pokémon is already fused!"))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
pbDisplay(_INTL("Select a Pokémon!"))
|
||||||
|
end
|
||||||
|
when 2 #cancel
|
||||||
|
cancelFusion()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def pbUnfuseFromPC(selected)
|
||||||
|
box=selected[0]
|
||||||
|
index=selected[1]
|
||||||
|
pokemon = @storage[box,index]
|
||||||
|
|
||||||
|
if pbConfirm(_INTL("Unfuse {1}?",pokemon.name))
|
||||||
|
item = selectSplicer()
|
||||||
|
return if item == nil
|
||||||
|
isSuperSplicer = isSuperSplicer?(item)
|
||||||
|
if pbUnfuse(pokemon,@scene,isSuperSplicer,selected)
|
||||||
|
if canDeleteItem(item)
|
||||||
|
$PokemonBag.pbDeleteItem(item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@scene.pbHardRefresh
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def selectSplicer()
|
||||||
|
dna_splicers_const = "DNA Splicers"
|
||||||
|
super_splicers_const = "Super Splicers"
|
||||||
|
infinite_splicers_const = "Infinite Splicers"
|
||||||
|
|
||||||
|
dnaSplicersQt = $PokemonBag.pbQuantity(:DNASPLICERS)
|
||||||
|
superSplicersQt = $PokemonBag.pbQuantity(:SUPERSPLICERS)
|
||||||
|
infiniteSplicersQt = $PokemonBag.pbQuantity(:INFINITESPLICERS)
|
||||||
|
infiniteSplicers2Qt = $PokemonBag.pbQuantity(:INFINITESPLICERS2)
|
||||||
|
|
||||||
|
options = []
|
||||||
|
options.push(_INTL"{1}",infinite_splicers_const)if infiniteSplicers2Qt > 0 || infiniteSplicersQt > 0
|
||||||
|
options.push(_INTL("{1} ({2})",super_splicers_const,superSplicersQt))if superSplicersQt > 0
|
||||||
|
options.push(_INTL("{1} ({2})",dna_splicers_const,dnaSplicersQt))if dnaSplicersQt > 0
|
||||||
|
|
||||||
|
if options.length <= 0
|
||||||
|
pbDisplay(_INTL("You have no fusion items available."))
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
cmd=pbShowCommands("Use which splicers?",options)
|
||||||
|
if cmd == -1
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
ret = options[cmd]
|
||||||
|
if ret.start_with?(dna_splicers_const)
|
||||||
|
return :DNASPLICERS
|
||||||
|
elsif ret.start_with?(super_splicers_const)
|
||||||
|
return :SUPERSPLICERS
|
||||||
|
elsif ret.start_with?(infinite_splicers_const)
|
||||||
|
return infiniteSplicers2Qt >= 1 ? :INFINITESPLICERS2 : :INFINITESPLICERS
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -254,7 +254,6 @@ ItemHandlers::UseOnPokemon.add(:TRANSGENDERSTONE, proc { |item, pokemon, scene|
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
#NOT FULLY IMPLEMENTED
|
#NOT FULLY IMPLEMENTED
|
||||||
ItemHandlers::UseOnPokemon.add(:SECRETCAPSULE, proc { |item, poke, scene|
|
ItemHandlers::UseOnPokemon.add(:SECRETCAPSULE, proc { |item, poke, scene|
|
||||||
abilityList = poke.getAbilityList
|
abilityList = poke.getAbilityList
|
||||||
@@ -373,7 +372,6 @@ ItemHandlers::UseFromBag.add(:DEBUGGER, proc { |item|
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
|
ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
|
||||||
TOTAL_SPIRITS_NEEDED = 108
|
TOTAL_SPIRITS_NEEDED = 108
|
||||||
nbSpirits = pbGet(VAR_ODDKEYSTONE_NB)
|
nbSpirits = pbGet(VAR_ODDKEYSTONE_NB)
|
||||||
@@ -382,14 +380,14 @@ ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
|
|||||||
Kernel.pbMessage(_INTL("Voices can be heard whispering from it..."))
|
Kernel.pbMessage(_INTL("Voices can be heard whispering from it..."))
|
||||||
Kernel.pbMessage(_INTL("Just... one... more..."))
|
Kernel.pbMessage(_INTL("Just... one... more..."))
|
||||||
elsif nbSpirits < TOTAL_SPIRITS_NEEDED
|
elsif nbSpirits < TOTAL_SPIRITS_NEEDED
|
||||||
nbNeeded = TOTAL_SPIRITS_NEEDED-nbSpirits
|
nbNeeded = TOTAL_SPIRITS_NEEDED - nbSpirits
|
||||||
Kernel.pbMessage(_INTL("Voices can be heard whispering from the Odd Keystone..."))
|
Kernel.pbMessage(_INTL("Voices can be heard whispering from the Odd Keystone..."))
|
||||||
Kernel.pbMessage(_INTL("Bring... us... {1}... spirits",nbNeeded.to_s))
|
Kernel.pbMessage(_INTL("Bring... us... {1}... spirits", nbNeeded.to_s))
|
||||||
else
|
else
|
||||||
Kernel.pbMessage(_INTL("The Odd Keystone appears to be moving on its own."))
|
Kernel.pbMessage(_INTL("The Odd Keystone appears to be moving on its own."))
|
||||||
Kernel.pbMessage(_INTL("It seems as if some poweful energy is trying to escape from it."))
|
Kernel.pbMessage(_INTL("It seems as if some poweful energy is trying to escape from it."))
|
||||||
if (Kernel.pbMessage("Let it out?", ["No","Yes"], 0)) == 1
|
if (Kernel.pbMessage("Let it out?", ["No", "Yes"], 0)) == 1
|
||||||
pbWildBattle(:SPIRITOMB,27)
|
pbWildBattle(:SPIRITOMB, 27)
|
||||||
pbSet(VAR_ODDKEYSTONE_NB, 0)
|
pbSet(VAR_ODDKEYSTONE_NB, 0)
|
||||||
end
|
end
|
||||||
next 1
|
next 1
|
||||||
@@ -687,8 +685,6 @@ def drawPokemonType(pokemon_id, x_pos = 192, y_pos = 264)
|
|||||||
return viewport
|
return viewport
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene|
|
ItemHandlers::UseOnPokemon.add(:SUPERSPLICERS, proc { |item, pokemon, scene|
|
||||||
next true if pbDNASplicing(pokemon, scene, true, true)
|
next true if pbDNASplicing(pokemon, scene, true, true)
|
||||||
})
|
})
|
||||||
@@ -882,40 +878,40 @@ ItemHandlers::UseOnPokemon.add(:SLOWPOKETAIL, proc { |item, pokemon, scene|
|
|||||||
# next true
|
# next true
|
||||||
# end
|
# end
|
||||||
# })
|
# })
|
||||||
ItemHandlers::UseOnPokemon.add(:POISONMUSHROOM,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:POISONMUSHROOM, proc { |item, pkmn, scene|
|
||||||
if pkmn.status != :POISON
|
if pkmn.status != :POISON
|
||||||
pkmn.status= :POISON
|
pkmn.status = :POISON
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} was poisoned from eating the mushroom.",pkmn.name))
|
scene.pbDisplay(_INTL("{1} was poisoned from eating the mushroom.", pkmn.name))
|
||||||
end
|
end
|
||||||
next pbHPItem(pkmn,10,scene)
|
next pbHPItem(pkmn, 10, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:POISONMUSHROOM,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:POISONMUSHROOM, proc { |item, pokemon, battler, choices, scene|
|
||||||
if battler.status != :POISON
|
if battler.status != :POISON
|
||||||
battler.status= :POISON
|
battler.status = :POISON
|
||||||
scene.pbRefresh
|
scene.pbRefresh
|
||||||
scene.pbDisplay(_INTL("{1} was poisoned from eating the mushroom.",pokemon.name))
|
scene.pbDisplay(_INTL("{1} was poisoned from eating the mushroom.", pokemon.name))
|
||||||
end
|
end
|
||||||
pbBattleHPItem(pokemon,battler,10,scene)
|
pbBattleHPItem(pokemon, battler, 10, scene)
|
||||||
})
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:TINYMUSHROOM,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:TINYMUSHROOM, proc { |item, pkmn, scene|
|
||||||
next pbHPItem(pkmn,10,scene)
|
next pbHPItem(pkmn, 10, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:TINYMUSHROOM,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:TINYMUSHROOM, proc { |item, pokemon, battler, choices, scene|
|
||||||
next pbBattleHPItem(pokemon,battler,50,scene)
|
next pbBattleHPItem(pokemon, battler, 50, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::UseOnPokemon.add(:BIGMUSHROOM,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:BIGMUSHROOM, proc { |item, pkmn, scene|
|
||||||
next pbHPItem(pkmn,10,scene)
|
next pbHPItem(pkmn, 10, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:BIGMUSHROOM,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:BIGMUSHROOM, proc { |item, pokemon, battler, choices, scene|
|
||||||
next pbBattleHPItem(pokemon,battler,50,scene)
|
next pbBattleHPItem(pokemon, battler, 50, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::UseOnPokemon.add(:BALMMUSHROOM,proc { |item,pkmn,scene|
|
ItemHandlers::UseOnPokemon.add(:BALMMUSHROOM, proc { |item, pkmn, scene|
|
||||||
next pbHPItem(pkmn,999,scene)
|
next pbHPItem(pkmn, 999, scene)
|
||||||
})
|
})
|
||||||
ItemHandlers::BattleUseOnPokemon.add(:BALMMUSHROOM,proc { |item,pokemon,battler,choices,scene|
|
ItemHandlers::BattleUseOnPokemon.add(:BALMMUSHROOM, proc { |item, pokemon, battler, choices, scene|
|
||||||
next pbBattleHPItem(pokemon,battler,999,scene)
|
next pbBattleHPItem(pokemon, battler, 999, scene)
|
||||||
})
|
})
|
||||||
|
|
||||||
#TRACKER (for roaming legendaries)
|
#TRACKER (for roaming legendaries)
|
||||||
@@ -1290,7 +1286,7 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
|||||||
scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if(pbFuse(pokemon,poke2,superSplicer))
|
if (pbFuse(pokemon, poke2, superSplicer))
|
||||||
pbRemovePokemonAt(chosen)
|
pbRemovePokemonAt(chosen)
|
||||||
scene.pbHardRefresh
|
scene.pbHardRefresh
|
||||||
pbBGMPlay(playingBGM)
|
pbBGMPlay(playingBGM)
|
||||||
@@ -1309,11 +1305,11 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
#UNFUSE
|
#UNFUSE
|
||||||
return true if pbUnfuse(pokemon,scene,supersplicers)
|
return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||||
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
|
||||||
|
|
||||||
pathCustom = _INTL("Graphics/CustomBattlers/{1}.{2}.png", poke2.species_data.id_number, pokemon.species_data.id_number)
|
pathCustom = _INTL("Graphics/CustomBattlers/{1}.{2}.png", poke2.species_data.id_number, pokemon.species_data.id_number)
|
||||||
@@ -1358,8 +1354,7 @@ def pbFuse(pokemon,poke2,supersplicers=false)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||||
def pbUnfuse(pokemon, scene,supersplicers,pcPosition=nil)
|
|
||||||
|
|
||||||
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
|
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
|
||||||
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
|
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
|
||||||
@@ -1375,7 +1370,7 @@ def pbUnfuse(pokemon, scene,supersplicers,pcPosition=nil)
|
|||||||
end
|
end
|
||||||
|
|
||||||
keepInParty = 0
|
keepInParty = 0
|
||||||
if $Trainer.party.length >= 6
|
if $Trainer.party.length >= 6 && !pcPosition
|
||||||
scene.pbDisplay(_INTL("Your party is full! Keep which Pokémon in party?"))
|
scene.pbDisplay(_INTL("Your party is full! Keep which Pokémon in party?"))
|
||||||
choice = Kernel.pbMessage("Select a Pokémon to keep in your party.", [_INTL("{1}", PBSpecies.getName(bodyPoke)), _INTL("{1}", PBSpecies.getName(headPoke)), "Cancel"], 2)
|
choice = Kernel.pbMessage("Select a Pokémon to keep in your party.", [_INTL("{1}", PBSpecies.getName(bodyPoke)), _INTL("{1}", PBSpecies.getName(headPoke)), "Cancel"], 2)
|
||||||
if choice == 2
|
if choice == 2
|
||||||
@@ -1407,9 +1402,9 @@ def pbUnfuse(pokemon, scene,supersplicers,pcPosition=nil)
|
|||||||
body_level = poke1.level
|
body_level = poke1.level
|
||||||
head_level = poke2.level
|
head_level = poke2.level
|
||||||
|
|
||||||
pokemon.exp_gained_since_fused=0
|
pokemon.exp_gained_since_fused = 0
|
||||||
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 $Trainer.party.length >= 6
|
if $Trainer.party.length >= 6
|
||||||
if (keepInParty == 0)
|
if (keepInParty == 0)
|
||||||
@@ -1419,11 +1414,27 @@ def pbUnfuse(pokemon, scene,supersplicers,pcPosition=nil)
|
|||||||
poke2 = Pokemon.new(bodyPoke, body_level)
|
poke2 = Pokemon.new(bodyPoke, body_level)
|
||||||
poke1 = Pokemon.new(headPoke, head_level)
|
poke1 = Pokemon.new(headPoke, head_level)
|
||||||
|
|
||||||
$PokemonStorage.pbStoreCaught(poke2)
|
if pcPosition != nil
|
||||||
scene.pbDisplay(_INTL("{1} was sent to the PC.", poke2.name))
|
box = pcPosition[0]
|
||||||
|
index = pcPosition[1]
|
||||||
|
#todo: store at next available position from current position
|
||||||
|
$PokemonStorage.pbStoreCaught(poke2)
|
||||||
|
else
|
||||||
|
$PokemonStorage.pbStoreCaught(poke2)
|
||||||
|
scene.pbDisplay(_INTL("{1} was sent to the PC.", poke2.name))
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
if pcPosition != nil
|
||||||
|
box = pcPosition[0]
|
||||||
|
index = pcPosition[1]
|
||||||
|
|
||||||
|
#todo: store at next available position from current position
|
||||||
|
$PokemonStorage.pbStoreCaught(poke2)
|
||||||
|
else
|
||||||
|
Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#On ajoute l'autre dans le pokedex aussi
|
#On ajoute l'autre dans le pokedex aussi
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user