mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
dna reverser, hotel crashes fix, unfusing & exp tracking, wondertrade
This commit is contained in:
@@ -183,6 +183,15 @@ class PokeBattle_Battle
|
||||
levelMaxExp = growth_rate.minimum_exp_for_level(curLevel + 1)
|
||||
tempExp2 = (levelMaxExp<expFinal) ? levelMaxExp : expFinal
|
||||
pkmn.exp = tempExp2
|
||||
|
||||
if pkmn.isFusion?
|
||||
if pkmn.exp_gained_since_fused == nil
|
||||
pkmn.exp_gained_since_fused = expGained
|
||||
else
|
||||
pkmn.exp_gained_since_fused += expGained
|
||||
end
|
||||
|
||||
end
|
||||
@scene.pbEXPBar(battler,levelMinExp,levelMaxExp,tempExp1,tempExp2)
|
||||
tempExp1 = tempExp2
|
||||
curLevel += 1
|
||||
|
||||
@@ -14,6 +14,11 @@ class Pokemon
|
||||
attr_accessor :time_form_set
|
||||
# @return [Integer] the current experience points
|
||||
attr_reader :exp
|
||||
|
||||
attr_accessor :exp_when_fused_head
|
||||
attr_accessor :exp_when_fused_body
|
||||
attr_accessor :exp_gained_since_fused
|
||||
|
||||
# @return [Integer] the number of steps until this Pokémon hatches, 0 if this Pokémon is not an egg
|
||||
attr_accessor :steps_to_hatch
|
||||
# @return [Integer] the current HP
|
||||
@@ -134,6 +139,10 @@ class Pokemon
|
||||
@species == GameData::Species.get(check_species).species)
|
||||
end
|
||||
|
||||
def isFusion?
|
||||
return species_data.id_number > NB_POKEMON
|
||||
end
|
||||
|
||||
def form
|
||||
return @forced_form if !@forced_form.nil?
|
||||
return @form if $game_temp.in_battle
|
||||
@@ -1054,6 +1063,7 @@ class Pokemon
|
||||
return ret
|
||||
end
|
||||
|
||||
|
||||
# Creates a new Pokémon object.
|
||||
# @param species [Symbol, String, Integer] Pokémon species
|
||||
# @param level [Integer] Pokémon level
|
||||
|
||||
@@ -7,6 +7,7 @@ class Trainer
|
||||
attr_accessor :id
|
||||
attr_accessor :language
|
||||
attr_accessor :party
|
||||
attr_accessor :quests
|
||||
|
||||
def inspect
|
||||
str = super.chop
|
||||
|
||||
@@ -485,7 +485,7 @@ class PokemonEvolutionScene
|
||||
end
|
||||
end
|
||||
|
||||
def pbStartScreen(pokemon,newspecies)
|
||||
def pbStartScreen(pokemon,newspecies,reversing=false)
|
||||
@pokemon = pokemon
|
||||
@newspecies = newspecies
|
||||
@sprites = {}
|
||||
@@ -495,7 +495,9 @@ class PokemonEvolutionScene
|
||||
@viewport.z = 99999
|
||||
@msgviewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
@msgviewport.z = 99999
|
||||
addBackgroundOrColoredPlane(@sprites,"background","evolutionbg",
|
||||
background_file = reversing ? "DNAbg": "evolutionbg"
|
||||
|
||||
addBackgroundOrColoredPlane(@sprites,"background",background_file,
|
||||
Color.new(248,248,248),@bgviewport)
|
||||
rsprite1 = PokemonSprite.new(@viewport)
|
||||
rsprite1.setOffset(PictureOrigin::Center)
|
||||
@@ -526,16 +528,18 @@ class PokemonEvolutionScene
|
||||
end
|
||||
|
||||
# Opens the evolution screen
|
||||
def pbEvolution(cancancel=true)
|
||||
def pbEvolution(cancancel=true,reversing=false)
|
||||
metaplayer1 = SpriteMetafilePlayer.new(@metafile1,@sprites["rsprite1"])
|
||||
metaplayer2 = SpriteMetafilePlayer.new(@metafile2,@sprites["rsprite2"])
|
||||
metaplayer1.play
|
||||
metaplayer2.play
|
||||
pbBGMStop
|
||||
@pokemon.play_cry
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]What? {1} is evolving!\\^",@pokemon.name)) { pbUpdate }
|
||||
pbMessageWaitForInput(@sprites["msgwindow"],50,true) { pbUpdate }
|
||||
if !reversing
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]What? {1} is evolving!\\^",@pokemon.name)) { pbUpdate }
|
||||
pbMessageWaitForInput(@sprites["msgwindow"],50,true) { pbUpdate }
|
||||
end
|
||||
pbPlayDecisionSE
|
||||
oldstate = pbSaveSpriteState(@sprites["rsprite1"])
|
||||
oldstate2 = pbSaveSpriteState(@sprites["rsprite2"])
|
||||
@@ -561,11 +565,11 @@ class PokemonEvolutionScene
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("Huh? {1} stopped evolving!",@pokemon.name)) { pbUpdate }
|
||||
else
|
||||
pbEvolutionSuccess
|
||||
pbEvolutionSuccess(reversing)
|
||||
end
|
||||
end
|
||||
|
||||
def pbEvolutionSuccess
|
||||
def pbEvolutionSuccess(reversing=false)
|
||||
# Play cry of evolved species
|
||||
frames = GameData::Species.cry_length(@newspecies, @pokemon.form)
|
||||
pbBGMStop
|
||||
@@ -577,9 +581,16 @@ class PokemonEvolutionScene
|
||||
# Success jingle/message
|
||||
pbMEPlay("Evolution success")
|
||||
newspeciesname = GameData::Species.get(@newspecies).name
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]",
|
||||
@pokemon.name,newspeciesname)) { pbUpdate }
|
||||
if !reversing
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]",
|
||||
@pokemon.name,newspeciesname)) { pbUpdate }
|
||||
else
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]{1} has been turned into {2}!\\wt[80]",
|
||||
@pokemon.name,newspeciesname)) { pbUpdate }
|
||||
end
|
||||
|
||||
@sprites["msgwindow"].text = ""
|
||||
# Check for consumed item and check if Pokémon should be duplicated
|
||||
pbEvolutionMethodAfterEvolution
|
||||
|
||||
@@ -194,22 +194,23 @@ class PokemonTrade_Scene
|
||||
pbPlayDecisionSE
|
||||
pbScene1
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("For {1}'s {2},\r\n{3} sends {4}.\1",@trader1,speciesname1,@trader2,speciesname2)) { pbUpdate }
|
||||
_INTL("For {1}'s {2},\r\n{3} sends {4}.\1",@trader1,@pokemon.name,@trader2,@pokemon2.name)) { pbUpdate }
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("{1} bids farewell to {2}.",@trader2,speciesname2)) { pbUpdate }
|
||||
_INTL("{1} bids farewell to {2}.",@trader2,@pokemon2.name)) { pbUpdate }
|
||||
pbScene2
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_ISPRINTF("{1:s}\r\nID: {2:05d} OT: {3:s}\1",
|
||||
@pokemon2.name,@pokemon2.owner.public_id,@pokemon2.owner.name)) { pbUpdate }
|
||||
_ISPRINTF("{1:s}\r\nNN: {2:s} OT: {3:s}\1", speciesname2,@pokemon2.name,@pokemon2.owner.name)) { pbUpdate }
|
||||
pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("Take good care of {1}.",speciesname2)) { pbUpdate }
|
||||
_INTL("Take good care of {1}.",@pokemon2.name)) { pbUpdate }
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0)
|
||||
def pbStartTrade(pokemonIndex,newpoke,nickname,trainerName,trainerGender=0,savegame=false)
|
||||
Kernel.Autosave if savegame
|
||||
|
||||
myPokemon = $Trainer.party[pokemonIndex]
|
||||
opponent = NPCTrainer.new(trainerName,trainerGender)
|
||||
opponent.id = $Trainer.make_foreign_ID
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Le eul but de cette clae et de pouvoir continuer à utilier le format PBTrainer::TRAINER quand on call la méthode de combat de dreeur
|
||||
# Le seul but de cette clae et de pouvoir continuer à utilier le format PBTrainer::TRAINER quand on call la méthode de combat de dreeur
|
||||
# pour ne pa à avoir à modifier tou le événement
|
||||
#
|
||||
module PBItems
|
||||
7
Data/Scripts/049_Compatibility/PBSpecies.rb
Normal file
7
Data/Scripts/049_Compatibility/PBSpecies.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
module PBSpecies
|
||||
#couldn't figure out how to get the size of GameData::Species so fuck it, here's the hardcoded value
|
||||
def PBSpecies.maxValue
|
||||
return 176832
|
||||
end
|
||||
end
|
||||
|
||||
39
Data/Scripts/050_AddOns/Autosave.rb
Normal file
39
Data/Scripts/050_AddOns/Autosave.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
AUTOSAVE_ENABLED_SWITCH = 48
|
||||
AUTOSAVE_HEALING_VAR = 24
|
||||
AUTOSAVE_CATCH_SWITCH = 782
|
||||
AUTOSAVE_WIN_SWITCH = 783
|
||||
AUTOSAVE_STEPS_SWITCH = 784
|
||||
AUTOSAVE_STEPS_VAR = 236
|
||||
|
||||
def pbSetPokemonCenter
|
||||
$PokemonGlobal.pokecenterMapId = $game_map.map_id
|
||||
$PokemonGlobal.pokecenterX = $game_player.x
|
||||
$PokemonGlobal.pokecenterY = $game_player.y
|
||||
$PokemonGlobal.pokecenterDirection = $game_player.direction
|
||||
if $game_variables[AUTOSAVE_HEALING_VAR]==0
|
||||
pbSEPlay("save",100,100)
|
||||
Kernel.tryAutosave()
|
||||
end
|
||||
end
|
||||
|
||||
def Kernel.Autosave
|
||||
pbSave(false)
|
||||
end
|
||||
|
||||
|
||||
def Kernel.tryAutosave()
|
||||
Kernel.Autosave if $game_switches[AUTOSAVE_ENABLED_SWITCH]
|
||||
end
|
||||
|
||||
if AUTOSAVE_STEPS_SWITCH
|
||||
Events.onMapUpdate+=proc {|sender,e|
|
||||
stepsNum = pbGet(AUTOSAVE_STEPS_VAR)
|
||||
if stepsNum > 0 && !$PokemonGlobal.sliding
|
||||
return if $PokemonGlobal.stepcount < 100
|
||||
if $PokemonGlobal.stepcount % stepsNum == 0
|
||||
Kernel.tryAutosave()
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
@@ -174,7 +174,15 @@ end
|
||||
#param2 = true pour body, false pour head
|
||||
#return int du pokemon de base
|
||||
def getBasePokemonID(pokemon, body = true)
|
||||
cname = getConstantName(PBSpecies, pokemon) rescue nil
|
||||
if pokemon.is_a?(Symbol)
|
||||
dex_number = GameData::Species.get(pokemon).id_number
|
||||
pokemon = dex_number
|
||||
end
|
||||
|
||||
# cname = getConstantName(PBSpecies, pokemon) rescue nil
|
||||
cname = GameData::Species.get(pokemon).id.to_s
|
||||
|
||||
|
||||
return pokemon if pokemon <= NB_POKEMON
|
||||
return pokemon if cname == nil
|
||||
|
||||
|
||||
@@ -110,4 +110,146 @@ end
|
||||
|
||||
def getHeadID(species, bodyId)
|
||||
return (species - (bodyId * NB_POKEMON)).round
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
list= []
|
||||
for i in 1..143
|
||||
list.push(i)
|
||||
end
|
||||
for i in 147..149
|
||||
list.push(i)
|
||||
end
|
||||
for i in 152..242
|
||||
list.push(i)
|
||||
end
|
||||
list.push(246)
|
||||
list.push(247)
|
||||
list.push(248)
|
||||
for i in 252..314
|
||||
list.push(i)
|
||||
end
|
||||
for i in 316..339
|
||||
list.push(i)
|
||||
end
|
||||
for i in 352..377
|
||||
list.push(i)
|
||||
end
|
||||
for i in 382..420
|
||||
list.push(i)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
def getPokemonEggGroups(species)
|
||||
groups = []
|
||||
|
||||
compat10=$pkmn_dex[species][13][0]
|
||||
compat11=$pkmn_dex[species][13][1]
|
||||
|
||||
groups << compat10
|
||||
groups << compat11
|
||||
return groups
|
||||
end
|
||||
|
||||
def generateEggGroupTeam(eggGroup)
|
||||
teamComplete = false
|
||||
generatedTeam = []
|
||||
while !teamComplete
|
||||
species = rand(PBSpecies.maxValue)
|
||||
if getPokemonEggGroups(species).include?(eggGroup)
|
||||
generatedTeam << species
|
||||
end
|
||||
teamComplete = generatedTeam.length == 3
|
||||
end
|
||||
return generatedTeam
|
||||
end
|
||||
|
||||
def pbGetSelfSwitch(eventId,switch)
|
||||
return $game_self_switches[[@map_id,eventId,switch]]
|
||||
end
|
||||
|
||||
def obtainBadgeMessage(badgeName)
|
||||
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!",$Trainer.name,badgeName))
|
||||
end
|
||||
|
||||
|
||||
def generateSameEggGroupFusionsTeam(eggGroup)
|
||||
teamComplete = false
|
||||
generatedTeam = []
|
||||
while !teamComplete
|
||||
foundFusionPartner = false
|
||||
species1 = rand(NB_POKEMON)
|
||||
if getPokemonEggGroups(species1).include?(eggGroup)
|
||||
foundFusionPartner = false
|
||||
while !foundFusionPartner
|
||||
species2 = rand(NB_POKEMON)
|
||||
if getPokemonEggGroups(species2).include?(eggGroup)
|
||||
generatedTeam << getFusionSpecies(species1,species2)
|
||||
foundFusionPartner = true
|
||||
end
|
||||
end
|
||||
end
|
||||
teamComplete = generatedTeam.length == 3
|
||||
end
|
||||
return generatedTeam
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
list= []
|
||||
for i in 1..143
|
||||
list.push(i)
|
||||
end
|
||||
for i in 147..149
|
||||
list.push(i)
|
||||
end
|
||||
for i in 152..242
|
||||
list.push(i)
|
||||
end
|
||||
list.push(246)
|
||||
list.push(247)
|
||||
list.push(248)
|
||||
for i in 252..314
|
||||
list.push(i)
|
||||
end
|
||||
for i in 316..339
|
||||
list.push(i)
|
||||
end
|
||||
for i in 352..377
|
||||
list.push(i)
|
||||
end
|
||||
for i in 382..420
|
||||
list.push(i)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
def generateSimpleTrainerParty(teamSpecies,level)
|
||||
team = []
|
||||
for species in teamSpecies
|
||||
poke = Pokemon.new(species, level)
|
||||
team << poke
|
||||
end
|
||||
return team
|
||||
end
|
||||
|
||||
|
||||
def isSinnohPokemon(species)
|
||||
list =
|
||||
[254,255,256,257,258,259,260,261,262,263,264,265,
|
||||
266,267,268,269,270,271,272,273,274,275,288,294,
|
||||
295,296,297,298,299,305,306,307,308,315,316,317,
|
||||
318,319,320,321,322,323,324,326,332,343,344,345,
|
||||
346,347,352,353,354,358,383,384,388,389,400,402,403]
|
||||
return list.include?(species)
|
||||
end
|
||||
|
||||
|
||||
def isHoennPokemon(species)
|
||||
list=[252,253,276,277,278,279,280,281,282,283,284,
|
||||
285,286,287,289,290,291,292,293,300,301,302,303,
|
||||
304,309,310,311,312,313,314,333,334,335,336,340,
|
||||
341,342,355,356,357,378,379,380,381,382,385,386,387,390,
|
||||
391,392,393,394,395,396,401,404,405]
|
||||
return list.include?(species)
|
||||
end
|
||||
@@ -435,15 +435,22 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
if !pokemon.isFusion?
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
newspecies = (head) * Settings::NB_POKEMON + body
|
||||
|
||||
body_exp = pokemon.exp_when_fused_body
|
||||
head_exp = pokemon.exp_when_fused_head
|
||||
|
||||
pokemon.exp_when_fused_body = head_exp
|
||||
pokemon.exp_when_fused_head = body_exp
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
@@ -451,7 +458,6 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
#fus.pbStartScreen(pokemon,newspecies,1)
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
@@ -461,119 +467,170 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
if (pokemon.species <= NB_POKEMON)
|
||||
if pokemon.fused != nil
|
||||
if $Trainer.party.length >= 6
|
||||
scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
return false
|
||||
else
|
||||
$Trainer.party[$Trainer.party.length] = pokemon.fused
|
||||
pokemon.fused = nil
|
||||
pokemon.form = 0
|
||||
scene.pbHardRefresh
|
||||
scene.pbDisplay(_INTL("{1} changed Forme!", pokemon.name))
|
||||
return true
|
||||
end
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
|
||||
if !pokemon.isFusion?
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * Settings::NB_POKEMON + body
|
||||
|
||||
body_exp = pokemon.exp_when_fused_body
|
||||
head_exp = pokemon.exp_when_fused_head
|
||||
|
||||
pokemon.exp_when_fused_body = head_exp
|
||||
pokemon.exp_when_fused_head = body_exp
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
#
|
||||
# def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
# if (pokemon.species <= NB_POKEMON)
|
||||
# if pokemon.fused != nil
|
||||
# if $Trainer.party.length >= 6
|
||||
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# $Trainer.party[$Trainer.party.length] = pokemon.fused
|
||||
# pokemon.fused = nil
|
||||
# pokemon.form = 0
|
||||
# scene.pbHardRefresh
|
||||
# scene.pbDisplay(_INTL("{1} changed Forme!", pokemon.name))
|
||||
# return true
|
||||
# end
|
||||
# else
|
||||
# chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||
# if chosen >= 0
|
||||
# poke2 = $Trainer.party[chosen]
|
||||
# if (poke2.species <= NB_POKEMON) && poke2 != pokemon
|
||||
# #check if fainted
|
||||
# if pokemon.hp == 0 || poke2.hp == 0
|
||||
# scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||
# return false
|
||||
# end
|
||||
# if pbFuse(pokemon, poke2, supersplicers)
|
||||
# pbRemovePokemonAt(chosen)
|
||||
# end
|
||||
# elsif pokemon == poke2
|
||||
# scene.pbDisplay(_INTL("{1} can't be fused with itself!", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("{1} can't be fused with {2}.", poke2.name, pokemon.name))
|
||||
# return false
|
||||
#
|
||||
# end
|
||||
#
|
||||
# else
|
||||
# return false
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
# return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||
#
|
||||
# #unfuse
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
# #pcPosition nil : unfusing from party
|
||||
# #pcPosition [x,x] : unfusing from pc
|
||||
# #
|
||||
#
|
||||
# if (pokemon.obtain_method == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
# scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
# return false
|
||||
# else
|
||||
# if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name))
|
||||
# if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion
|
||||
# scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name))
|
||||
# return false
|
||||
# elsif $Trainer.party.length >= 6 && !pcPosition
|
||||
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("Unfusing ... "))
|
||||
# scene.pbDisplay(_INTL(" ... "))
|
||||
# scene.pbDisplay(_INTL(" ... "))
|
||||
#
|
||||
# bodyPoke = getBasePokemonID(pokemon.species, true)
|
||||
# headPoke = getBasePokemonID(pokemon.species, false)
|
||||
#
|
||||
#
|
||||
# if pokemon.exp_when_fused_head == nil || pokemon.exp_when_fused_body == nil
|
||||
# new_level = calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
# body_level = new_level
|
||||
# head_level = new_level
|
||||
# poke1 = Pokemon.new(bodyPoke, body_level)
|
||||
# poke2 = Pokemon.new(headPoke, head_level)
|
||||
# else
|
||||
# exp_body = pokemon.exp_when_fused_body + pokemon.exp_gained_since_fused
|
||||
# exp_head = pokemon.exp_when_fused_head + pokemon.exp_gained_since_fused
|
||||
#
|
||||
# poke1 = Pokemon.new(bodyPoke, pokemon.level)
|
||||
# poke2 = Pokemon.new(headPoke, pokemon.level)
|
||||
# poke1.exp = exp_body
|
||||
# poke2.exp = exp_head
|
||||
# end
|
||||
#
|
||||
# #poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
# #poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
#
|
||||
# if pcPosition == nil
|
||||
# box = pcPosition[0]
|
||||
# index = pcPosition[1]
|
||||
# $PokemonStorage.pbStoreToBox(poke2, box, index)
|
||||
# else
|
||||
# Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
||||
# end
|
||||
# #On ajoute l'autre dans le pokedex aussi
|
||||
# $Trainer.seen[poke1.species] = true
|
||||
# $Trainer.owned[poke1.species] = true
|
||||
# $Trainer.seen[poke2.species] = true
|
||||
# $Trainer.owned[poke2.species] = true
|
||||
#
|
||||
# pokemon.species = poke1.species
|
||||
# pokemon.level = poke1.level
|
||||
# pokemon.name = poke1.name
|
||||
# pokemon.moves = poke1.moves
|
||||
# pokemon.obtain_method = 0
|
||||
# poke1.obtain_method = 0
|
||||
#
|
||||
# #scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
# scene.pbHardRefresh
|
||||
# scene.pbDisplay(_INTL("Your Pokémon were successfully unfused! "))
|
||||
# return true
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
def calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||
if chosen >= 0
|
||||
poke2 = $Trainer.party[chosen]
|
||||
if (poke2.species <= NB_POKEMON) && poke2 != pokemon
|
||||
#check if fainted
|
||||
if pokemon.hp == 0 || poke2.hp == 0
|
||||
scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||
return false
|
||||
end
|
||||
if pbFuse(pokemon, poke2, supersplicers)
|
||||
pbRemovePokemonAt(chosen)
|
||||
end
|
||||
elsif pokemon == poke2
|
||||
scene.pbDisplay(_INTL("{1} can't be fused with itself!", pokemon.name))
|
||||
return false
|
||||
else
|
||||
scene.pbDisplay(_INTL("{1} can't be fused with {2}.", poke2.name, pokemon.name))
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
return false
|
||||
end
|
||||
lev = pokemon.obtain_method == 2 ? pokemon.level * 0.65 : pokemon.level * 0.75
|
||||
end
|
||||
else
|
||||
return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||
|
||||
#unfuse
|
||||
end
|
||||
end
|
||||
|
||||
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
#pcPosition nil : unfusing from party
|
||||
#pcPosition [x,x] : unfusing from pc
|
||||
#
|
||||
|
||||
if (pokemon.obtainMode == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
return false
|
||||
else
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name))
|
||||
if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion
|
||||
scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name))
|
||||
return false
|
||||
elsif $Trainer.party.length >= 6 && !pcPosition
|
||||
scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
return false
|
||||
else
|
||||
scene.pbDisplay(_INTL("Unfusing ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
|
||||
bodyPoke = getBasePokemonID(pokemon.species, true)
|
||||
headPoke = getBasePokemonID(pokemon.species, false)
|
||||
# pf = pokemon.species
|
||||
# p1 = (pf/NB_POKEMON).round
|
||||
# p2 = pf - (NB_POKEMON*p1)
|
||||
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
lev = pokemon.obtainMode == 2 ? pokemon.level * 0.65 : pokemon.level * 0.75
|
||||
end
|
||||
else
|
||||
lev = 1
|
||||
end
|
||||
poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
|
||||
if pcPosition == nil
|
||||
box = pcPosition[0]
|
||||
index = pcPosition[1]
|
||||
$PokemonStorage.pbStoreToBox(poke2, box, index)
|
||||
else
|
||||
Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
||||
end
|
||||
#On ajoute l'autre dans le pokedex aussi
|
||||
$Trainer.seen[poke1.species] = true
|
||||
$Trainer.owned[poke1.species] = true
|
||||
$Trainer.seen[poke2.species] = true
|
||||
$Trainer.owned[poke2.species] = true
|
||||
|
||||
pokemon.species = poke1.species
|
||||
pokemon.level = poke1.level
|
||||
pokemon.name = poke1.name
|
||||
pokemon.moves = poke1.moves
|
||||
pokemon.obtainMode = 0
|
||||
poke1.obtainMode = 0
|
||||
|
||||
#scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
scene.pbHardRefresh
|
||||
scene.pbDisplay(_INTL("Your Pokémon were successfully unfused! "))
|
||||
return true
|
||||
end
|
||||
end
|
||||
lev = 1
|
||||
end
|
||||
return lev.floor
|
||||
end
|
||||
|
||||
def pbFuse(pokemon, poke2, supersplicers = false)
|
||||
@@ -1159,56 +1216,8 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
#fus.pbStartScreen(pokemon,newspecies,1)
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
@@ -1297,7 +1306,7 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
|
||||
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
|
||||
|
||||
if (pokemon.obtainMode == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
if (pokemon.obtain_method == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
return false
|
||||
else
|
||||
@@ -1322,21 +1331,23 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
|
||||
# pf = pokemon.species
|
||||
# p1 = (pf/NB_POKEMON).round
|
||||
# p2 = pf - (NB_POKEMON*p1)
|
||||
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
lev = pokemon.obtainMode == 2 ? pokemon.level * 0.65 : pokemon.level * 0.80
|
||||
end
|
||||
if pokemon.exp_when_fused_head == nil || pokemon.exp_when_fused_body == nil
|
||||
new_level = calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
body_level = new_level
|
||||
head_level = new_level
|
||||
poke1 = Pokemon.new(bodyPoke, body_level)
|
||||
poke2 = Pokemon.new(headPoke, head_level)
|
||||
else
|
||||
lev = 1
|
||||
exp_body = pokemon.exp_when_fused_body + pokemon.exp_gained_since_fused
|
||||
exp_head = pokemon.exp_when_fused_head + pokemon.exp_gained_since_fused
|
||||
|
||||
poke1 = Pokemon.new(bodyPoke, pokemon.level)
|
||||
poke2 = Pokemon.new(headPoke, pokemon.level)
|
||||
poke1.exp = exp_body
|
||||
poke2.exp = exp_head
|
||||
end
|
||||
poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
|
||||
|
||||
if $Trainer.party.length >= 6
|
||||
if (keepInParty == 0)
|
||||
@@ -1354,15 +1365,15 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
end
|
||||
|
||||
#On ajoute l'autre dans le pokedex aussi
|
||||
$Trainer.seen[poke1.species] = true
|
||||
$Trainer.owned[poke1.species] = true
|
||||
$Trainer.pokedex.set_seen(poke1.species)
|
||||
$Trainer.pokedex.set_owned(poke1.species)
|
||||
|
||||
pokemon.species = poke1.species
|
||||
pokemon.level = poke1.level
|
||||
pokemon.name = poke1.name
|
||||
pokemon.moves = poke1.moves
|
||||
pokemon.obtainMode = 0
|
||||
poke1.obtainMode = 0
|
||||
pokemon.obtain_method = 0
|
||||
poke1.obtain_method = 0
|
||||
|
||||
#scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
scene.pbHardRefresh
|
||||
|
||||
@@ -525,7 +525,7 @@ class PokemonFusionScene
|
||||
@pokemon2 = pokemon2
|
||||
|
||||
@newspecies = newspecies
|
||||
addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg",
|
||||
addBackgroundOrColoredPlane(@sprites, "background", "DNAbg",
|
||||
Color.new(248, 248, 248), @viewport)
|
||||
|
||||
poke1_number = GameData::Species.get(@pokemon1.species).id_number
|
||||
@@ -682,6 +682,11 @@ class PokemonFusionScene
|
||||
Kernel.pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]", @pokemon1.name, newspeciesname))
|
||||
|
||||
#exp
|
||||
@pokemon1.exp_when_fused_head = @pokemon2.exp #peut-être l'inverse
|
||||
@pokemon1.exp_when_fused_body = @pokemon1.exp #peut-être l'inverse
|
||||
@pokemon1.exp_gained_since_fused=0
|
||||
|
||||
averageFusionIvs()
|
||||
#add to pokedex
|
||||
if !$Trainer.pokedex.owned?(newSpecies)
|
||||
|
||||
@@ -198,7 +198,9 @@ def pbCompletedQuest?(id)
|
||||
end
|
||||
|
||||
def pbQuestlog
|
||||
Questlog.new
|
||||
pbMessage(_INTL("The quest log has been temporarily removed from the game and is planned to be added back in a future update"))
|
||||
return
|
||||
#Questlog.new
|
||||
end
|
||||
|
||||
def pbAddQuest(id)
|
||||
|
||||
1129
Data/Scripts/050_AddOns/Wondertrade.rb
Normal file
1129
Data/Scripts/050_AddOns/Wondertrade.rb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user