Commit 1040abfa authored by nekrozar's avatar nekrozar Committed by GitHub

fix&update remove (#1250)

parent 56b1e8aa
......@@ -10,14 +10,14 @@ function c11961740.initial_effect(c)
c:RegisterEffect(e1)
end
function c11961740.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c11961740.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,1,nil,tp,POS_FACEDOWN)
local tc=g:GetFirst()
if tc and Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)~=0 and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
tc:RegisterFlagEffect(11961740,RESET_EVENT+RESETS_STANDARD,0,1)
......
......@@ -28,17 +28,14 @@ end
function c15256925.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c15256925.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c15256925.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c15256925.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c15256925.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c15256925.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp,POS_FACEDOWN) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c15256925.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15256925.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e),tp,POS_FACEDOWN)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -20,15 +20,12 @@ end
function c15693423.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE
end
function c15693423.rmfilter(c,p)
return Duel.IsPlayerCanRemove(p,c) and not c:IsType(TYPE_TOKEN)
end
function c15693423.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
local ct=g:GetCount()-Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if e:GetHandler():IsLocation(LOCATION_HAND) then ct=ct-1 end
if chk==0 then return Duel.IsPlayerCanRemove(1-tp)
and ct>0 and g:IsExists(c15693423.rmfilter,1,nil,1-tp) end
and ct>0 and g:IsExists(Card.IsAbleToRemove,1,nil,1-tp,POS_FACEDOWN,REASON_RULE) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,ct,0,0)
end
function c15693423.activate(e,tp,eg,ep,ev,re,r,rp)
......@@ -37,7 +34,7 @@ function c15693423.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=g:GetCount()-Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(1-tp,c15693423.rmfilter,ct,ct,nil,1-tp)
local sg=g:FilterSelect(1-tp,Card.IsAbleToRemove,ct,ct,nil,1-tp,POS_FACEDOWN,REASON_RULE)
Duel.Remove(sg,POS_FACEDOWN,REASON_RULE)
end
end
......
......@@ -60,7 +60,7 @@ function c1735088.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c1735088.cfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
return c:IsFaceup() and c:IsSetCard(0x58) and c:IsAbleToRemoveAsCost(POS_FACEDOWN) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c1735088.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c1735088.spfilter(c,e,tp,code)
......
......@@ -26,7 +26,7 @@ function c18658572.cfop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetMinGroup(Card.GetSequence):GetFirst()
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
if tc:IsAbleToRemove() and Duel.SelectYesNo(tp,aux.Stringid(18658572,1)) then
if tc:IsAbleToRemove(tp,POS_FACEDOWN) and Duel.SelectYesNo(tp,aux.Stringid(18658572,1)) then
Duel.DisableShuffleCheck()
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
end
......
......@@ -38,11 +38,8 @@ end
function c29432790.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29432790.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c29432790.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c29432790.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,tp,POS_FACEDOWN)
if chk==0 then return Duel.IsExistingMatchingCard(c29432790.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and g:GetCount()>0 and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
......@@ -50,7 +47,7 @@ function c29432790.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c29432790.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c29432790.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil,tp,POS_FACEDOWN)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
......
......@@ -75,11 +75,11 @@ function c32013448.rmop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c32013448.rmtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
function c32013448.rmop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,tp,POS_FACEDOWN)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(tp,1)
local tc=sg:GetFirst()
......
......@@ -20,11 +20,11 @@ function c32999573.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(32999573+ep)==0
and bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ)
and re:GetHandler():GetOverlayCount()>=ev-1
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil,tp,POS_FACEDOWN)
end
function c32999573.rop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(32999573+ep,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil,tp,POS_FACEDOWN)
return Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
......@@ -14,7 +14,7 @@ function c35261759.initial_effect(c)
end
function c35261759.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,10)
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil)==10
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=12 end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
......
......@@ -32,24 +32,21 @@ function c36970611.initial_effect(c)
e3:SetOperation(c36970611.thop)
c:RegisterEffect(e3)
end
function c36970611.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c36970611.cfilter(c)
function c36970611.cfilter(c,tp)
return c:IsSetCard(0xc1) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingTarget(c36970611.rmfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c,tp,POS_FACEDOWN)
end
function c36970611.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local cg=Duel.SelectMatchingCard(tp,c36970611.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.Remove(cg,POS_FACEUP,REASON_COST)
end
function c36970611.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c36970611.rmfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c36970611.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -51,7 +51,7 @@ function c40080312.retcon2(e,tp,eg,ep,ev,re,r,rp)
end
function c40080312.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
......@@ -60,7 +60,7 @@ function c40080312.retop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
if c:IsLocation(LOCATION_EXTRA) then
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp,POS_FACEDOWN)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end
......
......@@ -19,7 +19,7 @@ function c40555959.initial_effect(c)
end
function c40555959.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil)
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil,tp,POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c40555959.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(40555959,1)) then
c40555959.remop(e,tp,eg,ep,ev,re,r,rp)
......@@ -35,13 +35,13 @@ function c40555959.remcon(e,tp,eg,ep,ev,re,r,rp)
end
function c40555959.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(40555959)==0
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) end
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
e:GetHandler():RegisterFlagEffect(40555959,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c40555959.remop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_HAND,0,nil,tp,POS_FACEDOWN)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -37,7 +37,7 @@ function c43175858.initial_effect(c)
end
function c43175858.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil)==3 end
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function c43175858.activate(e,tp,eg,ep,ev,re,r,rp)
......@@ -56,7 +56,7 @@ end
function c43175858.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=eg:FilterCount(c43175858.repfilter,nil,tp)
local g=Duel.GetDecktopGroup(tp,ct)
if chk==0 then return g:IsExists(Card.IsAbleToRemove,ct,nil) end
if chk==0 then return g:IsExists(Card.IsAbleToRemove,ct,nil,tp,POS_FACEDOWN) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -24,8 +24,14 @@ function c45148985.initial_effect(c)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
--cannot remove
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_REMOVE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,1)
e4:SetTarget(c45148985.rmlimit)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
......@@ -63,6 +69,9 @@ function c45148985.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=g:SelectSubGroup(tp,c45148985.gselect,false,5,5,tp)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c45148985.rmlimit(e,c,tp,r)
return c==e:GetHandler() and r==REASON_EFFECT
end
function c45148985.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
end
......
......@@ -11,7 +11,7 @@ function c45221020.initial_effect(c)
c:RegisterEffect(e1)
end
function c45221020.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost(POS_FACEDOWN)
end
function c45221020.filter(c,e,tp,lv)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -27,7 +27,7 @@ function c47870325.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function c47870325.rmfilter(c,tp)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove(tp)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c47870325.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -19,7 +19,7 @@ function c49238328.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c49238328.cfilter(c)
return c:IsFacedown() and c:IsAbleToRemoveAsCost()
return c:IsFacedown() and c:IsAbleToRemoveAsCost(POS_FACEDOWN)
end
function c49238328.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c49238328.cfilter,tp,LOCATION_EXTRA,0,nil)
......
......@@ -11,7 +11,7 @@ function c49587034.initial_effect(c)
c:RegisterEffect(e1)
end
function c49587034.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND)
end
function c49587034.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,7 +12,7 @@ function c56256517.initial_effect(c)
end
function c56256517.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil)==3 end
if chk==0 then return g:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function c56256517.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,8 +12,7 @@ function c58297729.target(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if chk==0 then return d and a:GetControler()~=d:GetControler()
and a:IsAbleToRemove() and d:IsAbleToRemove()
and not a:IsType(TYPE_TOKEN) and not d:IsType(TYPE_TOKEN) end
and a:IsAbleToRemove(a:GetControler(),POS_FACEDOWN,REASON_RULE) and d:IsAbleToRemove(d:GetControler(),POS_FACEDOWN,REASON_RULE) end
end
function c58297729.activate(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
......
......@@ -62,21 +62,18 @@ end
function c63845230.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function c63845230.cfilter(c)
return c:IsAbleToRemoveAsCost() and not c:IsType(TYPE_TOKEN)
end
function c63845230.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
local g=Duel.GetMatchingGroup(c63845230.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,c)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,c,POS_FACEDOWN)
return g:GetCount()>=5 and (ft>0 or g:IsExists(Card.IsLocation,ct,nil,LOCATION_MZONE))
end
function c63845230.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
local g=Duel.GetMatchingGroup(c63845230.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,c)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_EXTRA,0,c,POS_FACEDOWN)
local rg=nil
if ft<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......@@ -98,7 +95,7 @@ function c63845230.val(e,c)
end
function c63845230.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc and tc:IsControler(1-tp) and tc:IsAbleToRemove() and not tc:IsType(TYPE_TOKEN) end
if chk==0 then return tc and tc:IsControler(1-tp) and tc:IsAbleToRemove(tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
end
function c63845230.rmop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,7 +27,7 @@ function c71197066.initial_effect(c)
end
function c71197066.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,8)
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil)==8 end
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==8 end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
......@@ -43,9 +43,9 @@ function c71197066.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c71197066.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,3,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,3,nil,POS_FACEDOWN) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,3,3,nil)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_EXTRA,0,3,3,nil,POS_FACEDOWN)
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
end
function c71197066.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -43,7 +43,7 @@ function c72283691.mtcon(e,tp,eg,ep,ev,re,r,rp)
end
function c72283691.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,10)
if g:FilterCount(Card.IsAbleToRemoveAsCost,nil)==10 then
if g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==10 then
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
else
......
......@@ -19,9 +19,9 @@ function c73414375.operation(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,3,nil)
g:Merge(rg)
end
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(1-tp,aux.Stringid(73414375,1)) then
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,0,LOCATION_GRAVE,1,nil,1-tp) and Duel.SelectYesNo(1-tp,aux.Stringid(73414375,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,0,LOCATION_GRAVE,1,3,nil)
local rg=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,0,LOCATION_GRAVE,1,3,nil,1-tp)
g:Merge(rg)
end
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
......
......@@ -76,7 +76,7 @@ function c77498348.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if e:GetLabel()==ATTRIBUTE_LIGHT then
return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
else
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil)
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil,tp,POS_FACEDOWN)
end
end
if e:GetLabel()==ATTRIBUTE_LIGHT then
......@@ -96,7 +96,7 @@ function c77498348.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
else
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,tp,POS_FACEDOWN)
if g:GetCount()==0 then return end
local rg=g:RandomSelect(tp,1)
local tc=rg:GetFirst()
......
......@@ -11,7 +11,7 @@ function c81223446.initial_effect(c)
c:RegisterEffect(e1)
end
function c81223446.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c81223446.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
......
......@@ -10,12 +10,12 @@ function c82257940.initial_effect(c)
c:RegisterEffect(e1)
end
function c82257940.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil,tp,POS_FACEDOWN)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,1,nil,1-tp,POS_FACEDOWN) end
end
function c82257940.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,nil)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil,tp,POS_FACEDOWN)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,nil,1-tp,POS_FACEDOWN)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg1=g1:Select(tp,1,1,nil)
......
......@@ -11,7 +11,7 @@ function c84640866.initial_effect(c)
end
function c84640866.filter(c,tp)
return c:GetSummonPlayer()~=tp and bit.band(c:GetSummonLocation(),LOCATION_DECK+LOCATION_GRAVE)~=0
and c:IsAbleToRemove() and c:IsLocation(LOCATION_MZONE)
and c:IsAbleToRemove(tp,POS_FACEDOWN) and c:IsLocation(LOCATION_MZONE)
end
function c84640866.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c84640866.filter,nil,tp)
......
......@@ -14,7 +14,7 @@ function c90384300.initial_effect(c)
end
function c90384300.costfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER)
and not c:IsSummonableCard() and not c:IsType(TYPE_TOKEN) and c:IsAbleToRemoveAsCost()
and not c:IsSummonableCard() and c:IsAbleToRemoveAsCost(POS_FACEDOWN)
end
function c90384300.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c90384300.costfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,2,nil) end
......
......@@ -15,7 +15,7 @@ function c94446564.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc1=g1:GetFirst()
local g2=Duel.GetDecktopGroup(1-tp,1)
local tc2=g2:GetFirst()
return tc1 and tc2 and tc1:IsAbleToRemove() and tc2:IsAbleToRemove() and tc1:IsAbleToHand() and tc2:IsAbleToHand()
return tc1 and tc2 and tc1:IsAbleToRemove(tp) and tc2:IsAbleToRemove(1-tp) and tc1:IsAbleToHand() and tc2:IsAbleToHand()
end
end
function c94446564.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -53,14 +53,14 @@ function c95474755.excost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c95474755.extg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil,tp,POS_FACEDOWN) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function c95474755.exop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil,tp,POS_FACEDOWN)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
function c95474755.regop(e,tp,eg,ep,ev,re,r,rp)
......@@ -70,9 +70,9 @@ function c95474755.grcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(95474755)~=0
end
function c95474755.grtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil,tp,POS_FACEDOWN) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil,tp,POS_FACEDOWN)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end
function c95474755.grop(e,tp,eg,ep,ev,re,r,rp)
......@@ -91,7 +91,7 @@ function c95474755.dktg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c95474755.dkfilter,tp,0,LOCATION_REMOVED,nil,1-tp)
local tg=Duel.GetDecktopGroup(1-tp,ct)
if chk==0 then return ct>0
and tg:FilterCount(Card.IsAbleToRemove,nil)==ct end
and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==ct end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,1-tp,LOCATION_DECK)
end
function c95474755.dkop(e,tp,eg,ep,ev,re,r,rp)
......
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