diff --git a/Data/CommonEvents.rxdata b/Data/CommonEvents.rxdata
index 69752b6ed..328f836ba 100644
Binary files a/Data/CommonEvents.rxdata and b/Data/CommonEvents.rxdata differ
diff --git a/Data/Map004.rxdata b/Data/Map004.rxdata
index 61d632f0b..749c86c79 100644
Binary files a/Data/Map004.rxdata and b/Data/Map004.rxdata differ
diff --git a/Data/Map024.rxdata b/Data/Map024.rxdata
index 799f87b73..5b9af0f10 100644
Binary files a/Data/Map024.rxdata and b/Data/Map024.rxdata differ
diff --git a/Data/Map085.rxdata b/Data/Map085.rxdata
index 4390bafdb..cf3993868 100644
Binary files a/Data/Map085.rxdata and b/Data/Map085.rxdata differ
diff --git a/Data/Map129.rxdata b/Data/Map129.rxdata
index ea28c0485..cf5a339f9 100644
Binary files a/Data/Map129.rxdata and b/Data/Map129.rxdata differ
diff --git a/Data/Map152.rxdata b/Data/Map152.rxdata
index 3a3906308..d75c8b8c3 100644
Binary files a/Data/Map152.rxdata and b/Data/Map152.rxdata differ
diff --git a/Data/Map221.rxdata b/Data/Map221.rxdata
index dbb20773c..9dff692e8 100644
Binary files a/Data/Map221.rxdata and b/Data/Map221.rxdata differ
diff --git a/Data/Map386.rxdata b/Data/Map386.rxdata
index d5a9b2b11..6df4ee77b 100644
Binary files a/Data/Map386.rxdata and b/Data/Map386.rxdata differ
diff --git a/Data/Map479.rxdata b/Data/Map479.rxdata
index 6557cd793..fc45a76d2 100644
Binary files a/Data/Map479.rxdata and b/Data/Map479.rxdata differ
diff --git a/Data/Map542.rxdata b/Data/Map542.rxdata
index f7badd120..0005ba0d4 100644
Binary files a/Data/Map542.rxdata and b/Data/Map542.rxdata differ
diff --git a/Data/MapInfos.rxdata b/Data/MapInfos.rxdata
index 4375fea63..0d9ffaebf 100644
Binary files a/Data/MapInfos.rxdata and b/Data/MapInfos.rxdata differ
diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb
index d0837a6b5..4408b62c6 100644
--- a/Data/Scripts/007_Objects and windows/011_Messages.rb
+++ b/Data/Scripts/007_Objects and windows/011_Messages.rb
@@ -421,8 +421,31 @@ def pbDisplayGoldWindow(msgwindow)
end
def pbDisplayBattleFactoryPointsWindow(msgwindow)
- pointsString = $game_variables[BATTLE_FACTORY_TOKENS].to_s
- pointswindow = Window_AdvancedTextPokemon.new(_INTL("Tokens:\n{1}", pointsString))
+ pbDisplayVariableWindow(msgwindow,"Tokens",BATTLE_FACTORY_TOKENS)
+end
+
+
+def pbDisplayVariableWindow(msgwindow,name,variable_id)
+ pointsString = $game_variables[variable_id].to_s
+ pointswindow = Window_AdvancedTextPokemon.new(_INTL("{1}:\n{2}",name, pointsString))
+ pointswindow.setSkin("Graphics/Windowskins/goldskin")
+ pointswindow.resizeToFit(pointswindow.text, Graphics.width)
+ pointswindow.width = 160 if pointswindow.width <= 160
+ if msgwindow.y == 0
+ pointswindow.y = Graphics.height - pointswindow.height
+ else
+ pointswindow.y = 0
+ end
+ pointswindow.viewport = msgwindow.viewport
+ pointswindow.z = msgwindow.z
+ return pointswindow
+end
+
+def pbDisplayTwoVariableWindow(msgwindow,name1,variable1_id,name2, variable2_id)
+ pointsString1 = $game_variables[variable1_id].to_s
+ pointsString2 = $game_variables[variable2_id].to_s
+
+ pointswindow = Window_AdvancedTextPokemon.new(_INTL("{1}:{2}\n{3}:{4}",name1, pointsString1,name2,pointsString2))
pointswindow.setSkin("Graphics/Windowskins/goldskin")
pointswindow.resizeToFit(pointswindow.text, Graphics.width)
pointswindow.width = 160 if pointswindow.width <= 160
@@ -722,7 +745,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
when "ft" # Display battle factory tokens
goldwindow.dispose if goldwindow
goldwindow = pbDisplayBattleFactoryPointsWindow(msgwindow)
- when "hs" # Display battle factory tokens
+ when "hs" # Display heartscakes
goldwindow.dispose if goldwindow
goldwindow = pbDisplayHeartScalesWindow(msgwindow)
when "cn" # Display coins window
diff --git a/Data/Scripts/049_Compatibility/Constants.rb b/Data/Scripts/049_Compatibility/Constants.rb
index 81b70023a..19f41a29b 100644
--- a/Data/Scripts/049_Compatibility/Constants.rb
+++ b/Data/Scripts/049_Compatibility/Constants.rb
@@ -29,6 +29,10 @@ BATTLE_FACTORY_TOKENS = 243
NB_GYM_REMATCHES = 162
CUSTOM_SPRITES_ENABLED= 196
COMMAND_WINDOW_INDEX=249
+
+STANDARD_WONDERTRADE_LEFT=248
+PREMIUM_WONDERTRADE_LEFT=111
+
#Settings
# This is for settings that are used in scripts since it's a chore to change them everywhere to include the module name
NUM_BADGES = Settings::NB_BADGES
diff --git a/Data/Scripts/050_AddOns/BattleLounge.rb b/Data/Scripts/050_AddOns/BattleLounge.rb
index e69c7e270..bc6565bda 100644
--- a/Data/Scripts/050_AddOns/BattleLounge.rb
+++ b/Data/Scripts/050_AddOns/BattleLounge.rb
@@ -174,6 +174,13 @@ def listLegendaryPokemonIds()
return [144, 145, 146, 150, 151, 245, 243, 244, 245, 249, 250, 251, 315, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 378, 379, 380, 381]
end
+def pokemonIsPartLegendary(species)
+ head = getBasePokemonID(species, false)
+ body = getBasePokemonID(species, true)
+ return listLegendaryPokemonIds().include?(head) || listLegendaryPokemonIds().include?(body)
+end
+
+
def generateRandomFusionFromPokemon(dexNum, onlyCustomSprites = false, allowLegendaries=true)
speciesList = onlyCustomSprites ? getCustomSpeciesListForPokemon(dexNum,allowLegendaries) : getAllPokemonWithBase(dexNum)
return speciesList.sample
diff --git a/Data/Scripts/050_AddOns/GeneralUtils.rb b/Data/Scripts/050_AddOns/GeneralUtils.rb
index 3f2b1366f..a42c41370 100644
--- a/Data/Scripts/050_AddOns/GeneralUtils.rb
+++ b/Data/Scripts/050_AddOns/GeneralUtils.rb
@@ -308,19 +308,28 @@ def obtainPokemonSpritePath(id, includeCustoms = true)
end
def obtainPokemonSpritePath(bodyId, headId, include_customs = true)
- hasCustom = false
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)
if include_customs
- pathCustom = _INTL("Graphics/CustomBattlers/{1}.{2}.png", headId, bodyId)
+ pathCustom = getCustomSpritePath(bodyId,headId)
if (pbResolveBitmap(pathCustom))
picturePath = pathCustom
- hasCustom = true
end
end
return picturePath
end
+def getCustomSpritePath(body,head)
+ return _INTL("Graphics/CustomBattlers/{1}.{2}.png", head, body)
+end
+
+def customSpriteExists(species)
+ head = getBasePokemonID(species, false)
+ body = getBasePokemonID(species, true)
+ pathCustom = getCustomSpritePath(body,head)
+ return pbResolveBitmap(pathCustom) != nil
+end
+
def getArceusPlateType(heldItem)
return :NORMAL if heldItem == nil
case heldItem
@@ -415,6 +424,8 @@ def Kernel.getItemNamesAsString(list)
return strList
end
+
+
def Kernel.getPlateType(item)
return :FIGHTING if item == PBItems::FISTPLATE
return :FLYING if item == PBItems::SKYPLATE
diff --git a/Data/Scripts/050_AddOns/Wondertrade.rb b/Data/Scripts/050_AddOns/Wondertrade.rb
index 701fdd19c..cd53a5156 100644
--- a/Data/Scripts/050_AddOns/Wondertrade.rb
+++ b/Data/Scripts/050_AddOns/Wondertrade.rb
@@ -1003,7 +1003,7 @@ RandPokeNick = [
"maymay"
]
-def pbWonderTrade(lvl, except = [], except2 = [], rare = true)
+def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = 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
@@ -1013,6 +1013,7 @@ def pbWonderTrade(lvl, except = [], except2 = [], rare = true)
# ignoreExcept = rand(100) == 0 #tiny chance to include legendaries
#
# except+=[]
+ rare = premiumWonderTrade
chosen = pbChoosePokemon(1, 2, # Choose eligable pokemon
proc {
|poke| !poke.egg? && !(poke.isShadow?) && # No Eggs, No Shadow Pokemon
@@ -1041,8 +1042,18 @@ def pbWonderTrade(lvl, except = [], except2 = [], rare = true)
# 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
-
+ bstLimit = chosenBST + bonus# + $game_variables[120]
+ if !premiumWonderTrade
+ bstLimit-=50
+ end
+ species = 0 if bst > bstLimit
+ if species > 0 && premiumWonderTrade
+ species = 0 if !customSpriteExists(species)
+ end
+ if species > 0
+ skipLegendaryCheck = premiumWonderTrade && rand(100) < luck
+ species = 0 if pokemonIsPartLegendary(species) && !$game_switches[BEAT_THE_LEAGUE] && !skipLegendaryCheck
+ end
#Redo loop if below BST - 200
species = 0 if bst < (chosenBST - 200)
@@ -1063,7 +1074,11 @@ def pbWonderTrade(lvl, except = [], except2 = [], rare = true)
pname = RandPokeNick[rand(RandPokeNick.size)] # Randomizes Pokemon Nicknames
#num of Wondertrade - 1
- $game_variables[111] = $game_variables[111] - 1
+ if premiumWonderTrade
+ $game_variables[PREMIUM_WONDERTRADE_LEFT] -= 1
+ else
+ $game_variables[STANDARD_WONDERTRADE_LEFT] -= 1
+ end
newpoke = pbStartTrade(pbGet(1), species, pname, tname, 0, true) # Starts the trade
#lower level by 1 to prevent abuse
diff --git a/Data/System.rxdata b/Data/System.rxdata
index 925287174..9122b20af 100644
Binary files a/Data/System.rxdata and b/Data/System.rxdata differ