mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Improved Debug running options in battle, allowed Debug running from battle by choosing Call, removed support for save files in the old save location
This commit is contained in:
@@ -79,19 +79,4 @@ module SaveData
|
||||
end
|
||||
return hash
|
||||
end
|
||||
|
||||
# Moves a save file from the old Saved Games folder to the new
|
||||
# location specified by {FILE_PATH}. Does nothing if a save file
|
||||
# already exists in {FILE_PATH}.
|
||||
def self.move_old_windows_save
|
||||
return if File.file?(FILE_PATH)
|
||||
game_title = System.game_title.gsub(/[^\w ]/, "_")
|
||||
home = ENV["HOME"] || ENV["HOMEPATH"]
|
||||
return if home.nil?
|
||||
old_location = File.join(home, "Saved Games", game_title)
|
||||
return unless File.directory?(old_location)
|
||||
old_file = File.join(old_location, "Game.rxdata")
|
||||
return unless File.file?(old_file)
|
||||
File.move(old_file, FILE_PATH)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,6 @@ module Game
|
||||
# Loads bootup data from save file (if it exists) or creates bootup data (if
|
||||
# it doesn't).
|
||||
def self.set_up_system
|
||||
SaveData.move_old_windows_save if System.platform[/Windows/]
|
||||
save_data = (SaveData.exists?) ? SaveData.read_from_file(SaveData::FILE_PATH) : {}
|
||||
if save_data.empty?
|
||||
SaveData.initialize_bootup_values
|
||||
|
||||
@@ -21,6 +21,36 @@ class Battle
|
||||
return true
|
||||
end
|
||||
|
||||
# Return values:
|
||||
# -1: Chose not to end the battle via Debug means
|
||||
# 0: Couldn't end the battle via Debug means; carry on trying to run
|
||||
# 1: Ended the battle via Debug means
|
||||
def pbDebugRun
|
||||
return 0 if !$DEBUG || !Input.press?(Input::CTRL)
|
||||
commands = [_INTL("Treat as a win"), _INTL("Treat as a loss"),
|
||||
_INTL("Treat as a draw"), _INTL("Treat as running away/forfeit")]
|
||||
commands.push(_INTL("Treat as a capture")) if wildBattle?
|
||||
commands.push(_INTL("Cancel"))
|
||||
case pbShowCommands(_INTL("Choose the outcome of this battle."), commands)
|
||||
when 0 # Win
|
||||
@decision = 1
|
||||
when 1 # Loss
|
||||
@decision = 2
|
||||
when 2 # Draw
|
||||
@decision = 5
|
||||
when 3 # Run away/forfeit
|
||||
pbSEPlay("Battle flee")
|
||||
pbDisplayPaused(_INTL("You got away safely!"))
|
||||
@decision = 3
|
||||
when 4 # Capture
|
||||
return -1 if trainerBattle?
|
||||
@decision = 4
|
||||
else
|
||||
return -1
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
# Return values:
|
||||
# -1: Failed fleeing
|
||||
# 0: Wasn't possible to attempt fleeing, continue choosing action for the round
|
||||
@@ -36,17 +66,12 @@ class Battle
|
||||
@choices[idxBattler][2] = nil
|
||||
return -1
|
||||
end
|
||||
# Fleeing from trainer battles
|
||||
# Debug ending the battle
|
||||
debug_ret = pbDebugRun
|
||||
return debug_ret if debug_ret != 0
|
||||
# Running from trainer battles
|
||||
if trainerBattle?
|
||||
if $DEBUG && Input.press?(Input::CTRL)
|
||||
if pbDisplayConfirm(_INTL("Treat this battle as a win?"))
|
||||
@decision = 1
|
||||
return 1
|
||||
elsif pbDisplayConfirm(_INTL("Treat this battle as a loss?"))
|
||||
@decision = 2
|
||||
return 1
|
||||
end
|
||||
elsif @internalBattle
|
||||
if @internalBattle
|
||||
pbDisplayPaused(_INTL("No! There's no running from a Trainer battle!"))
|
||||
elsif pbDisplayConfirm(_INTL("Would you like to forfeit the match and quit now?"))
|
||||
pbSEPlay("Battle flee")
|
||||
@@ -56,13 +81,6 @@ class Battle
|
||||
end
|
||||
return 0
|
||||
end
|
||||
# Fleeing from wild battles
|
||||
if $DEBUG && Input.press?(Input::CTRL)
|
||||
pbSEPlay("Battle flee")
|
||||
pbDisplayPaused(_INTL("You got away safely!"))
|
||||
@decision = 3
|
||||
return 1
|
||||
end
|
||||
if !@canRun
|
||||
pbDisplayPaused(_INTL("You can't escape!"))
|
||||
return 0
|
||||
|
||||
@@ -36,6 +36,9 @@ class Battle
|
||||
end
|
||||
|
||||
def pbCall(idxBattler)
|
||||
# Debug ending the battle
|
||||
return if pbDebugRun != 0
|
||||
# Call the battler
|
||||
battler = @battlers[idxBattler]
|
||||
trainerName = pbGetOwnerName(idxBattler)
|
||||
pbDisplay(_INTL("{1} called {2}!", trainerName, battler.pbThis(true)))
|
||||
|
||||
Reference in New Issue
Block a user