Commit b3dbb8b5 authored by Grajade's avatar Grajade

Update c22201301.lua

parent 7b6ccddf
Pipeline #7733 failed with stage
in 7 seconds
--咏唱破弃 --咏唱破弃
function c22201301.initial_effect(c) function c22201301.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22201301,0)) e1:SetDescription(aux.Stringid(22201301,0))
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,22201301+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,22201301+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c22201301.target) e1:SetTarget(c22201301.target)
e1:SetOperation(c22201301.operation) e1:SetOperation(c22201301.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c22201301.ritfilter(c,e,tp) function c22201301.ritfilter(c,e,tp)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and not c:IsPublic() return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end end
function c22201301.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22201301.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(c22201301.ritfilter,tp,LOCATION_HAND,0,1,nil) return Duel.IsExistingMatchingCard(c22201301.ritfilter,tp,LOCATION_HAND,0,1,nil)
end end
end end
function c22201301.operation(e,tp,eg,ep,ev,re,r,rp) function c22201301.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c22201301.ritfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c22201301.ritfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()<1 then return end if g:GetCount()<1 then return end
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) or not c:IsReason(REASON_DESTROY) then return end if not c:IsPreviousLocation(LOCATION_SZONE) then return end
if Duel.GetMZoneCount(tp)>0 and tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(22201301,1)) then if c:IsRelateToEffect(e) or not c:IsReason(REASON_DESTROY) then return end
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP) if Duel.GetMZoneCount(tp)>0 and tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) and Duel.SelectYesNo(tp,aux.Stringid(22201301,1)) then
tc:CompleteProcedure() Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
end tc:CompleteProcedure()
end 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