Commit 5e062177 authored by GuGu's avatar GuGu

Update c31504.lua

parent 6b5ac676
Pipeline #33471 passed with stage
in 15 seconds
...@@ -11,6 +11,7 @@ function c31504.initial_effect(c) ...@@ -11,6 +11,7 @@ function c31504.initial_effect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA) e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c31504.lkcon) e0:SetCondition(c31504.lkcon)
e0:SetTarget(c31504.lktg)
e0:SetOperation(c31504.lkop) e0:SetOperation(c31504.lkop)
e0:SetValue(SUMMON_TYPE_LINK) e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0) c:RegisterEffect(e0)
...@@ -24,19 +25,38 @@ function c31504.initial_effect(c) ...@@ -24,19 +25,38 @@ function c31504.initial_effect(c)
e1:SetValue(500) e1:SetValue(500)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c31504.mdfilter(c) function c31504.mdfilter(c,tp,sc)
return c:IsSetCard(0x208) and c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x208) and c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
and c:IsLocation(LOCATION_MZONE) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
end end
function c31504.lkcon(e,c) function c31504.lkcon(e,c,og)
if c==nil then return true end if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCountFromEx(tp,tp,c)>0 and Duel.IsExistingMatchingCard(c31504.mdfilter,tp,LOCATION_MZONE,0,1,nil) if og then return og:Filter(c31504.mdfilter,nil,tp,c) end
return Duel.IsExistingMatchingCard(c31504.mdfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
end
function c31504.lktg(e,tp,eg,ep,ev,re,r,rp,chk,c,og)
local sg=nil
if og then
local mg=og:Filter(c31504.mdfilter,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
sg=mg:SelectSubGroup(tp,aux.TRUE,true,1,1,tp,c)
else
local mg=Duel.GetMatchingGroup(c31504.mdfilter,tp,LOCATION_MZONE,0,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
sg=mg:SelectSubGroup(tp,aux.TRUE,true,1,1,tp,c)
end
if sg~=nil then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end end
function c31504.lkop(e,tp,eg,ep,ev,re,r,rp,c) function c31504.lkop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=e:GetLabelObject()
local g=Duel.SelectMatchingCard(tp,c31504.mdfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT) g:DeleteGroup()
end end
function c31504.tgtg(e,c) function c31504.tgtg(e,c)
return rp~=e:GetHandlerPlayer() and (e:GetHandler():GetLinkedGroup():IsContains(c)) return rp~=e:GetHandlerPlayer() and (e:GetHandler():GetLinkedGroup():IsContains(c))
......
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