diff --git a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb index f51189f8a..4bc41d89a 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/007_Evolution.rb @@ -638,6 +638,10 @@ GameData::Evolution.register({ # event numbers are: # 1: Kubfu -> Urshifu # 2: Galarian Yamask -> Runerigus +# These used event numbers are only used in pokemon.txt/pokemon_forms.txt and in +# map events that call pbEvolutionEvent, so they are relatively easy to change +# if you need to (no script changes are required). However, you could just +# ignore them instead if you don't want to use them. #=============================================================================== def pbEvolutionEvent(number) return if !$player diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 52dba4514..7732fd1a5 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -78,6 +78,12 @@ class Pokemon # Used by Galarian Yamask to remember that it took sufficient damage from a # battle and can evolve. attr_accessor :ready_to_evolve + # Whether this Pokémon can be deposited in storage + attr_accessor :cannot_store + # Whether this Pokémon can be released + attr_accessor :cannot_release + # Whether this Pokémon can be traded + attr_accessor :cannot_trade # Max total IVs IV_STAT_LIMIT = 31 diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb index 033fe3a02..8270a01ca 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/001_UI_SplashesAndTitleScreen.rb @@ -1,6 +1,6 @@ class IntroEventScene < EventScene # Splash screen images that appear for a few seconds and then disappear. - SPLASH_IMAGES = ['splash1'] + SPLASH_IMAGES = ['splash1', 'splash2'] # The main title screen background image. TITLE_BG_IMAGE = 'title' TITLE_START_IMAGE = 'start' diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb index 4f9e4ed26..a7cce5dde 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb @@ -81,7 +81,7 @@ and everyone else who helped out "mkxp-z" by: Roza -Based on MKXP by Ancurio et al. +Based on "mkxp" by Ancurio et al. "RPG Maker XP" by: Enterbrain diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 98b8274fa..09a683e69 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -1126,7 +1126,7 @@ class PokemonPartyScreen eligibility = [] for pkmn in @party elig = ableProc.call(pkmn) - elig = false if pkmn.egg? || pkmn.shadowPokemon? + elig = false if pkmn.egg? || pkmn.shadowPokemon? || pkmn.cannot_trade eligibility.push(elig) annot.push((elig) ? _INTL("ABLE") : _INTL("NOT ABLE")) end diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index 6ded29f2e..d60b93a16 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -1716,6 +1716,10 @@ class PokemonStorageScreen pbDisplay(_INTL("Please remove the Mail.")) elsif !heldpoke && @storage[box,index].mail pbDisplay(_INTL("Please remove the Mail.")) + elsif heldpoke && heldpoke.cannot_store + pbDisplay(_INTL("{1} refuses to go into storage!", heldpoke.name)) + elsif !heldpoke && @storage[box, index].cannot_store + pbDisplay(_INTL("{1} refuses to go into storage!", @storage[box, index].name)) else loop do destbox = @scene.pbChooseBox(_INTL("Deposit in which Box?")) @@ -1766,14 +1770,17 @@ class PokemonStorageScreen index = selected[1] if @storage[box,index] raise _INTL("Position {1},{2} is not empty...",box,index) - end - if box!=-1 && index>=@storage.maxPokemon(box) - pbDisplay("Can't place that there.") - return - end - if box!=-1 && @heldpkmn.mail - pbDisplay("Please remove the mail.") - return + elsif box != -1 + if index >= @storage.maxPokemon(box) + pbDisplay("Can't place that there.") + return + elsif @heldpkmn.mail + pbDisplay("Please remove the mail.") + return + elsif @heldpkmn.cannot_store + pbDisplay(_INTL("{1} refuses to go into storage!", @heldpkmn.name)) + return + end end if Settings::HEAL_STORED_POKEMON && box >= 0 old_ready_evo = @heldpkmn.ready_to_evolve @@ -1795,7 +1802,11 @@ class PokemonStorageScreen if !@storage[box,index] raise _INTL("Position {1},{2} is empty...",box,index) end - if box==-1 && pbAble?(@storage[box,index]) && pbAbleCount<=1 && !pbAble?(@heldpkmn) + if @heldpkmn.cannot_store && box != -1 + pbPlayBuzzerSE + pbDisplay(_INTL("{1} refuses to go into storage!", @heldpkmn.name)) + return false + elsif box==-1 && pbAble?(@storage[box,index]) && pbAbleCount<=1 && !pbAble?(@heldpkmn) pbPlayBuzzerSE pbDisplay(_INTL("That's your last Pokémon!")) return false @@ -1828,6 +1839,9 @@ class PokemonStorageScreen elsif pokemon.mail pbDisplay(_INTL("Please remove the mail.")) return false + elsif pokemon.cannot_release + pbDisplay(_INTL("{1} refuses to leave you!", pokemon.name)) + return false end if box==-1 && pbAbleCount<=1 && pbAble?(pokemon) && !heldpoke pbPlayBuzzerSE 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 b7e9cff30..4b458a742 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -1026,6 +1026,7 @@ def pbPokemonEditor [_INTL("EggGroup 2"), GameDataProperty.new(:EggGroup), _INTL("Compatibility group (egg group) for breeding purposes.")], [_INTL("HatchSteps"), LimitProperty.new(99999), _INTL("Number of steps until an egg of this species hatches.")], [_INTL("Incense"), ItemProperty, _INTL("Item needed to be held by a parent to produce an egg of this species.")], + [_INTL("Offspring"), SpeciesPoolProperty, _INTL("All possible species that an egg can be when breeding for an egg of this species (if blank, the egg can only be this species).")], [_INTL("Evolutions"), EvolutionsProperty.new, _INTL("Evolution paths of this species.")], [_INTL("Height"), NonzeroLimitProperty.new(999), _INTL("Height of the Pokémon in 0.1 metres (e.g. 42 = 4.2m).")], [_INTL("Weight"), NonzeroLimitProperty.new(9999), _INTL("Weight of the Pokémon in 0.1 kilograms (e.g. 42 = 4.2kg).")], @@ -1086,6 +1087,7 @@ def pbPokemonEditor spec.egg_groups[1], spec.hatch_steps, spec.incense, + spec.offspring, evolutions, spec.height, spec.weight, @@ -1131,15 +1133,15 @@ def pbPokemonEditor :egg_groups => egg_groups, # 26, 27 :hatch_steps => data[28], :incense => data[29], - :offspring => spec.offspring, - :evolutions => data[30], - :height => data[31], - :weight => data[32], - :color => data[33], - :shape => data[34], - :habitat => data[35], - :generation => data[36], - :flags => data[37] + :offspring => data[30], + :evolutions => data[31], + :height => data[32], + :weight => data[33], + :color => data[34], + :shape => data[35], + :habitat => data[36], + :generation => data[37], + :flags => data[38] } # Add species' data to records GameData::Species.register(species_hash) diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index bbc4032f6..bdad8a209 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -975,6 +975,108 @@ end +module SpeciesPoolProperty + def self.set(_settingname, oldsetting) + # Get all species in the pool + realcmds = [] + realcmds.push([nil, "-", -1]) # Species ID, index in this list, name + for i in 0...oldsetting.length + realcmds.push([oldsetting[i], GameData::Species.get(oldsetting[i]).real_name, i]) + end + # Edit species pool + cmdwin = pbListWindow([], 200) + oldsel = -1 + ret = oldsetting + cmd = [0, 0] + commands = [] + refreshlist = true + loop do + if refreshlist + realcmds.sort! { |a, b| a[2] <=> b[2] } + commands = [] + realcmds.each_with_index do |entry, i| + commands.push((entry[0].nil?) ? _INTL("[ADD SPECIES]") : entry[1]) + end + end + refreshlist = false + oldsel = -1 + cmd = pbCommands3(cmdwin, commands, -1, cmd[1], true) + case cmd[0] + when 1 # Swap species up + if cmd[1] > 0 && cmd[1] < realcmds.length - 1 + realcmds[cmd[1] + 1][2], realcmds[cmd[1]][2] = realcmds[cmd[1]][2], realcmds[cmd[1] + 1][2] + refreshlist = true + end + when 2 # Swap species down + if cmd[1] > 1 + realcmds[cmd[1] - 1][2], realcmds[cmd[1]][2] = realcmds[cmd[1]][2], realcmds[cmd[1] - 1][2] + refreshlist = true + end + when 0 + if cmd[1] >= 0 # Chose an entry + entry = realcmds[cmd[1]] + if entry[0].nil? # Add new species + new_species = pbChooseSpeciesList + if new_species + maxid = -1 + realcmds.each { |e| maxid = [maxid, e[2]].max } + realcmds.push([new_species, GameData::Species.get(new_species).real_name, maxid + 1]) + refreshlist = true + end + else # Edit existing species + case pbMessage(_INTL("\\ts[]Do what with this species?"), + [_INTL("Change species"), _INTL("Delete"), _INTL("Cancel")], 3) + when 0 # Change species + new_species = pbChooseSpeciesList(entry[0]) + if new_species && new_species != entry[0] + entry[0] = new_species + entry[1] = GameData::Species.get(new_species).real_name + oldsel = entry[2] + refreshlist = true + end + when 1 # Delete + realcmds.delete_at(cmd[1]) + cmd[1] = [cmd[1], realcmds.length - 1].min + refreshlist = true + end + end + else # Cancel/quit + case pbMessage(_INTL("Save changes?"), + [_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3) + when 0 + realcmds.shift + for i in 0...realcmds.length + realcmds[i] = realcmds[i][0] + end + realcmds.compact! + ret = realcmds + break + when 1 + break + end + end + end + end + cmdwin.dispose + return ret + end + + def self.defaultValue + return [] + end + + def self.format(value) + ret = "" + for i in 0...value.length + ret << "," if i > 0 + ret << GameData::Species.get(value[i]).real_name + end + return ret + end +end + + + module ItemPoolProperty def self.set(_settingname, oldsetting) # Get all items in the pool 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 cf5c49399..864b9b702 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 @@ -1030,6 +1030,36 @@ PokemonDebugMenuCommands.register("ownership", { } }) +#=============================================================================== +# Can store/release/trade +#=============================================================================== +PokemonDebugMenuCommands.register("setdiscardable", { + "parent" => "main", + "name" => _INTL("Set discardable"), + "always_show" => true, + "effect" => proc { |pkmn, pkmnid, heldpoke, settingUpBattle, screen| + cmd = 0 + loop do + msg = _INTL("Click option to toggle.") + cmds = [] + cmds.push((pkmn.cannot_store) ? _INTL("Cannot store") : _INTL("Can store")) + cmds.push((pkmn.cannot_release) ? _INTL("Cannot release") : _INTL("Can release")) + cmds.push((pkmn.cannot_trade) ? _INTL("Cannot trade") : _INTL("Can trade")) + cmd = screen.pbShowCommands(msg, cmds, cmd) + break if cmd < 0 + case cmd + when 0 # Toggle storing + pkmn.cannot_store = !pkmn.cannot_store + when 1 # Toggle releasing + pkmn.cannot_release = !pkmn.cannot_release + when 2 # Toggle trading + pkmn.cannot_trade = !pkmn.cannot_trade + end + end + next false + } +}) + #=============================================================================== # Other options #===============================================================================