Commit 73af6b9e authored by GuGu's avatar GuGu

Update c22251.lua

parent c2fd47f8
Pipeline #33333 passed with stage
in 7 seconds
......@@ -20,8 +20,11 @@ function c22251.initial_effect(c)
end
function c22251.filter0(c)
return ((c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK))
or c:IsSetCard(0x183,0x184) or c:IsFusionCode(22200)
or (c:IsSetCard(0x178,0x179,0x180,0x181,0x182,0x183,0x184) and not c:IsLocation(LOCATION_DECK)))
or c:IsCode(22161,22162,22200))
and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c22251.filter00(c)
return c:IsCode(22131,22132,22133,22134,22135,22161,22162,22191,22200)
and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c22251.filter1(c,e)
......@@ -36,32 +39,19 @@ end
function c22251.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
--effect flag
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(22249)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(22131)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(22132)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(22133)
Duel.RegisterEffect(e4,tp)
local e5=e1:Clone()
e5:SetCode(22134)
Duel.RegisterEffect(e5,tp)
local e6=e1:Clone()
e6:SetCode(22135)
Duel.RegisterEffect(e6,tp)
local e101=Effect.CreateEffect(e:GetHandler())
e101:SetType(EFFECT_TYPE_FIELD)
e101:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e101:SetCode(22249)
e101:SetTargetRange(1,0)
Duel.RegisterEffect(e101,tp)
--
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(c22251.filter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,nil)
local mg2=Duel.GetMatchingGroup(c22251.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local mg22=Duel.GetMatchingGroup(c22251.filter00,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
mg1:Merge(mg22)
local res=Duel.IsExistingMatchingCard(c22251.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -73,44 +63,26 @@ function c22251.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
--flag reset
e1:Reset()
e2:Reset()
e3:Reset()
e4:Reset()
e5:Reset()
e6:Reset()
e101:Reset()
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22251.activate(e,tp,eg,ep,ev,re,r,rp)
--effect flag
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(22249)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(22131)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(22132)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(22133)
Duel.RegisterEffect(e4,tp)
local e5=e1:Clone()
e5:SetCode(22134)
Duel.RegisterEffect(e5,tp)
local e6=e1:Clone()
e6:SetCode(22135)
Duel.RegisterEffect(e6,tp)
local e101=Effect.CreateEffect(e:GetHandler())
e101:SetType(EFFECT_TYPE_FIELD)
e101:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e101:SetCode(22249)
e101:SetTargetRange(1,0)
Duel.RegisterEffect(e101,tp)
--
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c22251.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c22251.filter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,nil)
local mg2=Duel.GetMatchingGroup(c22251.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local mg22=Duel.GetMatchingGroup(c22251.filter00,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
mg1:Merge(mg22)
local sg1=Duel.GetMatchingGroup(c22251.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -141,12 +113,7 @@ function c22251.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure()
end
--flag reset
e1:Reset()
e2:Reset()
e3:Reset()
e4:Reset()
e5:Reset()
e6:Reset()
e101:Reset()
end
function c22251.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() 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