From 500edeca7d562ee82038aa2440e7ad76ca0bc0dd Mon Sep 17 00:00:00 2001 From: infinitefusion Date: Thu, 1 Jul 2021 20:08:02 -0400 Subject: [PATCH] dna reverser, hotel crashes fix, unfusing & exp tracking, wondertrade --- .../004_Battle_ExpAndMoveLearning.rb | 9 + Data/Scripts/014_Pokemon/001_Pokemon.rb | 10 + .../015_Trainers and player/001_Trainer.rb | 1 + .../004_UI_Evolution.rb | 33 +- .../001_Non-interactive UI/005_UI_Trading.rb | 13 +- .../PBItems.rb | 2 +- Data/Scripts/049_Compatibility/PBSpecies.rb | 7 + .../PBTrainers.rb | 0 .../pb_types.rb | 0 Data/Scripts/050_AddOns/Autosave.rb | 39 + Data/Scripts/050_AddOns/Gen 2.rb | 10 +- Data/Scripts/050_AddOns/GeneralUtils.rb | 142 +++ Data/Scripts/050_AddOns/New Items effects.rb | 365 +++--- Data/Scripts/050_AddOns/PokemonFusion.rb | 7 +- Data/Scripts/050_AddOns/QuestLogScript.rb | 4 +- Data/Scripts/050_AddOns/Wondertrade.rb | 1129 +++++++++++++++++ 16 files changed, 1573 insertions(+), 198 deletions(-) rename Data/Scripts/{050_AddOns/Migration => 049_Compatibility}/PBItems.rb (98%) create mode 100644 Data/Scripts/049_Compatibility/PBSpecies.rb rename Data/Scripts/{050_AddOns/Migration => 049_Compatibility}/PBTrainers.rb (100%) rename Data/Scripts/{050_AddOns/Migration => 049_Compatibility}/pb_types.rb (100%) create mode 100644 Data/Scripts/050_AddOns/Autosave.rb create mode 100644 Data/Scripts/050_AddOns/Wondertrade.rb diff --git a/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb index d36553e75..dcdd7c0a2 100644 --- a/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb @@ -183,6 +183,15 @@ class PokeBattle_Battle levelMaxExp = growth_rate.minimum_exp_for_level(curLevel + 1) tempExp2 = (levelMaxExp 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 diff --git a/Data/Scripts/015_Trainers and player/001_Trainer.rb b/Data/Scripts/015_Trainers and player/001_Trainer.rb index a05dd36c7..921fa9e7d 100644 --- a/Data/Scripts/015_Trainers and player/001_Trainer.rb +++ b/Data/Scripts/015_Trainers and player/001_Trainer.rb @@ -7,6 +7,7 @@ class Trainer attr_accessor :id attr_accessor :language attr_accessor :party + attr_accessor :quests def inspect str = super.chop diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 7153f6b1f..5863076b9 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -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 diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index 81909cdb1..d48997c16 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -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 diff --git a/Data/Scripts/050_AddOns/Migration/PBItems.rb b/Data/Scripts/049_Compatibility/PBItems.rb similarity index 98% rename from Data/Scripts/050_AddOns/Migration/PBItems.rb rename to Data/Scripts/049_Compatibility/PBItems.rb index 297f93717..49d0f3f66 100644 --- a/Data/Scripts/050_AddOns/Migration/PBItems.rb +++ b/Data/Scripts/049_Compatibility/PBItems.rb @@ -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 diff --git a/Data/Scripts/049_Compatibility/PBSpecies.rb b/Data/Scripts/049_Compatibility/PBSpecies.rb new file mode 100644 index 000000000..bf1fa1164 --- /dev/null +++ b/Data/Scripts/049_Compatibility/PBSpecies.rb @@ -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 + diff --git a/Data/Scripts/050_AddOns/Migration/PBTrainers.rb b/Data/Scripts/049_Compatibility/PBTrainers.rb similarity index 100% rename from Data/Scripts/050_AddOns/Migration/PBTrainers.rb rename to Data/Scripts/049_Compatibility/PBTrainers.rb diff --git a/Data/Scripts/050_AddOns/Migration/pb_types.rb b/Data/Scripts/049_Compatibility/pb_types.rb similarity index 100% rename from Data/Scripts/050_AddOns/Migration/pb_types.rb rename to Data/Scripts/049_Compatibility/pb_types.rb diff --git a/Data/Scripts/050_AddOns/Autosave.rb b/Data/Scripts/050_AddOns/Autosave.rb new file mode 100644 index 000000000..5b420185f --- /dev/null +++ b/Data/Scripts/050_AddOns/Autosave.rb @@ -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 \ No newline at end of file diff --git a/Data/Scripts/050_AddOns/Gen 2.rb b/Data/Scripts/050_AddOns/Gen 2.rb index 040ab5245..87ad0f1a1 100644 --- a/Data/Scripts/050_AddOns/Gen 2.rb +++ b/Data/Scripts/050_AddOns/Gen 2.rb @@ -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 diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb index 9fafb7e64..f1aaa3e2e 100644 --- a/Data/Scripts/050_AddOns/GeneralUtils.rb +++ b/Data/Scripts/050_AddOns/GeneralUtils.rb @@ -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 \ No newline at end of file diff --git a/Data/Scripts/050_AddOns/New Items effects.rb b/Data/Scripts/050_AddOns/New Items effects.rb index ac63ee470..8ae29b192 100644 --- a/Data/Scripts/050_AddOns/New Items effects.rb +++ b/Data/Scripts/050_AddOns/New Items effects.rb @@ -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 diff --git a/Data/Scripts/050_AddOns/PokemonFusion.rb b/Data/Scripts/050_AddOns/PokemonFusion.rb index 667ff58d1..9ace0b7e1 100644 --- a/Data/Scripts/050_AddOns/PokemonFusion.rb +++ b/Data/Scripts/050_AddOns/PokemonFusion.rb @@ -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) diff --git a/Data/Scripts/050_AddOns/QuestLogScript.rb b/Data/Scripts/050_AddOns/QuestLogScript.rb index a06924c03..3d75aa54f 100644 --- a/Data/Scripts/050_AddOns/QuestLogScript.rb +++ b/Data/Scripts/050_AddOns/QuestLogScript.rb @@ -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) diff --git a/Data/Scripts/050_AddOns/Wondertrade.rb b/Data/Scripts/050_AddOns/Wondertrade.rb new file mode 100644 index 000000000..bd9a0ae44 --- /dev/null +++ b/Data/Scripts/050_AddOns/Wondertrade.rb @@ -0,0 +1,1129 @@ + +=begin +*** Wonder Trade Script by Black Eternity *** +This script is to mimic Wonder Trade from an offline perspective. +THERE IS NO ONLINE CAPABILITIES OF THIS SCRIPT, +ALL CALCULATIONS ARE DONE INTERNALLY. + +To call the script like normal and have ALL Pokemon trade-able, use the following. + pbWondertrade(1,[],[]) + +Black listed Pokemon are to be added to the Exceptions arrays. + Except is the list of pokemon the player is forbidden to trade. + Here the player cannot trade any of the following. + pbWonderTrade(1,[:PIKACHU,:SQUIRTLE,:CHARMANDER,;BULBASAUR],[]) + + Except2 is the list of pokemon the player is forbidden to receive. + Here the player cannot receive any of the following. + pbWonderTrade(1,[],[:MEWTWO,;MEW,;DEOXYS]) + + + +The first parameter is the minimum allowed Level of the Pokemon to be traded. +For example, you can not trade a Pokemon through Wonder Trade unless its level +is greater than or equal to specified level. + + pbWonderTrade(40,[:SQUIRTLE,:CHARMANDER,:BULBASAUR],[:MEWTWO,:MEW,:DEOXYS]) + *** Only pokemon over level 40 can be traded, you cannot trade starters. + *** You cannot receive these legendaries. + +The fourth parameter, which has recently replaced mej71's "hardobtain" +is called "rare", this parameter developed also by mej71, will use +the Pokemon's rareness and filter the results depending on its values. + +** Rareness is turned on by default, if you wish to disable it, call the + function accordingly. + + pbWonderTrade(10,[:SQUIRTLE],[:CHARMANDER,:BULBASAUR],false) + ** Only Pokemon over level 10, cannot trade Squirtle, cannot + ** recieve Charmander or Bulbasaur, Rareness disabled. + +It is up to you to use it how you wish, credits will be appreciated. +=end + +# List of Randomly selected Trainer Names +# These are just names taken from a generator, add custom or change to +# whatever you desire. +RandTrainerNames=[ + "Mikaël", + "James", + "Keith", + "Matthew", + "Jeremy", + "Louis", + "Albert", + "Emily", + "Aaron", + "Frances", + "Steve", + "Joan", + "Dorothy", + "Jeffrey", + "Alice", + "Sara", + "David", + "Anne", + "Shirley", + "Henry", + "Carolyn", + "Christopher", + "Christina", + "Ronald", + "Randy", + "Nancy", + "Virginia", + "Donna", + "William", + "Jacqueline", + "Catherine", + "Ash", + "Jesse", + "Roger", + "Denise", + "Ashley", + "Maria", + "Todd", + "Helen", + "Teresa", + "Fred", + "Annie", + "Rachel", + "Kathleen", + "Marie", + "Scott", + "Phillip", + "Craig", + "Diane", + "Beverly", + "Lisa", + "Mildred", + "Lois", + "Douglas", + "Deborah", + "Bianca", + "Phyllis", + "Melissa", + "Laura", + "Lara", + "Stephanie", + "Ernest", + "Evelyn", + "Irene", + "Brandon", + "Jean", + "Sandra", + "Linda", + "Stan", + "Kenny", + "Eric", + "Kyle", + "Raymond", + "Lucy", + "Molly", + "Kathryn", + "Harry", + "Gary", + "Katherine", + "Theresa", + "Bill", + "Howard", + "Stephen", + "Russell", + "Louisel", + "Bobby", + "Alyssa", + "Susan", + "Martin", + "Harold", + "Andrea", + "Sharon", + "Juan", + "Rose", + "Lori", + "Dorist", + "Mom", + "Joseph", + "Charles", + "Donald", + "Arthur", + "Janice", + "Carlos", + "Brock", + "Misty", + "Lt. Surge", + "Erika", + "Koga", + "Sabrina", + "Blaine", + "Giovanni", + "Blue", + "Prof. Oak", + "Lance", + "Agatha", + "Bruno", + "Lorelei", + "Jack", + "Wanda", + "Miyamoto", + "Ralph", + "Christine", + "Mel", + "Betty", + "Julia", + "Michelle", + "Barrack", + "Kevin", + "James", + "Michael", + "Kathy", + "Game Freak", + "Nintendo", + "Silph Co.", + "Boris", + "Mr. Fuji", + "Santa Claus", + "Blue", + "Archie", + "Maxie", + "Cyrus", + "Team Rocket", + "Vladimir" +] + +# List of randomly selected Pokemon Nicknames +RandPokeNick=[ + "Poncho", + "King", + "Batar", + "Pneuma", + "goo", + "Shakira", + "BATMAN", + "Armstrong", + "Guten Tag =)", + "Saturn", + "BUTTER47", + "Lakota", + "Lepizig", + "Mombacho", + "Slam", + "Frogman", + "Easter", + "Atari", + "Regis", + "Cleopatra", + "Robin", + "pthread_cond_init", + "Pharaoh", + "Moskva", + "Skywalker", + "Minivan", + "Nevada", + "CAPTAIN", + "Buzz", + "Bolzano", + "Jabroni", + "InfiniteFusion.cpp", + "Paco", + "Killah", + "Skyrim", + "Zeffy", + "Hydra", + "Ultimo!", + "Sohcahtoa", + "The Beast", + "Ragnarok", + "Supernova", + "Tolkien", + "♩ DE R△//en♩ ", + "Martina", + "Minessota", + "Sir", + "crunchy", + "MACE4", + "Vouta", + "Yussef", + "Dracula", + "Spikes", + "Arnold", + "Grenadine", + "Piña", + "rofl", + "Bulrog", + "Bubbles", + "Pompadour", + "Mew", + "MEWTHREE", + "Eclipse", + "Yoshi", + "Wonder", + "Kalashnikov", + "Spencer", + "Jingle", + "Jungle", + "Asgore", + "0", + "Mischief", + "Lambo", + "Elvis", + "Pretzel", + "Mec", + "Boromir", + "Gandalf", + "Mickey", + "Michael Jordan", + "POSIX", + "pokemon.exe", + "Frodo", + "One", + "Dude", + "Sandstorm", + "The Destroyer", + "Pokenator", + "Big guy", + "Mallow", + "MALLOW", + "Aladdin", + "Sluggy", + "Freaky", + "fuxj", + "ur mum", + "TwerkWobufet", + "John Wick", + "Angel", + "baddybad", + "Mr. Bean", + "Lover", + "HALLOWS", + "Trucker", + "idk", + "Bababa", + "Absinthe", + "Fatality", + "hereyouare", + "Egg", + "Mademoiselle", + "Jolly", + "Jet", + "Gourmet", + "Nocturne", + "Bo", + "Foxy", + "Lady", + "Deadpool", + "Mean Joe", + "Lise", + "no name", + "Shards", + "Mrs. Johnson", + "Mister", + "Female", + "Grand", + "Polyp", + "Sao Paulo", + "Inspector", + "Vinny", + "Knight", + "SpdefSpdAtk", + "Soul", + "Saul", + "Heho", + "Bluebeard", + "Whirlio", + "Managua", + "Soprano", + "Doomsday", + "Mechano", + "Roboto", + "Stealy", + "London", + "Paris", + "Barcelona", + "Tokyo", + "New York", + "Wondertrade", + "wt_poke_01", + "Moscow", + "cool", + "cool guy", + "AAAAAAAAAA", + "♂♂♂♂♂♂♂♂♂", + "♀♀♀♀♀♀♀♀♀", + "♀", + "♂", + "Charlie", + "SKA", + "Fatal", + "P.I.M.P.", + "Manson", + "Kilburn", + "thank you", + "Lamar", + "CJ", + "sup", + "LOL", + "^-^", + "fart69", + "420", + "this game sucks", + "this game is shit", + "i like this", + "Bazooka", + "Scorpio", + "______", + "x", + "Rob", + "Charlie", + "Zack", + "Garou", + "Artyom", + "Bert", + "Passe-partout", + "Ali", + "Marty", + "xxx", + "Zappa", + "Carmen", + "Brad", + "Ferrari", + "Floyd", + "Morrisson", + "Ti-criss", + "#pokemon", + "Rocky", + "Sony", + "Microsoft", + "Combo", + "poulet", + "Jesus", + "Cyrano", + "Cthulhu", + "Couillard", + "Zoombini", + "Allah", + "clipou", + "Muhammad", + "Gino", + "password", + "password123", + "covid", + "covfefe", + "admin", + "God", + "spaghetti-o", + "prawn", + "1; DROP TABLE pokemon;--", + "Serberus", + "Aurora", + "lmao", + "Rob Ford", + "Mew", + "Arceus", + "SwaggDab", + "KOFFING", + "Rayquaza", + "ur welcome", + "Cartman", + "Switch", + "Zelda", + "Link", + "Mario", + "Luigi", + "Waluigi", + "Kirby", + "Samus", + "Donkey Kong", + "Donkey", + "Sparky", + "Bob", + "Spartacus", + "Shrek", + "Martin", + "Toto", + "Bobo", + "Klown", + "papi", + "Gaston", + "farts", + "$$$", + "Diego", + "Samba", + "Bossa Nova", + "Reggae", + "Spock", + "Jazz", + "generatedName_1", + "generatedName_2", + "generatedName_3", + "Caesar", + "Celebi", + "pikachu", + "Rorschach", + "Rock n' Roll", + "AAAAAAAAAAAA", + "Gringo", + "Ringo", + "Bigmac", + "Nintendo", + "Ferocious", + "xxx", + ":)", + "♫ ♫ ♫", + "Schrroms", + "GOD", + "Samantha", + "Gaga", + "Audrey", + "birb", + "Donut", + "Jell-o", + "Tropicana", + "Sleepy", + "Kirill", + "Carbon", + "thank you!!", + "hello", + "Carl", + "Meow", + "Marcus", + "Woof", + "Carlos", + "hm_slave", + "Varicelle", + "Google", + "Twitter", + "Facebook", + "Mia", + "Lame-o", + "Snoop", + "Mephesto", + "salut toi", + "Eric", + "Kyle", + "Kenny", + "Stan", + "Kevin", + "Jim", + "spooky boi", + "Pam", + "Stevie", + "Bravo", + "Johnny Bravo", + "Dolores", + "Junior", + "Spinacio", + "Doc", + "Mailloux", + "Marley", + "Leibniz", + "Jasmine", + "Wack", + "Fizzy", + "Foo", + "Metrognome", + "R2D2", + "my pokéman", + "POKEMAN1", + "POKEMAN2", + "POKEMAN4", + "Gnome", + "Warbles", + "Primavera", + "Gigi", + "Scuba", + "Gulpino", + "Anthem", + "Cinderella", + "Schnapps", + "Toughman", + "HASBRO", + "Primavera", + "Tapu", + "Lolu", + "PKP", + "Lord", + "Gollum", + "Vipa", + "Ringo", + "Django", + "Moses", + "Porkus", + "Mallow", + "Leaf", + "Red", + "Wormus", + "Java", + "Zag", + "Zef", + "Dorothy", + "pink floyd", + "Misty", + "Ash", + "Satoshi", + "Sniper", + "Suzy", + "Lucy", + "Molly", + "Leela", + "Pauvcon", + "Fatso", + "Coolio", + "Sonata", + "Romeo", + "Juliet", + "Mojito", + "5BAGGIGUANE", + "Slug", + "Love", + "Bella", + "Bourbon", + "The Menace", + "Shihuang", + "Kim", + "Solfege", + "Kunidé", + "Kate", + "Dave", + "t bo", + "what", + "Zebra", + "Captain", + "Venimo", + "Markazus", + "Otello", + "The one and only", + "Ricky", + "Scree", + "Creepium", + "Newton", + "Blaster", + "Requiem", + "Shelley", + "Steve Winwood", + "uranium", + "Princess", + "Zuzu", + "Brainiac", + "P1", + "P2", + "Morpheus", + "Brexit", + "Boromir", + "Rick", + "Morty", + "Scheiße", + "Santa", + "Crumbs", + "Neo", + "Michael", + "Jackson", + "Adamas", + "Tina", + "Scrabble", + "Tiamath", + "Raggedy", + "Rickety", + "Cricket", + "Wario", + "Rex", + "Fido", + "Castor", + "Pollux", + "Rambo", + "Skeletor", + "Speedo", + "Robocop", + "Dredd", + "Nicolas Cage", + "jean michel", + "Sammy", + "Jones", + "cheers!", + "Frootloops", + "T", + "The Batman", + "Twerk", + "Dubstep", + "Flynn", + "Bender", + "uwotm8", + "KFC", + "Legolas", + "Ronald", + "Jareth", + "Macarena", + "Dreamer", + "Beetlejuice", + "fann", + "Gizmo", + "Cannonball", + "Copyright", + "John McClane", + "Mint", + "Colonel", + "Ed", + "jay jay", + "Ramen", + "Rascal", + "Enigma", + "", + "77", + "420", + "strong guy", + "Skyzo", + "Cozy", + "Nica", + "Sticky", + "Angela", + "Zala", + "Cornflake", + "Spyro", + "Manhattan", + "Devon", + "Passion", + "Silph", + "Yan", + "Double", + "Doc", + "Rayman", + "Taco", + "Toro", + "Pokémon Infinite Fusion", + "uwotm8", + "ROCKY", + "Giga", + "Santana", + "McCola", + "Lexy", + "Kenya", + "Bean", + "GameBoy", + "PlayStation", + "GameCube", + "Petit mec", + "X-Box", + "AAAAAAAA", + "cyka", + "Jetpack", + "Yankee", + "Batman", + "Garfield", + "Schokolade", + "Vile", + "Penny", + "Lionel", + "Malicious", + "Supernova", + "Agumon", + "mick jagger", + "Greymon", + "Rockstar", + "Shin", + "Egg", + "Emily", + "garcia", + "Goku", + "Vegeta", + "Nacho", + "Chachi", + "Weasley", + "salut", + "DEMON", + "Ponytails", + "monesti", + "ticon", + "macalice", + "Dixie", + "Tails", + "Banzai", + "Sonic", + "Mario", + "Luigi", + "lol nice try", + "Anakin", + "Snape", + "Conky", + "fait chier", + "lamus", + "Sonic", + "Harry", + "Potter", + "Rumba", + "pikapika", + "Never Gonna Give You Up", + "Peppy", + "Link", + "Uber", + "Lollipop", + "CURSED", + "Solid", + "Rock", + "Metroid", + "Obelix", + "Asterix", + "Monsta!", + "virus.exe", + "Limewire", + "nothing", + "rick and morty", + "a Pokémon", + "Lilly", + "Safari", + "Dreams", + "Todd", + "Dino", + "Jaws", + "Flatman", + "Sylvain", + "Light", + "Peter", + "Angel", + "Corona", + "Cinnamon", + "TBK", + "Tabarnak", + "Joker", + "O'Neil", + "Stu", + "||||", + "Nightmare", + "1", + "Maniac", + "Bee Gee", + "Volleyball", + "BaBa", + "Nemo", + "25", + "Puppy", + "Puffy", + "Fi", + "FASHION", + "Chuckles", + "Bacon", + "Nightman", + "Dayman", + "Jojo", + "Moon", + "Unity", + "Zappa", + "McNeil", + "Bowie", + "Hendrix", + "Bunny", + "Jina", + "Gipsy", + "$$$", + "Scooby", + "Marcarcand", + "Artist", + "Galleon", + "Hilary Clinton", + "Metroid", + "Ali", + "Snoopy", + "Mimi", + "Quebec", + "Zexy", + "woopsie", + "wrong pokemon", + "MISSINGNO", + "MISSINGNAME", + "Proton", + "Numba 1","Number 2","Number 3","Number 4","Number 5","Number 6","Number 7", + "pokeman", + "hm_slave", + "hm_slave01", + "Gio", + "Domingo", + "Domino", + "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII", + "Chad", + "try again", + "Ridley", + "Ursaring", + "Charlie", + "Justin Trudeau", + "273-8255", + "Gino", + "Woody", + "Buzz", + "Zerg", + "Macho", + "Paddle", + "Tennis", + "Chidi", + "OFCOURS-_-", + "Baseball", + "2738255", + "call me", + "Lanky", + "DK", + "Tiny", + "Splashy", + "Tomato", + "<3", + "Z", + "Zorro", + "Zoe", + "Frank", + "Jeff", + "Redneck", + "good IVs", + "Rooster", + "Peyton", + "Nutella", + "Bell", + "Soup", + "Yoda", + "Corsola", + "Glass", + "Rocket", + "Vodka", + "I <3 U", + "Ninja", + "Papa", + "Mama", + "Fortnite", + "Eleanor", + "Pepito", + "Dolphin", + "Lucky", + "Amour", + "Nova", + "my name", + "AAAAAH!!!", + "N64", + "Turnips", + "Hermione", + "Narnia", + "Obama", + "Freebie", + "un joli pokémon", + "Unit-3", + "Happy", + "Terror", + "Kanto","Johto","Hoenn","Sinnoh","Unova","Kalos","Alola", + "Jar Jar", + "Garcia", + "Reaper", + "193119", + "pokemon.png", + "Muscles", + "Buddy", + "asl", + "test", + "Simba", + "Blacky", + "Mufasa", + "caca", + "Neptune", + "MASTER", + "Yoga", + "McDo", + "yourself", + "something", + "something better", + "this","that", + "it", + "愛", + "Franz", + "Muffinman", + "huh?", + "Rachid", + "Naruto", + "bling bling", + "gimme $$$", + "Zombie", + "Woofster", + "Turing", + "d00d", + "Billy", + "qt", + "Digimon", + "Elsa", + "Candy", + "Mini", + "Squash", + "Queen", + "King", + "Prince", + "Princess", + "Emperor", + "Mimosa", + "Heisenberg", + "Java", + "Copernicus", + "Lloyd", + "BOOM", + "Cloud", + "Jeremy", + "Madrid", + "Garfield", + "Gin", + "Luke", + "gracias", + "Lucky", + "Pinnocchio", + "Kappa", + "Budweiser", + "Ruby", + "Boogieman", + "Disco", + "sweatie", + "ACDC", + "coco", + "NullPointerException", + "Myriam", + "pink", + "Gump", + "shazam", + "Stefano", + "Moby", + "Sashimi", + "Vito", + "Chippy", + "Boogie", + "Funky", + "Groot", + "Chewbacca", + "Schrroms", + "Boris", + "maymay" +] + + +def pbWonderTrade(lvl,except=[],except2=[],rare=true) + # for i in 0...except.length # Gets ID of pokemon in exception array + # except[i]=getID(PBSpecies,except[i]) if !except[i].is_a?(Integer) + # end + # for i in 0...except2.length # Gets ID of pokemon in exception array + # except2[i]=getID(PBSpecies,except2[i]) if !except2[i].is_a?(Integer) + # end + # ignoreExcept = rand(100) == 0 #tiny chance to include legendaries + # + # except+=[] + chosen=pbChoosePokemon(1,2, # Choose eligable pokemon + proc { + |poke| !poke.egg? && !(poke.isShadow?) && # No Eggs, No Shadow Pokemon + (poke.level>=lvl) && !(except.include?(poke.species)) # None under "lvl", no exceptions. + }) + poke = $Trainer.party[pbGet(1)] + $PokemonBag.pbStoreItem(poke.item,1) if poke.item != nil + myPoke = poke.species + chosenBST = calcBaseStats(myPoke) + # The following excecption fields are for hardcoding the blacklisted pokemon + # without adding them in the events. + #except+=[] + except2+=[:ARCEUS,:MEW,:CELEBI,:LUGIA,:HOOH,:MEWTWO] + if pbGet(1)>=0 + species=0 + luck = rand(5)+1 + rarecap = (rand(155+poke.level)/(1+rand(5)))/luck + bonus = 0 + while (species==0) # Loop Start + bonus+= 5 #+ de chance de pogner un bon poke a chaque loop (permet d'eviter infinite loop) + + species=rand(PBSpecies.maxValue)+1 + bst = calcBaseStats(species) + # Redo the loop if pokemon is too evolved for its level + #species=0 if lvl < pbGetMinimumLevel(species)# && pbGetPreviousForm(species) != species # && pbGetPreviousForm(species)!=species + # Redo the loop if the species is an exception. + species=0 if checkifBlacklisted(species,except2) && !ignoreExcept #except2.include?(species) + #Redo loop if above BST + species=0 if bst > chosenBST+$game_variables[120]+bonus + + #Redo loop if below BST - 200 + species=0 if bst < (chosenBST - 200) + + + # raise _INTL("{1}'s bst ist {2}, new ist {3}",myPoke,chosenBST,bst) + + # species=0 if (except.include?(species) && except2.include?(species)) + # use this above line instead if you wish to neither receive pokemon that YOU + # cannot trade. + if rare==true #turn on rareness + if species > 0 + rareness=GameData::Species.get(species).catch_rate + species=0 if rarecap>=rareness + end + end + end + tname=RandTrainerNames[rand(RandTrainerNames.size)] # Randomizes Trainer Names + pname=RandPokeNick[rand(RandPokeNick.size)] # Randomizes Pokemon Nicknames + + #num of Wondertrade - 1 + $game_variables[111] = $game_variables[111]-1 + + newpoke = pbStartTrade(pbGet(1),species,pname,tname,0,true) # Starts the trade + #lower level by 1 to prevent abuse + if poke.level > 25 + newpoke.level = poke.level - 1 + end + else + return -1 + end +end + +def pbGRS(minBST,chosenBST,luck,rare,except2) #pbGenerateRandomSpecies (le nom doit etre short pour etre callé dans events) + # The following excecption fields are for hardcoding the blacklisted pokemon + # without adding them in the events. + #except+=[] +except2+=[] +species=0 + #luck = rand(5)+1 +rarecap = (rand(rare)/(1+rand(5)))/luck +bonus = 0 +while (species==0) # Loop Start + bonus+= 5 #+ de chance de pogner un bon poke a chaque loop (permet d'eviter infinite loop) + + species=rand(PBSpecies.maxValue)+1 + bst = calcBaseStats(species) + # Redo the loop if pokemon is too evolved for its level + #species=0 if lvl < pbGetMinimumLevel(species)# && pbGetPreviousForm(species) != species # && pbGetPreviousForm(species)!=species + # Redo the loop if the species is an exception. + species=0 if checkifBlacklisted(species,except2)#except2.include?(species) + #Redo loop if above BST + species=0 if bst > chosenBST+$game_variables[120]+bonus + + #Redo loop if below BST - 200 + species=0 if bst < (chosenBST - 200) + + + # raise _INTL("{1}'s bst ist {2}, new ist {3}",myPoke,chosenBST,bst) + + # species=0 if (except.include?(species) && except2.include?(species)) + # use this above line instead if you wish to neither receive pokemon that YOU + # cannot trade. + if rare==true #turn on rareness + rareness=GameData::Species.get(species).catch_rate + species=0 if rarecap>=rareness + end +end +return species +end + +def calcBaseStats(species) + stats = GameData::Species.get(species).base_stats + sum =0 + sum+= stats[:HP] + sum+= stats[:ATTACK] + sum+= stats[:DEFENSE] + sum+= stats[:SPECIAL_ATTACK] + sum+= stats[:SPECIAL_DEFENSE] + sum+= stats[:SPEED] + return sum + # + # basestatsum = $pkmn_dex[species][5][0] # HP + # basestatsum +=$pkmn_dex[species][5][1] # Attack + # basestatsum +=$pkmn_dex[species][5][2] # Defense + # basestatsum +=$pkmn_dex[species][5][3] # Speed + # basestatsum +=$pkmn_dex[species][5][4] # Special Attack + # basestatsum +=$pkmn_dex[species][5][5] # Special Defense + # return basestatsum +end + +def checkifBlacklisted(species,blacklist) + return true if blacklist.include?(getBasePokemonID(species,true)) + return true if blacklist.include?(getBasePokemonID(species,false)) + return false +end \ No newline at end of file