Commit 1879dc58 authored by 未闻皂名's avatar 未闻皂名

2024/1/2 添加通用方法:从卡组顶把卡送去墓地,并从那些卡之中选择卡片

parent 38e0147b
Pipeline #24772 passed with stages
in 15 minutes and 45 seconds
...@@ -368,7 +368,7 @@ function RushDuel.RevealDeckTopAndCanSelectGroup(player, count, desc, hint, filt ...@@ -368,7 +368,7 @@ function RushDuel.RevealDeckTopAndCanSelectGroup(player, count, desc, hint, filt
Duel.ConfirmDecktop(player, count) Duel.ConfirmDecktop(player, count)
local g = Duel.GetDecktopGroup(player, count) local g = Duel.GetDecktopGroup(player, count)
if g:GetCount() > 0 then if g:GetCount() > 0 then
local mg=g:Filter(filter,nil) local mg = g:Filter(filter,nil)
if mg:CheckSubGroup(check, min, max, ...) then if mg:CheckSubGroup(check, min, max, ...) then
::cancel:: ::cancel::
if Duel.SelectYesNo(player, desc) then if Duel.SelectYesNo(player, desc) then
...@@ -385,6 +385,30 @@ function RushDuel.RevealDeckTopAndCanSelectGroup(player, count, desc, hint, filt ...@@ -385,6 +385,30 @@ function RushDuel.RevealDeckTopAndCanSelectGroup(player, count, desc, hint, filt
end end
return Group.CreateGroup(), g return Group.CreateGroup(), g
end end
-- 可选操作: 从卡组上面把卡送去墓地, 并选择被送去墓地的卡片
function RushDuel.SendDeckTopToGraveAndCanSelect(player, count, desc, hint, filter, min, max, ...)
if Duel.DiscardDeck(player, count, REASON_EFFECT) ~= 0 then
local g = Duel.GetOperatedGroup()
if g:GetCount() > 0 then
local mg = g:Filter(filter, nil, ...)
if mg:GetCount() >= min then
::cancel::
if Duel.SelectYesNo(player, desc) then
Duel.Hint(HINT_SELECTMSG, player, hint)
local sg = RushDuel.SelectGroup(player, mg, min, max)
if sg == nil then
goto cancel
elseif sg:GetCount() > 0 then
g:Sub(sg)
return sg, g
end
end
end
end
return Group.CreateGroup(), g
end
return Group.CreateGroup(), Group.CreateGroup()
end
-- 可选操作: 抽卡 -- 可选操作: 抽卡
function RushDuel.CanDraw(desc, player, count, break_effect) function RushDuel.CanDraw(desc, player, count, break_effect)
......
...@@ -19,7 +19,7 @@ function cm.costfilter(c) ...@@ -19,7 +19,7 @@ function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToDeckOrExtraAsCost() return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToDeckOrExtraAsCost()
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand() return c:IsType(TYPE_EQUIP) and c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler()) return RD.IsSummonTurn(e:GetHandler())
...@@ -30,15 +30,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,15 +30,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,3) then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,3,aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),1,1)
local og=Duel.GetOperatedGroup():Filter(aux.NecroValleyFilter(cm.thfilter),nil) if sg:GetCount()>0 then
if og:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SendToHandAndExists(sg,1-tp)
local g=og:Select(tp,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
end
end
end end
end end
\ No newline at end of file
...@@ -21,7 +21,7 @@ function cm.costfilter(c,e,tp) ...@@ -21,7 +21,7 @@ function cm.costfilter(c,e,tp)
return not c:IsPublic() and c:IsRace(RACE_WARRIOR) return not c:IsPublic() and c:IsRace(RACE_WARRIOR)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[2]) and c:IsAbleToHand() return c:IsCode(list[2]) and c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsCode(list[1]) return not e:GetHandler():IsCode(list[1])
...@@ -35,14 +35,12 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,14 +35,12 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.ChangeCode(e,c,list[1],RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) RD.ChangeCode(e,c,list[1],RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.BreakEffect() Duel.BreakEffect()
if RD.SendDeckTopToGraveAndExists(tp,3) then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,3,aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),1,1)
local og=Duel.GetOperatedGroup() if sg:GetCount()>0 then
if og:IsExists(cm.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SendToHandAndExists(sg,1-tp)
local sg=og:FilterSelect(tp,cm.thfilter,1,1,nil)
RD.SendToHandAndExists(sg,1-tp)
end
end end
end end
end end
\ No newline at end of file
...@@ -17,7 +17,8 @@ function cm.initial_effect(c) ...@@ -17,7 +17,8 @@ function cm.initial_effect(c)
end end
--Discard Deck --Discard Deck
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(list[1]) and c:IsLocation(LOCATION_GRAVE) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsCode(list[1]) and c:IsLocation(LOCATION_GRAVE)
and Duel.GetMZoneCount(tp)>0 and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler()) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 return RD.IsSummonTurn(e:GetHandler()) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
...@@ -27,13 +28,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,13 +28,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,3) and Duel.GetMZoneCount(tp)>0 then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,3,aux.Stringid(m,1),HINTMSG_SPSUMMON,aux.NecroValleyFilter(cm.spfilter),1,1,e,tp)
local og=Duel.GetOperatedGroup() if sg:GetCount()>0 then
if og:IsExists(cm.spfilter,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local sg=og:FilterSelect(tp,cm.spfilter,1,1,nil,e,tp)
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -14,7 +14,8 @@ function cm.initial_effect(c) ...@@ -14,7 +14,8 @@ function cm.initial_effect(c)
end end
--Activate --Activate
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_EFFECT) and c:IsAttack(2500) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP) return c:IsType(TYPE_EFFECT) and c:IsAttack(2500) and c:IsLocation(LOCATION_GRAVE)
and Duel.GetMZoneCount(tp)>0 and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end end
cm.cost=RD.CostPayLP(1500) cm.cost=RD.CostPayLP(1500)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -22,13 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,13 +23,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,3) and Duel.GetMZoneCount(tp)>0 then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,3,aux.Stringid(m,1),HINTMSG_SPSUMMON,aux.NecroValleyFilter(cm.spfilter),1,1,e,tp)
local og=Duel.GetOperatedGroup() if sg:GetCount()>0 then
if og:IsExists(cm.spfilter,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local sg=og:FilterSelect(tp,cm.spfilter,1,1,nil,e,tp)
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
\ No newline at end of file
...@@ -32,13 +32,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,13 +32,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,4) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,4)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,4) then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,4,aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),1,1)
local og=Duel.GetOperatedGroup() if sg:GetCount()>0 then
if og:IsExists(cm.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SendToHandAndExists(sg,1-tp)
local sg=og:FilterSelect(tp,cm.thfilter,1,1,nil)
Duel.BreakEffect()
RD.SendToHandAndExists(sg,1-tp)
end
end end
end end
\ No newline at end of file
...@@ -17,7 +17,7 @@ function cm.initial_effect(c) ...@@ -17,7 +17,7 @@ function cm.initial_effect(c)
end end
--Discard Deck --Discard Deck
function cm.thfilter(c) function cm.thfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToHand() return c:IsCode(list[1],list[2]) and c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler()) return RD.IsSummonTurn(e:GetHandler())
...@@ -27,15 +27,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -27,15 +27,9 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,2) then local sg,og=RD.SendDeckTopToGraveAndCanSelect(tp,2,aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),1,1)
local og=Duel.GetOperatedGroup():Filter(aux.NecroValleyFilter(cm.thfilter),nil) if sg:GetCount()>0 then
if og:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) RD.SendToHandAndExists(sg,1-tp)
local g=og:Select(tp,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
end
end
end end
end end
\ No newline at end of file
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