Commit b9d921e4 authored by 未闻皂名's avatar 未闻皂名

2020/3/23 bug修复

parent b3646f4a
...@@ -28,7 +28,9 @@ function RushDuel._private_action_select_group(hint, filter, check, tp, s_range, ...@@ -28,7 +28,9 @@ function RushDuel._private_action_select_group(hint, filter, check, tp, s_range,
local g = Duel.GetMatchingGroup(filter, tp, s_range, o_range, expect, ...) local g = Duel.GetMatchingGroup(filter, tp, s_range, o_range, expect, ...)
if g:CheckSubGroup(check, min, max, ...) then if g:CheckSubGroup(check, min, max, ...) then
Duel.Hint(HINT_SELECTMSG, tp, hint) Duel.Hint(HINT_SELECTMSG, tp, hint)
local sg = g:SelectSubGroup(tp, check, false, min, max, ...) aux.GCheckAdditional = check
local sg = g:SelectSubGroup(tp, aux.TRUE, false, min, max, ...)
aux.GCheckAdditional = nil
if sg:GetCount() > 0 then if sg:GetCount() > 0 then
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp) RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
return action(sg, ...) return action(sg, ...)
...@@ -52,22 +54,22 @@ function RushDuel._private_is_include_public(s_range, o_range) ...@@ -52,22 +54,22 @@ function RushDuel._private_is_include_public(s_range, o_range)
return (s_range | o_range) & (LOCATION_ONFIELD | LOCATION_GRAVE | LOCATION_REMOVED) ~= 0 return (s_range | o_range) & (LOCATION_ONFIELD | LOCATION_GRAVE | LOCATION_REMOVED) ~= 0
end end
-- 内部方法: 特殊召唤 -- 内部方法: 特殊召唤
function RushDuel._special_summon(g, e, tp, pos, break_effect) function RushDuel._special_summon(target, effect, player, position, break_effect)
if break_effect then if break_effect then
Duel.BreakEffect() Duel.BreakEffect()
end end
local ct = Duel.SpecialSummon(g, 0, tp, tp, false, false, pos) local ct = Duel.SpecialSummon(target, 0, player, player, false, false, position)
if (pos & POS_FACEDOWN) ~= 0 then if (position & POS_FACEDOWN) ~= 0 then
Duel.ConfirmCards(1 - tp, g) Duel.ConfirmCards(1 - player, target)
end end
return ct return ct
end end
-- 内部方法: 盖放魔法陷阱 -- 内部方法: 盖放魔法陷阱
function RushDuel._set_spell_trap(g, e, tp, break_effect) function RushDuel._set_spell_trap(target, effect, player, break_effect)
if break_effect then if break_effect then
Duel.BreakEffect() Duel.BreakEffect()
end end
return Duel.SSet(tp, g) return Duel.SSet(player, target)
end end
-- 操作: 选择匹配卡片 -- 操作: 选择匹配卡片
...@@ -264,7 +266,6 @@ function RushDuel.CanDraw(desc, player, count, break_effect) ...@@ -264,7 +266,6 @@ function RushDuel.CanDraw(desc, player, count, break_effect)
end end
return 0 return 0
end end
-- 可选操作: 盲堆 -- 可选操作: 盲堆
function RushDuel.CanDiscardDeck(desc, player, count, break_effect) function RushDuel.CanDiscardDeck(desc, player, count, break_effect)
if Duel.IsPlayerCanDiscardDeck(player, count) and Duel.SelectYesNo(player, desc) then if Duel.IsPlayerCanDiscardDeck(player, count) and Duel.SelectYesNo(player, desc) then
......
...@@ -156,14 +156,17 @@ function RushDuel.CreateMultiChooseEffect(card, hint1, condition1, operation1, h ...@@ -156,14 +156,17 @@ function RushDuel.CreateMultiChooseEffect(card, hint1, condition1, operation1, h
local e1 = Effect.CreateEffect(card) local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
if condition1 ~= nil or condition2 ~= nil then
e1:SetTarget(RushDuel.MultiChooseTarget(condition1, condition2)) e1:SetTarget(RushDuel.MultiChooseTarget(condition1, condition2))
end
e1:SetOperation(RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2)) e1:SetOperation(RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2))
return e1 return e1
end end
function RushDuel.MultiChooseTarget(condition1, condition2, target) function RushDuel.MultiChooseTarget(condition1, condition2, target)
return function(e, tp, eg, ep, ev, re, r, rp, chk) return function(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then if chk == 0 then
return condition1(e, tp, eg, ep, ev, re, r, rp, false) or condition2(e, tp, eg, ep, ev, re, r, rp, false) return (condition1 == nil or condition1(e, tp, eg, ep, ev, re, r, rp, false))
or (condition2 == nil or condition2(e, tp, eg, ep, ev, re, r, rp, false))
end end
if target ~= nil then if target ~= nil then
target(e, tp, eg, ep, ev, re, r, rp) target(e, tp, eg, ep, ev, re, r, rp)
...@@ -172,8 +175,8 @@ function RushDuel.MultiChooseTarget(condition1, condition2, target) ...@@ -172,8 +175,8 @@ function RushDuel.MultiChooseTarget(condition1, condition2, target)
end end
function RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2) function RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2)
return function(e, tp, eg, ep, ev, re, r, rp) return function(e, tp, eg, ep, ev, re, r, rp)
local effect1 = condition1(e, tp, eg, ep, ev, re, r, rp, true) local effect1 = condition1 == nil or condition1(e, tp, eg, ep, ev, re, r, rp, true)
local effect2 = condition2(e, tp, eg, ep, ev, re, r, rp, true) local effect2 = condition2 == nil or condition2(e, tp, eg, ep, ev, re, r, rp, true)
local option = 0 local option = 0
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EFFECT) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EFFECT)
if effect1 and effect2 then if effect1 and effect2 then
......
...@@ -59,8 +59,8 @@ function RushDuel.IsCanChangePosition(card) ...@@ -59,8 +59,8 @@ function RushDuel.IsCanChangePosition(card)
return card:IsCanChangePosition() and not RushDuel.IsMaximumMode(card) return card:IsCanChangePosition() and not RushDuel.IsMaximumMode(card)
end end
-- 条件: 可否特殊召唤 -- 条件: 可否特殊召唤
function RushDuel.IsCanBeSpecialSummoned(card, effect, player, pos) function RushDuel.IsCanBeSpecialSummoned(card, effect, player, position)
return card:IsCanBeSpecialSummoned(effect, 0, player, false, false, pos) return card:IsCanBeSpecialSummoned(effect, 0, player, false, false, position)
end end
-- 条件: 位置变化前的控制者 -- 条件: 位置变化前的控制者
function RushDuel.IsPreviousControler(card, player) function RushDuel.IsPreviousControler(card, player)
......
...@@ -94,6 +94,13 @@ function RushDuel.SendDeckTopToBottom(player, count) ...@@ -94,6 +94,13 @@ function RushDuel.SendDeckTopToBottom(player, count)
Duel.MoveSequence(Duel.GetDecktopGroup(player, 1):GetFirst(), 1) Duel.MoveSequence(Duel.GetDecktopGroup(player, 1):GetFirst(), 1)
end end
end end
-- 将玩家卡组最下面的N张卡移到卡组最上面
function RushDuel.SendDeckBottomToTop(player, count)
local g = Duel.GetFieldGroup(player, LOCATION_DECK, 0)
for i = 1, count do
Duel.MoveSequence(g:GetMinGroup(Card.GetSequence):GetFirst(), 0)
end
end
-- 返回卡组并排序 -- 返回卡组并排序
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player) function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player)
local g = RushDuel.ToMaximunGroup(target) local g = RushDuel.ToMaximunGroup(target)
......
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