Commit 3f1dcf9d authored by wyykak's avatar wyykak

fix c60922.lua

parent 1ae1f81f
--红叶的和伞-秋分
function c60922.initial_effect(c)
--link summon
Nef.AddLinkProcedureWithDesc(c,c60922.matfilter,1,1,nil,aux.Stringid(60922,0))
c:EnableReviveLimit()
--link summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetDescription(aux.Stringid(60922,1))
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c60922.lkcon)
e1:SetOperation(c60922.lkop)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
end
function c60922.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_WATER)
end
function c60922.umbfilter(c)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
return mt and mt.DescSetName == 0x229 and c:IsAbleToRemoveAsCost()
end
function c60922.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c60922.umbfilter,tp,LOCATION_GRAVE,0,nil)
return mg:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0
end
function c60922.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c60922.umbfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=mg:Select(tp,1,1,nil)
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_MATERIAL+REASON_LINK)
end
--红叶的和伞-秋分
function c60922.initial_effect(c)
--link summon
Nef.AddLinkProcedureWithDesc(c,c60922.matfilter,1,1,nil,aux.Stringid(60922,0))
c:EnableReviveLimit()
--link summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetDescription(aux.Stringid(60922,1))
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL|60922)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c60922.lkcon)
e1:SetOperation(c60922.lkop)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
end
function c60922.matfilter(c)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_WATER)
end
function c60922.umbfilter(c)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
return mt and mt.DescSetName == 0x229 and c:IsAbleToRemoveAsCost()
end
function c60922.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c60922.umbfilter,tp,LOCATION_GRAVE,0,nil)
return mg:GetCount()>0 and Duel.GetLocationCountFromEx(tp)>0
end
function c60922.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c60922.umbfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=mg:Select(tp,1,1,nil)
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_MATERIAL+REASON_LINK)
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