Commit 6b38de03 authored by Amiya's avatar Amiya

新卡

parent 8868f3d2
Pipeline #41984 failed with stages
in 3 minutes and 32 seconds
No preview for this file type
--デス・レジーナ・デーモン
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(aux.ritlimit)
c:RegisterEffect(e0)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetRange(LOCATION_PZONE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetCondition(s.eqcon)
e4:SetValue(s.efilter)
c:RegisterEffect(e4)
end
function s.thfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x45) and c:IsAbleToHand()
end
function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0+0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0+0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToChain() and Duel.Destroy(c,REASON_EFFECT)~=0
and tc:IsRelateToChain() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,nil)
if Duel.Destroy(sg,REASON_EFFECT)~=0
and c:IsRelateToChain()
and c:GetSequence()>4
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.rmfilter),tp,0,LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.rmfilter),tp,0,LOCATION_GRAVE,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
function s.eqcon(e)
return e:GetHandler():GetSequence()>4
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
\ No newline at end of file
--デーモンの簒奪
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.setfilter(c)
return c:IsSetCard(0x45) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function s.ritual_filter(c)
return c:IsFaceupEx() and c:IsType(TYPE_RITUAL) and c:IsSetCard(0x45)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end
local b1=ct>0 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
local mg=Duel.GetRitualMaterial(tp)
local b2=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,s.rfilter,e,tp,mg,nil,Card.GetLevel,"Greater")
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(id,0),1},
{b2,aux.Stringid(id,1),2})
e:SetLabel(op)
if op==1 then
if e:IsCostChecked() then
e:SetCategory(0)
end
elseif op==2 then
if e:IsCostChecked() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_EXTRA)
end
end
function s.rfilter(c,e,tp)
return c:IsFaceupEx() and c:IsSetCard(0x45)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and tc:IsAttackPos() then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
elseif e:GetLabel()==2 then
::cancel::
local mg=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,s.rfilter,e,tp,mg,nil,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,true,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat then goto cancel end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
\ No newline at end of file
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