diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 88d114c8f..98f09afb8 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -40,6 +40,10 @@ module Settings SUPER_SHINY = (MECHANICS_GENERATION >= 8) # The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). POKERUS_CHANCE = 3 + # Whether IVs and EVs are treated as 0 when calculating a Pokémon's stats. + # IVs and EVs still exist, and are used by Hidden Power and some cosmetic + # things as normal. + DISABLE_IVS_AND_EVS = false #============================================================================= diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 3a097c417..fd47e4f45 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -74,7 +74,7 @@ end #=============================================================================== FORMATREGEXP = /<(\/?)(c|c2|c3|o|fn|br|fs|i|b|r|pg|pog|u|s|icon|img|ac|ar|al|outln|outln2)(\s*\=\s*([^>]*))?>/i -def fmtescape(text) +def fmtEscape(text) if text[/[&<>]/] text2 = text.gsub(/&/, "&") text2.gsub!(/") + text.gsub!(/'/, "'") + text.gsub!(/"/, "\"") + text.gsub!(/&/, "&") + text.gsub!(/&m;/, "♂") + text.gsub!(/&f;/, "♀") +end + def toUnformattedText(text) text2 = text.gsub(FORMATREGEXP, "") - text2.gsub!(/</, "<") - text2.gsub!(/>/, ">") - text2.gsub!(/'/, "'") - text2.gsub!(/"/, "\"") - text2.gsub!(/&/, "&") + fmtReplaceEscapes(text2) return text2 end @@ -376,13 +383,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = # realtextStart = oldtext[0, oldtext.length - realtext.length] # end textchunks.push(text) - textchunks.each do |chunk| - chunk.gsub!(/</, "<") - chunk.gsub!(/>/, ">") - chunk.gsub!(/'/, "'") - chunk.gsub!(/"/, "\"") - chunk.gsub!(/&/, "&") - end + textchunks.each { |chunk| fmtReplaceEscapes(chunk) } textlen = 0 controls.each_with_index do |control, i| textlen += textchunks[i].scan(/./m).length diff --git a/Data/Scripts/014_Pokemon/001_Pokemon.rb b/Data/Scripts/014_Pokemon/001_Pokemon.rb index 86e5143a7..55e7e42c9 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon.rb @@ -1085,11 +1085,13 @@ class Pokemon # @return [Integer] the maximum HP of this Pokémon def calcHP(base, level, iv, ev) return 1 if base == 1 # For Shedinja + iv = ev = 0 if Settings::DISABLE_IVS_AND_EVS return (((base * 2) + iv + (ev / 4)) * level / 100).floor + level + 10 end # @return [Integer] the specified stat of this Pokémon (not used for total HP) def calcStat(base, level, iv, ev, nat) + iv = ev = 0 if Settings::DISABLE_IVS_AND_EVS return (((((base * 2) + iv + (ev / 4)) * level / 100).floor + 5) * nat / 100).floor end diff --git a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb index c4bb571f7..84720d60a 100644 --- a/Data/Scripts/017_Minigames/001_Minigame_Duel.rb +++ b/Data/Scripts/017_Minigames/001_Minigame_Duel.rb @@ -46,7 +46,7 @@ class DuelWindow < Window_AdvancedTextPokemon name_tag = shadowc3tag(PLAYER_TEXT_BASE, PLAYER_TEXT_SHADOW) end hp_tag = shadowc3tag(HP_TEXT_BASE, HP_TEXT_SHADOW) - self.text = name_tag + fmtescape(@name) + "\n" + hp_tag + _INTL("HP: {1}", @hp) + self.text = name_tag + fmtEscape(@name) + "\n" + hp_tag + _INTL("HP: {1}", @hp) end end