mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added Settings::DISABLE_IVS_AND_EVS, added text replacements for gender symbols
This commit is contained in:
@@ -40,6 +40,10 @@ module Settings
|
|||||||
SUPER_SHINY = (MECHANICS_GENERATION >= 8)
|
SUPER_SHINY = (MECHANICS_GENERATION >= 8)
|
||||||
# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
|
# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
|
||||||
POKERUS_CHANCE = 3
|
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
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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[/[&<>]/]
|
if text[/[&<>]/]
|
||||||
text2 = text.gsub(/&/, "&")
|
text2 = text.gsub(/&/, "&")
|
||||||
text2.gsub!(/</, "<")
|
text2.gsub!(/</, "<")
|
||||||
@@ -84,13 +84,20 @@ def fmtescape(text)
|
|||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Modifies text; does not return a modified copy of it.
|
||||||
|
def fmtReplaceEscapes(text)
|
||||||
|
text.gsub!(/</, "<")
|
||||||
|
text.gsub!(/>/, ">")
|
||||||
|
text.gsub!(/'/, "'")
|
||||||
|
text.gsub!(/"/, "\"")
|
||||||
|
text.gsub!(/&/, "&")
|
||||||
|
text.gsub!(/&m;/, "♂")
|
||||||
|
text.gsub!(/&f;/, "♀")
|
||||||
|
end
|
||||||
|
|
||||||
def toUnformattedText(text)
|
def toUnformattedText(text)
|
||||||
text2 = text.gsub(FORMATREGEXP, "")
|
text2 = text.gsub(FORMATREGEXP, "")
|
||||||
text2.gsub!(/</, "<")
|
fmtReplaceEscapes(text2)
|
||||||
text2.gsub!(/>/, ">")
|
|
||||||
text2.gsub!(/'/, "'")
|
|
||||||
text2.gsub!(/"/, "\"")
|
|
||||||
text2.gsub!(/&/, "&")
|
|
||||||
return text2
|
return text2
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -376,13 +383,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
|||||||
# realtextStart = oldtext[0, oldtext.length - realtext.length]
|
# realtextStart = oldtext[0, oldtext.length - realtext.length]
|
||||||
# end
|
# end
|
||||||
textchunks.push(text)
|
textchunks.push(text)
|
||||||
textchunks.each do |chunk|
|
textchunks.each { |chunk| fmtReplaceEscapes(chunk) }
|
||||||
chunk.gsub!(/</, "<")
|
|
||||||
chunk.gsub!(/>/, ">")
|
|
||||||
chunk.gsub!(/'/, "'")
|
|
||||||
chunk.gsub!(/"/, "\"")
|
|
||||||
chunk.gsub!(/&/, "&")
|
|
||||||
end
|
|
||||||
textlen = 0
|
textlen = 0
|
||||||
controls.each_with_index do |control, i|
|
controls.each_with_index do |control, i|
|
||||||
textlen += textchunks[i].scan(/./m).length
|
textlen += textchunks[i].scan(/./m).length
|
||||||
|
|||||||
@@ -1085,11 +1085,13 @@ class Pokemon
|
|||||||
# @return [Integer] the maximum HP of this Pokémon
|
# @return [Integer] the maximum HP of this Pokémon
|
||||||
def calcHP(base, level, iv, ev)
|
def calcHP(base, level, iv, ev)
|
||||||
return 1 if base == 1 # For Shedinja
|
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
|
return (((base * 2) + iv + (ev / 4)) * level / 100).floor + level + 10
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Integer] the specified stat of this Pokémon (not used for total HP)
|
# @return [Integer] the specified stat of this Pokémon (not used for total HP)
|
||||||
def calcStat(base, level, iv, ev, nat)
|
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
|
return (((((base * 2) + iv + (ev / 4)) * level / 100).floor + 5) * nat / 100).floor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class DuelWindow < Window_AdvancedTextPokemon
|
|||||||
name_tag = shadowc3tag(PLAYER_TEXT_BASE, PLAYER_TEXT_SHADOW)
|
name_tag = shadowc3tag(PLAYER_TEXT_BASE, PLAYER_TEXT_SHADOW)
|
||||||
end
|
end
|
||||||
hp_tag = shadowc3tag(HP_TEXT_BASE, HP_TEXT_SHADOW)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user