diff --git a/Data/Scripts/001_Technical/002_RubyUtilities.rb b/Data/Scripts/001_Technical/002_RubyUtilities.rb index 6389960b7..0e6f8823d 100644 --- a/Data/Scripts/001_Technical/002_RubyUtilities.rb +++ b/Data/Scripts/001_Technical/002_RubyUtilities.rb @@ -71,6 +71,17 @@ class Numeric def to_s_formatted return self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse end + + def to_word + ret = [_INTL("zero"), _INTL("one"), _INTL("two"), _INTL("three"), + _INTL("four"), _INTL("five"), _INTL("six"), _INTL("seven"), + _INTL("eight"), _INTL("nine"), _INTL("ten"), _INTL("eleven"), + _INTL("twelve"), _INTL("thirteen"), _INTL("fourteen"), _INTL("fifteen"), + _INTL("sixteen"), _INTL("seventeen"), _INTL("eighteen"), _INTL("nineteen"), + _INTL("twenty")] + return ret[self] if self.is_a?(Integer) && self >= 0 && self <= ret.length + return self.to_s + end end #=============================================================================== 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 5ec0daf6f..75f96591e 100644 --- a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb @@ -29,7 +29,7 @@ module GameData "Happiness" => [:happiness, "u"], "Shiny" => [:shininess, "b"], "Shadow" => [:shadowness, "b"], - "Ball" => [:poke_ball, "u"], + "Ball" => [:poke_ball, "s"], } extend ClassMethods @@ -155,7 +155,7 @@ module GameData pkmn.update_shadow_moves(true) pkmn.shiny = false end - pkmn.poke_ball = pbBallTypeToItem(pkmn_data[:poke_ball]).id if pkmn_data[:poke_ball] + pkmn.poke_ball = pkmn_data[:poke_ball] if pkmn_data[:poke_ball] pkmn.calc_stats end return trainer 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 1a7d4a38f..d36553e75 100644 --- a/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb @@ -239,7 +239,8 @@ class PokeBattle_Battle end # Pokémon already knows the maximum number of moves; try to forget one to learn the new move loop do - pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows four moves.",pkmnName,moveName)) + pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.", + pkmnName, moveName, pkmn.moves.length.to_word)) if pbDisplayConfirm(_INTL("Forget a move to learn {1}?",moveName)) pbDisplayPaused(_INTL("Which move should be forgotten?")) forgetMove = @scene.pbForgetMove(pkmn,newMove) diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index fc2bf9266..be1e11ec8 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -411,7 +411,8 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block) return true end loop do - pbMessage(_INTL("{1} wants to learn {2}, but it already knows four moves.\1",pkmnname,movename),&block) if !bymachine + pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1", + pkmnname, movename, pkmn.numMoves.to_word), &block) if !bymachine pbMessage(_INTL("Please choose a move that will be replaced with {1}.",movename),&block) forgetmove = pbForgetMove(pkmn,move) if forgetmove>=0 @@ -421,7 +422,7 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block) if bymachine && Settings::TAUGHT_MACHINES_KEEP_OLD_PP pkmn.moves[forgetmove].pp = [oldmovepp,pkmn.moves[forgetmove].total_pp].min end - pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block) + pbMessage(_INTL("1, 2, and...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block) pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1",pkmnname,oldmovename),&block) pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pkmnname,movename),&block) pkmn.changeHappiness("machine") if bymachine diff --git a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb index e90d3a17f..74af1e70f 100644 --- a/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb +++ b/Data/Scripts/018_Alternate battle modes/003_Battle Frontier generator/001_ChallengeGenerator_Data.rb @@ -134,7 +134,7 @@ def isBattlePokemonDuplicate(pk, pk2) end moves1.sort! moves2.sort! - # Accept as same if moves are same and there are four moves each + # Accept as same if moves are same and there are MAX_MOVES number of moves each return true if moves1 == moves2 && moves1[Pokemon::MAX_MOVES - 1] same_evs = true GameData::Stat.each_main { |s| same_evs = false if pk.ev[s.id] != pk2.ev[s.id] } diff --git a/Data/Scripts/020_Debug/001_Editor_Utilities.rb b/Data/Scripts/020_Debug/001_Editor_Utilities.rb index ea5390995..e6098e142 100644 --- a/Data/Scripts/020_Debug/001_Editor_Utilities.rb +++ b/Data/Scripts/020_Debug/001_Editor_Utilities.rb @@ -206,16 +206,16 @@ def pbChooseAbilityList(default = nil) return pbChooseList(commands, default, nil, -1) end -def pbChooseBallList(defaultMoveID = -1) +def pbChooseBallList(defaultMoveID = nil) cmdwin = pbListWindow([], 200) commands = [] moveDefault = 0 for key in $BallTypes.keys item = GameData::Item.try_get($BallTypes[key]) - commands.push([key.to_i, item.name]) if item + commands.push([$BallTypes[key], item.name]) if item end commands.sort! { |a, b| a[1] <=> b[1] } - if defaultMoveID >= 0 + if defaultMoveID for i in 0...commands.length moveDefault = i if commands[i][0] == defaultMoveID end diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index 22915d5b1..f564a35cf 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -557,8 +557,7 @@ class BallProperty end def set(_settingname,oldsetting) - ret = pbChooseBallList((oldsetting) ? oldsetting : -1) - return (ret>=0) ? ret : (oldsetting) ? oldsetting : nil + return pbChooseBallList(oldsetting) end def defaultValue @@ -566,7 +565,7 @@ class BallProperty end def format(value) - return (value) ? pbBallTypeToItem(value).name : "-" + return (value) ? GameData::Item.get(value).name : "-" end end diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index 236c46f34..e39c11853 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -1222,6 +1222,15 @@ module Compiler value_hash[s.id] = property_value[s.pbs_order] || property_value[0] end current_pkmn[line_schema[0]] = value_hash + when "Ball" + if property_value[/^\d+$/] + current_pkmn[line_schema[0]] = pbBallTypeToItem(property_value.to_i).id + elsif !GameData::Item.exists?(property_value.to_sym) || + !GameData::Item.get(property_value.to_sym).is_poke_ball? + raise _INTL("Value {1} isn't a defined Poké Ball.\r\n{2}", property_value, FileLineData.linereport) + else + current_pkmn[line_schema[0]] = property_value.to_sym + end else current_pkmn[line_schema[0]] = property_value end diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index 26d27c3fb..2410a36d4 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -622,7 +622,7 @@ module Compiler f.write(sprintf(" IV = %s\r\n", ivs_array.join(","))) if pkmn[:iv] f.write(sprintf(" EV = %s\r\n", evs_array.join(","))) if pkmn[:ev] f.write(sprintf(" Happiness = %d\r\n", pkmn[:happiness])) if pkmn[:happiness] - f.write(sprintf(" Ball = %d\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball] + f.write(sprintf(" Ball = %s\r\n", pkmn[:poke_ball])) if pkmn[:poke_ball] end end } diff --git a/PBS/trainers.txt b/PBS/trainers.txt index 582b5d911..e63ab5c77 100644 --- a/PBS/trainers.txt +++ b/PBS/trainers.txt @@ -12,7 +12,7 @@ Pokemon = GEODUDE,12 Gender = male Moves = DEFENSECURL,HEADSMASH,ROCKPOLISH,ROCKTHROW Ability = 0 - IV = 20 + IV = 20,20,20,20,20,20 Pokemon = ONIX,14 Name = Rocky Gender = male @@ -20,8 +20,8 @@ Pokemon = ONIX,14 Moves = HEADSMASH,ROCKTHROW,RAGE,ROCKTOMB Ability = 0 Item = SITRUSBERRY - IV = 20 - Ball = 19 + IV = 20,20,20,20,20,20 + Ball = HEAVYBALL #------------------------------- [TEAMROCKET_M,Grunt,1] LoseText = "You're too good for me!" @@ -82,6 +82,7 @@ Pokemon = TURTWIG,19 Pokemon = CHIMCHAR,19 #------------------------------- [POKEMONTRAINER_Brendan,Brendan] +LoseText = "..." Pokemon = MARSHTOMP,19 #------------------------------- [SWIMMER2_F,Ariel] @@ -114,4 +115,4 @@ Pokemon = VENUSAUR,63 Pokemon = CHARIZARD,63 Item = SITRUSBERRY Pokemon = BLASTOISE,63 - Item = SITRUSBERRY \ No newline at end of file + Item = SITRUSBERRY