def me_play(me)
if me != nil && me.name != ''
vol = correction(@bgm_volume)
dream_ed = me.clone
dream_ed.volume = dream_ed.volume * vol / 100
DREAM.play_encrypted_audio('Audio/ME/', dream_ed, 2)
else
Audio.me_stop
end
Graphics.frame_reset
end
def se_play(se)
if se != nil && se.name != ''
vol = correction(@sfx_volume)
dream_ed = se.clone
dream_ed.volume = dream_ed.volume * vol / 100
DREAM.play_encrypted_audio('Audio/SE/', dream_ed, 3)
end
end
else
def bgm_play(bgm)
@playing_bgm = bgm
if bgm != nil && bgm.name != ''
vol = correction(@bgm_volume)
Audio.bgm_play('Audio/BGM/' + bgm.name , bgm.volume * vol / 100, bgm.pitch
)
else
Audio.bgm_stop
end
Graphics.frame_reset
end
def bgs_play(bgs)
@playing_bgs = bgs
if bgs != nil && bgs.name != ''
vol = correction(@sfx_volume)
Audio.bgs_play('Audio/BGS/' + bgs.name, bgs.volume * vol / 100, bgs.pitch)
else
Audio.bgs_stop
end
Graphics.frame_reset
end
def me_play(me)
if me != nil && me.name != ''
vol = correction(@bgm_volume)
Audio.me_play('Audio/ME/' + me.name, me.volume * vol / 100, me.pitch)
else
Audio.me_stop
end
Graphics.frame_reset
end
def se_play(se)
if se != nil && se.name != ''
vol = correction(@sfx_volume)
Audio.se_play('Audio/SE/' + se.name, se.volume * vol / 100, se.pitch)
end
end
end
def correction(volume)
case volume
when 100 then return 100
when 95 then return 97
when 90 then return 95
when 85 then return 92
when 80 then return 90
when 75 then return 87
when 70 then return 85
when 65 then return 82
when 60 then return 80
when 55 then return 77
when 50 then return 75
when 45 then return 72
when 40 then return 70
when 35 then return 65
when 30 then return 60
when 25 then return 55
when 20 then return 50
when 15 then return 40
when 10 then return 35
when 5 then return 25
end
return 0
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
def now_exp
return (@exp-@exp_list[@level])
end
def next_exp
return (@exp_list[@level+1] > 0 ? @exp_list[@level+1]-@exp_list[@level] : 0)
end
def test_equip(equip_type, id)
case equip_type
when 0 then old_id, @weapon_id = @weapon_id, id
when 1 then old_id, @armor1_id = @armor1_id, id
when 2 then old_id, @armor2_id = @armor2_id, id
when 3 then old_id, @armor3_id = @armor3_id, id
when 4 then old_id, @armor4_id = @armor4_id, id
end
tested = [self.maxhp, self.maxsp, self.atk, self.pdef, self.mdef, self.str,
self.dex, self.agi, self.int, self.eva]
case equip_type
when 0 then @weapon_id = old_id
when 1 then @armor1_id = old_id
when 2 then @armor2_id = old_id
when 3 then @armor3_id = old_id
when 4 then @armor4_id = old_id
end
return tested
end
end
#==============================================================================
# Scene_Title
#==============================================================================
class Scene_Title
alias main_storm_cms_later main
def main
$map_infos = load_data('Data/MapInfos.rxdata')
$map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
main_storm_cms_later
end
end
#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
def name
return $map_infos[@map_id]
end
end
#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
if $tons_version == nil || $tons_version < 3.71
alias init_ultimate_font_override_later initialize
def initialize(w, h = nil)
if w.is_a?(Numeric) && h.is_a?(Numeric)
init_ultimate_font_override_later(w, h)
else
init_ultimate_font_override_later(w)
end
if $game_system != nil && $game_system.fontname != nil &&
!$scene.is_a?(Scene_Title)
self.font.name = $game_system.fontname
self.font.size = $game_system.fontsize
else
self.font.name = Font.default_name
self.font.size = Font.default_size
end
end
def gradient_bar(x, y, w, color1, color2, color3, rate, flag = false)
offset = 5
x += offset
y += 26
(0...offset+3).each {|i| fill_rect(x-i, y+i-2, w+3, 1, Color.new(0, 0, 0))}
(0...offset+1).each {|i| fill_rect(x-i, y+i-1, w+1, 1, Color.new(255, 255, 2
55))}
(0...w+offset).each {|i|
red = color3.red * i / (w + offset)
green = color3.green * i / (w + offset)
blue = color3.blue * i / (w + offset)
oy = i < offset ? offset-i : 0
off = i < offset ? i : i > w ? w+offset-i : offset
fill_rect(x+i-offset+1, y+oy-1, 1, off, Color.new(red, green, blue))}
if (w*rate).to_i >= offset
(0...(w*rate).to_i+offset).each {|i|
red = color1.red + (color2.red-color1.red)*i/((w+offset)*rate)
green = color1.green + (color2.green-color1.green)*i/((w+offset)*rate)
blue = color1.blue + (color2.blue-color1.blue)*i/((w+offset)*rate)
oy = i < offset ? offset-i : 0
off = i < offset ? i : i > w*rate ? (w*rate).to_i+offset-i : offset
fill_rect(x+i-offset+1, y+oy-1, 1, off, Color.new(red, green, blue))}
else
(0...(w*rate).to_i).each {|i| (0...offset-1).each {|j|
red = color1.red + (color2.red-color1.red) * i / (w * rate)
green = color1.green + (color2.green-color1.green) * i / (w * rate)
blue = color1.blue + (color2.blue-color1.blue) * i / (w * rate)
set_pixel(x+i-j+1, y+j-1, Color.new(red, green, blue))}}
end
end
end
def draw_element_graph(x_plus, y_plus, rad, color, limit = -1)
(-rad-1...0).each {|r| (r...0).each {|x|
color.alpha = 255 * (rad+1.0-r.abs)/(rad+1)
y = (r.abs * Math.sin(Math.acos(x/r.to_f))).to_i
h = y * 2
case limit
when 1, 8 then h = (y < x.abs ? 0 : y - x.abs)
when 2, 7 then y > x.abs ? h = y = x.abs : h = y
when 3, 6
y > x.abs ? h = y = x.abs : h = y
y = 0 if y > 0
when 4, 5 then h, y = (y < x.abs ? 0 : y - x.abs), -x.abs
end
if limit < 5
fill_rect(rad*2-x + x_plus, rad-y + y_plus, 1, h, color)
else
fill_rect(rad*2+x+1 + x_plus, rad-y + y_plus, 1, h, color)
end}}
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
alias st_cms_hybrid_hack_init initialize
def initialize(xx, yy, w, h)
st_cms_hybrid_hack_init(xx, yy, w, h)
if BlizzCFG::CMS_EDITION && @background != nil
@backsprite = Sprite.new
@backsprite.bitmap = RPG::Cache.picture("CMS/#{BlizzCFG::CMS_EDITION}/#{@b
ackground}")
self.opacity, @backsprite.x, @backsprite.y = 0, self.x, self.y
end
end
alias st_cms_hybrid_hack_x_ x=
def x=(xx)
st_cms_hybrid_hack_x_($scene.is_a?(Scene_Menu) && BlizzCFG::WIN_MIRRORED ? 6
40-width-xx : xx)
@backsprite.x = xx unless @backsprite == nil || @backsprite.disposed?
end
alias st_cms_hybrid_hack_y_ y=
def y=(yy)
st_cms_hybrid_hack_y_(yy)
@backsprite.y = yy unless @backsprite == nil || @backsprite.disposed?
end
alias st_cms_hybrid_hack_x x
def x
xx = st_cms_hybrid_hack_x
return ($scene.is_a?(Scene_Menu) && BlizzCFG::WIN_MIRRORED ? 640-width-xx :
xx)
end
alias st_cms_hybrid_hack_z z=
def z=(z)
st_cms_hybrid_hack_z(z)
@backsprite.z = z unless @backsprite == nil || @backsprite.disposed?
end
alias st_cms_hybrid_hack_width width=
def width=(w)
self.x += w-width if $scene.is_a?(Scene_Menu) && BlizzCFG::WIN_MIRRORED
st_cms_hybrid_hack_width(w)
end
alias st_cms_hybrid_hack_visible visible=
def visible=(expr)
st_cms_hybrid_hack_visible(expr)
@backsprite.visible = expr unless @backsprite == nil || @backsprite.disposed
?
end
alias disp_sprite_later dispose
def dispose
@backsprite.dispose unless @backsprite == nil || @backsprite.disposed?
disp_sprite_later
end
alias st_cms_hybrid_hack_normal_color normal_color
def normal_color
if $scene.is_a?(Scene_Menu) && BlizzCFG::FONT_BACKGROUND_FIX
return Color.new(0, 0, 0)
else
return st_cms_hybrid_hack_normal_color
end
end
alias st_cms_hybrid_hack_system_color system_color
def system_color
if $scene.is_a?(Scene_Menu) && BlizzCFG::FONT_BACKGROUND_FIX
return Color.new(160, 0, 255)
else
return st_cms_hybrid_hack_system_color
end
end
alias st_cms_hybrid_hack_disabled_color disabled_color
def disabled_color
if $scene.is_a?(Scene_Menu) && BlizzCFG::FONT_BACKGROUND_FIX
return Color.new(96, 96, 96)
else
return st_cms_hybrid_hack_disabled_color
end
end
alias st_cms_hybrid_hack_crisis_color crisis_color
def crisis_color
if $scene.is_a?(Scene_Menu) && BlizzCFG::FONT_BACKGROUND_FIX
return Color.new(192, 192, 0)
else
return st_cms_hybrid_hack_crisis_color
end
end
alias draw_actor_graphic_st_cms_later draw_actor_graphic
def draw_actor_graphic(actor, x, y)
if actor != nil && actor.character_name != ''
if self.is_a?(Window_CMSMenuStatus) && BlizzCFG::FACESETS
bitmap = RPG::Cache.character("#{actor.character_name}_face", actor.char
acter_hue)
x -= bitmap.width / 2
y -= bitmap.height
draw_actor_face_st_cms(actor, x, y)
else
draw_actor_graphic_st_cms_later(actor, x, y)
end
end
end
def draw_actor_face_st_cms(actor, x, y)
if $tons_version == nil || $tons_version < 3.71 || !FACE_HUE
hue = 0
else
hue = (FACE_HUE ? actor.character_hue : 0)
end
bitmap = RPG::Cache.character("#{actor.character_name}_face", hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_actor_battler(actor, x, y)
if actor != nil && actor.battler_name != ''
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw,ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
def draw_actor_exp(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 48, 32, 'EXP')
if actor.exp_s.to_i > 999999
w = self.contents.text_size('999999').width
else
w = self.contents.text_size(actor.exp_s).width
end
if actor.next_exp_s.to_i > 999999
w2 = self.contents.text_size('999999').width
else
w2 = self.contents.text_size(actor.next_exp_s).width
end
self.contents.font.color = normal_color
self.contents.draw_text(x + 108 - w2, y, w2, 32, actor.exp_s, 2)
self.contents.draw_text(x + 108, y, 12, 32, '/', 1)
self.contents.draw_text(x + 120, y, w2, 32, actor.next_exp_s)
end
def draw_actor_exp_alt(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 64, 32, 'next')
self.contents.font.color = normal_color
self.contents.draw_text(x + 56, y, 84, 32, actor.next_rest_exp_s, 2)
end
def draw_actor_name2(actor, x, y, w, a)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, w, 32, actor.name, a)
end
def up_color
return Color.new(0, 255, 0)
end
def down_color
return Color.new(255, 0, 0)
end
alias draw_actor_parameter_st_cms_later draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
if type == 7
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, 'Evasion')
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
else
draw_actor_parameter_st_cms_later(actor, x, y, type)
end
end
def draw_actor_element_vulnerability(actor, x, y, rad = 60)
colors = []
(1..8).each {|i|
rate = actor.element_rate(i)
if rate < 0
colors.push(Color.new(0, 255 * (100-rate.abs) / 200, 255))
elsif rate == 0
colors.push(Color.new(0, 128, 255))
elsif rate <= 50
colors.push(Color.new(0, 255 * (rate+50) / 100, 255 * (50-rate) / 50))
elsif rate <= 100
colors.push(Color.new(255 * (rate-50) / 50 , 255, 0))
elsif rate <= 200
colors.push(Color.new(255, 255 * (200-rate) / 100, 0))
else
colors.push(normal_color)
end}
(1..8).each {|i|
self.contents.draw_element_graph(x + 16, y + 32, rad, colors[i-1], i)}
save_color = self.contents.font.color.clone
(1..8).each {|i|
str1 = $data_system.elements[i]
str2 = "#{actor.element_rate(i)}%"
w1 = self.contents.text_size(str1).width
w2 = self.contents.text_size(str2).width
case i
when 1 then x2, y2, x3, y3 = x+152, y+20, x+168, y+4
when 2 then x2, y2, x3, y3 = x+176, y+56, x+192, y+40
when 3 then x2, y2, x3, y3 = x+176, y+92, x+192, y+108
when 4 then x2, y2, x3, y3 = x+152, y+128, x+168, y+144
when 5 then x2, y2, x3, y3 = x+120-w1, y+128, x+104-w2, y+144
when 6 then x2, y2, x3, y3 = x+96-w1, y+92, x+80-w2, y+108
when 7 then x2, y2, x3, y3 = x+96-w1, y+56, x+80-w2, y+40
when 8 then x2, y2, x3, y3 = x+120-w1, y+20, x+104-w2, y+4
end
self.contents.font.color = save_color
self.contents.draw_text(x2, y2, w1, 32, str1)
self.contents.font.color = colors[i-1]
self.contents.draw_text(x3, y3, w2, 32, str2)}
self.contents.font.color = save_color
end
if $Blizz_Art
alias draw_actor_exp_blizzart_later draw_actor_exp
def draw_actor_exp(actor, x, y, w = 148)
if $game_system.BARS
w -= 12
rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
if rate < 0.5
color1 = Color.new(20 * rate, 60, 80, 192)
color2 = Color.new(60 * rate, 180, 240, 192)
elsif rate >= 0.5
color1 = Color.new(20 + 120 * (rate-0.5), 60 + 40 * (rate-0.5), 80, 192)
color2 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240, 1
92)
end
color3 = Color.new(80, 80, 80, 192)
self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
end
draw_actor_exp_blizzart_later(actor, x, y)
end
alias draw_actor_exp_new2 draw_actor_exp_alt
def draw_actor_exp_alt(actor, x, y, w = 148)
w -= 12
rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
if rate < 0.5
color1 = Color.new(20 * rate, 60, 80)
color2 = Color.new(60 * rate, 180, 240)
elsif rate >= 0.5
color1 = Color.new(20 + 120 * (rate-0.5), 60 + 40 * (rate-0.5), 80)
color2 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240)
end
color3 = Color.new(80, 80, 80, 192)
self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
draw_actor_exp_new2(actor, x, y)
end
end
end
#==============================================================================
# Window_CMSCommand
#==============================================================================
class Window_CMSCommand < Window_Command
attr_reader :continue
def initialize(index, continue)
@background = 'CMSCommand'
commands = [$data_system.words.item, 'Equipment', $data_system.words.equip,
$data_system.words.skill, 'Status', 'Options', 'Save', 'Load', 'Exit']
super(180, commands)
@continue, self.index, self.x, self.y, self.z = continue, index, 972, 0, 999
end
def draw_item(i, color)
self.contents.fill_rect(0, i*32, 148, 32, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon("CMS/commandmenu#{i}")
opacity = (color == normal_color ? 255 : 128)
self.contents.blt(4, 4 + i*32, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.font.color = color
self.contents.draw_text(32, i*32, 148, 32, @commands[i])
end
end
#==============================================================================
# Window_CMSChooseItem
#==============================================================================
class Window_CMSChooseItem < Window_Selectable
def initialize
@background = 'CMSHelp'
super(0, -576, 640, 64)
@commands = ['Items', 'Sort', 'Quest Items']
@item_max = @column_max = @commands.size
self.contents = Bitmap.new(width - 32, 32)
refresh
self.active, self.z, self.index = true, 2900, 0
end
def refresh
self.contents.clear
(0...@item_max).each {|i| draw_item(i, normal_color)}
end
def draw_item(i, color)
self.contents.font.color = color
self.contents.fill_rect(8 + 212*i, 0, 164, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(8 + 212*i, 0, 164, 32, @commands[i], 1)
end
end
#==============================================================================
# Window_CMSOptions
#==============================================================================
class Window_CMSOptions < Window_Selectable
attr_accessor :current_font
attr_reader :current_skin
attr_reader :skin_name
attr_reader :font_name
def initialize
@background = 'CMSFullscreen'
super(0, 512, 640, 480)
@commands = ['BGM Volume', 'SFX Volume', 'Battle BGM']
@commands.push('Battle Cam') if BlizzCFG::CAM_AVAILABLE
@commands.push('Bar Style', 'Bar Opacity') if $Blizz_Art
@commands.push('Font', 'Windowskin')
get_skin_and_font
self.contents = Bitmap.new(width - 32, height - 32)
self.z, self.index = 2999, 0
@item_max = @commands.size
refresh
end
def get_option
return @commands[index]
end
def refresh
self.contents.clear
self.contents.font.name = $game_system.fontname
(0...@item_max).each {|i|
self.contents.font.color = normal_color
self.contents.fill_rect(24, 16 + i*36, 192, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(24, 16 + i*36, 192, 32, @commands[i])
draw_arrows(288, 4 + i*36)
case @commands[i]
when 'BGM Volume' then draw_volume(288, 4 + i*36)
when 'SFX Volume' then draw_volume(288, 4 + i*36, true)
when 'Battle BGM' then draw_battle_bgm(288, 4 + i*36)
when 'Battle Cam' then draw_battle_cam(288, 4 + i*36)
when 'Bar Style' then draw_style(288, 4 + i*36)
when 'Bar Opacity' then draw_opacity(288, 4 + i*36)
when 'Font' then draw_font(288, 4 + i*36)
when 'Windowskin' then draw_skin(288, 4 + i*36)
end}
end
def draw_arrows(x, y)
self.contents.draw_text(x - 32, y + 13, 32, 32, '<<')
self.contents.draw_text(x + 249, y + 13, 32, 32, '>>')
end
def draw_volume(x, y, mode = false, width = 224)
volume = (mode ? $game_system.sfx_volume.to_f : $game_system.bgm_volume.to_f
)
vol = volume.to_f / 100
color1 = Color.new(20, 40, 80, 192)
color2 = Color.new(60, 120, 240, 192)
color3 = Color.new(0, 0, 80, 192)
old, $game_system.bar_opacity = $game_system.bar_opacity, 255 if $Blizz_Art
self.contents.gradient_bar(x, y, width, color1, color2, color3, vol, true)
$game_system.bar_opacity = old if $Blizz_Art
end
def draw_style(x, y, width = 224)
color1 = Color.new(80, 80, 0, 192)
color2 = Color.new(240, 240, 0, 192)
self.contents.gradient_bar(x + 32, y, width - 64, color1, color2, color1, 1,
true)
end
def draw_battle_bgm(x, y, width = 224)
bgm = BlizzCFG::BATTLE_BGMS[$game_variables[BlizzCFG::BGM_Variable]][3]
if $game_switches[BlizzCFG::BGM_Lock] || BlizzCFG::BATTLE_BGMS.size <= 1
self.contents.font.color = Color.new(0, 0, 0, 255)
self.contents.draw_text(x+1, y + 13+1, 224, 32, bgm, 1)
self.contents.font.color = disabled_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x, y + 13, 224, 32, bgm, 1)
end
end
#==============================================================================
# Window_CMSEndCommand
#==============================================================================
class Window_CMSEndCommand < Window_Command
def initialize
@background = 'CMSMini'
super(180, ['Back to game', 'Back to title', 'Exit game'])
self.x, self.y, self.z = 460, 524, 3999
end
end
#==============================================================================
# Window_CMSInfo
#==============================================================================
class Window_CMSInfo < Window_Base
def initialize
@background = 'CMSInfo'
super(0, 0, 180, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.active, self.x, self.y, self.z = false, 460, 832, 1999
refresh
end
def refresh
self.contents.clear
self.contents.font.name = $game_system.fontname
@double_sec = Graphics.frame_count * 2 / Graphics.frame_rate
total_sec = @double_sec / 2
hour, min, sec = total_sec / 60 / 60, total_sec / 60 % 60, total_sec % 60
if @double_sec % 2 == 1
text = sprintf('%02d %02d %02d', hour, min, sec)
else
text = sprintf('%02d:%02d:%02d', hour, min, sec)
end
self.contents.font.color = system_color
cx = contents.text_size($data_system.words.gold).width
self.contents.draw_text(148-cx, 32, cx, 32, $data_system.words.gold, 2)
self.contents.draw_text(0, 64, 148, 32, 'Location:')
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 148, 32, text, 1)
self.contents.draw_text(0, 32, 144-cx, 32, $game_party.gold.to_s, 2)
self.contents.draw_text(0, 96, 148, 32, $game_map.name, 2)
end
def update
super
refresh if Graphics.frame_count * 2 / Graphics.frame_rate != @double_sec
end
end
#==============================================================================
# Window_CMSMenuStatus
#==============================================================================
class Window_CMSMenuStatus < Window_Base
attr_reader :index
attr_reader :actor
attr_reader :dir
def initialize(actor)
@background = 'CMSMenuStatus'
super(0, 0, 460, 120)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
@dir = 0
refresh
self.active = false
self.index = -1
self.x, self.y, self.z = -512, @actor.index * 120, 999
end
def index=(i)
@index = i
update_cursor_rect
end
def refresh
self.contents.clear
self.contents.font.name = $game_system.fontname
self.contents.font.color = normal_color
draw_actor_graphic(@actor, 56, 80)
draw_actor_name2(@actor, 8, 0, 88, 1)
draw_actor_level(@actor, 104, 0)
draw_actor_state(@actor, 168, 0, 252)
draw_actor_hp(@actor, 104, 28)
draw_actor_sp(@actor, 272, 28)
draw_actor_exp_alt(@actor, 272, 56)
if $crls
if BlizzCFG::DRAW_SR_BAR
draw_actor_sr_with_bar(@actor, 104, 56)
else
draw_actor_sr(@actor, 104, 56)
end
end
end
def dir=(val)
self.y -= val*56
@dir = val
end
def update(i = @actor.index - 1)
if @actor.index == i
self.index = 0 if self.index == -1
else
self.index = -1 if self.index == 0
end
self.y = @actor.index*120 unless self.active
@dir = 0 if self.y / 120 * 120 == self.y
super()
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, 0, width - 32, height - 32)
end
end
end
#==============================================================================
# Scene_Menu
#==============================================================================
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
@actor_index = @target_index = -1
@viewport1 = Viewport.new(0, 0, 640, 480)
@moved = false
end
def main
if BlizzCFG::MAP_BACKGROUND
@spriteset = Spriteset_Map.new
elsif BlizzCFG::CMS_EDITION
@spriteset = Sprite.new
@spriteset.bitmap = RPG::Cache.picture("CMS/#{BlizzCFG::CMS_EDITION}/CMSFu
llscreen")
end
continue = ((1..BlizzCFG::SAVE_FILES_NUMBER).any? {|i|
FileTest.exist?("#{BlizzCFG::SAVE_NAME}#{i}.#{BlizzCFG::SAVE_EXTENSION}"
)})
@command_window = Window_CMSCommand.new(@menu_index, continue)
(0...5).each {|i| @command_window.disable_item(i)} if $game_party.actors.siz
e == 0
@command_window.disable_item(6) if $game_system.save_disabled
@command_window.disable_item(7) unless @command_window.continue
@info_window = Window_CMSInfo.new
@status_windows, @target_windows = [], []
$game_party.actors.each {|actor|
@status_windows.push(Window_CMSMenuStatus.new(actor))}
@help_window = Window_Help.new
@help_window.x, @help_window.y, @help_window.z = 0, -368, 9999
Graphics.transition
loop do
Graphics.update
Input.update
update
break if @scene != nil || $scene != self
end
loop do
Graphics.update
(@status_windows + [@command_window, @info_window]).each {|win| win.update
}
move_da_outro
break if @status_windows[0].x <= - 512
end
Graphics.freeze
(@status_windows + @target_windows + [@command_window, @info_window,
@help_window, @spriteset]).each {|obj| obj.dispose if obj != nil}
del_sort if @sort_window != nil
del_status if @playerstatus_window != nil
del_equip if @left_window != nil
del_skill if @skill_window != nil
del_end if @end_window != nil
del_items if @item_choose_window != nil
del_equipment if @equips_window != nil
del_options if @options_window != nil
if @scene.is_a?(Scene_Title)
Graphics.transition(25)
Graphics.freeze
end
$scene = @scene
end
def equip_refresh
if @item_window.active
item = @item_window.data
last_hp = @actor.hp
last_sp = @actor.sp
@left_window.current = [@actor.maxhp, @actor.maxsp, @actor.atk,
@actor.pdef, @actor.mdef, @actor.str, @actor.dex, @actor.agi,
@actor.int, @actor.eva]
@left_window.changed = @actor.test_equip(@right_window.index, item == nil
? 0 : item.id)
elements = (item.is_a?(RPG::Weapon) ? item.element_set :
(item.is_a?(RPG::Armor) ? item.guard_element_set : []))
states = (item.is_a?(RPG::Weapon) ? item.plus_state_set :
(item.is_a?(RPG::Armor) ? item.guard_state_set : []))
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(elements, states)
else
@left_window.current = @left_window.changed = [0, 0, 0, 0, 0, 0, 0, 0, 0,
0]
@left_window.set_new_parameters([], [])
end
end
def del_sort
@sort_window.dispose
@sort_window = nil
end
def del_status
@playerstatus_window.dispose
@playerstatus_window = nil
end
def del_equip
@left_window.dispose
@right_window.dispose
@item_windows.each {|win| win.dispose}
@left_window = @right_window = @item_window = @item_windows = nil
end
def del_skill
@skill_window.dispose
@skill_window = nil
end
def del_target
@target_windows.each {|win| win.dispose}
@target_windows = []
end
def del_end
@end_window.dispose
@end_window = nil
end
def del_items
@items_window1.dispose
@items_window1 = nil
@items_window2.dispose
@items_window2 = nil
@item_choose_window.dispose
@item_choose_window = nil
end
def del_equipment
@equips_window.dispose
@equips_window = nil
del_target
end
def del_options
@options_window.dispose
@options_window = nil
end
def update
@status_windows.each {|win| win.update(@actor_index)}
@target_windows.each {|win| win.update(@target_index)}
@info_window.update
unless @status_windows[0].x < 0 || @status_windows[0].dir != 0 ||
@target_windows[0] != nil && @target_windows[0].dir != 0
@command_window.update
[@help_window, @equips_window, @item_choose_window, @sort_window,
@skill_window, @left_window, @right_window, @playerstatus_window,
@options_window, @end_window].each {|win| win.update if win != nil}
end
move_da_main if @status_windows[0].x < 0
move_da_selection if @status_windows[0].dir != 0
move_da_targeting if @target_windows[0] != nil && @target_windows[0].dir !=
0
move_da_status if @playerstatus_window != nil && @playerstatus_window.y > 0
move_da_equip if @left_window != nil && @left_window.x > 0
move_da_skill if @skill_window != nil && @skill_window.x < 256
move_da_target if @target_windows[0] != nil && @target_windows[0].x < 0
move_da_items if @item_choose_window != nil && @item_choose_window.y < 0
move_da_sort if @sort_window != nil && @sort_window.y < 64
move_da_equipment if @equips_window != nil && @equips_window.y < 64
move_da_options if @options_window != nil && @options_window.y > 0
move_da_end if @end_window != nil && @end_window.y > 336
if @moved
@moved = false
return
end
if @equips_window != nil
update_equipment
elsif @command_window.active
update_command
elsif @status_windows[0].active
update_status
elsif @item_choose_window != nil
if @item_choose_window.active
items_refresh
update_items_choose
elsif @sort_window != nil && @sort_window.active
update_sort
elsif @items_window1 != nil && @items_window1.active
@items_window1.update
update_item
elsif @items_window2 != nil && @items_window2.active
@items_window2.update
update_item
elsif @target_windows[0] != nil && @target_windows[0].active
update_item_target
end
elsif @skill_window != nil && @skill_window.active
update_skill
elsif @target_windows[0] != nil && @target_windows[0].active
update_skill_target
elsif @right_window != nil
if @right_window.active
update_right_equip
elsif @item_window != nil && @item_window.active
@item_window.update
update_eitem
end
elsif @playerstatus_window != nil && @playerstatus_window.active
update_playerstatus
elsif @options_window != nil && @options_window.active
update_options
elsif @end_window != nil
update_end
end
end
def move_windows(wins, border, mdiff, lead, xy, acc = false)
if acc
diff = [[((xy ? lead.x : lead.y)-border).abs, mdiff].min, 1].max
else
diff = [[((xy ? lead.x : lead.y)-border).abs/2, mdiff].min, 1].max
end
wins[0].each {|win| win.x += diff if win != nil}
wins[1].each {|win| win.x -= diff if win != nil}
wins[2].each {|win| win.y += diff if win != nil}
wins[3].each {|win| win.y -= diff if win != nil}
@moved = true
end
def move_da_main
lead = @status_windows[0]
x_plus = @status_windows
x_minus = [@command_window]
y_minus = [@info_window]
move_windows([x_plus, x_minus, [], y_minus], 0, 128, lead, true)
end
def move_da_outro
@flag = true
lead = @status_windows[0]
x_plus = [@command_window]
x_minus = @status_windows + @target_windows + [@skill_window, @help_window]
y_plus = [@info_window]
y_minus = [@item_choose_window, @items_window1, @items_window2, @help_window
]
move_windows([x_plus, x_minus, y_plus, y_minus], 0, 128, lead, true, true)
end
def move_da_selection(lead = @status_windows[@actor_index])
if lead.dir == 1
move_windows([[], [], [], @status_windows], 360, 32, lead, false)
else
move_windows([[], [], @status_windows, []], 0, 32, lead, false)
end
end
def move_da_targeting(lead = @target_windows[@target_index])
if lead.dir == 1
move_windows([[], [], [], @target_windows], 376, 32, lead, false)
else
move_windows([[], [], @target_windows, []], 64, 32, lead, false)
end
end
def move_da_sort(win = @sort_window)
move_windows([[], [], [win], []], 64, 32, win, false)
end
def move_da_status(win = @playerstatus_window)
move_windows([[], [], [], [win]], 0, 64, win, false)
end
def move_da_equip(win = @left_window)
x_minus = [@left_window, @right_window, @help_window] + @item_windows
move_windows([[], x_minus, [], []], 0, 64, win, true)
end
def move_da_skill(win = @skill_window)
x_plus = [@skill_window, @help_window]
move_windows([x_plus, [], [], []], 256, 64, win, true)
end
def move_da_target(win = @target_windows[0])
move_windows([@target_windows, [], [], []], 0, 32, win, true)
end
def move_da_items(win = @item_choose_window)
y_plus = [@item_choose_window, @items_window1, @items_window2, @help_window]
move_windows([[], [], y_plus, []], 0, 64, win, false)
end
def move_da_equipment(win = @equips_window)
y_plus = [@equips_window, @help_window]
move_windows([[], [], y_plus, []], 64, 64, win, false)
end
def move_da_options(win = @options_window)
move_windows([[], [], [], [win]], 0, 64, win, false)
end
def move_da_end(win = @end_window)
move_windows([[], [], [], [win]], 336, 64, win, false)
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.actors.size == 0 && @command_window.index < 5
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_ITEM_SCENE
@scene = Scene_Item.new
else
@item_choose_window = Window_CMSChooseItem.new
@items_window1 = Window_NormalItem.new
@items_window2 = Window_QuestItem.new
@items_window1.help_window = @items_window2.help_window = @help_window
@command_window.active = false
@help_window.x, @help_window.y = 0, -576
@help_window.set_text('')
@help_window.visible = false
items_refresh
end
when 1..4
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_windows.each {|win| win.active = true}
@actor_index = 0
when 5
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_OPTIONS_SCENE
@scene = Scene_Options.new
else
@options_window = Window_CMSOptions.new
@command_window.active = false
end
when 6
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
@scene = Scene_CMSSave.new
Graphics.transition(0)
end
when 7
if @command_window.continue
$game_system.se_play($data_system.decision_se)
@scene = Scene_CMSLoad.new
Graphics.transition(0)
else
$game_system.se_play($data_system.buzzer_se)
end
when 8
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_END_SCENE
@scene = Scene_End.new
else
@command_window.active = false
@end_window = Window_CMSEndCommand.new
end
end
end
end
def update_status
@actor = $game_party.actors[@actor_index]
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@status_windows.each {|win| win.active, win.index = false, -1}
@actor_index = -1
@command_window.active = true
elsif Input.trigger?(Input::C)
case @command_window.index
when 1
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_EQUIPMENT_SCENE
@scene = Scene_Equipment.new(@actor_index)
else
@equips_window = Window_EquipmentItem.new(@actor)
@equips_window.help_window = @help_window
@target_windows.push(Window_CMSTarget.new(@actor, true))
@status_windows.each {|win| win.active = false}
@help_window.visible = true
@help_window.x, @help_window.y = 0, -612
end
when 2
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_EQUIP_SCENE
@scene = Scene_Equip.new(@actor_index)
else
@left_window = Window_CMSEquipLeft.new(@actor)
@right_window = Window_CMSEquipRight.new(@actor)
@right_window.help_window = @help_window
@item_windows = []
(0..4).each {|i| win = Window_CMSEquipItem.new(@actor, 4-i)
win.help_window = @help_window
@item_windows.unshift(win)}
@item_windows[0].visible = @help_window.visible = true
@help_window.x, @help_window.y = 640, 0
@status_windows.each {|win| win.active = false}
end
when 3
if @actor.restriction >= 2
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_SKILL_SCENE
@scene = Scene_Skill.new(@actor_index)
else
@skill_window = Window_CMSSkill.new(@actor)
@skill_window.help_window = @help_window
@help_window.visible = true
@help_window.x, @help_window.y = -768, 0
@status_windows.each {|win| win.active = false}
end
end
when 4
$game_system.se_play($data_system.decision_se)
if BlizzCFG::CUSTOM_STATUS_SCENE
@scene = Scene_Status.new(@actor_index)
else
@playerstatus_window = Window_CMSStatus.new(@actor)
@status_windows.each {|win| win.active = false}
end
end
elsif Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@actor_index = (@actor_index+1) % $game_party.actors.size
if @status_windows[@actor_index].y < 0
@status_windows.each {|win| win.y += ($game_party.actors.size-4)*120}
elsif @status_windows[@actor_index].y >= 480
@status_windows.each {|win| win.dir = 1}
end
elsif Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size-1
@actor_index %= $game_party.actors.size
if @status_windows[@actor_index].y < 0
@status_windows.each {|win| win.dir = -1}
elsif @status_windows[@actor_index].y >= 480
@status_windows.each {|win| win.y -= ($game_party.actors.size-4)*120}
end
end
end
def update_items_choose
if Input.trigger?(Input::B)
del_items
$game_system.se_play($data_system.cancel_se)
@command_window.active, @help_window.x, @help_window.y = true, 0, -612
elsif Input.trigger?(Input::C)
items_refresh
@item_choose_window.active = false
$game_system.se_play($data_system.decision_se)
case @item_choose_window.index
when 0
@items_window1.active = @help_window.visible = true
@items_window1.index = 0
when 1 then @sort_window = Window_CMSSortCommand.new
when 2
@items_window2.active = @help_window.visible = true
@items_window2.index = 0
end
end
end
def update_sort
if Input.trigger?(Input::B)
del_sort
@item_choose_window.active = true
$game_system.se_play($data_system.cancel_se)
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@items_window1.mode = case @sort_window.index
when 0 then @sort_window.index
when 1 then @items_window1.mode == 1 ? 2 : 1
when 2 then @items_window1.mode == 3 ? 4 : 3
end
@items_window1.refresh
end
end
def items_refresh
index = @item_choose_window.index
@items_window1.visible = [0, 1].include?(index)
@items_window2.visible = (index == 2)
end
def update_equipment
if Input.trigger?(Input::B)
del_equipment
$game_system.se_play($data_system.cancel_se)
@actor_index = -1
@command_window.active = true
@help_window.visible = false
@help_window.x, @help_window.y = 0, -612
elsif Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
if Input.trigger?(Input::RIGHT)
@actor_index = (@actor_index+1) % $game_party.actors.size
elsif Input.trigger?(Input::LEFT)
@actor_index += $game_party.actors.size-1
@actor_index %= $game_party.actors.size
end
@target_windows[0].update_actor($game_party.actors[@actor_index])
@equips_window.update_actor($game_party.actors[@actor_index])
unless @equips_window.item_max > @equips_window.index
@equips_window.index = 0
end
end
end
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@item_choose_window.active = true
@help_window.set_text('')
@items_window1.active = @items_window2.active = @help_window.visible = fal
se
@items_window1.index = @items_window2.index = -1
elsif Input.trigger?(Input::C)
win = (@item_choose_window.index == 0 ? @items_window1 : @items_window2)
@item = win.data
unless @item.is_a?(RPG::Item) && $game_party.item_can_use?(@item.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_party.actors.each_index {|i|
@target_windows.push(Window_CMSTarget.new($game_party.actors[i]))}
@target_index = 0
$game_system.se_play($data_system.decision_se)
if @item.scope.between?(3, 6)
win.active = false
@target_windows.each {|win| win.active = true}
if [4, 6].include?(@item.scope)
@target_windows.each {|win| win.index = -2}
else
@target_windows[@target_index].index = 0
end
elsif @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
win.draw_item(win.index)
end
(@status_windows + @target_windows).each {|win| win.refresh}
@scene = Scene_Map.new
elsif @skill.scope == 7
$game_system.se_play($data_system.buzzer_se)
end
end
end
def update_item_target
if Input.trigger?(Input::B)
del_target
$game_system.se_play($data_system.cancel_se)
@target_index = -1
@items_window1.refresh unless $game_party.item_can_use?(@item.id)
@items_window1.active = true
elsif Input.trigger?(Input::C)
if $game_party.item_number(@item.id) == 0
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_windows[0].index == -2
used = false
$game_party.actors.each {|actor| used |= actor.item_effect(@item)}
elsif @target_index >= 0
used = $game_party.actors[@target_index].item_effect(@item)
end
if used
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
@items_window1.draw_item(@items_window1.index)
end
(@status_windows + @target_windows).each {|win| win.refresh}
if $game_party.all_dead?
@scene = Scene_Gameover.new
elsif @item.common_event_id > 0
$game_temp.common_event_id = @item.common_event_id
@scene = Scene_Map.new
end
else
$game_system.se_play($data_system.buzzer_se)
end
else
update_target
end
end
def update_target
return if @target_windows[0] == nil || @target_windows[0].index == -2
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@target_index = (@target_index+1) % $game_party.actors.size
if @target_windows[@target_index].y < 64
@target_windows.each {|win| win.y += ($game_party.actors.size-4)*104}
elsif @target_windows[@target_index].y >= 480
@target_windows.each {|win| win.dir = 1}
end
elsif Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@target_index += $game_party.actors.size-1
@target_index %= $game_party.actors.size
if @target_windows[@target_index].y < 64
@target_windows.each {|win| win.dir = -1}
elsif @target_windows[@target_index].y >= 480
@target_windows.each {|win| win.y -= ($game_party.actors.size-4)*104}
end
end
end
def update_skill
if Input.trigger?(Input::B)
del_skill
$game_system.se_play($data_system.cancel_se)
@help_window.x, @help_window.y = 0, -768
@help_window.visible = false
@command_window.active = true
@actor_index = @target_index = -1
elsif Input.trigger?(Input::C)
@skill = @skill_window.data
if @skill == nil || !@actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_party.actors.each_index {|i|
@target_windows.push(Window_CMSTarget.new($game_party.actors[i]))}
@target_index = 0
$game_system.se_play($data_system.decision_se)
if @skill.scope.between?(3, 6)
@skill_window.active = false
@target_windows.each {|win| win.visible = win.active = true}
if [4, 6].include?(@skill.scope)
@target_windows.each {|win| win.index = -2}
else
@target_windows[@target_index].index = 0
end
elsif @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
(@status_windows + @target_windows).each {|win| win.refresh}
@skill_window.refresh
@scene = Scene_Map.new
elsif @skill.scope == 7
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.trigger?(Input::R) || Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
if Input.trigger?(Input::R)
@actor_index = (@actor_index+1) % $game_party.actors.size
elsif Input.trigger?(Input::L)
@actor_index += $game_party.actors.size-1
@actor_index %= $game_party.actors.size
end
@actor = $game_party.actors[@actor_index]
@skill_window.update_actor(@actor)
@skill_window.index = 0
end
end
def update_skill_target
if Input.trigger?(Input::B)
del_target
$game_system.se_play($data_system.cancel_se)
@skill_window.active = true
@target_index = -1
elsif Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_windows[0].index == -2
used = false
$game_party.actors.each {|actor| used |= actor.skill_effect(@actor, @ski
ll)}
else
used = $game_party.actors[@target_index].skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
(@status_windows + @target_windows).each {|win| win.refresh}
@skill_window.refresh
if $game_party.all_dead?
@scene = Scene_Gameover.new
elsif @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
@scene = Scene_Map.new
end
else
$game_system.se_play($data_system.buzzer_se)
end
else
update_target
end
end
def update_right_equip
@item_windows.each_index {|i|
@item_windows[i].visible = (@right_window.index == i)}
@item_window = @item_windows[@right_window.index]
newmode = [@right_window.index, 1].min
if newmode != @left_window.mode
@left_window.mode = newmode
@left_window.refresh
end
if Input.trigger?(Input::B)
del_equip
$game_system.se_play($data_system.cancel_se)
@help_window.x, @help_window.y = 660, 0
@command_window.active = true
@actor_index = -1
elsif Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active, @item_window.index = true, 0
equip_refresh
end
elsif Input.trigger?(Input::R) || Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
if Input.trigger?(Input::R)
@actor_index = (@actor_index+1) % $game_party.actors.size
elsif Input.trigger?(Input::L)
@actor_index += $game_party.actors.size-1
@actor_index %= $game_party.actors.size
end
@actor = $game_party.actors[@actor_index]
@right_window.update_actor(@actor)
@left_window.update_actor(@actor)
@item_windows.each_index {|i| @item_windows[i].update_actor(@actor, i)}
end
end
def update_eitem
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@item_window.active, @item_window.index = false, -1
equip_refresh
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.data
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@item_window.active, @item_window.index = false, -1
@right_window.refresh
@item_window.refresh
(@item_windows + @status_windows).each {|win| win.refresh}
equip_refresh
elsif Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN) ||
Input.repeat?(Input::R) || Input.repeat?(Input::L)
equip_refresh
end
end
def update_playerstatus
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@actor_index = -1
del_status
elsif Input.trigger?(Input::R) || Input.trigger?(Input::RIGHT) ||
Input.trigger?(Input::L) || Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
if Input.trigger?(Input::R) || Input.trigger?(Input::RIGHT)
@actor_index = (@actor_index+1) % $game_party.actors.size
elsif Input.trigger?(Input::L) || Input.trigger?(Input::LEFT)
@actor_index += $game_party.actors.size-1
@actor_index %= $game_party.actors.size
end
@actor = $game_party.actors[@actor_index]
@playerstatus_window.update_actor(@actor)
end
end
def update_options
if Input.trigger?(Input::B)
del_options
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
return
end
case @options_window.get_option
when 'BGM Volume'
if Input.repeat?(Input::RIGHT)
$game_system.bgm_volume += 5
$game_system.bgm_volume = 100 if $game_system.bgm_volume > 100
$game_system.bgm_play($game_system.bgm_memorize)
@options_window.refresh
elsif Input.repeat?(Input::LEFT)
$game_system.bgm_volume -= 5
$game_system.bgm_volume = 0 if $game_system.bgm_volume < 0
$game_system.bgm_play($game_system.bgm_memorize)
@options_window.refresh
end
when 'SFX Volume'
if Input.repeat?(Input::RIGHT)
$game_system.sfx_volume += 5
if $game_system.sfx_volume > 100
$game_system.sfx_volume = 100
else
$game_system.se_play($data_system.cursor_se)
end
@options_window.refresh
elsif Input.repeat?(Input::LEFT)
$game_system.sfx_volume -= 5
$game_system.sfx_volume = 0 if $game_system.sfx_volume < 0
$game_system.se_play($data_system.cursor_se)
@options_window.refresh
end
when 'Battle BGM'
if Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT) ||
Input.repeat?(Input::C)
if $game_switches[BlizzCFG::BGM_Lock] || BlizzCFG::BATTLE_BGMS.size <= 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
ind = $game_variables[BlizzCFG::BGM_Variable]
if Input.repeat?(Input::RIGHT) || Input.repeat?(Input::C)
ind = (ind+1) % BlizzCFG::BATTLE_BGMS.size
elsif Input.repeat?(Input::LEFT)
ind = (ind+BlizzCFG::BATTLE_BGMS.size-1) % BlizzCFG::BATTLE_BGMS.siz
e
end
$game_variables[BlizzCFG::BGM_Variable] = ind
$game_system.reset_battle_bgm
@options_window.refresh
end
end
when 'Battle Cam'
if Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT) ||
Input.repeat?(Input::C)
if BlizzCFG::CAM_AVAILABLE
$game_system.se_play($data_system.decision_se)
$game_system.cam = ($game_system.cam+1) % 2
$game_system.get_cam
@options_window.refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
when 'Bar Style'
if Input.repeat?(Input::RIGHT)
if $game_system.bar_opacity == 0
$game_system.se_play($data_system.buzzer_se)
else
$game_system.bar_style = ($game_system.bar_style + 1) % 7
$game_system.se_play($data_system.decision_se)
@options_window.refresh
@status_windows.each {|win| win.refresh}
end
elsif Input.repeat?(Input::LEFT)
if $game_system.bar_opacity == 0
$game_system.se_play($data_system.buzzer_se)
else
$game_system.bar_style = ($game_system.bar_style + 6) % 7
$game_system.se_play($data_system.decision_se)
@options_window.refresh
@status_windows.each {|win| win.refresh}
end
end
when 'Bar Opacity'
if Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.decision_se)
$game_system.bar_opacity += (Input.repeat?(Input::RIGHT) ? 64 : -64)
@options_window.refresh
@status_windows.each {|win| win.refresh}
end
when 'Font'
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.decision_se)
@options_window.current_font += 1
@options_window.current_font %= BlizzCFG::CMS_FONTS.size
@options_window.refresh
elsif Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.decision_se)
@options_window.current_font += BlizzCFG::CMS_FONTS.size - 1
@options_window.current_font %= BlizzCFG::CMS_FONTS.size
@options_window.refresh
elsif Input.repeat?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_system.fontname = @options_window.font_name
@command_window.refresh
@info_window.refresh
@status_windows.each {|win| win.refresh}
@help_window.refresh
@options_window.refresh
(0...5).each {|i| @command_window.disable_item(i)} if $game_party.actors
.size == 0
@command_window.disable_item(6) if $game_system.save_disabled
@command_window.disable_item(7) unless @command_window.continue
end
when 'Windowskin'
if Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.decision_se)
@options_window.current_skin += 1
@options_window.current_skin %= BlizzCFG::CMS_SKINS.size
@options_window.refresh
elsif Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.decision_se)
@options_window.current_skin += BlizzCFG::CMS_SKINS.size - 1
@options_window.current_skin %= BlizzCFG::CMS_SKINS.size
@options_window.refresh
elsif Input.repeat?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_system.windowskin_name = @options_window.skin_name
end
end
end
def update_end
if Input.trigger?(Input::B) || Input.trigger?(Input::C) &&
@end_window.index == 0
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
del_end
elsif Input.trigger?(Input::C)
Graphics.freeze
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
@end_window.index == 1 ? @scene = Scene_Title.new : $scene = nil
del_end
end
end
end
#==============================================================================
# Scene_CMSSave
#==============================================================================
class Scene_CMSSave < Scene_Save
def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(6)
end
end
#==============================================================================
# Scene_CMSLoad
#==============================================================================
class Scene_CMSLoad < Scene_Load
def on_cancel
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(7)
end
end