Commit a3afe1d2 authored by zh99998's avatar zh99998

添加查看卡组指令,还没实现

parent 488befb2
...@@ -10,8 +10,8 @@ class Deck ...@@ -10,8 +10,8 @@ class Deck
attr_accessor :side attr_accessor :side
attr_accessor :extra attr_accessor :extra
attr_accessor :temp attr_accessor :temp
#DeckPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/deck' DeckPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/deck'
DeckPath = 'E:/game/yu-gi-oh/deck' #DeckPath = 'E:/game/yu-gi-oh/deck'
def initialize(main, side=[], extra=[], temp=[]) def initialize(main, side=[], extra=[], temp=[])
@main = main @main = main
@side = side @side = side
......
...@@ -38,7 +38,6 @@ require_relative 'game_event' ...@@ -38,7 +38,6 @@ require_relative 'game_event'
require_relative 'cacheable' require_relative 'cacheable'
require_relative 'user' require_relative 'user'
require_relative 'room' require_relative 'room'
#4.times{Thread.new{loop{sleep 0.01}}}
$fpstimer = FPSTimer.new $fpstimer = FPSTimer.new
$scene = Scene_Title.new $scene = Scene_Title.new
......
...@@ -41,10 +41,10 @@ class Scene_Hall < Scene ...@@ -41,10 +41,10 @@ class Scene_Hall < Scene
@active_window.clicked @active_window.clicked
when Key::F2 when Key::F2
$game.host $game.host
@joinroom_msgbox = Widget_Msgbox.new("创建房间", "正在等待对手"){} @joinroom_msgbox = Widget_Msgbox.new("创建房间", "正在等待对手")
when Key::F3 when Key::F3
$game.join '127.0.0.1' $game.join '192.168.0.103'
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间"){} @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
when Key::F5 when Key::F5
if @roomlist.list and room = @roomlist.list.find{|room|room.player1 == $game.user or room.player2 == $game.user} if @roomlist.list and room = @roomlist.list.find{|room|room.player1 == $game.user or room.player2 == $game.user}
$game.qroom room $game.qroom room
...@@ -114,10 +114,10 @@ class Scene_Hall < Scene ...@@ -114,10 +114,10 @@ class Scene_Hall < Scene
return unless @roomlist.index and room = @roomlist.list[@roomlist.index] return unless @roomlist.index and room = @roomlist.list[@roomlist.index]
if room.full? if room.full?
$game.watch room $game.watch room
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战"){} @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入观战")
else else
$game.join room, "test" $game.join room, "test"
@joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间"){} @joinroom_msgbox = Widget_Msgbox.new("加入房间", "正在加入房间")
end end
end end
end end
......
...@@ -69,7 +69,8 @@ class Widget_Msgbox < Window ...@@ -69,7 +69,8 @@ class Widget_Msgbox < Window
end end
end end
def clicked def clicked
@proc.call(@index) if @index return if @index.nil?
@proc.call(@index) if @proc
self.destroy self.destroy
end end
end end
...@@ -110,6 +110,7 @@ class Window_Field < Window ...@@ -110,6 +110,7 @@ class Window_Field < Window
when :deck when :deck
@card = @field.deck.first @card = @field.deck.first
@action_names = {"抽卡" => true, @action_names = {"抽卡" => true,
"查看卡组" => true,
"卡组洗切" => true, "卡组洗切" => true,
"抽卡并确认" => false, "抽卡并确认" => false,
"顶牌回卡组底" => false, "顶牌回卡组底" => false,
...@@ -122,14 +123,16 @@ class Window_Field < Window ...@@ -122,14 +123,16 @@ class Window_Field < Window
} }
when :extra when :extra
@card = @field.extra.first @card = @field.extra.first
@action_names = {"特殊召唤" => !@field.empty_field(@card).nil?, @action_names = {"查看" => true,
"特殊召唤" => !@field.empty_field(@card).nil?,
"效果发动" => true, "效果发动" => true,
"从游戏中除外" => true, "从游戏中除外" => true,
"送入墓地" => true "送入墓地" => true
} }
when :removed when :removed
@card = @field.removed.first @card = @field.removed.first
@action_names = {"特殊召唤" => @card.monster? && !@field.empty_field(@card).nil?, @action_names = {"查看" => true,
"特殊召唤" => @card.monster? && !@field.empty_field(@card).nil?,
"效果发动" => true, "效果发动" => true,
"加入手卡" => true, "加入手卡" => true,
"返回卡组" => true, "返回卡组" => true,
...@@ -137,7 +140,8 @@ class Window_Field < Window ...@@ -137,7 +140,8 @@ class Window_Field < Window
} }
when :graveyard when :graveyard
@card = @field.graveyard.first @card = @field.graveyard.first
@action_names = {"特殊召唤" => @card.monster? && !@field.empty_field(@card).nil?, @action_names = {"查看" => true,
"特殊召唤" => @card.monster? && !@field.empty_field(@card).nil?,
"效果发动" => true, "效果发动" => true,
"加入手卡" => true, "加入手卡" => true,
"返回卡组" => true, "返回卡组" => true,
...@@ -220,72 +224,79 @@ class Window_Field < Window ...@@ -220,72 +224,79 @@ class Window_Field < Window
when 0 when 0
Action::Draw.new(true) Action::Draw.new(true)
when 1 when 1
Action::Shuffle.new Widget_Msgbox.new("查看卡组", "功能未实现")
when 2 when 2
p "未实现" Action::Shuffle.new(true)
#Action::Draw.new(true)
when 3 when 3
p "未实现" Widget_Msgbox.new("抽卡并确认", "功能未实现")
when 4 when 4
Action::SendToGraveyard.new(true, :deck, @card) Widget_Msgbox.new("顶牌回卡组底", "功能未实现")
when 5 when 5
Action::Remove.new(true, :deck, @card) Action::SendToGraveyard.new(true, :deck, @card)
when 6 when 6
p "未实现" Action::Remove.new(true, :deck, @card)
when 7 when 7
p "未实现" Widget_Msgbox.new("顶牌背面除外", "功能未实现")
when 8 when 8
p "未实现" Widget_Msgbox.new("确认顶牌", "功能未实现")
when 9 when 9
p "未实现" Widget_Msgbox.new("双方确认顶牌", "功能未实现")
when 10
Widget_Msgbox.new("对方确认顶牌", "功能未实现")
end end
when :extra when :extra
case @action_window.index case @action_window.index
when 0 when 0
Widget_Msgbox.new("查看", "功能未实现")
when 1
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::SpecialSummon.new(true, :extra, pos, @card, nil, :attack) Action::SpecialSummon.new(true, :extra, pos, @card, nil, :attack)
else else
p "场位已满" Widget_Msgbox.new("特殊召唤", "场位已满")
end end
when 1
Action::Effect_Activate.new(true, :extra, @card)
when 2 when 2
Action::Remove.new(true, :extra, @card) Action::Effect_Activate.new(true, :extra, @card)
when 3 when 3
Action::Remove.new(true, :extra, @card)
when 4
Action::SendToGraveyard.new(true, :extra, @card) Action::SendToGraveyard.new(true, :extra, @card)
end end
when :removed when :removed
case @action_window.index case @action_window.index
when 0 #特殊召唤 when 0
Widget_Msgbox.new("查看", "功能未实现")
when 1 #特殊召唤
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::SpecialSummon.new(true, :removed, pos, @card) Action::SpecialSummon.new(true, :removed, pos, @card)
else else
p "场位已满" Widget_Msgbox.new("特殊召唤", "场位已满")
end end
when 1 #效果发动 when 2 #效果发动
Action::Effect_Activate.new(true, :removed, @card) Action::Effect_Activate.new(true, :removed, @card)
when 2 #加入手卡 when 3 #加入手卡
Action::ReturnToHand.new(true, :removed, @card) Action::ReturnToHand.new(true, :removed, @card)
when 3
Action::ReturnToDeck.new(true, :removed, @card)
when 4 when 4
Action::ReturnToDeck.new(true, :removed, @card)
when 5
Action::SendToGraveyard.new(true, :removed, @card) Action::SendToGraveyard.new(true, :removed, @card)
end end
when :graveyard when :graveyard
case @action_window.index case @action_window.index
when 0 #特殊召唤 when 0
Widget_Msgbox.new("查看", "功能未实现")
when 1 #特殊召唤
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::SpecialSummon.new(true, :graveyard, pos, @card) Action::SpecialSummon.new(true, :graveyard, pos, @card)
else else
p "场位已满" Widget_Msgbox.new("特殊召唤", "场位已满")
end end
when 1 #效果发动 when 2 #效果发动
Action::Effect_Activate.new(true, :graveyard, @card) Action::Effect_Activate.new(true, :graveyard, @card)
when 2 #加入手卡 when 3 #加入手卡
Action::ReturnToHand.new(true, :graveyard, @card) Action::ReturnToHand.new(true, :graveyard, @card)
when 3
Action::ReturnToDeck.new(true, :graveyard, @card)
when 4 when 4
Action::ReturnToDeck.new(true, :graveyard, @card)
when 5
Action::Remove.new(true, :graveyard, @card) Action::Remove.new(true, :graveyard, @card)
end end
when 0..5 #后场 when 0..5 #后场
...@@ -318,9 +329,9 @@ class Window_Field < Window ...@@ -318,9 +329,9 @@ class Window_Field < Window
when 5 when 5
Action::Effect_Activate.new(true, @index, @card) Action::Effect_Activate.new(true, @index, @card)
when 6 when 6
p "未实现" Widget_Msgbox.new("攻击宣言", "功能未实现")
when 7 when 7
p "未实现" Widget_Msgbox.new("转移控制权", "功能未实现")
when 8 when 8
Action::ReturnToDeck.new(true, @index, @card) Action::ReturnToDeck.new(true, @index, @card)
when 9 when 9
...@@ -336,25 +347,25 @@ class Window_Field < Window ...@@ -336,25 +347,25 @@ class Window_Field < Window
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::Summon.new(true, :hand, pos, @card) Action::Summon.new(true, :hand, pos, @card)
else else
p "场位已满" Widget_Msgbox.new("召唤", "场位已满")
end end
when 1 #特殊召唤 when 1 #特殊召唤
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::SpecialSummon.new(true, :hand, pos, @card, nil, :attack) Action::SpecialSummon.new(true, :hand, pos, @card, nil, :attack)
else else
p "场位已满" Widget_Msgbox.new("特殊召唤", "场位已满")
end end
when 2 #发动 when 2 #发动
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::Activate.new(true, :hand, pos, @card) Action::Activate.new(true, :hand, pos, @card)
else else
p "场位已满" Widget_Msgbox.new("发动", "场位已满")
end end
when 3 #放置 when 3 #放置
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::Set.new(true, :hand, pos, @card) Action::Set.new(true, :hand, pos, @card)
else else
p "场位已满" Widget_Msgbox.new("放置", "场位已满")
end end
when 4 #返回卡组 when 4 #返回卡组
Action::ReturnToDeck.new(true, :hand, @card) Action::ReturnToDeck.new(true, :hand, @card)
...@@ -366,7 +377,7 @@ class Window_Field < Window ...@@ -366,7 +377,7 @@ class Window_Field < Window
Action::Effect_Activate.new(true, :hand, @card) Action::Effect_Activate.new(true, :hand, @card)
end end
end end
$scene.action action $scene.action action if action.is_a? Action
@index = nil @index = nil
refresh refresh
mousemoved(Mouse.state[0], Mouse.state[1]) mousemoved(Mouse.state[0], Mouse.state[1])
......
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