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

2024/4/7 返回卡组上面/下面代码修改

parent 572a629e
Pipeline #26272 passed with stages
in 6 minutes and 34 seconds
......@@ -301,32 +301,39 @@ function RushDuel.SendToDeckAndExists(target, filter, count, expect)
return Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT) ~= 0 and RushDuel.IsOperatedGroupExists(filter, count, expect)
end
-- 操作: 返回卡组上面 (排序)
function RushDuel.SendToDeckTop(target, sort_player, target_player, sort)
function RushDuel.SendToDeckTop(target, sort_player)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, sort_player, target_player)
if sort_player ~= nil then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, sort_player)
return ct
else
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
end
end
-- 操作: 返回卡组下面 (排序)
function RushDuel.SendToDeckBottom(target, sort_player, target_player, sort)
function RushDuel.SendToDeckBottom(target, sort_player)
local g = RushDuel.ToMaximunGroup(target)
if sort then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, sort_player, target_player)
if sort_player ~= nil then
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, sort_player)
return ct
else
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
end
end
-- 操作: 返回卡组上面或下面 (排序)
function RushDuel.SendToDeckTopOrBottom(target, sort_player, top_desc, bottom_desc)
local g = RushDuel.ToMaximunGroup(target)
local sequence = Duel.SelectOption(sort_player, top_desc, bottom_desc)
local og, ct = RushDuel.SendToDeckSort(g, sequence, REASON_EFFECT, sort_player)
return ct
end
-- 操作: 返回对方卡组上面 (排序)
function RushDuel.SendToOpponentDeckTop(target, player)
local g = RushDuel.ToMaximunGroup(target)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKTOP, REASON_EFFECT, player)
return ct
end
end
......@@ -336,7 +343,7 @@ function RushDuel.SendToOpponentDeckBottom(target, player)
if g:GetCount() == 1 then
return Duel.SendtoDeck(g, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
else
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, player, 1 - player)
local og, ct = RushDuel.SendToDeckSort(g, SEQ_DECKBOTTOM, REASON_EFFECT, player)
return ct
end
end
......
......@@ -48,7 +48,7 @@ function RushDuel._private_action_send_deck_sort(sequence, reason, hint_selectio
return function(g, e, tp, eg, ep, ev, re, r, rp)
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp, tp)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp)
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
......@@ -58,7 +58,7 @@ function RushDuel._private_action_send_deck_top_or_bottom(top_desc, bottom_desc,
RushDuel.HintOrConfirm(g, hint_selection, confirm, 1 - tp)
RushDuel.SetLabelAndObject(e, g, set_label_before, set_object_before)
local sequence = Duel.SelectOption(tp, top_desc, bottom_desc)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp, tp)
local og, ct = RushDuel.SendToDeckSort(g, sequence, reason, tp)
RushDuel.SetLabelAndObject(e, og, set_label_after, set_object_after)
end
end
......
......@@ -107,7 +107,7 @@ function RushDuel.GetDeckBottomGroup(player, count)
end
-- 返回卡组并排序
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player, target_player)
function RushDuel.SendToDeckSort(target, sequence, reason, sort_player)
local g = RushDuel.ToMaximunGroup(target)
local ct = 0
if sequence == SEQ_DECKTOP then
......
......@@ -38,10 +38,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if ct==0 then return end
RD.SelectAndDoAction(HINTMSG_TODECK,Card.IsAbleToDeck,p,LOCATION_HAND,0,ct,ct,nil,function(g)
Duel.BreakEffect()
if Duel.SelectOption(p,aux.Stringid(m,1),aux.Stringid(m,2))==0 then
RD.SendToDeckTop(g,p,p,true)
else
RD.SendToDeckBottom(g,p,p,true)
end
RD.SendToDeckTopOrBottom(g,p,aux.Stringid(m,1),aux.Stringid(m,2))
end)
end
\ No newline at end of file
......@@ -34,7 +34,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and c:IsControler(tp) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and Duel.Draw(tp,2,REASON_EFFECT)~=0 then
RD.SelectAndDoAction(HINTMSG_TODECK,Card.IsAbleToDeck,tp,LOCATION_HAND,0,2,2,nil,function(g)
Duel.BreakEffect()
RD.SendToDeckBottom(g,tp,tp,true)
RD.SendToDeckBottom(g,tp)
end)
end
end
\ No newline at end of file
......@@ -29,7 +29,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(p,d,REASON_EFFECT)==d then
RD.SelectAndDoAction(HINTMSG_TODECK,Card.IsAbleToDeck,p,LOCATION_HAND,0,2,2,nil,function(g)
Duel.BreakEffect()
RD.SendToDeckBottom(g,p,p,true)
RD.SendToDeckBottom(g,p)
end)
end
end
\ No newline at end of file
......@@ -32,7 +32,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToDeckTop(g,tp,tp,true)~=0 then
if RD.SendToDeckTop(g)~=0 then
Duel.ConfirmDecktop(tp,1)
end
end)
......
......@@ -29,7 +29,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToDeckTop(g,tp,tp,true)~=0 then
if RD.SendToDeckTop(g)~=0 then
Duel.ConfirmDecktop(tp,1)
local tc=g:GetFirst()
if (RD.IsLegendCard(tc) and tc:IsType(TYPE_MONSTER)) or tc:IsCode(list[1]) then
......
......@@ -36,7 +36,7 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetCount()>0 end
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_COST,tp,tp)
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_COST,tp)
if og:IsExists(cm.exfilter,3,nil) then
e:SetValue(1)
else
......
......@@ -36,7 +36,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,3,nil,function(g)
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_EFFECT,tp,tp)
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_EFFECT,tp)
if ct==0 then return end
if RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0
and not Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
......
......@@ -31,6 +31,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,2,3,nil,function(g)
RD.SendToDeckTop(g,tp,tp,true)
RD.SendToDeckTop(g,tp)
end)
end
\ No newline at end of file
......@@ -27,7 +27,6 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,function(g)
local tc=g:GetFirst()
RD.SendToDeckTop(tc,tp,tc:GetOwner(),true)
RD.SendToDeckTop(g,tp)
end)
end
\ No newline at end of file
......@@ -32,7 +32,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.Recover()~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.exfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToDeckTop(g,tp,tp,true)~=0 then
if RD.SendToDeckTop(g)~=0 then
Duel.ConfirmDecktop(tp,1)
end
end)
......
......@@ -38,7 +38,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 and g:FilterCount(Card.IsAbleToDeck,nil)==g:GetCount()
and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_EFFECT,tp,tp)
local og,ct=RD.SendToDeckSort(g,SEQ_DECKBOTTOM,REASON_EFFECT,tp)
if ct>0 then
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -32,11 +32,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
if RD.SendToDeckTop(g,tp,tp,true)~=0 then
if RD.SendToDeckTop(g)~=0 then
Duel.ConfirmDecktop(tp,1)
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,2,2,nil,function(sg)
RD.SendToDeckTop(sg,tp,tp,true)
RD.SendToDeckTop(sg,tp)
end)
end
end
......
......@@ -30,7 +30,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,0,LOCATION_GRAVE,1,1,nil,function(g)
local tc=g:GetFirst()
if RD.SendToDeckBottom(tc,tp,tp,true)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
if RD.SendToDeckBottom(tc)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetLevel()*200
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if c:GetEquipCount()~=0 then
......
......@@ -30,7 +30,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,3,6,nil,function(g)
if RD.SendToDeckTop(g,tp,tp,true)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if RD.SendToDeckTop(g,tp)~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,nil,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT)
end)
......
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