Commit 032bd407 authored by Grajade's avatar Grajade

Update c66917001.lua

parent b495120b
Pipeline #8807 passed with stage
in 33 seconds
...@@ -27,104 +27,94 @@ end ...@@ -27,104 +27,94 @@ end
function cm.thfilter1(c) function cm.thfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end end
function cm.spfilter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial()
end
function cm.spfilter1(c,e) function cm.spfilter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function cm.spfilter2(c,e,tp,m,f,chkf) function cm.spfilter2(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,66917000) and (not f or f(c)) if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,66917000) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.starlight_fusion_check or cm.fcheck aux.FCheckAdditional=c.starlight_fusion_check or c66917001.fcheck
local res=c:CheckFusionMaterial(m,nil,chkf) local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil aux.FCheckAdditional=nil
return res return res
end end
function cm.fcheck(tp,sg,fc) function cm.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionCode,1,nil,66917000) return sg:IsExists(Card.IsFusionCode,1,nil,66917000)
end
function cm.spfilter3(c,e,tp,chkf,rc)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,66917000)) then return false end
if Duel.GetLocationCountFromEx(tp,tp,rc,c)<=0 then return false end
local mg=Duel.GetMatchingGroup(cm.spfilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
local res=cm.spfilter2(c,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=cm.spfilter2(c,e,tp,mg,mf,chkf)
end
end
return res
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,66917008,0,0x4011,0,0,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT,POS_FACEUP) and Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end and Duel.IsPlayerCanSpecialSummonMonster(tp,66917008,0,0x4011,0,0,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT,POS_FACEUP) and Duel.IsExistingTarget(cm.thfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.thfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,cm.thfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,66917008,0,0x4011,0,0,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT,POS_FACEUP) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,66917008,0,0x4011,0,0,4,RACE_SPELLCASTER,ATTRIBUTE_LIGHT,POS_FACEUP) then return end
local token=Duel.CreateToken(tp,66917008) local token=Duel.CreateToken(tp,66917008)
if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(tc:GetAttribute()) e1:SetValue(tc:GetAttribute())
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1) token:RegisterEffect(e1)
local f=function(ee) local f=function(ee)
Duel.SendtoGrave(ee:GetHandler(),REASON_RULE) Duel.SendtoGrave(ee:GetHandler(),REASON_RULE)
end end
local e2=Effect.CreateEffect(token) local e2=Effect.CreateEffect(token)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_DELAY|EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_CANNOT_INACTIVATE|EFFECT_FLAG_CANNOT_NEGATE|EFFECT_FLAG_DAMAGE_STEP|EFFECT_FLAG_DAMAGE_CAL|EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_DELAY|EFFECT_FLAG_IGNORE_IMMUNE|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_CANNOT_INACTIVATE|EFFECT_FLAG_CANNOT_NEGATE|EFFECT_FLAG_DAMAGE_STEP|EFFECT_FLAG_DAMAGE_CAL|EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAIN_END) e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(f) e2:SetOperation(f)
token:RegisterEffect(e2) token:RegisterEffect(e2)
local chkf=tp local chkf=tp
if not Duel.IsExistingMatchingCard(cm.spfilter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,chkf,e:GetHandler()) or not Duel.IsPlayerCanSpecialSummonCount(tp,1) then return end local mg1=Duel.GetFusionMaterial(tp):Filter(c66917001.spfilter1,nil,e)
if Duel.SelectYesNo(tp,aux.Stringid(m,2)) then local res=Duel.IsExistingMatchingCard(c66917001.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT) if not res then
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter3),tp,LOCATION_EXTRA,0,1,1,nil,e,tp,chkf,nil) local ce=Duel.GetChainMaterial(tp)
local tc=g:GetFirst() if ce~=nil then
if tc and tc:IsLocation(LOCATION_EXTRA) then local fgroup=ce:GetTarget()
local mg1=Duel.GetMatchingGroup(cm.spfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e) local mg2=fgroup(ce,e,tp)
local mgchk1=cm.spfilter2(tc,e,tp,mg1,nil,chkf) local mf=ce:GetValue()
local mg2=nil res=Duel.IsExistingMatchingCard(c66917001.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
local mgchk2=false end
local ce=Duel.GetChainMaterial(tp) end
if ce~=nil then if res and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local fgroup=ce:GetTarget() local sg1=Duel.GetMatchingGroup(c66917001.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
mg2=fgroup(ce,e,tp) local mg3=nil
local mf=ce:GetValue() local sg2=nil
mgchk2=cm.spfilter2(tc,e,tp,mg2,mf,chkf) local ce=Duel.GetChainMaterial(tp)
end if ce~=nil then
if mgchk1 or mgchk2 then local fgroup=ce:GetTarget()
if mgchk1 and (not mgchk2 or not Duel.SelectYesNo(tp,ce:GetDescription())) then mg3=fgroup(ce,e,tp)
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mf=ce:GetValue()
tc:SetMaterial(mat1) sg2=Duel.GetMatchingGroup(c66917001.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) end
Duel.BreakEffect() if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) local sg=sg1:Clone()
else if sg2 then sg:Merge(sg2) end
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local fop=ce:GetOperation() local tg=sg:Select(tp,1,1,nil)
fop(ce,e,tp,tc,mat2) local tc=tg:GetFirst()
end aux.FCheckAdditional=tc.starlight_fusion_check or c66917001.fcheck
tc:CompleteProcedure() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
end local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
end tc:SetMaterial(mat1)
else Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
end Duel.BreakEffect()
end Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
end
end end
function cm.mfilter(c) function cm.mfilter(c)
return c:IsCode(66917000) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_TUNER) return c:IsCode(66917000) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_TUNER)
......
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