Commit e8efb21f authored by sidschingis's avatar sidschingis Committed by VanillaSalt

fix

fixed not being able to chain the effect when XYZ summoned with Star
Drawing or HC Extra Sword
parent 81bc1172
......@@ -28,9 +28,13 @@ function c46772449.condition(e,tp,eg,ep,ev,re,r,rp)
end
end
function c46772449.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and
c:GetFlagEffect(46772449)==0
end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
c:RegisterFlagEffect(46772449,RESET_CHAIN,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -40,12 +44,12 @@ function c46772449.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp)
end
function c46772449.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
if chk==0 then return
Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c46772449.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
end
\ No newline at end of file
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