Tidied up semicolon use, refactored random dungeon generation code, fixed visual bug in Day Care debug screen

This commit is contained in:
Maruno17
2021-08-22 23:18:34 +01:00
parent ecc5a040cd
commit 8bb70a226e
64 changed files with 1286 additions and 926 deletions

View File

@@ -181,7 +181,7 @@ module SaveData
# new_game_value { Bar.new }
# end
# @param id [Symbol] value id
# @yieldself [Value]
# @yield the block of code to be saved as a Value
def self.register(id, &block)
validate id => Symbol
unless block_given?

View File

@@ -152,7 +152,7 @@ module SaveData
# save_data[:new_value] = Foo.new
# end
# end
# @yield self [Conversion]
# @yield the block of code to be saved as a Conversion
def self.register_conversion(id, &block)
validate id => Symbol
unless block_given?

View File

@@ -5,8 +5,8 @@ SaveData.register(:player) do
save_value { $Trainer }
load_value { |value| $Trainer = value }
new_game_value {
trainer_type = nil # Get the first defined trainer type as a placeholder
GameData::TrainerType.each { |t| trainer_type = t.id; break }
# Get the first defined trainer type as a placeholder
trainer_type = GameData::TrainerType.keys.first
Player.new("Unnamed", trainer_type)
}
from_old_format { |old_format| old_format[0] }