From 223d480e0fdf7c2288d498af9fc46d2dc8d64254 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 24 Jun 2021 18:21:47 +0100 Subject: [PATCH] =?UTF-8?q?Super=20shininess=20can=20now=20be=20set=20for?= =?UTF-8?q?=20a=20Pok=C3=A9mon,=20and=20trainers.txt=20can=20define=20a=20?= =?UTF-8?q?Pok=C3=A9mon=20as=20super=20shiny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../010_Data/002_PBS data/013_Trainer.rb | 39 ++++++++++--------- .../001_Editor screens/001_EditorScreens.rb | 33 +++++++++------- .../005_Debug_PokemonCommands.rb | 13 +++++-- .../021_Compiler/003_Compiler_WritePBS.rb | 3 +- 4 files changed, 50 insertions(+), 38 deletions(-) diff --git a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb index ad5cd0fe4..fd20b9a5e 100644 --- a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb @@ -12,24 +12,25 @@ module GameData DATA_FILENAME = "trainers.dat" SCHEMA = { - "Items" => [:items, "*e", :Item], - "LoseText" => [:lose_text, "s"], - "Pokemon" => [:pokemon, "ev", :Species], # Species, level - "Form" => [:form, "u"], - "Name" => [:name, "s"], - "Moves" => [:moves, "*e", :Move], - "Ability" => [:ability, "e", :Ability], - "AbilityIndex" => [:ability_index, "u"], - "Item" => [:item, "e", :Item], - "Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, - "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }], - "Nature" => [:nature, "e", :Nature], - "IV" => [:iv, "uUUUUU"], - "EV" => [:ev, "uUUUUU"], - "Happiness" => [:happiness, "u"], - "Shiny" => [:shininess, "b"], - "Shadow" => [:shadowness, "b"], - "Ball" => [:poke_ball, "e", :Item], + "Items" => [:items, "*e", :Item], + "LoseText" => [:lose_text, "s"], + "Pokemon" => [:pokemon, "ev", :Species], # Species, level + "Form" => [:form, "u"], + "Name" => [:name, "s"], + "Moves" => [:moves, "*e", :Move], + "Ability" => [:ability, "e", :Ability], + "AbilityIndex" => [:ability_index, "u"], + "Item" => [:item, "e", :Item], + "Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, + "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }], + "Nature" => [:nature, "e", :Nature], + "IV" => [:iv, "uUUUUU"], + "EV" => [:ev, "uUUUUU"], + "Happiness" => [:happiness, "u"], + "Shiny" => [:shininess, "b"], + "SuperShiny" => [:super_shininess, "b"], + "Shadow" => [:shadowness, "b"], + "Ball" => [:poke_ball, "e", :Item], } extend ClassMethodsSymbols @@ -130,7 +131,7 @@ module GameData pkmn.ability = pkmn_data[:ability] pkmn.gender = pkmn_data[:gender] || ((trainer.male?) ? 0 : 1) pkmn.shiny = (pkmn_data[:shininess]) ? true : false - pkmn.super_shiny = false + pkmn.super_shiny = (pkmn_data[:super_shininess]) ? true : false if pkmn_data[:nature] pkmn.nature = pkmn_data[:nature] else # Make the nature random but consistent for the same species used by the same trainer type diff --git a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb index 783e0971a..9f9fe0964 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -629,6 +629,7 @@ module TrainerPokemonProperty initsetting[:form], initsetting[:gender], initsetting[:shininess], + initsetting[:super_shininess], initsetting[:shadowness] ] Pokemon::MAX_MOVES.times do |i| @@ -652,6 +653,7 @@ module TrainerPokemonProperty [_INTL("Form"), LimitProperty2.new(999), _INTL("Form of the Pokémon.")], [_INTL("Gender"), GenderProperty, _INTL("Gender of the Pokémon.")], [_INTL("Shiny"), BooleanProperty2, _INTL("If set to true, the Pokémon is a different-colored Pokémon.")], + [_INTL("SuperShiny"), BooleanProperty2, _INTL("Whether the Pokémon is super shiny (shiny with a special shininess animation).")], [_INTL("Shadow"), BooleanProperty2, _INTL("If set to true, the Pokémon is a Shadow Pokémon.")] ] Pokemon::MAX_MOVES.times do |i| @@ -671,21 +673,22 @@ module TrainerPokemonProperty pbPropertyList(settingname, oldsetting, pkmn_properties, false) return nil if !oldsetting[0] # Species is nil ret = { - :species => oldsetting[0], - :level => oldsetting[1], - :name => oldsetting[2], - :form => oldsetting[3], - :gender => oldsetting[4], - :shininess => oldsetting[5], - :shadowness => oldsetting[6], - :ability => oldsetting[7 + Pokemon::MAX_MOVES], - :ability_index => oldsetting[8 + Pokemon::MAX_MOVES], - :item => oldsetting[9 + Pokemon::MAX_MOVES], - :nature => oldsetting[10 + Pokemon::MAX_MOVES], - :iv => oldsetting[11 + Pokemon::MAX_MOVES], - :ev => oldsetting[12 + Pokemon::MAX_MOVES], - :happiness => oldsetting[13 + Pokemon::MAX_MOVES], - :poke_ball => oldsetting[14 + Pokemon::MAX_MOVES], + :species => oldsetting[0], + :level => oldsetting[1], + :name => oldsetting[2], + :form => oldsetting[3], + :gender => oldsetting[4], + :shininess => oldsetting[5], + :super_shininess => oldsetting[6], + :shadowness => oldsetting[7], + :ability => oldsetting[8 + Pokemon::MAX_MOVES], + :ability_index => oldsetting[9 + Pokemon::MAX_MOVES], + :item => oldsetting[10 + Pokemon::MAX_MOVES], + :nature => oldsetting[11 + Pokemon::MAX_MOVES], + :iv => oldsetting[12 + Pokemon::MAX_MOVES], + :ev => oldsetting[13 + Pokemon::MAX_MOVES], + :happiness => oldsetting[14 + Pokemon::MAX_MOVES], + :poke_ball => oldsetting[15 + Pokemon::MAX_MOVES], } moves = [] Pokemon::MAX_MOVES.times do |i| diff --git a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb index 3d3300d2c..02078298b 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/005_Debug_PokemonCommands.rb @@ -863,19 +863,26 @@ PokemonDebugMenuCommands.register("setshininess", { "effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen| cmd = 0 loop do - msg = [_INTL("Is shiny."), _INTL("Is normal (not shiny).")][pkmn.shiny? ? 0 : 1] + msg_idx = pkmn.shiny? ? (pkmn.super_shiny? ? 1 : 0) : 2 + msg = [_INTL("Is shiny."), _INTL("Is super shiny."), _INTL("Is normal (not shiny).")][msg_idx] cmd = screen.pbShowCommands(msg, [ _INTL("Make shiny"), + _INTL("Make super shiny"), _INTL("Make normal"), _INTL("Reset")], cmd) break if cmd < 0 case cmd when 0 # Make shiny pkmn.shiny = true - when 1 # Make normal + pkmn.super_shiny = false + when 1 # Make super shiny + pkmn.super_shiny = true + when 2 # Make normal pkmn.shiny = false - when 2 # Reset + pkmn.super_shiny = false + when 3 # Reset pkmn.shiny = nil + pkmn.super_shiny = nil end screen.pbRefreshSingle(pkmnid) end diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index 3a9b306ba..83b259356 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -593,7 +593,8 @@ module Compiler f.write(sprintf(" Name = %s\r\n", pkmn[:name])) if pkmn[:name] && !pkmn[:name].empty? f.write(sprintf(" Form = %d\r\n", pkmn[:form])) if pkmn[:form] && pkmn[:form] > 0 f.write(sprintf(" Gender = %s\r\n", (pkmn[:gender] == 1) ? "female" : "male")) if pkmn[:gender] - f.write(" Shiny = yes\r\n") if pkmn[:shininess] + f.write(" Shiny = yes\r\n") if pkmn[:shininess] && !pkmn[:super_shininess] + f.write(" SuperShiny = yes\r\n") if pkmn[:super_shininess] f.write(" Shadow = yes\r\n") if pkmn[:shadowness] f.write(sprintf(" Moves = %s\r\n", pkmn[:moves].join(","))) if pkmn[:moves] && pkmn[:moves].length > 0 f.write(sprintf(" Ability = %s\r\n", pkmn[:ability])) if pkmn[:ability]