Commit 0f510119 authored by nanahira's avatar nanahira
parents 97adab0a 9d6689df
...@@ -175,9 +175,12 @@ function cm.ClariSRankFilter(c,xyzc) ...@@ -175,9 +175,12 @@ function cm.ClariSRankFilter(c,xyzc)
return c:IsSetCard(0x570) and c:IsXyzType(TYPE_XYZ) and c:GetRank()==2 return c:IsSetCard(0x570) and c:IsXyzType(TYPE_XYZ) and c:GetRank()==2
end end
function cm.ClariSXyzValue(c) function cm.ClariSXyzValue(c)
local v=1 local eset={c:IsHasEffect(57300021)}
if c:IsHasEffect(57300021) then v=v+0x20000 end for _,te in ipairs(eset) do
return v local g=te:GetLabelObject()
if not g or not g:IsContains(c) then return 0x20001 end
end
return 1
end end
function cm.ClariSXyzCheck(ct) function cm.ClariSXyzCheck(ct)
return function(g,xyzc) return function(g,xyzc)
...@@ -205,97 +208,84 @@ function cm.CheckGroup(g,f,cg,min,max,...) ...@@ -205,97 +208,84 @@ function cm.CheckGroup(g,f,cg,min,max,...)
if ct>=min and ct<=max and f(sg,...) then return true end if ct>=min and ct<=max and f(sg,...) then return true end
return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params) return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params)
end end
if Group.SelectUnselect then function cm.CheckGroupRecursive(c,sg,g,f,min,max,ext_params)
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...) sg:AddCard(c)
local min=min or 1 local ct=sg:GetCount()
local max=max or g:GetCount() local res=(ct>=min and ct<=max and f(sg,table.unpack(ext_params)))
local ext_params={...} or (ct<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params))
local sg=Group.CreateGroup() sg:RemoveCard(c)
local cg=cg or Group.CreateGroup() return res
sg:Merge(cg) end
local ct=sg:GetCount() function cm.CheckGroup(g,f,cg,min,max,...)
local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) local min=min or 1
while ct<max and ag:GetCount()>0 do local max=max or g:GetCount()
local finish=(ct>=min and ct<=max and f(sg,...)) if min>max then return false end
local seg=sg:Clone() local ext_params={...}
local dmin=min-cg:GetCount() local sg=Group.CreateGroup()
local dmax=math.min(max-cg:GetCount(),g:GetCount()) if cg then sg:Merge(cg) end
seg:Sub(cg) local ct=sg:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,desc) if ct>=min and ct<=max and f(sg,...) then return true end
local tc=ag:SelectUnselect(seg,tp,finish,finish,dmin,dmax) return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params)
if not tc then break end end
if sg:IsContains(tc) then function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
sg:RemoveCard(tc) local min=min or 1
else local max=max or g:GetCount()
sg:AddCard(tc) local ext_params={...}
end local sg=Group.CreateGroup()
ct=sg:GetCount() local cg=cg or Group.CreateGroup()
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) sg:Merge(cg)
end local ct=sg:GetCount()
return sg local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end while ct<max and ag:GetCount()>0 do
function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...) local finish=(ct>=min and ct<=max and f(sg,...))
local min=min or 1 local seg=sg:Clone()
local max=max or g:GetCount() local dmin=min-cg:GetCount()
local ext_params={...} local dmax=math.min(max-cg:GetCount(),g:GetCount())
local sg=Group.CreateGroup() seg:Sub(cg)
local cg=cg or Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,desc)
sg:Merge(cg) local tc=ag:SelectUnselect(seg,tp,finish,finish,dmin,dmax)
local ct=sg:GetCount() if not tc then break end
local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) if sg:IsContains(tc) then
while ct<max and ag:GetCount()>0 do sg:RemoveCard(tc)
local finish=(ct>=min and ct<=max and f(sg,...)) else
local cancel=finish or ct==0 sg:AddCard(tc)
local seg=sg:Clone()
local dmin=min-cg:GetCount()
local dmax=math.min(max-cg:GetCount(),g:GetCount())
seg:Sub(cg)
Duel.Hint(HINT_SELECTMSG,tp,desc)
local tc=ag:SelectUnselect(seg,tp,finish,cancel,dmin,dmax)
if not tc then
if not finish then return end
break
end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
ct=sg:GetCount()
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end end
return sg ct=sg:GetCount()
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end end
else return sg
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...) end
local min=min or 1 function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
local max=max or g:GetCount() local min=min or 1
local ext_params={...} local max=max or g:GetCount()
local sg=Group.CreateGroup() local ext_params={...}
if cg then local sg=Group.CreateGroup()
sg:Merge(cg) local cg=cg or Group.CreateGroup()
sg:Merge(cg)
local ct=sg:GetCount()
local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
while ct<max and ag:GetCount()>0 do
local finish=(ct>=min and ct<=max and f(sg,...))
local cancel=finish or ct==0
local seg=sg:Clone()
local dmin=min-cg:GetCount()
local dmax=math.min(max-cg:GetCount(),g:GetCount())
seg:Sub(cg)
Duel.Hint(HINT_SELECTMSG,tp,desc)
local tc=ag:SelectUnselect(seg,tp,finish,cancel,dmin,dmax)
if not tc then
if not finish then return end
break
end end
local ct=sg:GetCount() if sg:IsContains(tc) then
local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) sg:RemoveCard(tc)
while ct<max and ag:GetCount()>0 do else
local minc=1 sg:AddCard(tc)
local finish=(ct>=min and ct<=max and f(sg,...))
if finish then
minc=0
if cm.master_rule_3_flag and not Duel.SelectYesNo(tp,210) then break end
end
Duel.Hint(HINT_SELECTMSG,tp,desc)
local tg=ag:Select(tp,minc,1,nil)
if tg:GetCount()==0 then break end
sg:Merge(tg)
ct=sg:GetCount()
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end end
return sg ct=sg:GetCount()
end ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
end end
return sg
end end
function cm.exgoal(g,tp,fc) function cm.exgoal(g,tp,fc)
return Duel.GetLocationCountFromEx(tp,tp,g,fc)>0 return Duel.GetLocationCountFromEx(tp,tp,g,fc)>0
...@@ -587,4 +577,24 @@ function cm.SanaeCost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -587,4 +577,24 @@ function cm.SanaeCost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.SanaeCostFilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.SanaeCostFilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
\ No newline at end of file function cm.AddSummonMusic(c,desc,stype)
if c:IsStatus(STATUS_COPYING_EFFECT) or Senya.master_rule_3_flag then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
if stype then
e1:SetCondition(cm.SummonTypeCondition(stype))
end
e1:SetOperation(function()
Duel.Hint(11,0,desc)
end)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
function c57300012.initial_effect(c) function c57300012.initial_effect(c)
xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end) xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end)
miyuki.AddXyzProcedureClariS(c,3) miyuki.AddXyzProcedureClariS(c,3)
miyuki.AddSummonMusic(c,m*16+1,SUMMON_TYPE_XYZ)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(57300012,0)) e2:SetDescription(aux.Stringid(57300012,0))
e2:SetCategory(CATEGORY_REMOVE) e2:SetCategory(CATEGORY_REMOVE)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
function c57300022.initial_effect(c) function c57300022.initial_effect(c)
xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end) xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end)
miyuki.AddXyzProcedureClariS(c,3) miyuki.AddXyzProcedureClariS(c,3)
miyuki.AddSummonMusic(c,m*16,SUMMON_TYPE_XYZ)
local ex=Effect.CreateEffect(c) local ex=Effect.CreateEffect(c)
ex:SetType(EFFECT_TYPE_SINGLE) ex:SetType(EFFECT_TYPE_SINGLE)
ex:SetCode(57300022) ex:SetCode(57300022)
......
...@@ -3,6 +3,7 @@ function c57300023.initial_effect(c) ...@@ -3,6 +3,7 @@ function c57300023.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end) xpcall(function() require("expansions/script/c57300000") end,function() require("script/c57300000") end)
miyuki.AddXyzProcedureClariS(c,2) miyuki.AddXyzProcedureClariS(c,2)
miyuki.AddSummonMusic(c,m*16+1,SUMMON_TYPE_XYZ)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_HANDES) e1:SetCategory(CATEGORY_HANDES)
e1:SetDescription(aux.Stringid(57300023,0)) e1:SetDescription(aux.Stringid(57300023,0))
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
local m=57300027 local m=57300027
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
miyuki.AddSummonMusic(c,m*16+1,SUMMON_TYPE_LINK)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x570),2,2) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x570),2,2)
c:EnableReviveLimit() c:EnableReviveLimit()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -13,16 +14,39 @@ function cm.initial_effect(c) ...@@ -13,16 +14,39 @@ function cm.initial_effect(c)
e2:SetCondition(cm.rmcon) e2:SetCondition(cm.rmcon)
e2:SetOperation(cm.rmop) e2:SetOperation(cm.rmop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local g=Group.CreateGroup()
g:KeepAlive()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(57300021) e1:SetCode(57300021)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetLabelObject(g)
e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(function(e,c) e1:SetTarget(function(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) return e:GetHandler():GetLinkedGroup():IsContains(c) and Duel.GetFlagEffect(e:GetHandlerPlayer(),m)==0
end) end)
e1:SetValue(1) e1:SetValue(1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetLabelObject(e1)
e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0xff,0xff)
e3:SetValue(function(e,c)
if not c:IsType(TYPE_XYZ) or not c:IsSetCard(0x570) or Duel.GetFlagEffect(e:GetHandlerPlayer(),m)>0 then return end
local rg=e:GetLabelObject():GetLabelObject()
local g=c:GetMaterial()
local check1=c:IsXyzSummonable(g,g:GetCount(),g:GetCount())
rg:Merge(g)
local check2=c:IsXyzSummonable(g,g:GetCount(),g:GetCount())
rg:Clear()
if check1 and not check2 then
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
end
end)
c:RegisterEffect(e3)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsSetCard(0x570) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x570) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
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