Commit 7c76f158 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #582 from salix5/patch8

fix
parents 04ecaac8 ce4acf58
......@@ -4,6 +4,7 @@ function c28553439.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetCondition(c28553439.condition)
......@@ -21,16 +22,20 @@ function c28553439.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c28553439.rfilter(c,e)
return c:IsReleasableByEffect() and not c:IsImmuneToEffect(e)
return c:IsReleasableByEffect()
end
function c28553439.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c28553439.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c28553439.rfilter(chkc,e) end
if chk==0 then return Duel.CheckReleaseGroup(tp,c28553439.rfilter,1,nil,e)
and Duel.IsExistingMatchingCard(c28553439.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.SelectTarget(tp,c28553439.rfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c28553439.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectReleaseGroup(tp,c28553439.rfilter,1,1,nil,e)
if g:GetCount()==0 or Duel.Release(g,REASON_EFFECT)==0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
if Duel.Release(tc,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c28553439.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if sg:GetCount()==0 then return end
......@@ -44,4 +49,5 @@ function c28553439.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
Duel.Destroy(des,REASON_EFFECT)
end
end
end
......@@ -4,6 +4,7 @@ function c78986941.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c78986941.target)
......@@ -13,9 +14,10 @@ end
function c78986941.rfilter(c,e)
local tpe=c:GetType()
return bit.band(tpe,TYPE_NORMAL)~=0 and bit.band(tpe,TYPE_TOKEN)==0
and c:IsFaceup() and c:IsReleasable() and c:IsReleasableByEffect() and not c:IsImmuneToEffect(e)
and c:IsFaceup() and c:IsReleasable() and c:IsReleasableByEffect()
end
function c78986941.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c78986941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c78986941.rfilter(chkc,e) end
if chk==0 then return Duel.IsExistingTarget(c78986941.rfilter,tp,LOCATION_MZONE,0,1,nil,e)
and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
......@@ -25,7 +27,7 @@ function c78986941.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c78986941.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Release(tc,REASON_EFFECT)>0 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and Duel.Release(tc,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil)
if dg:GetCount()>0 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