Commit a3afe1d2 authored by zh99998's avatar zh99998

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

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