Commit a5f345be authored by zh99998's avatar zh99998

BGM修正,退出时报错修正

parent 7f34a9cc
......@@ -20,7 +20,7 @@ class Game_Event
when "K"
WatchAction
when "M"
QROOMOK #TODO
Leave
when "O"
Chat
when "P"
......
......@@ -54,9 +54,9 @@ class Iduel < Game
end
def leave
if @room.include? @user
#
send(10, @key, room.id, checknum("QROOM", @session + room.id.to_s))
else
send("QUITWATCHROOM", @key, checknum("QUITWATCHROOM", @session))
send(9, @key, checknum("QUITWATCHROOM", @session))
end
end
def action(action)
......
#encoding: UTF-8
#仅用于调试,发布时删
alias gbk_puts puts
def puts(*args)
gbk_puts(*(args.collect{|item|item.to_s.encode "GBK", :invalid => :replace, :undef => :replace}))
end
def p(*args)
print(args.collect{|item|item.inspect.encode "GBK", :invalid => :replace, :undef => :replace}.join("\n")+"\n") rescue print(args.join("\n")+"\n")
#仅用于调试
Windows = RUBY_PLATFORM["mingw"] || RUBY_PLATFORM["mswin"]
if Windows
STDOUT.set_encoding "GBK", "UTF-8", :invalid => :replace, :undef => :replace
end
def filesize_inspect(size)
......
......@@ -29,7 +29,7 @@ class Scene_Duel < Scene
end
def start
@bgm = Mixer::Music.load "audio/bgm/title.ogg"
Mixer.fade_in_music(@bgm, 8000, -1)
Mixer.fade_in_music(@bgm, -1, 800)
@background = Surface.load "graphics/field/main.png"
Surface.blit(@background, 0, 0, 0, 0, $screen, 0, 0)
......@@ -68,7 +68,7 @@ class Scene_Duel < Scene
end
def change_phase(phase)
action Action::ChangePhase.new(true, phase)
if phase == :EP
if phase == :EP and
action Action::TurnEnd.new(true, $game.player_field, $game.turn_player ? $game.turn : $game.turn.next)
end
end
......@@ -105,6 +105,8 @@ class Scene_Duel < Scene
when Key::F5
reset
@player_field_window.refresh
when Key::F10
$game.leave
end
else
super
......@@ -136,6 +138,11 @@ class Scene_Duel < Scene
Widget_Msgbox.new(event.title, event.message){$scene = Scene_Title.new}
when Game_Event::Leave
$scene = Scene_Hall.new
when Game_Event::NewRoom
if event.room == $game.room
@player_lp_window.player = $game.room.player1
@opponent_lp_window.player = $game.room.player2
end
end
end
def update
......
......@@ -22,7 +22,7 @@ class Scene_Hall < Scene
@chat = Window_Chat.new(321,551,682,168)
bgm = Mixer::Music.load("audio/bgm/hall.ogg")
Mixer.fade_in_music(bgm, 800, -1)
Mixer.fade_in_music(bgm, -1, 800)
@bgm.destroy if @bgm
@bgm = bgm
@count = 0
......
......@@ -15,7 +15,7 @@ class Scene_Watch < Scene_Duel
end
def start
super
$game.action Action::Chat.new(true, "#{$game.user.name}(#{$game.user.id})进入了观战")
#$game.action Action::Chat.new(true, "#{$game.user.name}(#{$game.user.id})进入了观战")
end
def handle_game(event)
case event
......
......@@ -42,7 +42,7 @@ class Window
def destroy
@destroyed = true
@contents.destroy if @contents
$scene.windows.delete self
$scene.windows.delete self if $scene
end
def destroyed?
@destroyed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment