Auteur: Yukihiro matsumoto
#============================================
# ¡ Scene_Title
#----------------------------------------------
# @ƒ^ƒCƒgƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#============================================
class Scene_Title
#------------------------------------------
# œ ƒƒCƒ“ˆ—
#------------------------------------------
def main
# 퓬ƒeƒXƒg‚Ìê‡
if $BTEST
battle_test
return
end
# ƒf[ƒ^ƒx[ƒX‚ðƒ[ƒh
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# ƒVƒXƒeƒ€ƒIƒuƒWƒFƒNƒg‚ðì¬
$game_system = Game_System.new
# ƒ^ƒCƒgƒ‹ƒOƒ‰ƒtƒBƒbƒN‚ðì¬
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
s1 = "Nouvelle partie"
s2 = "Charger une partie"
s3 = "Quitter"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
# ƒRƒ“ƒeƒBƒjƒ…[—LŒø”»’è
# ƒZ[ƒuƒtƒ@ƒCƒ‹‚ª‚Ð‚Æ‚Â‚Å‚à‘¶Ý‚·‚é‚©‚Ç‚¤‚©‚𒲂ׂé
# —LŒø‚È‚ç @continue_enabled ‚ð trueA–³Œø‚È‚ç false ‚É‚·‚é
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# ƒRƒ“ƒeƒBƒjƒ…[‚ª—LŒø‚Èê‡AƒJ[ƒƒ‹‚ðƒRƒ“ƒeƒBƒjƒ…[‚ɇ‚킹‚é
# –³Œø‚Èê‡AƒRƒ“ƒeƒBƒjƒ…[‚Ì•¶Žš‚ðƒOƒŒ[•Ž¦‚É‚·‚é
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# ƒ^ƒCƒgƒ‹ BGM ‚ð‰‰‘t
$game_system.bgm_play($data_system.title_bgm)
# MEABGS ‚̉‰‘t‚ð’âŽ~
Audio.me_stop
Audio.bgs_stop
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
Graphics.transition
# ƒƒCƒ“ƒ‹[ƒv
loop do
# ƒQ[ƒ€‰æ–Ê‚ðXV
Graphics.update
# “ü—Íî•ñ‚ðXV
Input.update
# ƒtƒŒ[ƒ€XV
update
# ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
if $scene != self
break
end
end
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
Graphics.freeze
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@command_window.dispose
# ƒ^ƒCƒgƒ‹ƒOƒ‰ƒtƒBƒbƒN‚ð‰ð•ú
@sprite.bitmap.dispose
@sprite.dispose
end
#------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#------------------------------------------
def update
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðXV
@command_window.update
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 0 # ƒjƒ…[ƒQ[ƒ€
command_new_game
when 1 # ƒRƒ“ƒeƒBƒjƒ…[
command_continue
when 2 # ƒVƒƒƒbƒgƒ_ƒEƒ“
command_shutdown
end
end
end
#------------------------------------------
# œ ƒRƒ}ƒ“ƒh : ƒjƒ…[ƒQ[ƒ€
#------------------------------------------
def command_new_game
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# BGM ‚ð’âŽ~
Audio.bgm_stop
# ƒvƒŒƒCŽžŠÔŒv‘ª—p‚̃tƒŒ[ƒ€ƒJƒEƒ“ƒg‚ðƒŠƒZƒbƒg
Graphics.frame_count = 0
# ŠeŽíƒQ[ƒ€ƒIƒuƒWƒFƒNƒg‚ðì¬
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# ‰Šúƒp[ƒeƒB‚ðƒZƒbƒgƒAƒbƒv
$game_party.setup_starting_members
# ‰ŠúˆÊ’u‚̃}ƒbƒv‚ðƒZƒbƒgƒAƒbƒv
$game_map.setup($data_system.start_map_id)
# ƒvƒŒƒCƒ„[‚ð‰ŠúˆÊ’u‚Ɉړ®
$game_player.moveto($data_system.start_x, $data_system.start_y)
# ƒvƒŒƒCƒ„[‚ðƒŠƒtƒŒƒbƒVƒ…
$game_player.refresh
# ƒ}ƒbƒv‚Éݒ肳‚ê‚Ä‚¢‚é BGM ‚Æ BGS ‚ÌŽ©“®Ø‚è‘Ö‚¦‚ðŽÀs
$game_map.autoplay
# ƒ}ƒbƒv‚ðXV (•À—ñƒCƒxƒ“ƒgŽÀs)
$game_map.update
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Map.new
end
#------------------------------------------
# œ ƒRƒ}ƒ“ƒh : ƒRƒ“ƒeƒBƒjƒ…[
#------------------------------------------
def command_continue
# ƒRƒ“ƒeƒBƒjƒ…[‚ª–³Œø‚Ìê‡
unless @continue_enabled
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒ[ƒh‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Load.new
end
#------------------------------------------
# œ ƒRƒ}ƒ“ƒh : ƒVƒƒƒbƒgƒ_ƒEƒ“
#------------------------------------------
def command_shutdown
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# BGMABGSAME ‚ðƒtƒF[ƒhƒAƒEƒg
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# ƒVƒƒƒbƒgƒ_ƒEƒ“
$scene = nil
end
#------------------------------------------
# œ 퓬ƒeƒXƒg
#------------------------------------------
def battle_test
# ƒf[ƒ^ƒx[ƒX (퓬ƒeƒXƒg—p) ‚ðƒ[ƒh
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# ƒvƒŒƒCŽžŠÔŒv‘ª—p‚̃tƒŒ[ƒ€ƒJƒEƒ“ƒg‚ðƒŠƒZƒbƒg
Graphics.frame_count = 0
# ŠeŽíƒQ[ƒ€ƒIƒuƒWƒFƒNƒg‚ðì¬
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 퓬ƒeƒXƒg—p‚̃p[ƒeƒB‚ðƒZƒbƒgƒAƒbƒv
$game_party.setup_battle_test_members
# ƒgƒ‹[ƒv IDA“¦‘–‰Â”ƒtƒ‰ƒOAƒoƒgƒ‹ƒoƒbƒN‚ðÝ’è
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# ƒoƒgƒ‹ŠJŽn SE ‚ð‰‰‘t
$game_system.se_play($data_system.battle_start_se)
# ƒoƒgƒ‹ BGM ‚ð‰‰‘t
$game_system.bgm_play($game_system.battle_bgm)
# ƒoƒgƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Battle.new
end
end |
|