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,
local g = Duel.GetMatchingGroup(filter, tp, s_range, o_range, expect, ...)
if g:CheckSubGroup(check, min, max, ...) then
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
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
return action(sg, ...)
......@@ -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
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
Duel.BreakEffect()
end
local ct = Duel.SpecialSummon(g, 0, tp, tp, false, false, pos)
if (pos & POS_FACEDOWN) ~= 0 then
Duel.ConfirmCards(1 - tp, g)
local ct = Duel.SpecialSummon(target, 0, player, player, false, false, position)
if (position & POS_FACEDOWN) ~= 0 then
Duel.ConfirmCards(1 - player, target)
end
return ct
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
Duel.BreakEffect()
end
return Duel.SSet(tp, g)
return Duel.SSet(player, target)
end
-- 操作: 选择匹配卡片
......@@ -264,7 +266,6 @@ function RushDuel.CanDraw(desc, player, count, break_effect)
end
return 0
end
-- 可选操作: 盲堆
function RushDuel.CanDiscardDeck(desc, player, count, break_effect)
if Duel.IsPlayerCanDiscardDeck(player, count) and Duel.SelectYesNo(player, desc) then
......
......@@ -156,14 +156,17 @@ function RushDuel.CreateMultiChooseEffect(card, hint1, condition1, operation1, h
local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(RushDuel.MultiChooseTarget(condition1, condition2))
if condition1 ~= nil or condition2 ~= nil then
e1:SetTarget(RushDuel.MultiChooseTarget(condition1, condition2))
end
e1:SetOperation(RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2))
return e1
end
function RushDuel.MultiChooseTarget(condition1, condition2, target)
return function(e, tp, eg, ep, ev, re, r, rp, chk)
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
if target ~= nil then
target(e, tp, eg, ep, ev, re, r, rp)
......@@ -172,8 +175,8 @@ function RushDuel.MultiChooseTarget(condition1, condition2, target)
end
function RushDuel.MultiChooseOperation(hint1, condition1, operation1, hint2, condition2, operation2)
return function(e, tp, eg, ep, ev, re, r, rp)
local effect1 = condition1(e, tp, eg, ep, ev, re, r, rp, true)
local effect2 = condition2(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 == nil or condition2(e, tp, eg, ep, ev, re, r, rp, true)
local option = 0
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EFFECT)
if effect1 and effect2 then
......
......@@ -59,8 +59,8 @@ function RushDuel.IsCanChangePosition(card)
return card:IsCanChangePosition() and not RushDuel.IsMaximumMode(card)
end
-- 条件: 可否特殊召唤
function RushDuel.IsCanBeSpecialSummoned(card, effect, player, pos)
return card:IsCanBeSpecialSummoned(effect, 0, player, false, false, pos)
function RushDuel.IsCanBeSpecialSummoned(card, effect, player, position)
return card:IsCanBeSpecialSummoned(effect, 0, player, false, false, position)
end
-- 条件: 位置变化前的控制者
function RushDuel.IsPreviousControler(card, player)
......
......@@ -94,6 +94,13 @@ function RushDuel.SendDeckTopToBottom(player, count)
Duel.MoveSequence(Duel.GetDecktopGroup(player, 1):GetFirst(), 1)
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)
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