Commit 4b59a4a0 authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent 08fde6ab
--MS-765·北上丽花
local m=81015010
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function c81015010.initial_effect(c)
function cm.initial_effect(c)
--summon limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_SUMMON)
e0:SetCondition(aux.NOT(Tenka.ReikaCon))
e0:SetCondition(cm.sumcon)
c:RegisterEffect(e0)
--spsummon limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(Tenka.ReikaCon)
e1:SetValue(cm.sumlimit)
c:RegisterEffect(e1)
--summon with no tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(81015010,0))
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetCondition(c81015010.ntcon)
e2:SetCondition(cm.ntcon)
c:RegisterEffect(e2)
--synchro level
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e3:SetTarget(c81015010.syntg)
e3:SetTarget(cm.syntg)
e3:SetValue(1)
e3:SetOperation(c81015010.synop)
e3:SetOperation(cm.synop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
......@@ -37,52 +39,61 @@ function c81015010.initial_effect(c)
e4:SetRange(LOCATION_MZONE)
c:RegisterEffect(e4)
end
function c81015010.ntcon(e,c,minc)
function cm.confilter(c)
return c:GetSequence()<5
end
function cm.sumcon(e)
return Duel.GetMatchingGroupCount(cm.confilter,e:GetHandler():GetControler(),LOCATION_SZONE,0,nil)>0
end
function cm.sumlimit(e,se,sp,st,pos,tp)
return Duel.GetMatchingGroupCount(cm.confilter,sp,LOCATION_SZONE,0,nil)==0
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c81015010.cardiansynlevel(c)
function cm.cardiansynlevel(c)
return 3
end
function c81015010.synfilter(c,syncard,tuner,f)
function cm.synfilter(c,syncard,tuner,f)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end
function c81015010.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
function cm.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
g:AddCard(c)
local ct=g:GetCount()
local res=c81015010.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(c81015010.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
local res=cm.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end
function c81015010.syngoal(g,tp,lv,syncard,minc,ct)
function cm.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(c81015010.cardiansynlevel,lv,ct,ct,syncard))
or g:CheckWithSumEqual(cm.cardiansynlevel,lv,ct,ct,syncard))
end
function c81015010.syntg(e,syncard,f,min,max)
function cm.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<=c81015010.cardiansynlevel(c) then return false end
if lv<=c:GetLevel() and lv<=cm.cardiansynlevel(c) then return false end
local g=Group.FromCards(c)
local mg=Duel.GetMatchingGroup(c81015010.synfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return mg:IsExists(c81015010.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
local mg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
return mg:IsExists(cm.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end
function c81015010.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
function cm.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.GetMatchingGroup(c81015010.synfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
local mg=Duel.GetMatchingGroup(cm.synfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
for i=1,maxc do
local cg=mg:Filter(c81015010.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
local cg=mg:Filter(cm.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c81015010.syngoal(g,tp,lv,syncard,minc,i) then
if cm.syngoal(g,tp,lv,syncard,minc,i) then
if not Duel.SelectYesNo(tp,210) then break end
minct=0
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