Commit 7a5e14f7 authored by GuGu's avatar GuGu

Update c22249.lua

parent 37af53b4
Pipeline #33331 passed with stage
in 12 seconds
......@@ -20,8 +20,11 @@ function c22249.initial_effect(c)
end
function c22249.filter0(c)
return ((c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_FIRE+ATTRIBUTE_WATER+ATTRIBUTE_DARK))
or c:IsSetCard(0x178,0x179,0x184) or c:IsFusionCode(22200)
or (c:IsSetCard(0x178,0x179,0x180,0x181,0x182,0x183,0x184) and not c:IsLocation(LOCATION_DECK)))
or c:IsCode(22131,22132,22162,22191,22200))
and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c22249.filter00(c)
return c:IsCode(22131,22132,22133,22134,22135,22161,22162,22191,22200)
and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c22249.filter1(c,e)
......@@ -36,29 +39,19 @@ end
function c22249.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 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 e7=e1:Clone()
e7:SetCode(22161)
Duel.RegisterEffect(e7,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(c22249.filter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,nil)
local mg2=Duel.GetMatchingGroup(c22249.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local mg22=Duel.GetMatchingGroup(c22249.filter00,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
mg1:Merge(mg22)
local res=Duel.IsExistingMatchingCard(c22249.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -70,40 +63,26 @@ function c22249.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
--flag reset
e1:Reset()
e4:Reset()
e5:Reset()
e6:Reset()
e7:Reset()
e101:Reset()
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22249.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 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 e7=e1:Clone()
e7:SetCode(22161)
Duel.RegisterEffect(e7,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(c22249.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c22249.filter0,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_DECK,0,nil)
local mg2=Duel.GetMatchingGroup(c22249.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mg2)
local mg22=Duel.GetMatchingGroup(c22249.filter00,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
mg1:Merge(mg22)
local sg1=Duel.GetMatchingGroup(c22249.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
......@@ -134,11 +113,7 @@ function c22249.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure()
end
--flag reset
e1:Reset()
e4:Reset()
e5:Reset()
e6:Reset()
e7:Reset()
e101:Reset()
end
function c22249.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