reverse from pc

This commit is contained in:
infinitefusion
2022-08-03 19:30:53 -04:00
parent ec9776e3f1
commit d38ffa5c94
7 changed files with 45 additions and 18492 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1645,6 +1645,7 @@ class PokemonStorageScreen
cmdItem = -1 cmdItem = -1
cmdFuse = -1 cmdFuse = -1
cmdUnfuse = -1 cmdUnfuse = -1
cmdReverse = -1
cmdRelease = -1 cmdRelease = -1
cmdDebug = -1 cmdDebug = -1
cmdCancel = -1 cmdCancel = -1
@@ -1659,6 +1660,7 @@ class PokemonStorageScreen
if pokemon != nil if pokemon != nil
if dexNum(pokemon.species) > NB_POKEMON if dexNum(pokemon.species) > NB_POKEMON
commands[cmdUnfuse = commands.length] = _INTL("Unfuse") commands[cmdUnfuse = commands.length] = _INTL("Unfuse")
commands[cmdReverse = commands.length] = _INTL("Reverse") if $PokemonBag.pbQuantity(:DNAREVERSER) > 0
else else
commands[cmdFuse = commands.length] = _INTL("Fuse") commands[cmdFuse = commands.length] = _INTL("Fuse")
end end
@@ -1686,6 +1688,8 @@ class PokemonStorageScreen
pbFuseFromPC(selected, @heldpkmn) pbFuseFromPC(selected, @heldpkmn)
elsif cmdUnfuse >= 0 && command == cmdUnfuse # unfuse elsif cmdUnfuse >= 0 && command == cmdUnfuse # unfuse
pbUnfuseFromPC(selected) pbUnfuseFromPC(selected)
elsif cmdReverse >= 0 && command == cmdReverse # unfuse
reverseFromPC(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
@@ -2265,6 +2269,21 @@ class PokemonStorageScreen
end end
end end
def reverseFromPC(selected)
box = selected[0]
index = selected[1]
pokemon = @storage[box, index]
if !pokemon.isFusion?
scene.pbDisplay(_INTL("It won't have any effect."))
return
end
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
reverseFusion(pokemon)
end
$PokemonBag.pbDeleteItem(:DNAREVERSER)
end
def pbUnfuseFromPC(selected) def pbUnfuseFromPC(selected)
box = selected[0] box = selected[0]
index = selected[1] index = selected[1]

View File

@@ -456,6 +456,16 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
next false next false
end end
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name)) if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
reverseFusion(pokemon)
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
scene.pbRefresh
next true
end
next false
})
def reverseFusion(pokemon)
body = getBasePokemonID(pokemon.species, true) body = getBasePokemonID(pokemon.species, true)
head = getBasePokemonID(pokemon.species, false) head = getBasePokemonID(pokemon.species, false)
newspecies = (head) * Settings::NB_POKEMON + body newspecies = (head) * Settings::NB_POKEMON + body
@@ -472,14 +482,9 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
fus.pbStartScreen(pokemon, newspecies, true) fus.pbStartScreen(pokemon, newspecies, true)
fus.pbEvolution(false, true) fus.pbEvolution(false, true)
fus.pbEndScreen fus.pbEndScreen
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
scene.pbRefresh
} }
next true end
end
next false
})
ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene| ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
if !pokemon.isFusion? if !pokemon.isFusion?
@@ -812,7 +817,7 @@ ItemHandlers::UseOnPokemon.add(:SLOWPOKETAIL, proc { |item, pokemon, scene|
evo.pbStartScreen(pokemon, newspecies) evo.pbStartScreen(pokemon, newspecies)
evo.pbEvolution(false) evo.pbEvolution(false)
evo.pbEndScreen evo.pbEndScreen
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 }) scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 }) if scene.pbHasAnnotations?
scene.pbRefresh scene.pbRefresh
} }
next true next true
@@ -1295,7 +1300,7 @@ def pbFuse(pokemon, poke2, supersplicers = false)
typeWindow = drawPokemonType(newid) typeWindow = drawPokemonType(newid)
if hasCustom if hasCustom
previewwindow.picture.pbSetColor(220, 255, 220, 200) previewwindow.picture.pbSetColor(150, 255, 150, 200)
else else
previewwindow.picture.pbSetColor(255, 255, 255, 200) previewwindow.picture.pbSetColor(255, 255, 255, 200)
end end

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff