Commit cbdede8a authored by salix5's avatar salix5

disfilter

parent 182e64f2
...@@ -38,18 +38,15 @@ function c17874674.initial_effect(c) ...@@ -38,18 +38,15 @@ function c17874674.initial_effect(c)
e4:SetOperation(c17874674.costop) e4:SetOperation(c17874674.costop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c17874674.filter(c)
return c:IsFaceup() and (not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_EFFECT))
end
function c17874674.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c17874674.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c17874674.filter(chkc) end if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return true end if chk==0 then return true end
if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY if Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()==PHASE_STANDBY
and Duel.IsExistingTarget(c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(17874674,2)) then and Duel.SelectYesNo(tp,aux.Stringid(17874674,2)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else else
e:SetProperty(0) e:SetProperty(0)
...@@ -59,17 +56,17 @@ function c17874674.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,17 +56,17 @@ function c17874674.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp return Duel.GetTurnPlayer()~=tp
end end
function c17874674.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c17874674.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c17874674.filter(chkc) end if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(17874674)==0 end if chk==0 then return e:GetHandler():GetFlagEffect(17874674)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c17874674.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(17874674,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
function c17874674.operation(e,tp,eg,ep,ev,re,r,rp) function c17874674.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetFlagEffect(17874674)==0 then return end if c:GetFlagEffect(17874674)==0 or not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc) c:SetCardTarget(tc)
e:SetLabelObject(tc) e:SetLabelObject(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -35,20 +35,17 @@ end ...@@ -35,20 +35,17 @@ end
function c23204029.splimit(e,se,sp,st) function c23204029.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
function c23204029.filter(c)
return c:IsFaceup() and not c:IsDisabled() and not c:IsType(TYPE_NORMAL)
end
function c23204029.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c23204029.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c23204029.filter(chkc) end if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c23204029.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c23204029.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function c23204029.operation(e,tp,eg,ep,ev,re,r,rp) function c23204029.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -57,15 +57,12 @@ function c47017574.discost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,15 +57,12 @@ function c47017574.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c47017574.filter(c)
return c:IsFaceup() and (c:IsLocation(LOCATION_SZONE) or c:IsType(TYPE_EFFECT))
end
function c47017574.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c47017574.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c47017574.filter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
end end
function c47017574.disop(e,tp,eg,ep,ev,re,r,rp) function c47017574.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c47017574.filter,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -78,6 +75,13 @@ function c47017574.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,6 +75,13 @@ function c47017574.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e3)
end
tc=g:GetNext() tc=g:GetNext()
end end
end end
...@@ -28,9 +28,6 @@ function c48333324.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,9 +28,6 @@ function c48333324.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c48333324.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c48333324.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c48333324.negfilter(c)
return not c:IsDisabled()
end
function c48333324.activate(e,tp,eg,ep,ev,re,r,rp) function c48333324.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local c=e:GetHandler() local c=e:GetHandler()
...@@ -52,7 +49,7 @@ function c48333324.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +49,7 @@ function c48333324.activate(e,tp,eg,ep,ev,re,r,rp)
if g1:GetFirst() then if g1:GetFirst() then
Duel.BreakEffect() Duel.BreakEffect()
end end
local ng=g1:Filter(c48333324.negfilter,nil) local ng=g1:Filter(aux.disfilter1,nil)
local nc=ng:GetFirst() local nc=ng:GetFirst()
while nc do while nc do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -39,7 +39,7 @@ function c5795980.cfilter(c,e,dg) ...@@ -39,7 +39,7 @@ function c5795980.cfilter(c,e,dg)
return dg:GetCount()-a>=1 return dg:GetCount()-a>=1
end end
function c5795980.tgfilter(c,e) function c5795980.tgfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e) return aux.disfilter1(c) and c:IsCanBeEffectTarget(e)
end end
function c5795980.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c5795980.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c5795980.tgfilter(chkc,e) and chkc~=e:GetHandler() end if chkc then return chkc:IsOnField() and c5795980.tgfilter(chkc,e) and chkc~=e:GetHandler() end
...@@ -70,7 +70,7 @@ end ...@@ -70,7 +70,7 @@ end
function c5795980.activate(e,tp,eg,ep,ev,re,r,rp) function c5795980.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -35,15 +35,12 @@ function c73445448.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,15 +35,12 @@ function c73445448.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST) Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end end
function c73445448.filter(c)
return c:IsFaceup() and not c:IsDisabled() and not c:IsType(TYPE_NORMAL)
end
function c73445448.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c73445448.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c73445448.filter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return e:GetHandler():IsAttackPos() if chk==0 then return e:GetHandler():IsAttackPos()
and Duel.IsExistingTarget(c73445448.filter,tp,0,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c73445448.filter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function c73445448.operation(e,tp,eg,ep,ev,re,r,rp) function c73445448.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -51,7 +48,7 @@ function c73445448.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +48,7 @@ function c73445448.operation(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) or c:IsDefencePos() then return end if not c:IsRelateToEffect(e) or c:IsDefencePos() then return end
Duel.ChangePosition(c,POS_FACEUP_DEFENCE,POS_FACEDOWN_DEFENCE,0,0) Duel.ChangePosition(c,POS_FACEUP_DEFENCE,POS_FACEDOWN_DEFENCE,0,0)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -40,11 +40,11 @@ function c81146288.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -40,11 +40,11 @@ function c81146288.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Remove(g1,POS_FACEUP,REASON_COST) Duel.Remove(g1,POS_FACEUP,REASON_COST)
end end
function c81146288.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c81146288.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
end end
function c81146288.disop(e,tp,eg,ep,ev,re,r,rp) function c81146288.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -57,6 +57,13 @@ function c81146288.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,6 +57,13 @@ function c81146288.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e3)
end
tc=g:GetNext() tc=g:GetNext()
end end
end end
...@@ -19,14 +19,11 @@ function c86848580.discost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,14 +19,11 @@ function c86848580.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c86848580.filter1(c)
return c:IsFaceup() and not c:IsDisabled() and (c:IsLocation(LOCATION_SZONE) or c:IsType(TYPE_EFFECT))
end
function c86848580.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c86848580.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86848580.filter1,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
end end
function c86848580.disop(e,tp,eg,ep,ev,re,r,rp) function c86848580.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c86848580.filter1,tp,0,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
local c=e:GetHandler() local c=e:GetHandler()
...@@ -41,6 +38,13 @@ function c86848580.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,6 +38,13 @@ function c86848580.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY,2)
tc:RegisterEffect(e3)
end
tc=g:GetNext() tc=g:GetNext()
end end
local atk=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)*300 local atk=Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)*300
......
...@@ -943,3 +943,7 @@ function Auxiliary.PendOperation() ...@@ -943,3 +943,7 @@ function Auxiliary.PendOperation()
Duel.HintSelection(pg) Duel.HintSelection(pg)
end end
end end
function Auxiliary.disfilter1(c)
return (c:IsFaceup() and not c:IsDisabled() and (c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)>0))
or c:IsType(TYPE_TRAPMONSTER)
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