Commit 2c63729d authored by GuGu's avatar GuGu

Update c19500039.lua

parent 99d04bb6
Pipeline #32901 passed with stage
in 7 seconds
......@@ -23,30 +23,15 @@ function c19500039.initial_effect(c)
e1:SetOperation(c19500039.drop)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19500039,5))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c19500039.sccost)
e2:SetTarget(c19500039.sctg)
e2:SetOperation(c19500039.scop)
c:RegisterEffect(e2)
if not c19500039.global_check then
c19500039.global_check=true
c19500039[0]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(c19500039.acop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetCountLimit(1)
ge2:SetOperation(c19500039.clear)
Duel.RegisterEffect(ge2,0)
end
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c19500039.spcon)
e1:SetOperation(c19500039.spop)
c:RegisterEffect(e1)
end
--e1
function c19500039.SelfRemoveCost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -71,55 +56,17 @@ function c19500039.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(p,d,REASON_EFFECT)
end
--E2
function c19500039.cfilter(c)
return c:IsSetCard(0x186) and c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
end
function c19500039.acop(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c19500039.cfilter,nil)
if ct>0 then
c19500039[0]=c19500039[0]+ct
end
end
function c19500039.clear(e,tp,eg,ep,ev,re,r,rp)
c19500039[0]=0
end
--function c19500039.spcon(e,c)
-- if c==nil then return true end
--local tp=c:GetControler()
--return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c19500039[0]>6
--end
function c19500039.fselect(g)
return g:GetClassCount(Card.GetOriginalCode)==g:GetCount()
function c19500039.spfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsSetCard(0x186)
end
function c19500039.costfilter(c,code)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE) and c:IsAbleToRemoveAsCost() and not c:IsCode(code)
function c19500039.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c19500039.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c19500039.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local code=c:GetAttribute()
local g=Duel.GetMatchingGroup(c19500039.costfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),code)
if chk==0 then return g:CheckSubGroup(c19500039.fselect,6,6) end
function c19500039.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c19500039.fselect,false,6,6)
rg:AddCard(c)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c19500039.filter(c,e,tp)
return c:IsCode(19500038) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c19500039.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19500039)==0 and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL)
and Duel.IsExistingMatchingCard(c19500039.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.RegisterFlagEffect(tp,19500039,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c19500039.scop(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_SMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19500039.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
local g=Duel.SelectMatchingCard(tp,c19500039.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
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