Commit 1a7b5d48 authored by nekrozar's avatar nekrozar

fix

parent 8748593c
...@@ -4,6 +4,9 @@ function c18634367.initial_effect(c) ...@@ -4,6 +4,9 @@ function c18634367.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x28)
e1:SetTarget(c18634367.target)
e1:SetOperation(c18634367.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--cannot attack --cannot attack
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -34,8 +37,28 @@ function c18634367.initial_effect(c) ...@@ -34,8 +37,28 @@ function c18634367.initial_effect(c)
e4:SetCondition(c18634367.spcon) e4:SetCondition(c18634367.spcon)
e4:SetTarget(c18634367.sptg) e4:SetTarget(c18634367.sptg)
e4:SetOperation(c18634367.spop) e4:SetOperation(c18634367.spop)
e4:SetLabel(1)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c18634367.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c18634367.filter(chkc,e,tp) end
if chk==0 then return true end
if Duel.IsExistingMatchingCard(c18634367.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():IsDestructable() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c18634367.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(18634367,1)) then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c18634367.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c18634367.mtcon(e,tp,eg,ep,ev,re,r,rp) function c18634367.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
...@@ -66,6 +89,7 @@ function c18634367.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -66,6 +89,7 @@ function c18634367.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c18634367.spop(e,tp,eg,ep,ev,re,r,rp) function c18634367.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()~=1 or not Duel.IsExistingMatchingCard(c18634367.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then return end
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
......
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