Commit c1ebb0e4 authored by Tachibana's avatar Tachibana

eme

parent d6fda13f
Pipeline #6264 passed with stages
in 21 minutes and 4 seconds
--周子·青之绘本 --周子·青之绘本
function c81040030.initial_effect(c) local m=81040030
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,81040030) e1:SetCountLimit(1,m)
e1:SetTarget(c81040030.target) e1:SetTarget(cm.target)
e1:SetOperation(c81040030.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -15,66 +18,49 @@ function c81040030.initial_effect(c) ...@@ -15,66 +18,49 @@ function c81040030.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,81040930) e2:SetCountLimit(1,m+900)
e2:SetCondition(aux.exccon) e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost) e2:SetCost(aux.bfgcost)
e2:SetTarget(c81040030.drtg) e2:SetTarget(cm.drtg)
e2:SetOperation(c81040030.drop) e2:SetOperation(cm.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c81040030.filter(c,e,tp,m1,m2,ft) function cm.filter(c,e,tp)
if not c:IsSetCard(0x81c) or bit.band(c:GetType(),0x81)~=0x81 return c:IsSetCard(0x81c)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
else
return ft>-1 and mg:IsExists(c81040030.mfilterf,1,nil,tp,mg,c)
end
end
function c81040030.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end
end end
function c81040030.mfilter(c) function cm.mfilter(c)
return c:GetLevel()>0 and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x81c) and c:IsAbleToDeck() return c:GetLevel()>0 and c:IsSetCard(0x81c) and c:IsAbleToDeck() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end end
function c81040030.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c81040030.mfilter,tp,LOCATION_REMOVED,0,nil) local mg2=Duel.GetMatchingGroup(cm.mfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,cm.filter,e,tp,mg1,mg2,Card.GetLevel,"Equal")
return Duel.IsExistingMatchingCard(c81040030.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end end
function c81040030.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c81040030.mfilter,tp,LOCATION_REMOVED,0,nil) local mg2=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.mfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c81040030.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local g=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,cm.filter,e,tp,mg1,mg2,Card.GetLevel,"Equal")
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2) mg:Merge(mg2)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c81040030.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_REMOVED):Filter(Card.IsSetCard,nil,0x81c) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE+LOCATION_REMOVED):Filter(Card.IsSetCard,nil,0x81c)
mat:Sub(mat2) mat:Sub(mat2)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.SendtoDeck(mat2,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.SendtoDeck(mat2,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
...@@ -83,19 +69,19 @@ function c81040030.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,19 +69,19 @@ function c81040030.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function c81040030.tdfilter(c) function cm.tdfilter(c)
return c:IsSetCard(0x81c) and c:IsAbleToDeck() and not c:IsCode(81040030) return c:IsSetCard(0x81c) and c:IsAbleToDeck() and not c:IsCode(m)
end end
function c81040030.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c81040030.tdfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c81040030.tdfilter,tp,LOCATION_REMOVED,0,3,nil) end and Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_REMOVED,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c81040030.tdfilter,tp,LOCATION_REMOVED,0,3,3,nil) local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_REMOVED,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function c81040030.drop(e,tp,eg,ep,ev,re,r,rp) function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT) Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
......
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