mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Merge branch 'dev' into ui-redesign
This commit is contained in:
@@ -60,8 +60,15 @@ end
|
|||||||
# class Numeric
|
# class Numeric
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Numeric
|
class Numeric
|
||||||
# Turns a number into a string formatted like 12,345,678.
|
# Turns a number into a string formatted like 12,345,678. Some languages use
|
||||||
|
# different characters as the thousands separator.
|
||||||
def to_s_formatted
|
def to_s_formatted
|
||||||
|
case System.user_language[0..1]
|
||||||
|
when "fr", "es"
|
||||||
|
return self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1 ').reverse
|
||||||
|
when "it", "de"
|
||||||
|
return self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1.').reverse
|
||||||
|
end
|
||||||
return self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse
|
return self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\1,').reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -72,9 +79,38 @@ class Numeric
|
|||||||
_INTL("twelve"), _INTL("thirteen"), _INTL("fourteen"), _INTL("fifteen"),
|
_INTL("twelve"), _INTL("thirteen"), _INTL("fourteen"), _INTL("fifteen"),
|
||||||
_INTL("sixteen"), _INTL("seventeen"), _INTL("eighteen"), _INTL("nineteen"),
|
_INTL("sixteen"), _INTL("seventeen"), _INTL("eighteen"), _INTL("nineteen"),
|
||||||
_INTL("twenty")]
|
_INTL("twenty")]
|
||||||
return ret[self] if self.is_a?(Integer) && self >= 0 && self <= ret.length
|
return ret[self] if self.is_a?(Integer) && self >= 0 && self <= ret.length - 1
|
||||||
return self.to_s
|
return self.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_ordinal
|
||||||
|
ret = [_INTL("zeroth"), _INTL("first"), _INTL("second"), _INTL("third"),
|
||||||
|
_INTL("fourth"), _INTL("fifth"), _INTL("sixth"), _INTL("seventh"),
|
||||||
|
_INTL("eighth"), _INTL("ninth"), _INTL("tenth"), _INTL("eleventh"),
|
||||||
|
_INTL("twelfth"), _INTL("thirteenth"), _INTL("fourteenth"), _INTL("fifteenth"),
|
||||||
|
_INTL("sixteenth"), _INTL("seventeenth"), _INTL("eighteenth"), _INTL("nineteenth"),
|
||||||
|
_INTL("twentieth")]
|
||||||
|
return ret[self] if self.is_a?(Integer) && self >= 0 && self <= ret.length - 1
|
||||||
|
return self.to_ord
|
||||||
|
end
|
||||||
|
|
||||||
|
# Returns "1st", "2nd", "3rd", etc.
|
||||||
|
def to_ord
|
||||||
|
return self.to_s if !self.is_a?(Integer)
|
||||||
|
ret = self.to_s
|
||||||
|
if ((self % 100) / 10) == 1 # 10-19
|
||||||
|
ret += "th"
|
||||||
|
elsif (self % 10) == 1
|
||||||
|
ret += "st"
|
||||||
|
elsif (self % 10) == 2
|
||||||
|
ret += "nd"
|
||||||
|
elsif (self % 10) == 3
|
||||||
|
ret += "rd"
|
||||||
|
else
|
||||||
|
ret += "th"
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -556,8 +556,18 @@ module PluginManager
|
|||||||
return true if $full_compile
|
return true if $full_compile
|
||||||
return true if !FileTest.exist?("Data/PluginScripts.rxdata")
|
return true if !FileTest.exist?("Data/PluginScripts.rxdata")
|
||||||
Input.update
|
Input.update
|
||||||
|
# Force compiling if holding Shift or Ctrl
|
||||||
return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL)
|
return true if Input.press?(Input::SHIFT) || Input.press?(Input::CTRL)
|
||||||
# analyze whether or not to push recompile
|
# Should compile if the number of plugins has changed
|
||||||
|
scripts = load_data("Data/PluginScripts.rxdata")
|
||||||
|
return true if scripts.length != plugins.length
|
||||||
|
# Should compile if any plugins have changed version or been replaced
|
||||||
|
found_plugins = []
|
||||||
|
plugins.each_pair { |name, meta| found_plugins.push([meta[:name], meta[:version]]) }
|
||||||
|
existing_plugins = []
|
||||||
|
scripts.each { |plugin| existing_plugins.push([plugin[1][:name], plugin[1][:version]]) }
|
||||||
|
return true if found_plugins != existing_plugins
|
||||||
|
# Should compile if any plugin files have been recently modified
|
||||||
mtime = File.mtime("Data/PluginScripts.rxdata")
|
mtime = File.mtime("Data/PluginScripts.rxdata")
|
||||||
order.each do |o|
|
order.each do |o|
|
||||||
# go through all the registered plugin scripts
|
# go through all the registered plugin scripts
|
||||||
|
|||||||
@@ -72,11 +72,13 @@ end
|
|||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
SaveData.register_conversion(:v22_add_primal_reversion_stat) do
|
SaveData.register_conversion(:v22_add_new_stats) do
|
||||||
essentials_version 22
|
essentials_version 22
|
||||||
display_title "Adding a primal reversion stat"
|
display_title "Adding some more stats"
|
||||||
to_value :stats do |stats|
|
to_value :stats do |stats|
|
||||||
stats.instance_eval do
|
stats.instance_eval do
|
||||||
|
@wild_battles_fled = 0 if !@wild_battles_fled
|
||||||
|
@pokemon_release_count = 0 if !@pokemon_release_count
|
||||||
@primal_reversion_count = 0 if !@primal_reversion_count
|
@primal_reversion_count = 0 if !@primal_reversion_count
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -400,8 +400,22 @@ class Interpreter
|
|||||||
result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
|
result = ($game_switches[@parameters[1]] == (@parameters[2] == 0))
|
||||||
end
|
end
|
||||||
when 1 # variable
|
when 1 # variable
|
||||||
value1 = $game_variables[@parameters[1]]
|
variable1_name = $data_system.variables[@parameters[1]]
|
||||||
value2 = (@parameters[2] == 0) ? @parameters[3] : $game_variables[@parameters[3]]
|
if variable1_name && variable1_name[/^s\:/]
|
||||||
|
value1 = eval($~.post_match)
|
||||||
|
else
|
||||||
|
value1 = $game_variables[@parameters[1]]
|
||||||
|
end
|
||||||
|
if @parameters[2] == 0
|
||||||
|
value2 = @parameters[3]
|
||||||
|
else
|
||||||
|
variable2_name = $data_system.variables[@parameters[3]]
|
||||||
|
if variable2_name && variable2_name[/^s\:/]
|
||||||
|
value2 = eval($~.post_match)
|
||||||
|
else
|
||||||
|
value2 = $game_variables[@parameters[3]]
|
||||||
|
end
|
||||||
|
end
|
||||||
case @parameters[4]
|
case @parameters[4]
|
||||||
when 0 then result = (value1 == value2)
|
when 0 then result = (value1 == value2)
|
||||||
when 1 then result = (value1 >= value2)
|
when 1 then result = (value1 >= value2)
|
||||||
|
|||||||
@@ -79,13 +79,19 @@ class Game_Event < Game_Character
|
|||||||
end
|
end
|
||||||
|
|
||||||
def switchIsOn?(id)
|
def switchIsOn?(id)
|
||||||
switchname = $data_system.switches[id]
|
switch_name = $data_system.switches[id]
|
||||||
return false if !switchname
|
if switch_name && switch_name[/^s\:/]
|
||||||
if switchname[/^s\:/]
|
|
||||||
return eval($~.post_match)
|
return eval($~.post_match)
|
||||||
else
|
|
||||||
return $game_switches[id]
|
|
||||||
end
|
end
|
||||||
|
return $game_switches[id]
|
||||||
|
end
|
||||||
|
|
||||||
|
def variableIsLessThan?(id, value)
|
||||||
|
variable_name = $data_system.variables[id]
|
||||||
|
if variable_name && variable_name[/^s\:/]
|
||||||
|
return eval($~.post_match) < value
|
||||||
|
end
|
||||||
|
return $game_variables[id] < value
|
||||||
end
|
end
|
||||||
|
|
||||||
def variable
|
def variable
|
||||||
@@ -208,7 +214,7 @@ class Game_Event < Game_Character
|
|||||||
c = page.condition
|
c = page.condition
|
||||||
next if c.switch1_valid && !switchIsOn?(c.switch1_id)
|
next if c.switch1_valid && !switchIsOn?(c.switch1_id)
|
||||||
next if c.switch2_valid && !switchIsOn?(c.switch2_id)
|
next if c.switch2_valid && !switchIsOn?(c.switch2_id)
|
||||||
next if c.variable_valid && $game_variables[c.variable_id] < c.variable_value
|
next if c.variable_valid && variableIsLessThan?(c.variable_id, c.variable_value)
|
||||||
if c.self_switch_valid
|
if c.self_switch_valid
|
||||||
key = [@map_id, @event.id, c.self_switch_ch]
|
key = [@map_id, @event.id, c.self_switch_ch]
|
||||||
next if $game_self_switches[key] != true
|
next if $game_self_switches[key] != true
|
||||||
|
|||||||
@@ -28,12 +28,13 @@ class GameStats
|
|||||||
attr_accessor :eggs_hatched
|
attr_accessor :eggs_hatched
|
||||||
attr_accessor :evolution_count, :evolutions_cancelled
|
attr_accessor :evolution_count, :evolutions_cancelled
|
||||||
attr_accessor :trade_count
|
attr_accessor :trade_count
|
||||||
|
attr_accessor :pokemon_release_count
|
||||||
attr_accessor :moves_taught_by_item, :moves_taught_by_tutor, :moves_taught_by_reminder
|
attr_accessor :moves_taught_by_item, :moves_taught_by_tutor, :moves_taught_by_reminder
|
||||||
attr_accessor :day_care_deposits, :day_care_levels_gained
|
attr_accessor :day_care_deposits, :day_care_levels_gained
|
||||||
attr_accessor :pokerus_infections
|
attr_accessor :pokerus_infections
|
||||||
attr_accessor :shadow_pokemon_purified
|
attr_accessor :shadow_pokemon_purified
|
||||||
# Battles
|
# Battles
|
||||||
attr_accessor :wild_battles_won, :wild_battles_lost # Lost includes fled from
|
attr_accessor :wild_battles_won, :wild_battles_lost, :wild_battles_fled # Fled counts both player and wild Pokémon fleeing
|
||||||
attr_accessor :trainer_battles_won, :trainer_battles_lost
|
attr_accessor :trainer_battles_won, :trainer_battles_lost
|
||||||
attr_accessor :total_exp_gained
|
attr_accessor :total_exp_gained
|
||||||
attr_accessor :battle_money_gained, :battle_money_lost
|
attr_accessor :battle_money_gained, :battle_money_lost
|
||||||
@@ -101,6 +102,7 @@ class GameStats
|
|||||||
@evolution_count = 0
|
@evolution_count = 0
|
||||||
@evolutions_cancelled = 0
|
@evolutions_cancelled = 0
|
||||||
@trade_count = 0
|
@trade_count = 0
|
||||||
|
@pokemon_release_count = 0
|
||||||
@moves_taught_by_item = 0
|
@moves_taught_by_item = 0
|
||||||
@moves_taught_by_tutor = 0
|
@moves_taught_by_tutor = 0
|
||||||
@moves_taught_by_reminder = 0
|
@moves_taught_by_reminder = 0
|
||||||
@@ -111,6 +113,7 @@ class GameStats
|
|||||||
# Battles
|
# Battles
|
||||||
@wild_battles_won = 0
|
@wild_battles_won = 0
|
||||||
@wild_battles_lost = 0
|
@wild_battles_lost = 0
|
||||||
|
@wild_battles_fled = 0
|
||||||
@trainer_battles_won = 0
|
@trainer_battles_won = 0
|
||||||
@trainer_battles_lost = 0
|
@trainer_battles_lost = 0
|
||||||
@total_exp_gained = 0
|
@total_exp_gained = 0
|
||||||
|
|||||||
@@ -897,16 +897,12 @@ class Battle::Move::DisableTargetHealingMoves < Battle::Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Target cannot use sound-based moves for 2 more rounds. (Throat Chop)
|
# Target cannot use sound-based moves for 2 rounds. (Throat Chop)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Move::DisableTargetSoundMoves < Battle::Move
|
class Battle::Move::DisableTargetSoundMoves < Battle::Move
|
||||||
def pbAdditionalEffect(user, target)
|
def pbAdditionalEffect(user, target)
|
||||||
return if target.fainted? || target.damageState.substitute
|
return if target.fainted? || target.damageState.substitute
|
||||||
if target.effects[PBEffects::ThroatChop] == 0
|
target.effects[PBEffects::ThroatChop] = 2 if target.effects[PBEffects::ThroatChop] == 0
|
||||||
@battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!",
|
|
||||||
@name, target.pbThis(true)))
|
|
||||||
end
|
|
||||||
target.effects[PBEffects::ThroatChop] = 3
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -194,13 +194,23 @@ class Battle::AI
|
|||||||
# Returns whether the move will definitely fail against the target (assuming
|
# Returns whether the move will definitely fail against the target (assuming
|
||||||
# no battle conditions change between now and using the move).
|
# no battle conditions change between now and using the move).
|
||||||
def pbPredictMoveFailureAgainstTarget
|
def pbPredictMoveFailureAgainstTarget
|
||||||
|
calc_type = @move.rough_type
|
||||||
|
typeMod = @move.move.pbCalcTypeMod(calc_type, @user.battler, @target.battler)
|
||||||
# Move effect-specific checks
|
# Move effect-specific checks
|
||||||
return true if Battle::AI::Handlers.move_will_fail_against_target?(@move.function_code, @move, @user, @target, self, @battle)
|
return true if Battle::AI::Handlers.move_will_fail_against_target?(@move.function_code, @move, @user, @target, self, @battle)
|
||||||
# Immunity to priority moves because of Psychic Terrain
|
# Immunity to priority moves because of Psychic Terrain
|
||||||
return true if @battle.field.terrain == :Psychic && @target.battler.affectedByTerrain? &&
|
return true if @battle.field.terrain == :Psychic && @target.battler.affectedByTerrain? &&
|
||||||
@target.opposes?(@user) && @move.rough_priority(@user) > 0
|
@target.opposes?(@user) && @move.rough_priority(@user) > 0
|
||||||
# Immunity because of ability
|
# Immunity because of ability
|
||||||
return true if @move.move.pbImmunityByAbility(@user.battler, @target.battler, false)
|
if @target.has_active_ability?(:WONDERGUARD) && !@target.being_mold_broken?
|
||||||
|
# NOTE: The Battle::AbilityEffects::MoveImmunity for Wonder Guard makes
|
||||||
|
# use of target.damageState.typeMod, which isn't set by the AI, so
|
||||||
|
# its triggering needs to be checked here instead of via
|
||||||
|
# pbImmunityByAbility.
|
||||||
|
return true if move.damagingMove? && calc_type && !Effectiveness.super_effective?(typeMod)
|
||||||
|
else
|
||||||
|
return true if @move.move.pbImmunityByAbility(@user.battler, @target.battler, false)
|
||||||
|
end
|
||||||
# Immunity because of Dazzling/Queenly Majesty
|
# Immunity because of Dazzling/Queenly Majesty
|
||||||
if @move.rough_priority(@user) > 0 && @target.opposes?(@user)
|
if @move.rough_priority(@user) > 0 && @target.opposes?(@user)
|
||||||
each_same_side_battler(@target.side) do |b, i|
|
each_same_side_battler(@target.side) do |b, i|
|
||||||
@@ -208,8 +218,6 @@ class Battle::AI
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Type immunity
|
# Type immunity
|
||||||
calc_type = @move.rough_type
|
|
||||||
typeMod = @move.move.pbCalcTypeMod(calc_type, @user.battler, @target.battler)
|
|
||||||
return true if @move.move.pbDamagingMove? && Effectiveness.ineffective?(typeMod)
|
return true if @move.move.pbDamagingMove? && Effectiveness.ineffective?(typeMod)
|
||||||
# Dark-type immunity to moves made faster by Prankster
|
# Dark-type immunity to moves made faster by Prankster
|
||||||
return true if Settings::MECHANICS_GENERATION >= 7 && @move.statusMove? &&
|
return true if Settings::MECHANICS_GENERATION >= 7 && @move.statusMove? &&
|
||||||
|
|||||||
@@ -842,7 +842,8 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DisableTargetHealingMove
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DisableTargetSoundMoves",
|
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DisableTargetSoundMoves",
|
||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
next score if target.effects[PBEffects::ThroatChop] > 1
|
next score if target.effects[PBEffects::ThroatChop] >= 1
|
||||||
|
next score if target.effects[PBEffects::Substitute] > 0
|
||||||
next score if !target.check_for_move { |m| m.soundMove? }
|
next score if !target.check_for_move { |m| m.soundMove? }
|
||||||
# Check additional effect chance
|
# Check additional effect chance
|
||||||
add_effect = move.get_score_change_for_additional_effect(user, target)
|
add_effect = move.get_score_change_for_additional_effect(user, target)
|
||||||
|
|||||||
@@ -334,9 +334,12 @@ module BattleCreationHelperMethods
|
|||||||
when Battle::Outcome::WIN, Battle::Outcome::CATCH
|
when Battle::Outcome::WIN, Battle::Outcome::CATCH
|
||||||
$stats.wild_battles_won += 1 if !trainer_battle
|
$stats.wild_battles_won += 1 if !trainer_battle
|
||||||
$stats.trainer_battles_won += 1 if trainer_battle
|
$stats.trainer_battles_won += 1 if trainer_battle
|
||||||
when Battle::Outcome::LOSE, Battle::Outcome::FLEE, Battle::Outcome::DRAW
|
when Battle::Outcome::LOSE, Battle::Outcome::DRAW
|
||||||
$stats.wild_battles_lost += 1 if !trainer_battle
|
$stats.wild_battles_lost += 1 if !trainer_battle
|
||||||
$stats.trainer_battles_lost += 1 if trainer_battle
|
$stats.trainer_battles_lost += 1 if trainer_battle
|
||||||
|
when Battle::Outcome::FLEE
|
||||||
|
$stats.wild_battles_fled += 1 if !trainer_battle
|
||||||
|
$stats.trainer_battles_lost += 1 if trainer_battle
|
||||||
end
|
end
|
||||||
pbSet(outcome_variable, outcome)
|
pbSet(outcome_variable, outcome)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1865,6 +1865,7 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
command = pbShowCommands(_INTL("Release this Pokémon?"), [_INTL("No"), _INTL("Yes")])
|
command = pbShowCommands(_INTL("Release this Pokémon?"), [_INTL("No"), _INTL("Yes")])
|
||||||
if command == 1
|
if command == 1
|
||||||
|
$bag.add(pokemon.item_id) if pokemon.hasItem?
|
||||||
pkmnname = pokemon.name
|
pkmnname = pokemon.name
|
||||||
@scene.pbRelease(selected, heldpoke)
|
@scene.pbRelease(selected, heldpoke)
|
||||||
if heldpoke
|
if heldpoke
|
||||||
@@ -1875,6 +1876,7 @@ class PokemonStorageScreen
|
|||||||
@scene.pbRefresh
|
@scene.pbRefresh
|
||||||
pbDisplay(_INTL("{1} was released.", pkmnname))
|
pbDisplay(_INTL("{1} was released.", pkmnname))
|
||||||
pbDisplay(_INTL("Bye-bye, {1}!", pkmnname))
|
pbDisplay(_INTL("Bye-bye, {1}!", pkmnname))
|
||||||
|
$stats.pokemon_release_count += 1
|
||||||
@scene.pbRefresh
|
@scene.pbRefresh
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -118,7 +118,30 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
name = $data_system.variables[index + 1]
|
name = $data_system.variables[index + 1]
|
||||||
status = $game_variables[index + 1].to_s
|
codeswitch = (name[/^s\:/])
|
||||||
|
if codeswitch
|
||||||
|
code = $~.post_match
|
||||||
|
code_parts = code.split(/[(\[=<>. ]/)
|
||||||
|
code_parts[0].strip!
|
||||||
|
code_parts[0].gsub!(/^\s*!/, "")
|
||||||
|
status = nil
|
||||||
|
if code_parts[0][0][/[a-z]/i]
|
||||||
|
if code_parts[0][0].upcase == code_parts[0][0] &&
|
||||||
|
(Kernel.const_defined?(code_parts[0]) rescue false)
|
||||||
|
status = (eval(code) rescue nil) # Code starts with a class/method name
|
||||||
|
elsif code_parts[0][0].downcase == code_parts[0][0] &&
|
||||||
|
!(Interpreter.method_defined?(code_parts[0].to_sym) rescue false) &&
|
||||||
|
!(Game_Event.method_defined?(code_parts[0].to_sym) rescue false)
|
||||||
|
status = (eval(code) rescue nil) # Code starts with a method name (that isn't in Interpreter/Game_Event)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# Code doesn't start with a letter, probably $, just evaluate it
|
||||||
|
status = (eval(code) rescue nil)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
status = $game_variables[index + 1]
|
||||||
|
end
|
||||||
|
status = status.to_s
|
||||||
status = "\"__\"" if nil_or_empty?(status)
|
status = "\"__\"" if nil_or_empty?(status)
|
||||||
end
|
end
|
||||||
name ||= ""
|
name ||= ""
|
||||||
@@ -186,6 +209,8 @@ def pbDebugVariables(mode)
|
|||||||
current_id = right_window.index + 1
|
current_id = right_window.index + 1
|
||||||
case mode
|
case mode
|
||||||
when 0 # Switches
|
when 0 # Switches
|
||||||
|
name = $data_system.switches[current_id]
|
||||||
|
next if name && name[/^s\:/]
|
||||||
if Input.trigger?(Input::USE)
|
if Input.trigger?(Input::USE)
|
||||||
pbPlayDecisionSE
|
pbPlayDecisionSE
|
||||||
$game_switches[current_id] = !$game_switches[current_id]
|
$game_switches[current_id] = !$game_switches[current_id]
|
||||||
@@ -193,6 +218,8 @@ def pbDebugVariables(mode)
|
|||||||
$game_map.need_refresh = true
|
$game_map.need_refresh = true
|
||||||
end
|
end
|
||||||
when 1 # Variables
|
when 1 # Variables
|
||||||
|
name = $data_system.variables[current_id]
|
||||||
|
next if name && name[/^s\:/]
|
||||||
if Input.repeat?(Input::LEFT)
|
if Input.repeat?(Input::LEFT)
|
||||||
pbDebugSetVariable(current_id, -1)
|
pbDebugSetVariable(current_id, -1)
|
||||||
right_window.refresh
|
right_window.refresh
|
||||||
@@ -715,7 +742,7 @@ def pbDebugFixInvalidTiles
|
|||||||
else
|
else
|
||||||
echoln ""
|
echoln ""
|
||||||
Console.echo_h2(_INTL("Done. {1} errors found and fixed.", total_errors), text: :green)
|
Console.echo_h2(_INTL("Done. {1} errors found and fixed.", total_errors), text: :green)
|
||||||
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now to ensure changes are applied."))
|
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now without saving to ensure changes are applied."))
|
||||||
echoln ""
|
echoln ""
|
||||||
pbMessage(_INTL("{1} error(s) were found across {2} map(s) and fixed.", total_errors, num_error_maps))
|
pbMessage(_INTL("{1} error(s) were found across {2} map(s) and fixed.", total_errors, num_error_maps))
|
||||||
pbMessage(_INTL("Close RPG Maker XP to ensure the changes are applied properly."))
|
pbMessage(_INTL("Close RPG Maker XP to ensure the changes are applied properly."))
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ module FilenameUpdater
|
|||||||
# Warn if any map data has been changed
|
# Warn if any map data has been changed
|
||||||
if !change_record.empty?
|
if !change_record.empty?
|
||||||
change_record.each { |msg| Console.echo_warn(msg) }
|
change_record.each { |msg| Console.echo_warn(msg) }
|
||||||
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now to ensure changes are applied."))
|
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now without saving to ensure changes are applied."))
|
||||||
end
|
end
|
||||||
echoln ""
|
echoln ""
|
||||||
Console.echo_h2(_INTL("Finished updating file names and locations"), text: :green)
|
Console.echo_h2(_INTL("Finished updating file names and locations"), text: :green)
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ module Compiler
|
|||||||
rescue SystemCallError
|
rescue SystemCallError
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
compile_pbs_files
|
text_files = get_all_pbs_files_to_compile
|
||||||
|
compile_pbs_files(text_files)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,8 +98,7 @@ module Compiler
|
|||||||
return (latest_text_edit_time >= latest_data_write_time)
|
return (latest_text_edit_time >= latest_data_write_time)
|
||||||
end
|
end
|
||||||
|
|
||||||
def compile_pbs_files
|
def compile_pbs_files(text_files)
|
||||||
text_files = get_all_pbs_files_to_compile
|
|
||||||
modify_pbs_file_contents_before_compiling
|
modify_pbs_file_contents_before_compiling
|
||||||
compile_town_map(*text_files[:TownMap][1])
|
compile_town_map(*text_files[:TownMap][1])
|
||||||
compile_connections(*text_files[:Connection][1])
|
compile_connections(*text_files[:Connection][1])
|
||||||
|
|||||||
@@ -40,11 +40,17 @@ module Compiler
|
|||||||
["calcStats", "calc_stats"]
|
["calcStats", "calc_stats"]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@categories[:import_new_maps] = {
|
||||||
|
:should_compile => proc { |compiling| next !new_maps_to_import.nil? },
|
||||||
|
:header_text => proc { next _INTL("Importing new maps") },
|
||||||
|
:skipped_text => proc { next _INTL("None found") },
|
||||||
|
:compile => proc { import_new_maps }
|
||||||
|
}
|
||||||
|
|
||||||
@@categories[:map_data] = {
|
@@categories[:map_data] = {
|
||||||
:should_compile => proc { |compiling| next import_new_maps },
|
:header_text => proc { next _INTL("Modifying map data") },
|
||||||
:header_text => proc { next _INTL("Modifying map data") },
|
:skipped_text => proc { next _INTL("Not modified") },
|
||||||
:skipped_text => proc { next _INTL("Not modified") },
|
:compile => proc { compile_trainer_events }
|
||||||
:compile => proc { compile_trainer_events }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@categories[:messages] = {
|
@@categories[:messages] = {
|
||||||
@@ -67,8 +73,9 @@ module Compiler
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Add new map files to the map tree.
|
# Add new map files to the map tree.
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
def import_new_maps
|
|
||||||
return false if !$DEBUG
|
def new_maps_to_import
|
||||||
|
return nil if !$DEBUG
|
||||||
mapfiles = {}
|
mapfiles = {}
|
||||||
# Get IDs of all maps in the Data folder
|
# Get IDs of all maps in the Data folder
|
||||||
Dir.chdir("Data") do
|
Dir.chdir("Data") do
|
||||||
@@ -85,6 +92,19 @@ module Compiler
|
|||||||
mapfiles.delete(id) if mapfiles[id]
|
mapfiles.delete(id) if mapfiles[id]
|
||||||
maxOrder = [maxOrder, mapinfos[id].order].max
|
maxOrder = [maxOrder, mapinfos[id].order].max
|
||||||
end
|
end
|
||||||
|
return (mapfiles.empty?) ? nil : mapfiles
|
||||||
|
end
|
||||||
|
|
||||||
|
def import_new_maps
|
||||||
|
mapfiles = new_maps_to_import
|
||||||
|
return false if !mapfiles
|
||||||
|
# Get maxOrder to add new maps at
|
||||||
|
maxOrder = 0
|
||||||
|
mapinfos = pbLoadMapInfos
|
||||||
|
mapinfos.each_key do |id|
|
||||||
|
next if !mapinfos[id]
|
||||||
|
maxOrder = [maxOrder, mapinfos[id].order].max
|
||||||
|
end
|
||||||
# Import maps not found in mapinfos
|
# Import maps not found in mapinfos
|
||||||
maxOrder += 1
|
maxOrder += 1
|
||||||
imported = false
|
imported = false
|
||||||
@@ -102,7 +122,8 @@ module Compiler
|
|||||||
if imported
|
if imported
|
||||||
save_data(mapinfos, "Data/MapInfos.rxdata")
|
save_data(mapinfos, "Data/MapInfos.rxdata")
|
||||||
$game_temp.map_infos = nil
|
$game_temp.map_infos = nil
|
||||||
pbMessage(_INTL("{1} new map(s) copied to the Data folder were successfully imported.", count))
|
Console.echoln_li_done(_INTL("{1} map(s) imported", count))
|
||||||
|
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now without saving to ensure changes are applied."))
|
||||||
end
|
end
|
||||||
return imported
|
return imported
|
||||||
end
|
end
|
||||||
@@ -1769,7 +1790,7 @@ module Compiler
|
|||||||
save_data(commonEvents, "Data/CommonEvents.rxdata") if changed
|
save_data(commonEvents, "Data/CommonEvents.rxdata") if changed
|
||||||
Console.echo_done(true)
|
Console.echo_done(true)
|
||||||
if change_record.length > 0 || changed
|
if change_record.length > 0 || changed
|
||||||
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now to ensure changes are applied."))
|
Console.echo_warn(_INTL("RMXP data was altered. Close RMXP now without saving to ensure changes are applied."))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user