Commit 25f9367a authored by Huangnan's avatar Huangnan

fix

parent 97647dcb
Pipeline #38078 passed with stages
in 48 minutes and 32 seconds
......@@ -71,7 +71,7 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:Select(tp,1,1,nil):GetFirst()
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -74,7 +74,7 @@ function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:Select(tp,1,1,nil):GetFirst()
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -74,7 +74,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:Select(tp,1,1,nil):GetFirst()
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
......
......@@ -38,75 +38,19 @@ function c16401515.initial_effect(c)
--synchro level
local e33=Effect.CreateEffect(c)
e33:SetType(EFFECT_TYPE_SINGLE)
e33:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e33:SetValue(1)
e33:SetTarget(c16401515.syntg)
e33:SetOperation(c16401515.synop)
e33:SetCode(EFFECT_SYNCHRO_LEVEL)
e33:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e33:SetRange(LOCATION_ONFIELD)
e33:SetValue(c16401515.slevel)
c:RegisterEffect(e33)
--
local e34=Effect.CreateEffect(c)
e34:SetType(EFFECT_TYPE_SINGLE)
e34:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e34:SetCode(16401515)
e34:SetRange(LOCATION_MZONE)
c:RegisterEffect(e34)
end
function c16401515.cardiansynlevel(c,sc)
if c:IsHasEffect(16401515) and sc:IsSetCard(0x6ce1) then
return 4+(1<<16)
function c16401515.slevel(e,c)
if c:IsAttribute(ATTRIBUTE_WATER) then
return e:GetHandler():GetLevel()+4*65536
else
return c:GetSynchroLevel(sc)
return e:GetHandler():GetLevel()
end
end
function c16401515.synfilter(c,syncard,tuner,f)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function c16401515.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=c16401515.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(c16401515.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function c16401515.syngoal(g,tp,lv,syncard,minc,ct)
return ct>=minc and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and (g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
or g:CheckWithSumEqual(c16401515.cardiansynlevel,lv,ct,ct,syncard))
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
end
function c16401515.syntg(e,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local tp=syncard:GetControler()
local lv=syncard:GetLevel()
if lv<=c:GetLevel() and lv<=c16401515.cardiansynlevel(c) then return false end
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(c16401515.synfilter,c,syncard,c,f)
return mg:IsExists(c16401515.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end
function c16401515.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local lv=syncard:GetLevel()
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(c16401515.synfilter,c,syncard,c,f)
for i=1,maxc do
local cg=mg:Filter(c16401515.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c16401515.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,1,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end
function c16401515.xyzlv(e,c,rc)
if rc:IsSetCard(0x6ce1) then
return c:GetLevel()+0x10000*e:GetLabel()
......
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