Auteur: Yukihiro matsumoto
#============================================
# ‘ Scene_Save
#----------------------------------------------
# @Z[uζΚΜπs€NXΕ·B
#============================================
class Scene_Save < Scene_File
#------------------------------------------
# IuWFNgϊ»
#------------------------------------------
def initialize
super("Voulez vous sauvegarder la partie ?")
end
#------------------------------------------
# θΜ
#------------------------------------------
def on_decision(filename)
# Z[u SE πt
$game_system.se_play($data_system.save_se)
# Z[uf[^Μ«έ
file = File.open(filename, "wb")
write_save_data(file)
file.close
# Cxg©ηΔΡo³κΔ’ικ
if $game_temp.save_calling
# Z[uΔΡo΅tOπNA
$game_temp.save_calling = false
# }bvζΚΙΨθΦ¦
$scene = Scene_Map.new
return
end
# j
[ζΚΙΨθΦ¦
$scene = Scene_Menu.new(4)
end
#------------------------------------------
# LZΜ
#------------------------------------------
def on_cancel
# LZ SE πt
$game_system.se_play($data_system.cancel_se)
# Cxg©ηΔΡo³κΔ’ικ
if $game_temp.save_calling
# Z[uΔΡo΅tOπNA
$game_temp.save_calling = false
# }bvζΚΙΨθΦ¦
$scene = Scene_Map.new
return
end
# j
[ζΚΙΨθΦ¦
$scene = Scene_Menu.new(4)
end
#------------------------------------------
# Z[uf[^Μ«έ
# file : «έpt@CIuWFNg (I[vΟέ)
#------------------------------------------
def write_save_data(file)
# Z[ut@C`ζpΜLN^[f[^πμ¬
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
# Z[ut@C`ζpΜLN^[f[^π«ή
Marshal.dump(characters, file)
# vCΤvͺpΜt[JEgπ«ή
Marshal.dump(Graphics.frame_count, file)
# Z[uρπ 1 β·
$game_system.save_count += 1
# }WbNio[πΫΆ·ι
# (GfB^ΕΫΆ·ι½ΡΙ_ΘlΙ«·¦ηκι)
$game_system.magic_number = $data_system.magic_number
# eνQ[IuWFNgπ«ή
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end |
|