Commit 40baa6fc authored by 聖園ミカ's avatar 聖園ミカ 🐟

man!

parent 4ccd57de
No preview for this file type
--乐在其中·双叶
local m=81021035
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
--add to hand
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOHAND)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e0:SetProperty(EFFECT_FLAG_DELAY)
e0:SetCode(EVENT_TO_DECK)
e0:SetRange(LOCATION_PZONE)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.thcon)
e0:SetTarget(cm.thtg)
e0:SetOperation(cm.thop)
c:RegisterEffect(e0)
--ritual summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(cm.rscost)
e1:SetTarget(cm.rstg)
e1:SetOperation(cm.rsop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_PAY_LPCOST)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+900)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
end
function cm.cfilter(c,tp)
return c:IsLocation(LOCATION_EXTRA) and c:IsControler(tp)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x818) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.rsfilter(c)
return c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsSetCard(0x818) and c:IsAbleToGraveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function cm.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.rstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.rsfilter,tp,LOCATION_DECK,0,1,nil) and Duel.CheckLPCost(tp,1000)
end
e:SetLabel(0)
Duel.PayLPCost(tp,1000)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.rsfilter,tp,LOCATION_DECK,0,1,1,nil)
local te=g:GetFirst():CheckActivateEffect(true,true,false)
e:SetLabelObject(te)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
Duel.ClearOperationInfo(0)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_EXTRA)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #g==0 then return end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
Duel.ShuffleExtra(1-tp)
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