Commit 157974e1 authored by nanahira's avatar nanahira

Auto Push by Nanahira

parent 5ff1fc69
...@@ -118,6 +118,10 @@ end ...@@ -118,6 +118,10 @@ end
function cm.goal(g,tp,lv,syncard,tuc) function cm.goal(g,tp,lv,syncard,tuc)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g:IsExists(Card.IsLocation,2,tuc,LOCATION_HAND) then return false end if tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g:IsExists(Card.IsLocation,2,tuc,LOCATION_HAND) then return false end
local pe={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)}
for _,te in ipairs(pe) do
if not g:IsContains(te:GetHandler()) then return false end
end
local ct=g:GetCount() local ct=g:GetCount()
return g:CheckWithSumEqual(cm.val,lv,ct,ct,syncard) return g:CheckWithSumEqual(cm.val,lv,ct,ct,syncard)
end end
...@@ -139,13 +143,10 @@ function cm.syncon(e,c,tuner,mg) ...@@ -139,13 +143,10 @@ function cm.syncon(e,c,tuner,mg)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c)
end end
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)
local lv=c:GetLevel() local lv=c:GetLevel()
local sg=nil local sg=nil
if tuner then if tuner then
return cm.matfilter1(c,tp) and cm.synfilter(tuner,c,lv,g2,g3,minc,maxc,tp) return cm.matfilter1(c,tp) and cm.synfilter(tuner,c,lv,g2,g3,minc,maxc,tp)
elseif pe then
return cm.matfilter1(pe:GetOwner(),tp) and cm.synfilter(pe:GetOwner(),c,lv,g2,g3,minc,maxc,tp)
else else
return g1:IsExists(cm.synfilter,1,nil,c,lv,g2,g3,minc,maxc,tp) return g1:IsExists(cm.synfilter,1,nil,c,lv,g2,g3,minc,maxc,tp)
end end
...@@ -165,20 +166,14 @@ function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg) ...@@ -165,20 +166,14 @@ function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c)
end end
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)
local lv=c:GetLevel() local lv=c:GetLevel()
local tuc=nil local tuc=nil
if tuner then if tuner then
tuner=tuc tuner=tuc
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
if not pe then local t1=g1:FilterSelect(tp,cm.synfilter,1,1,nil,c,lv,g2,g3,minc,maxc,tp)
local t1=g1:FilterSelect(tp,cm.synfilter,1,1,nil,c,lv,g2,g3,minc,maxc,tp) tuc=t1:GetFirst()
tuc=t1:GetFirst()
else
tuc=pe:GetOwner()
Group.FromCards(tuc):Select(tp,1,1,nil)
end
end end
tuc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1) tuc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1)
local tsg=tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2 local tsg=tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2
......
...@@ -7,21 +7,7 @@ function cm.initial_effect(c) ...@@ -7,21 +7,7 @@ function cm.initial_effect(c)
Senya.Nanahira(c) Senya.Nanahira(c)
Senya.AddSummonMusic(c,m*16+1,SUMMON_TYPE_LINK) Senya.AddSummonMusic(c,m*16+1,SUMMON_TYPE_LINK)
c:EnableReviveLimit() c:EnableReviveLimit()
--[[local e1=Effect.CreateEffect(c) aux.AddLinkProcedure(c,cm.mfilter,2,2,cm.lcheck)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)]]
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.linkcon)
e0:SetOperation(cm.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
...@@ -51,28 +37,11 @@ function cm.initial_effect(c) ...@@ -51,28 +37,11 @@ function cm.initial_effect(c)
e1:SetOperation(cm.operation) e1:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.mfilter(c,lc) function cm.mfilter(c)
return c:IsFaceup() and c:IsCode(37564765) and c:IsCanBeLinkMaterial(lc) return c:IsFaceup() and c:IsCode(37564765)
end end
function cm.lcheck(g,tp,lc) function cm.lcheck(g)
return Duel.GetLocationCountFromEx(tp,tp,g,lc)>0 and g:IsExists(cm.lfilter,1,nil,g) return g:IsExists(cm.lfilter,1,nil,g)
end
function cm.lfilter(c,g)
local cg=c:GetColumnGroup()
return g:IsExists(function(tc) return cg:IsContains(tc) end,1,c)
end
function cm.linkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,0,nil)
return g:GetCount()>=2 and Senya.CheckGroup(g,cm.lcheck,nil,2,2,tp,c)
end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,0,nil)
local g1=Senya.SelectGroup(tp,HINTMSG_LMATERIAL,g,cm.lcheck,nil,2,2,tp,c)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
end end
function cm.location_check(p,tp,z) function cm.location_check(p,tp,z)
local tz=0 local tz=0
......
...@@ -5,16 +5,7 @@ xpcall(function() require("expansions/script/c37564765") end,function() require( ...@@ -5,16 +5,7 @@ xpcall(function() require("expansions/script/c37564765") end,function() require(
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
Senya.AddSummonMusic(c,m*16+2,SUMMON_TYPE_LINK) Senya.AddSummonMusic(c,m*16+2,SUMMON_TYPE_LINK)
--Senya.CommonEffect_3L(c,m) aux.AddLinkProcedure(c,Senya.check_set_3L,2,2)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.linkcon)
e0:SetOperation(cm.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -26,6 +17,7 @@ function cm.initial_effect(c) ...@@ -26,6 +17,7 @@ function cm.initial_effect(c)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local code=c:GetFlagEffectLabel(m) local code=c:GetFlagEffectLabel(m)
c:ResetFlagEffect(m)
Senya.GainEffect_3L(c,code) Senya.GainEffect_3L(c,code)
end) end)
c:RegisterEffect(e0) c:RegisterEffect(e0)
...@@ -39,31 +31,15 @@ function cm.effect_operation_3L(c) ...@@ -39,31 +31,15 @@ function cm.effect_operation_3L(c)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
return e1 return e1
end end
function cm.linkfilter1(c,tp,ec) function cm.SetMaterial(c,g)
return c:IsFaceup() and Senya.check_set_3L(c) and c:IsCanBeLinkMaterial(ec) and Duel.IsExistingMatchingCard(cm.linkfilter2,tp,LOCATION_MZONE,0,1,c,tp,c,ec) local efg=g:Filter(function(c) return c.effect_operation_3L end,nil)
end
function cm.linkfilter2(c,tp,lc,ec)
return c:IsFaceup() and Senya.check_set_3L(c) and c:IsCanBeLinkMaterial(ec) and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,lc),ec)>0
end
function cm.linkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(cm.linkfilter1,tp,LOCATION_MZONE,0,1,nil,tp,c)
end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectMatchingCard(tp,cm.linkfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
local g2=Duel.SelectMatchingCard(tp,cm.linkfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),tp,g1:GetFirst(),c)
g1:Merge(g2)
local efg=g1:Filter(function(c) return c.effect_operation_3L end,nil)
if efg:GetCount()>0 then if efg:GetCount()>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,m*16) Duel.Hint(HINT_SELECTMSG,tp,m*16)
local tg=efg:Select(tp,1,1,nil) local tg=efg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
Duel.HintSelection(tg) Duel.HintSelection(tg)
e:GetHandler():RegisterFlagEffect(m,0xfe1000,0,1,tc:GetOriginalCode()) c:RegisterFlagEffect(m,0xfe1000,0,1,tc:GetOriginalCode())
end end
c:SetMaterial(g1) return Card.SetMaterial(c,g)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
end end
\ No newline at end of file
...@@ -6,15 +6,7 @@ cm.Senya_name_with_sayuri=true ...@@ -6,15 +6,7 @@ cm.Senya_name_with_sayuri=true
function cm.initial_effect(c) function cm.initial_effect(c)
Senya.AddSummonMusic(c,m*16,SUMMON_TYPE_LINK) Senya.AddSummonMusic(c,m*16,SUMMON_TYPE_LINK)
c:EnableReviveLimit() c:EnableReviveLimit()
local e0=Effect.CreateEffect(c) aux.AddLinkProcedure(c,cm.mfilter,3,3,cm.lcheck)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.linkcon)
e0:SetOperation(cm.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37564765,0)) e3:SetDescription(aux.Stringid(37564765,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
...@@ -27,28 +19,15 @@ function cm.initial_effect(c) ...@@ -27,28 +19,15 @@ function cm.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
Senya.NegateEffectModule(c,1,nil,cm.cost) Senya.NegateEffectModule(c,1,nil,cm.cost)
end end
function cm.mfilter(c,lc) function cm.mfilter(c)
return c:IsFaceup() and Senya.check_set_sayuri(c) and c:IsLinkType(TYPE_RITUAL) and c:IsCanBeLinkMaterial(lc) return c:IsFaceup() and Senya.check_set_sayuri(c) and c:IsLinkType(TYPE_RITUAL)
end end
function cm.lcheck(g,tp,lc) function cm.lcheck(g)
return Duel.GetLocationCountFromEx(tp,tp,g,lc)>0 and not g:IsExists(cm.lfilter,1,nil,g) return not g:IsExists(cm.lfilter,1,nil,g)
end end
function cm.lfilter(c,g) function cm.lfilter(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode()) return g:IsExists(Card.IsCode,1,c,c:GetCode())
end end
function cm.linkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,0,nil)
return g:GetCount()>=3 and Senya.CheckGroup(g,cm.lcheck,nil,3,3,tp,c)
end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_MZONE,0,nil)
local g1=Senya.SelectGroup(tp,HINTMSG_LMATERIAL,g,cm.lcheck,nil,3,3,tp,c)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
end
function cm.cfilter(c,g) function cm.cfilter(c,g)
return g:IsContains(c) return g:IsContains(c)
end 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