Commit 09ea2177 authored by wyykak's avatar wyykak

fix c61122.lua

parent 47f5739b
Pipeline #7895 passed with stage
in 1 minute and 3 seconds
--傲霜的透伞-小雪
function c61122.initial_effect(c)
--umb
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61122,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c61122.cost)
e1:SetTarget(c61122.target)
e1:SetOperation(c61122.operation)
c:RegisterEffect(e1)
--to grave
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetDescription(aux.Stringid(61122,1))
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,61122)
e2:SetCost(c61122.drcost)
e2:SetTarget(c61122.drtg)
e2:SetOperation(c61122.drop)
e2:SetCountLimit(1)
c:RegisterEffect(e2)
end
c61122.DescSetName = 0x229
function c61122.umbfilter(c)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
return mt and mt.DescSetName == 0x229 and c:IsDiscardable()
end
function c61122.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c61122.umbfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,c61122.umbfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c61122.filter(c)
return aux.TRUE
end
function c61122.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and c:IsControler(1-tp) and c61122.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61122.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c61122.filter,tp,0,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c61122.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c61122.exfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c61122.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function c61122.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61122.exfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c61122.exfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c61122.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c61122.exfilter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
local c=e:GetHandler()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--傲霜的透伞-小雪
function c61122.initial_effect(c)
--umb
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61122,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c61122.cost)
e1:SetTarget(c61122.target)
e1:SetOperation(c61122.operation)
c:RegisterEffect(e1)
--to grave
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetDescription(aux.Stringid(61122,1))
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,61122)
e2:SetCost(c61122.drcost)
e2:SetTarget(c61122.drtg)
e2:SetOperation(c61122.drop)
c:RegisterEffect(e2)
end
c61122.DescSetName = 0x229
function c61122.umbfilter(c)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
return mt and mt.DescSetName == 0x229 and c:IsDiscardable()
end
function c61122.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c61122.umbfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,c61122.umbfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c61122.filter(c)
return aux.TRUE
end
function c61122.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and c:IsControler(1-tp) and c61122.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61122.filter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c61122.filter,tp,0,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c61122.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c61122.exfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c61122.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function c61122.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c61122.exfilter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c61122.exfilter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c61122.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c61122.exfilter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
local c=e:GetHandler()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
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