Commit 245b8cd0 authored by Grajade's avatar Grajade

Update script/c22201106.lua

parent f92f7054
--未曾预见 --未曾预见
function c22201106.initial_effect(c) function c22201106.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c22201106.target) e1:SetTarget(c22201106.target)
e1:SetOperation(c22201106.activate) e1:SetOperation(c22201106.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c22201106.filter(c) function c22201106.filter(c)
return c:IsFaceup() and c:IsCanOverlay() return c:IsFaceup() and c:IsCanOverlay()
end end
function c22201106.filter2(c,g) function c22201106.filter2(sg)
return g:IsExists(Card.IsOriginalCodeRule,1,c,c:GetOriginalCode()) return sg:GetClassCount(Card.GetOriginalCodeRule)==1
end end
function c22201106.spfilter(c,e,tp,ec) function c22201106.spfilter(c,e,tp)
return c:IsCode(22200122) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,ec,c,0x60)>0 return c:IsCode(22200122) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c,0x60)>0
end end
function c22201106.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22201106.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and c22201106.filter(chkc) end if chkc then return false end
local g=Duel.GetMatchingGroup(c22201106.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) local g=Duel.GetMatchingGroup(c22201106.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local sg=g:Filter(c22201106.filter2,nil,g) if chk==0 then return g:CheckSubGroup(c22201106.filter2,2,2,nil) and Duel.IsExistingMatchingCard(c22201106.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler())
if chk==0 then end
return sg:GetCount()>0 and Duel.IsExistingMatchingCard(c22201106.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
end local hg=g:SelectSubGroup(tp,c22201106.filter2,false,2,2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SetTargetCard(hg)
local hg1=sg:Select(tp,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
local hg2=sg:Filter(Card.IsOriginalCodeRule,hg1:GetFirst(),hg1:GetFirst():GetOriginalCode()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) function c22201106.tfilter(c,e)
hg1:AddCard(hg2:Select(tp,1,1,nil):GetFirst()) return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
Duel.SetTargetCard(hg1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) function c22201106.activate(e,tp,eg,ep,ev,re,r,rp)
end local c=e:GetHandler()
function c22201106.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local c=e:GetHandler() local tc=Duel.SelectMatchingCard(tp,c22201106.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,0x60)>0 then
local tc=Duel.SelectMatchingCard(tp,c22201106.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,e:GetHandler()):GetFirst() local fid=c:GetFieldID()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,0x60)>0 then local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCountLimit(1)
e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetLabel(fid)
e2:SetLabelObject(tc) e2:SetLabelObject(tc)
e2:SetCondition(c22201106.descon) e2:SetCondition(c22201106.descon)
e2:SetOperation(c22201106.desop) e2:SetOperation(c22201106.desop)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL) e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(1) e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true) tc:RegisterEffect(e3,true)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e4,true) tc:RegisterEffect(e4,true)
local e5=e3:Clone() local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL) e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e5,true) tc:RegisterEffect(e5,true)
local e6=e5:Clone() local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e6,true) tc:RegisterEffect(e6,true)
tc:RegisterFlagEffect(22201106,RESET_EVENT+RESETS_STANDARD,0,1) tc:RegisterFlagEffect(22201106,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c22201106.tfilter,nil,e)
if tg:GetCount()<1 then return end if tg:GetCount()>0 then
local tg1=tg:GetFirst():GetOverlayGroup() local dg=Group.CreateGroup()
local tg2=tg:GetNext():GetOverlayGroup() for tc in aux.Next(tg) do
tg1:Merge(tg2) local rg=tc:GetOverlayGroup()
if tg1:GetCount()>0 then if rg:GetCount()>0 then dg:Merge(rg) end
Duel.SendtoGrave(tg1,REASON_RULE) if tc:IsType(TYPE_SPELL+TYPE_TRAP) then tc:CancelToGrave() end
end end
local tc1=tg:GetFirst() if dg:GetCount()>0 then
while tc1 do Duel.SendtoGrave(dg,REASON_RULE)
if tc1:IsType(TYPE_SPELL+TYPE_TRAP) then tc1:CancelToGrave() end end
tc1=tg:GetNext() Duel.Overlay(tc,tg)
end end
Duel.Overlay(tc,tg) local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetValue(tg:GetFirst():GetOriginalCode())
e1:SetValue(tg:GetFirst():GetOriginalCode()) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1)
tc:RegisterEffect(e1) end
end end
end function c22201106.descon(e,tp,eg,ep,ev,re,r,rp)
function c22201106.descon(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject()
local tc=e:GetLabelObject() if tc:GetFlagEffectLabel(22201106)==e:GetLabel() then
if tc:GetFlagEffect(22201106)~=0 then return true
return true else
else e:Reset()
e:Reset() return false
return false end
end end
end function c22201106.desop(e,tp,eg,ep,ev,re,r,rp)
function c22201106.desop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject()
local tc=e:GetLabelObject() Duel.Destroy(tc,REASON_EFFECT)
Duel.Destroy(tc,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