Commit 3724be5c authored by Tachibana's avatar Tachibana

1145141919810

parent 58f98679
Pipeline #15054 passed with stages
in 25 minutes and 48 seconds
......@@ -46,12 +46,15 @@ function cm.initial_effect(c)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
function cm.cknfilter(c)
return c:GetOriginalCode()==77765004 and not c:IsDisabled()
end
function cm.lkfilter(c,lc,tp)
local flag=c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsSetCard(0xfa4)
else
return c:IsFaceup() and c:IsType(TYPE_SPELL)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and not Duel.IsExistingMatchingCard(cm.cknfilter,tp,0,LOCATION_SZONE,1,nil)
end
end
function cm.lvfilter(c)
......@@ -133,22 +136,20 @@ function cm.tnop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,1))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.condition)
e3:SetValue(cm.efilter)
......@@ -159,25 +160,25 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not ct or ct<2
end
function cm.efilter(e,te)
return re and e:GetOwnerPlayer()~=re:GetOwnerPlayer()
return e:GetOwnerPlayer()~=te:GetOwnerPlayer()
end
function cm.costfilter(c,tp)
return c:IsSetCard(0xfa4) and c:IsPosition(POS_FACEUP) and c:IsReleasable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetCurrentChain()>1 and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_SZONE,0,3,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if Duel.GetCurrentChain()>1 and Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_SZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_SZONE,0,3,3,nil)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.Release(g,REASON_EFFECT)
e:SetLabel(1)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,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)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,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)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......@@ -209,7 +210,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
if e:GetLabel()==1 then
local check=false
for i=1,ev do
local chainc=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
for i=1,chainc do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:GetOwnerPlayer()==1-tp then
check=Duel.NegateActivation(i) or check
......
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