Commit c00efc2b authored by 神楽坂玲奈's avatar 神楽坂玲奈

卡片操作 移动系基本完成

parent 3f1a32a4
...@@ -88,7 +88,6 @@ class Action ...@@ -88,7 +88,6 @@ class Action
@position = position @position = position
end end
def run def run
#p 1
from_field = case @from_pos from_field = case @from_pos
when Integer when Integer
player_field.field player_field.field
...@@ -117,16 +116,11 @@ class Action ...@@ -117,16 +116,11 @@ class Action
from_field.delete_at from_pos from_field.delete_at from_pos
end end
end end
#p @to_pos
#p self
#p @to_pos
to_field = case @to_pos to_field = case @to_pos
when Integer when Integer
player_field.field player_field.field
when :hand when :hand
player_field.hand player_field.hand
#when :field
# player_field.field
when :graveyard when :graveyard
player_field.graveyard player_field.graveyard
when :deck when :deck
...@@ -136,11 +130,10 @@ class Action ...@@ -136,11 +130,10 @@ class Action
when :removed when :removed
player_field.removed player_field.removed
end end
#p to_field
if @to_pos.is_a? Integer if @to_pos.is_a? Integer
to_field[@to_pos] = @card to_field[@to_pos] = @card
#elsif to_field == player_field.field #elsif to_field == player_field.field
# to_pos = from_field.index(nil) || 11 # to_pos = from_field.index(nil) || 11
else else
to_field.unshift @card to_field.unshift @card
end end
...@@ -197,6 +190,14 @@ class Action ...@@ -197,6 +190,14 @@ class Action
super(from_player, from_pos, :opponent, card) super(from_player, from_pos, :opponent, card)
end end
end end
class Tribute < SendToGraveyard; end
class Flip < Move
def initialize(from_player, from_pos, card)
super(from_player, from_pos, from_pos, card)
end
end
class FlipSummon < Flip
end
class Refresh_Field < Action class Refresh_Field < Action
attr_reader :lp, :hand_count, :deck_count, :graveyard_count, :removed_count, :field attr_reader :lp, :hand_count, :deck_count, :graveyard_count, :removed_count, :field
def initialize(from_player, msg, lp, hand_count, deck_count, graveyard_count, removed_count, field) def initialize(from_player, msg, lp, hand_count, deck_count, graveyard_count, removed_count, field)
...@@ -209,6 +210,7 @@ class Action ...@@ -209,6 +210,7 @@ class Action
@field = field @field = field
end end
end end
class Turn_End < Refresh_Field class Turn_End < Refresh_Field
attr_reader :turn attr_reader :turn
def initialize(from_player, msg, lp, hand_count, deck_count, graveyard_count, removed_count, field, turn) def initialize(from_player, msg, lp, hand_count, deck_count, graveyard_count, removed_count, field, turn)
......
...@@ -250,7 +250,16 @@ class Action ...@@ -250,7 +250,16 @@ class Action
end end
class Set class Set
def escape def escape
"[#{@id}] ◎→从手卡~取一张#{@card.monster? ? "怪兽卡" : "魔/陷卡"}盖到场上(#{@to_pos})" case @from_pos
when @to_pos
if (0..5).include? @to_pos #魔陷
"[#{@id}] ◎→(#{@from_pos})#{@card.escape}变为里侧表示"
elsif (6..10).include? @to_pos #怪兽
"[#{@id}] ◎→从怪兽区(#{@from_pos})~取一张怪兽卡盖到场上(#{@to_pos})"
end
when :hand
"[#{@id}] ◎→从手卡~取一张#{@card.monster? ? "怪兽卡" : "魔/陷卡"}盖到场上(#{@to_pos})"
end
end end
end end
class Summon class Summon
...@@ -260,7 +269,7 @@ class Action ...@@ -260,7 +269,7 @@ class Action
end end
class SpecialSummon class SpecialSummon
def escape def escape
"[#{@id}] ◎→从手卡~特殊召唤#{@card.escape}(#{@to_pos})呈守备表示" "[#{@id}] ◎→从#{Action.escape_pos2(@from_pos)}~特殊召唤#{@card.escape}(#{@to_pos})呈#{case @position; when :attack; "攻击"; when :defense; "守备";when :set; "背面守备"; end}表示"
end end
end end
class Activate class Activate
...@@ -273,6 +282,11 @@ class Action ...@@ -273,6 +282,11 @@ class Action
"[#{@id}] ◎→将#{@card.escape}从~#{Action.escape_pos2(@from_pos)}~送往墓地" "[#{@id}] ◎→将#{@card.escape}从~#{Action.escape_pos2(@from_pos)}~送往墓地"
end end
end end
class Tribute
def escape
"[#{@id}] ◎→将~#{Action.escape_pos2(@from_pos)}~的#{@card.escape}解~放"
end
end
class Remove class Remove
def escape def escape
"[#{@id}] ◎→将#{Action.escape_pos2(@from_pos)}#{@card.escape}从游戏中除外" "[#{@id}] ◎→将#{Action.escape_pos2(@from_pos)}#{@card.escape}从游戏中除外"
...@@ -288,7 +302,7 @@ class Action ...@@ -288,7 +302,7 @@ class Action
when :removed when :removed
"除外区" "除外区"
when 0..10 when 0..10
"场上(#{pos})" "场上(#{@from_pos})"
end end
"[#{@id}] ◎→从#{pos}#{@card.escape}加入手卡" "[#{@id}] ◎→从#{pos}#{@card.escape}加入手卡"
end end
...@@ -303,7 +317,7 @@ class Action ...@@ -303,7 +317,7 @@ class Action
when :removed when :removed
"除外区" "除外区"
when 0..10 when 0..10
"场上(#{pos})" "场上(#{@from_pos})"
end end
"[#{@id}] ◎→#{@from_pos == :hand ? "一张卡" : @card.escape}#{pos}~放回卡组顶端" #TODO:set=【一张卡】 "[#{@id}] ◎→#{@from_pos == :hand ? "一张卡" : @card.escape}#{pos}~放回卡组顶端" #TODO:set=【一张卡】
end end
...@@ -321,6 +335,16 @@ class Action ...@@ -321,6 +335,16 @@ class Action
"[#{@id}] ◎→#{@card.escape}#{pos}返回额外牌堆" "[#{@id}] ◎→#{@card.escape}#{pos}返回额外牌堆"
end end
end end
class Flip < Move
def escape
"[#{@id}] ◎→(#{@from_pos})#{@card.escape}打开"
end
end
class FlipSummon < Flip
def escape
"[#{@id}] ◎→(#{@from_pos})#{@card.escape}反转"
end
end
class Effect_Activate class Effect_Activate
def escape def escape
pos = case @from_pos pos = case @from_pos
...@@ -332,10 +356,12 @@ class Action ...@@ -332,10 +356,12 @@ class Action
"己方卡组" "己方卡组"
when :extra when :extra
"己方额外牌堆" "己方额外牌堆"
when :removed
"己方除外区"
when 0..10 when 0..10
"(#{@from_pos})" "(#{@from_pos})"
end end
"[#{@id}] ◎→#{pos}#{@card.escape}效果发~动" "[#{@id}] ◎→#{pos}#{@card.escape}效果发#{"~" unless (0..10).include? @from_pos}动"
end end
end end
end end
......
...@@ -110,7 +110,6 @@ class Window_Field < Window ...@@ -110,7 +110,6 @@ class Window_Field < Window
when :removed when :removed
@card = @field.removed.first @card = @field.removed.first
@action_names = {"特殊召唤" => @card.monster?, @action_names = {"特殊召唤" => @card.monster?,
"发动" => !@card.monster?,
"效果发动" => true, "效果发动" => true,
"加入手卡" => true, "加入手卡" => true,
"返回卡组" => true, "返回卡组" => true,
...@@ -119,7 +118,6 @@ class Window_Field < Window ...@@ -119,7 +118,6 @@ class Window_Field < Window
when :graveyard when :graveyard
@card = @field.graveyard.first @card = @field.graveyard.first
@action_names = {"特殊召唤" => @card.monster?, @action_names = {"特殊召唤" => @card.monster?,
"发动" => !@card.monster?,
"效果发动" => true, "效果发动" => true,
"加入手卡" => true, "加入手卡" => true,
"返回卡组" => true, "返回卡组" => true,
...@@ -132,21 +130,23 @@ class Window_Field < Window ...@@ -132,21 +130,23 @@ class Window_Field < Window
"送入墓地" => true, "送入墓地" => true,
"从游戏中除外" => true, "从游戏中除外" => true,
"加入手卡" => true, "加入手卡" => true,
"打开/盖伏" => true "盖伏" => true
} }
when 6..10 when 6..10
@card = @field.field[@index] @card = @field.field[@index]
@action_names = {"攻/守形式转换" => true, @action_names = {"攻击表示" => false,
"里侧/表侧转换" => true, "守备表示" => false,
"转为里侧守备" => true, "里侧表示" => true,
"攻击宣言" => true, "反转召唤" => true,
"打开" => true,
"效果发动" => true, "效果发动" => true,
"转移控制权" => true, "攻击宣言" => false,
"转移控制权" => false,
"放回卡组顶端" => true, "放回卡组顶端" => true,
"送入墓地" => true, "送入墓地" => true,
"解放" => true, "解放" => true,
"加入手卡" => true, "加入手卡" => true,
"送入对手墓地" => true #"送入对手墓地" => false
} }
when Integer #手卡 when Integer #手卡
@card = @field.hand[@index-11] @card = @field.hand[@index-11]
...@@ -231,36 +231,93 @@ class Window_Field < Window ...@@ -231,36 +231,93 @@ class Window_Field < Window
Action::SendToGraveyard.new(true, :extra, @card).run Action::SendToGraveyard.new(true, :extra, @card).run
end end
when :removed when :removed
# @action_names = {"特殊召唤" => @card.monster?,
# "发动" => !@card.monster?,
# "效果发动" => true,
# "加入手卡" => true,
# "返回卡组" => true,
# "送入墓地" => true
case $scene.action_window.index case $scene.action_window.index
when 0 #特殊召唤 when 0 #特殊召唤
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::Summon.new(true, :removed, pos, @card).run Action::SpecialSummon.new(true, :removed, pos, @card).run
else else
p "场位已满" p "场位已满"
end end
when 1 #发动 when 1 #效果发动
Action::Effect_Activate.new(true, :removed, @card).run
when 2 #加入手卡
Action::ReturnToHand.new(true, :removed, @card).run
when 3
Action::ReturnToDeck.new(true, :removed, @card).run
when 4
Action::SendToGraveyard.new(true, :removed, @card).run
end
when :graveyard
case $scene.action_window.index
when 0 #特殊召唤
if pos = @field.empty_field(@card) if pos = @field.empty_field(@card)
Action::Activate.new(true, :removed, pos, @card).run Action::SpecialSummon.new(true, :graveyard, pos, @card).run
else else
p "场位已满" p "场位已满"
end end
when 2 #效果发动 when 1 #效果发动
Action::Effect_Activate.new(true, :removed, @card).run Action::Effect_Activate.new(true, :graveyard, @card).run
when 3 #加入手卡 when 2 #加入手卡
Action::ReturnToHand.new(true, :removed, @card).run Action::ReturnToHand.new(true, :graveyard, @card).run
when 3
Action::ReturnToDeck.new(true, :graveyard, @card).run
when 4 when 4
Action::ReturnToDeck.new(true, :removed, @card).run Action::Remove.new(true, :graveyard, @card).run
end
when 0..5 #后场
case $scene.action_window.index
when 0 #效果发动
Action::Effect_Activate.new(true, @index, @card).run
when 1 #返回卡组
Action::ReturnToDeck.new(true, @index, @card).run
when 2 #送入墓地
Action::SendToGraveyard.new(true, @index, @card).run
when 3 #从游戏中除外
Action::Remove.new(true, @index, @card).run
when 4 #加入手卡
Action::ReturnToHand.new(true, @index, @card).run
when 5 #盖伏
Action::Set.new(true, @index, @index, @card).run
end
when 6..10 #前场
#{"攻击表示" => false,
# "守备表示" => false,
# "里侧表示" => true,
# "反转召唤" => true,
# "打开" => true,
# "效果发动" => true,
# "攻击宣言" => false,
# "转移控制权" => false,
# "放回卡组顶端" => true,
# "送入墓地" => true,
# "解放" => true,
# "加入手卡" => true,
case $scene.action_window.index
when 0
p "未实现"
when 1
p "未实现"
when 2
Action::Set.new(true, @index, @index, @card).run
when 3
Action::FlipSummon.new(true, @index, @card).run
when 4
Action::Flip.new(true, @index, @card).run
when 5 when 5
Action::SendToGraveyard.new(true, :removed, @card).run Action::Effect_Activate.new(true, @index, @card).run
when 6
p "未实现"
when 7
p "未实现"
when 8
Action::ReturnToDeck.new(true, @index, @card).run
when 9
Action::SendToGraveyard.new(true, @index, @card).run
when 10
Action::Tribute.new(true, @index, @card).run
when 11
Action::ReturnToHand.new(true, @index, @card).run
end end
when 0..10
#场上
when Integer #手卡 when Integer #手卡
case $scene.action_window.index case $scene.action_window.index
when 0 #召唤 when 0 #召唤
......
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