Class: Game_System
- Defined in:
- scripts/00600 Script_RMXP/02100 Game_System.rb
Overview
Class that manage Music playing, save and menu access, timer and interpreter
Instance Attribute Summary collapse
-
#battle_interpreter
readonly
バトルイベント用インタプリタ.
-
#encounter_disabled
エンカウント禁止.
-
#magic_number
マジックナンバー.
-
#map_interpreter
readonly
マップイベント用インタプリタ.
-
#menu_disabled
メニュー禁止.
-
#message_frame
文章オプション ウィンドウ枠.
-
#message_position
文章オプション 表示位置.
-
#save_count
セーブ回数.
-
#save_disabled
セーブ禁止.
-
#timer
タイマー.
-
#timer_working
タイマー作動中フラグ.
Instance Method Summary collapse
-
#battle_bgm ⇒ RPG::AudioFile
Returns the battle BGM descriptor.
-
#battle_bgm=(battle_bgm)
Sets the battle BGM descriptor.
-
#battle_end_me ⇒ RPG::AudioFile
Returns the battle end ME descriptor.
-
#battle_end_me=(battle_end_me)
Sets the battle end ME descriptor.
-
#bgm_fade(time)
Fade the BGM out.
-
#bgm_memorize
Memorize the BGM.
-
#bgm_memorize2
Memorize an other BGM with position.
-
#bgm_play(bgm)
Plays a BGM.
-
#bgm_restore
Plays the Memorized BGM.
-
#bgm_restore2
Plays the other Memorized BGM at the right position (FmodEx Eclusive).
-
#bgm_stop
Stop the BGM.
-
#bgs_fade(time)
Fade the BGS out.
-
#bgs_memorize
Memorize the BGS.
-
#bgs_play(bgs)
Plays a BGS.
-
#bgs_restore
Play the memorized BGS.
-
#cry_play(id)
play the cry of a Pokémon.
-
#initialize ⇒ Game_System
constructor
Default initializer.
-
#me_play(me)
Plays a ME.
-
#playing_bgm ⇒ RPG::AudioFile
Returns the playing BGM descriptor.
-
#playing_bgs ⇒ RPG::AudioFile
Returns the playing BGS descriptor.
-
#se_play(se)
Plays a SE.
-
#se_stop
Stops every SE.
-
#update
Updates the Game System (timer).
-
#windowskin_name ⇒ String
Returns the name of the window skin.
-
#windowskin_name=(windowskin_name)
Sets the name of the window skin.
Constructor Details
#initialize ⇒ Game_System
Default initializer
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 17 def initialize @map_interpreter = Interpreter.new(0, true) @battle_interpreter = Interpreter.new(0, false) @timer = 0 @timer_working = false @save_disabled = false @menu_disabled = false @encounter_disabled = false @message_position = 2 @message_frame = 0 @save_count = 0 @magic_number = 0 end |
Instance Attribute Details
#battle_interpreter (readonly)
バトルイベント用インタプリタ
6 7 8 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 6 def battle_interpreter @battle_interpreter end |
#encounter_disabled
エンカウント禁止
11 12 13 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 11 def encounter_disabled @encounter_disabled end |
#magic_number
マジックナンバー
15 16 17 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 15 def magic_number @magic_number end |
#map_interpreter (readonly)
マップイベント用インタプリタ
5 6 7 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 5 def map_interpreter @map_interpreter end |
#menu_disabled
メニュー禁止
10 11 12 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 10 def @menu_disabled end |
#message_frame
文章オプション ウィンドウ枠
13 14 15 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 13 def @message_frame end |
#message_position
文章オプション 表示位置
12 13 14 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 12 def @message_position end |
#save_count
セーブ回数
14 15 16 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 14 def save_count @save_count end |
#save_disabled
セーブ禁止
9 10 11 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 9 def save_disabled @save_disabled end |
#timer
タイマー
7 8 9 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 7 def timer @timer end |
#timer_working
タイマー作動中フラグ
8 9 10 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 8 def timer_working @timer_working end |
Instance Method Details
#battle_bgm ⇒ RPG::AudioFile
Returns the battle BGM descriptor
146 147 148 149 150 151 152 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 146 def battle_bgm if @battle_bgm == nil return $data_system.battle_bgm else return @battle_bgm end end |
#battle_bgm=(battle_bgm)
Sets the battle BGM descriptor
155 156 157 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 155 def battle_bgm=(battle_bgm) @battle_bgm = battle_bgm end |
#battle_end_me ⇒ RPG::AudioFile
Returns the battle end ME descriptor
160 161 162 163 164 165 166 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 160 def battle_end_me if @battle_end_me == nil return $data_system.battle_end_me else return @battle_end_me end end |
#battle_end_me=(battle_end_me)
Sets the battle end ME descriptor
169 170 171 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 169 def battle_end_me=(battle_end_me) @battle_end_me = battle_end_me end |
#bgm_fade(time)
Fade the BGM out
52 53 54 55 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 52 def bgm_fade(time) @playing_bgm = nil Audio.bgm_fade(time * 1000) end |
#bgm_memorize
Memorize the BGM
57 58 59 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 57 def bgm_memorize @memorized_bgm = @playing_bgm end |
#bgm_memorize2
Memorize an other BGM with position
66 67 68 69 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 66 def bgm_memorize2 @bgm_position = Audio.bgm_position @memorized_bgm2 = @playing_bgm end |
#bgm_play(bgm)
Plays a BGM
37 38 39 40 41 42 43 44 45 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 37 def bgm_play(bgm) @playing_bgm = bgm if bgm and !bgm.name.empty? Audio.bgm_play(_utf8("Audio/BGM/" + bgm.name), bgm.volume, bgm.pitch) else Audio.bgm_stop end Graphics.frame_reset end |
#bgm_restore
Plays the Memorized BGM
61 62 63 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 61 def bgm_restore bgm_play(@memorized_bgm) end |
#bgm_restore2
Plays the other Memorized BGM at the right position (FmodEx Eclusive)
72 73 74 75 76 77 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 72 def bgm_restore2 bgm_play(@memorized_bgm2) if @bgm_position Audio.bgm_position = @bgm_position end end |
#bgm_stop
Stop the BGM
47 48 49 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 47 def bgm_stop Audio.bgm_stop end |
#bgs_fade(time)
Fade the BGS out
91 92 93 94 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 91 def bgs_fade(time) @playing_bgs = nil Audio.bgs_fade(time * 1000) end |
#bgs_memorize
Memorize the BGS
96 97 98 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 96 def bgs_memorize @memorized_bgs = @playing_bgs end |
#bgs_play(bgs)
Plays a BGS
80 81 82 83 84 85 86 87 88 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 80 def bgs_play(bgs) @playing_bgs = bgs if bgs and !bgs.name.empty? Audio.bgs_play(_utf8("Audio/BGS/" + bgs.name), bgs.volume, bgs.pitch) else Audio.bgs_stop end Graphics.frame_reset end |
#bgs_restore
Play the memorized BGS
100 101 102 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 100 def bgs_restore bgs_play(@memorized_bgs) end |
#cry_play(id)
play the cry of a Pokémon
32 33 34 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 32 def cry_play(id) Audio.cry_play(sprintf("Audio/SE/Cries/%03dCry", id.to_i)) end |
#me_play(me)
Plays a ME
105 106 107 108 109 110 111 112 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 105 def me_play(me) if me and !me.name.empty? Audio.me_play(_utf8("Audio/ME/" + me.name), me.volume, me.pitch) else Audio.me_stop end Graphics.frame_reset end |
#playing_bgm ⇒ RPG::AudioFile
Returns the playing BGM descriptor
126 127 128 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 126 def return @playing_bgm end |
#playing_bgs ⇒ RPG::AudioFile
Returns the playing BGS descriptor
131 132 133 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 131 def return @playing_bgs end |
#se_play(se)
Plays a SE
115 116 117 118 119 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 115 def se_play(se) if se and !se.name.empty? Audio.se_play(_utf8("Audio/SE/" + se.name), se.volume, se.pitch) end end |
#se_stop
Stops every SE
121 122 123 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 121 def se_stop Audio.se_stop end |
#update
Updates the Game System (timer)
173 174 175 176 177 178 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 173 def update # タイマーを 1 減らす if @timer_working and @timer > 0 @timer -= 1 end end |
#windowskin_name ⇒ String
Returns the name of the window skin
136 137 138 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 136 def windowskin_name return @windowskin_name || 'message' end |
#windowskin_name=(windowskin_name)
Sets the name of the window skin
141 142 143 |
# File 'scripts/00600 Script_RMXP/02100 Game_System.rb', line 141 def windowskin_name=(windowskin_name) @windowskin_name = windowskin_name end |