Commit e82ecd79 authored by POLYMER's avatar POLYMER

fix

parent 4a21f2b4
...@@ -44,14 +44,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,14 +44,12 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,aux.ExceptThisCard(e)) then
Duel.Destroy(eg,REASON_EFFECT) Duel.BreakEffect()
local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,aux.ExceptThisCard(e))
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end end
Duel.BreakEffect()
if Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local tc=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Destroy(tc,REASON_EFFECT)
end
end end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -12,71 +12,71 @@ function this.initial_effect(c) ...@@ -12,71 +12,71 @@ function this.initial_effect(c)
e1:SetTarget(this.sptg) e1:SetTarget(this.sptg)
e1:SetOperation(this.spop) e1:SetOperation(this.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY) e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION) e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+ofs) e3:SetCountLimit(1,id+ofs)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(this.dtg) e3:SetTarget(this.dtg)
e3:SetOperation(this.dop) e3:SetOperation(this.dop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function this.spcon(e,tp,eg,ep,ev,re,r,rp) function this.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_ONFIELD) return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_ONFIELD) and not eg:IsContains(e:GetHandler())
end end
function this.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function this.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0 end if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,c:GetLocation()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,c:GetLocation())
if c:IsLocation(LOCATION_GRAVE) then if c:IsLocation(LOCATION_GRAVE) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE) e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e:SetLabel(1) e:SetLabel(1)
end end
end end
function this.spop(e,tp,eg,ep,ev,re,r,rp) function this.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 and Duel.SpecialSummon(c,SUMMON_TYPE_SPECIAL,tp,tp,false,false,POS_FACEUP)>0 then if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 and Duel.SpecialSummon(c,SUMMON_TYPE_SPECIAL,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED) e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
if e:GetLabel()>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) if e:GetLabel()>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if tc then if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end end
end end
end end
end end
function this.dfilter1(c,tp) function this.dfilter1(c,tp)
return c:IsDestructable() and c:IsFaceup() return c:IsDestructable() and c:IsFaceup()
and Duel.IsExistingTarget(this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.IsExistingTarget(this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end end
function this.dfilter2(c) function this.dfilter2(c)
return c:IsDestructable() and c:IsFaceup() return c:IsDestructable() and c:IsFaceup()
end end
function this.dtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function this.dtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(this.dfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(this.dfilter1,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,this.dfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp) local g=Duel.SelectTarget(tp,this.dfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g) local g2=Duel.SelectTarget(tp,this.dfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
g:Merge(g2) g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end end
function this.dop(e,tp,eg,ep,ev,re,r,rp) function this.dop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain() local g=Duel.GetTargetsRelateToChain()
if #g~=2 then return end if #g~=2 then return end
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
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