~Site
Accueil
Forum
Admin

~Base de scripts
Scripts de base
Scripts Menu
Scripts Combat
Scripts Systθme
Scripts Modifiιs

Scripts de Base
Game_Temp
Game_System
Game_Switches
Game_Variables
Game_SelfSwitches
Game_Screen
Game_Picture
Game_Battler 1
Game_Battler 2
Game_Battler 3
Game_BattleAction
Game_Actor
Game_Enemy
Game_Actors
Game_Party
Game_Troop
Game_Map
Game_CommonEvent
Game_Character 1
Game_Character 2
Game_Character 3
Game_Event
Game_Player
Sprite_Character
Sprite_Battler
Sprite_Picture
Sprite_Timer
Spriteset_Map
Spriteset_Battle
Window_Base
Window_Selectable
Window_Command
Window_Help
Window_Gold
Window_PlayTime
Window_Steps
Window_MenuStatus
Window_Item
Window_Skill
Window_SkillStatus
Window_Target
Window_EquipLeft
Window_EquipRight
Window_EquipItem
Window_Status
Window_SaveFile
Window_ShopCommand
Window_ShopBuy
Window_ShopSell
Window_ShopNumber
Window_ShopStatus
Window_NameEdit
Window_NameInput
Window_InputNumber
Window_Message
Window_PartyCommand
Window_BattleStatus
Window_BattleResult
Window_DebugLeft
Window_DebugRight
Window_Dataset
Arrow_Base
Arrow_Enemy
Arrow_Actor
Interpreter 1
Interpreter 2
Interpreter 3
Interpreter 4
Interpreter 5
Interpreter 6
Interpreter 7
Scene_Title
Scene_Map
Scene_Menu
Scene_Item
Scene_Skill
Scene_Equip
Scene_Status
Scene_File
Scene_Save
Scene_Load
Scene_End
Scene_Battle 1
Scene_Battle 2
Scene_Battle 3
Scene_Battle 4
Scene_Shop
Scene_Name
Scene_Gameover
Scene_Debug
Main


Scene_Save ::: postι le 2006-02-16 @ 10:25:00
Auteur: Yukihiro matsumoto

#============================================
# ‘ Scene_Save
#----------------------------------------------
# @ƒZ[ƒu‰ζ–ʂ̏ˆ—‚πs‚€ƒNƒ‰ƒX‚Ε‚·B
#============================================

class Scene_Save < Scene_File
#------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šϊ‰»
#------------------------------------------
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[ƒuƒf[ƒ^‚̏‘‚«ž‚έ
file = File.open(filename, "wb")
write_save_data(file)
file.close
# ƒCƒxƒ“ƒg‚©‚ηŒΔ‚яo‚³‚κ‚Δ‚’‚ικ‡
if $game_temp.save_calling
# ƒZ[ƒuŒΔ‚яo‚΅ƒtƒ‰ƒO‚πƒNƒŠƒA
$game_temp.save_calling = false
# ƒ}ƒbƒv‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Map.new
return
end
# ƒƒjƒ…[‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Menu.new(4)
end
#------------------------------------------
# œ ƒLƒƒƒ“ƒZƒ‹Žž‚̏ˆ—
#------------------------------------------
def on_cancel
# ƒLƒƒƒ“ƒZƒ‹ SE ‚π‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒCƒxƒ“ƒg‚©‚ηŒΔ‚яo‚³‚κ‚Δ‚’‚ικ‡
if $game_temp.save_calling
# ƒZ[ƒuŒΔ‚яo‚΅ƒtƒ‰ƒO‚πƒNƒŠƒA
$game_temp.save_calling = false
# ƒ}ƒbƒv‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Map.new
return
end
# ƒƒjƒ…[‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Menu.new(4)
end
#------------------------------------------
# œ ƒZ[ƒuƒf[ƒ^‚̏‘‚«ž‚έ
# file : ‘‚«ž‚έ—pƒtƒ@ƒCƒ‹ƒIƒuƒWƒFƒNƒg (ƒI[ƒvƒ“Ο‚έ)
#------------------------------------------
def write_save_data(file)
# ƒZ[ƒuƒtƒ@ƒCƒ‹•`‰ζ—p‚ΜƒLƒƒƒ‰ƒNƒ^[ƒ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[ƒuƒtƒ@ƒCƒ‹•`‰ζ—p‚ΜƒLƒƒƒ‰ƒNƒ^[ƒf[ƒ^‚π‘‚«ž‚ή
Marshal.dump(characters, file)
# ƒvƒŒƒCŽžŠΤŒv‘ͺ—p‚ΜƒtƒŒ[ƒ€ƒJƒEƒ“ƒg‚π‘‚«ž‚ή
Marshal.dump(Graphics.frame_count, file)
# ƒZ[ƒu‰ρ”‚π 1 ‘‚β‚·
$game_system.save_count += 1
# ƒ}ƒWƒbƒNƒiƒ“ƒo[‚π•Ϋ‘Ά‚·‚ι
# (ƒGƒfƒBƒ^‚Ε•Ϋ‘Ά‚·‚ι‚½‚Ρ‚Ιƒ‰ƒ“ƒ_ƒ€‚Θ’l‚ɏ‘‚«Š·‚¦‚η‚κ‚ι)
$game_system.magic_number = $data_system.magic_number
# ŠeŽνƒQ[ƒ€ƒIƒuƒWƒFƒNƒg‚π‘‚«ž‚ή
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
Design By RaZ © Watery Build 2005