Commit 01169b09 authored by mercury233's avatar mercury233 Committed by GitHub

add Auxiliary.SelectCardFromFieldFirst (#2537)

* add Auxiliary.SelectCardFromFieldFirst

* use Duel.GetLastSelectHint

* update

* more
parent 87feef12
...@@ -43,7 +43,8 @@ function c13455674.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -43,7 +43,8 @@ function c13455674.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsControler(1-tp) and c13455674.rmfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and chkc:IsControler(1-tp) and c13455674.rmfilter(chkc) end
if chk==0 then return ct>0 and Duel.IsExistingTarget(c13455674.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end if chk==0 then return ct>0 and Duel.IsExistingTarget(c13455674.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c13455674.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,ct,nil) local g=aux.SelectCardFromFieldFirst(tp,c13455674.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,ct,nil)
Duel.SetTargetCard(g)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE)
else else
......
...@@ -54,7 +54,8 @@ function c197042.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -54,7 +54,8 @@ function c197042.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c197042.xyzfilter(c) function c197042.xyzfilter(c)
......
...@@ -57,7 +57,8 @@ function c23776077.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -57,7 +57,8 @@ function c23776077.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c23776077.rmfilter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c23776077.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c23776077.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c23776077.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c23776077.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c23776077.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
else else
......
...@@ -28,7 +28,8 @@ function c26211048.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,7 +28,8 @@ function c26211048.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c26211048.eqfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end and Duel.IsExistingTarget(c26211048.eqfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c26211048.eqfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c26211048.eqfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil)
Duel.SetTargetCard(g)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end end
......
...@@ -44,7 +44,8 @@ function s.srmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -44,7 +44,8 @@ function s.srmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function s.srmop(e,tp,eg,ep,ev,re,r,rp) function s.srmop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -89,23 +89,9 @@ end ...@@ -89,23 +89,9 @@ end
function c29884951.remtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c29884951.remtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and c29884951.remfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and c29884951.remfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c29884951.remfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c29884951.remfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local b1=Duel.IsExistingTarget(c29884951.remfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingTarget(c29884951.remfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(29884951,3),aux.Stringid(29884951,4))
else
op=2
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=nil local g=aux.SelectCardFromFieldFirst(tp,c29884951.remfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if op==0 then Duel.SetTargetCard(g)
g=Duel.SelectTarget(tp,c29884951.remfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
elseif op==1 then
g=Duel.SelectTarget(tp,c29884951.remfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
else
g=Duel.SelectTarget(tp,c29884951.remfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c29884951.remop(e,tp,eg,ep,ev,re,r,rp) function c29884951.remop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -34,23 +34,9 @@ function c38495396.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,23 +34,9 @@ function c38495396.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c38495396.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c38495396.thfilter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(38495396)==0 if chk==0 then return e:GetHandler():GetFlagEffect(38495396)==0
and Duel.IsExistingTarget(c38495396.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end and Duel.IsExistingTarget(c38495396.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
local b1=Duel.IsExistingTarget(c38495396.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
local b2=Duel.IsExistingTarget(c38495396.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(38495396,2),aux.Stringid(38495396,3))
else
op=2
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=nil local g=aux.SelectCardFromFieldFirst(tp,c38495396.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
if op==0 then Duel.SetTargetCard(g)
g=Duel.SelectTarget(tp,c38495396.thfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
elseif op==1 then
g=Duel.SelectTarget(tp,c38495396.thfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
else
g=Duel.SelectTarget(tp,c38495396.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c38495396.thop(e,tp,eg,ep,ev,re,r,rp) function c38495396.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -52,7 +52,7 @@ function c39185163.disrmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function c39185163.disrmop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,39185163,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,39185163,RESET_PHASE+PHASE_END,0,1)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c39185163.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c39185163.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,39185164,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,39185164,RESET_PHASE+PHASE_END,0,1)
end end
......
...@@ -69,7 +69,8 @@ function c42741437.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -69,7 +69,8 @@ function c42741437.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c42741437.rmop(e,tp,eg,ep,ev,re,r,rp) function c42741437.rmop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -48,7 +48,8 @@ function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,7 +48,8 @@ function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and s.filter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil,tp) local g=aux.SelectCardFromFieldFirst(tp,s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil,tp)
Duel.SetTargetCard(g)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end end
......
...@@ -94,7 +94,8 @@ function c56518311.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -94,7 +94,8 @@ function c56518311.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c56518311.rmfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c56518311.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c56518311.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c56518311.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c56518311.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c56518311.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c56518311.rmop(e,tp,eg,ep,ev,re,r,rp) function c56518311.rmop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -34,10 +34,11 @@ function c57416183.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -34,10 +34,11 @@ function c57416183.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c57416183.cfilter,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(c57416183.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g1=Duel.SelectTarget(tp,c57416183.cfilter,tp,LOCATION_MZONE,0,1,1,nil) local g1=Duel.SelectMatchingCard(tp,c57416183.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g2=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
g1:Merge(g2) g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,0)
end end
function c57416183.activate(e,tp,eg,ep,ev,re,r,rp) function c57416183.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,7 +40,8 @@ function c601193.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,7 +40,8 @@ function c601193.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function c601193.tdop(e,tp,eg,ep,ev,re,r,rp) function c601193.tdop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -108,7 +108,7 @@ function c60168186.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -108,7 +108,7 @@ function c60168186.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c60168186.rmop(e,tp,eg,ep,ev,re,r,rp) function c60168186.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end end
......
...@@ -31,7 +31,8 @@ function c60681103.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -31,7 +31,8 @@ function c60681103.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c60681103.rmfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c60681103.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c60681103.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c60681103.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c60681103.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c60681103.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then if tc:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
......
...@@ -39,7 +39,8 @@ function c65187687.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -39,7 +39,8 @@ function c65187687.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c65187687.rmfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c65187687.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c65187687.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c65187687.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c65187687.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c65187687.rmfilter,tp,0,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil)
Duel.SetTargetCard(g)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
else else
......
...@@ -84,7 +84,8 @@ function c7206349.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -84,7 +84,8 @@ function c7206349.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and c7206349.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and c7206349.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c7206349.thfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c7206349.thfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c7206349.thfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,c7206349.thfilter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c7206349.thop(e,tp,eg,ep,ev,re,r,rp) function c7206349.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -48,7 +48,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,7 +48,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetCategory(0) e:SetCategory(0)
e:SetOperation(s.mvop) e:SetOperation(s.mvop)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.mfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil,tp,0) local g=aux.SelectCardFromFieldFirst(tp,s.mfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil,tp,0)
Duel.SetTargetCard(g)
else else
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.spop) e:SetOperation(s.spop)
......
...@@ -37,7 +37,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -37,7 +37,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToRemove() and chkc~=c end if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and chkc:IsAbleToRemove() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,c) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,c) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,c)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -60,7 +60,8 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -60,7 +60,8 @@ function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -27,23 +27,10 @@ end ...@@ -27,23 +27,10 @@ end
function c90452877.desop(e,tp,eg,ep,ev,re,r,rp) function c90452877.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(90452877,0),aux.Stringid(90452877,1))
else
op=2
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=nil local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if op==0 then if #g>0 then
g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
elseif op==1 then
g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
else
g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
end end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end end
end end
...@@ -64,7 +64,8 @@ function c96239878.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -64,7 +64,8 @@ function c96239878.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return (chkc:IsOnField() or chkc:IsLocation(LOCATION_GRAVE)) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return (chkc:IsOnField() or chkc:IsLocation(LOCATION_GRAVE)) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c96239878.rmop(e,tp,eg,ep,ev,re,r,rp) function c96239878.rmop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -80,7 +80,7 @@ function c98020526.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +80,7 @@ function c98020526.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,98020526,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,98020526,RESET_PHASE+PHASE_END,0,1)
elseif opval[op]==2 then elseif opval[op]==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c98020526.rfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) local rg=aux.SelectCardFromFieldFirst(tp,aux.NecroValleyFilter(c98020526.rfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.HintSelection(rg) Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,98020527,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,98020527,RESET_PHASE+PHASE_END,0,1)
......
...@@ -807,6 +807,7 @@ HINTMSG_TOZONE =571 --请选择要移动到的位置 ...@@ -807,6 +807,7 @@ HINTMSG_TOZONE =571 --请选择要移动到的位置
HINTMSG_COUNTER =572 --请选择要放置指示物的卡 HINTMSG_COUNTER =572 --请选择要放置指示物的卡
HINTMSG_DISABLE =573 --请选择要无效的卡 HINTMSG_DISABLE =573 --请选择要无效的卡
HINTMSG_OPERATECARD =574 --请选择要操作的卡 HINTMSG_OPERATECARD =574 --请选择要操作的卡
HINTMSG_FIELD_FIRST =575 --请选择场上的卡(按取消可选择其他区域的卡)
--Select --请选择 --Select --请选择
SELECT_HEADS =60 --正面 SELECT_HEADS =60 --正面
SELECT_TAILS =61 --反面 SELECT_TAILS =61 --反面
......
...@@ -1234,6 +1234,24 @@ function Group.SelectSubGroupEach(g,tp,checks,cancelable,f,...) ...@@ -1234,6 +1234,24 @@ function Group.SelectSubGroupEach(g,tp,checks,cancelable,f,...)
return nil return nil
end end
end end
--for effects that player usually select card from field, avoid showing panel
function Auxiliary.SelectCardFromFieldFirst(tp,f,player,s,o,min,max,ex,...)
local ext_params={...}
local g=Duel.GetMatchingGroup(f,player,s,o,ex,ext_params)
local fg=g:Filter(Card.IsOnField,nil)
g:Sub(fg)
if #fg>=min and #g>0 then
local last_hint=Duel.GetLastSelectHint(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FIELD_FIRST)
local sg=fg:CancelableSelect(tp,min,max,nil)
if sg then
return sg
else
Duel.Hint(HINT_SELECTMSG,tp,last_hint)
end
end
return Duel.SelectMatchingCard(tp,f,player,s,o,min,max,ex,ext_params)
end
--condition of "negate activation and banish" --condition of "negate activation and banish"
function Auxiliary.nbcon(tp,re) function Auxiliary.nbcon(tp,re)
local rc=re:GetHandler() local rc=re:GetHandler()
......
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