Commit 12d5077a authored by Grajade's avatar Grajade

Update c86379108.lua

parent f6b278e1
Pipeline #8767 passed with stage
in 1 minute and 7 seconds
--符之二『人形十字军』 --符之二『人形十字军』
function c86379108.initial_effect(c) function c86379108.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -9,18 +8,19 @@ function c86379108.initial_effect(c) ...@@ -9,18 +8,19 @@ function c86379108.initial_effect(c)
e1:SetTarget(c86379108.tg) e1:SetTarget(c86379108.tg)
e1:SetOperation(c86379108.op) e1:SetOperation(c86379108.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
-- --
function c86379108.costfilter(c) function c86379108.costfilter(c,tp)
return c:IsSetCard(0x186) and c:IsReleasable() and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 local b1=Duel.IsPlayerCanDraw(tp)
local b2=(bit.band(c:GetOriginalAttribute(),ATTRIBUTE_LIGHT)~=0)
return c:IsSetCard(0x186) and c:IsReleasable() and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and (not b2 or b1)
end end
function c86379108.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c86379108.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86379108.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c86379108.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c86379108.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c86379108.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
if g:GetFirst():GetOriginalAttribute()==ATTRIBUTE_LIGHT then if bit.band(g:GetFirst():GetOriginalAttribute(),ATTRIBUTE_LIGHT)~=0 then
e:SetLabel(1) e:SetLabel(1)
else else
e:SetLabel(0) e:SetLabel(0)
...@@ -28,9 +28,14 @@ function c86379108.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,9 +28,14 @@ function c86379108.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c86379108.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c86379108.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if e:GetLabel() and e:GetLabel()==1 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
else
e:SetCategory(CATEGORY_DESTROY)
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c86379108.op(e,tp,eg,ep,ev,re,r,rp,chk) function c86379108.op(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -39,8 +44,7 @@ function c86379108.op(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,8 +44,7 @@ function c86379108.op(e,tp,eg,ep,ev,re,r,rp,chk)
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
local ct=e:GetLabel() if e:GetLabel() and e:GetLabel()==1 then
if ct==1 then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end 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