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,8 +208,26 @@ function cm.CheckGroup(g,f,cg,min,max,...) ...@@ -205,8 +208,26 @@ 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 ct=sg:GetCount()
local res=(ct>=min and ct<=max and f(sg,table.unpack(ext_params)))
or (ct<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params))
sg:RemoveCard(c)
return res
end
function cm.CheckGroup(g,f,cg,min,max,...)
local min=min or 1
local max=max or g:GetCount()
if min>max then return false end
local ext_params={...}
local sg=Group.CreateGroup()
if cg then sg:Merge(cg) end
local ct=sg:GetCount()
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)
end
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
local min=min or 1 local min=min or 1
local max=max or g:GetCount() local max=max or g:GetCount()
local ext_params={...} local ext_params={...}
...@@ -233,8 +254,8 @@ if Group.SelectUnselect then ...@@ -233,8 +254,8 @@ if Group.SelectUnselect then
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end end
return sg return sg
end end
function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...) function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
local min=min or 1 local min=min or 1
local max=max or g:GetCount() local max=max or g:GetCount()
local ext_params={...} local ext_params={...}
...@@ -265,37 +286,6 @@ if Group.SelectUnselect then ...@@ -265,37 +286,6 @@ if Group.SelectUnselect then
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params) ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end end
return sg return sg
end
else
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
local min=min or 1
local max=max or g:GetCount()
local ext_params={...}
local sg=Group.CreateGroup()
if cg then
sg:Merge(cg)
end
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 minc=1
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
return sg
end
function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
end
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
...@@ -588,3 +578,23 @@ function cm.SanaeCost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -588,3 +578,23 @@ function cm.SanaeCost(e,tp,eg,ep,ev,re,r,rp,chk)
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
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