Commit 0c1a00fd authored by 八宫一月's avatar 八宫一月 Committed by GitHub

Update c581014.lua

parent ba099435
...@@ -3,10 +3,8 @@ function c581014.initial_effect(c) ...@@ -3,10 +3,8 @@ function c581014.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,4,2) aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--ret&draw --ret&draw&spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(581014,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
...@@ -15,18 +13,6 @@ function c581014.initial_effect(c) ...@@ -15,18 +13,6 @@ function c581014.initial_effect(c)
e1:SetTarget(c581014.target1) e1:SetTarget(c581014.target1)
e1:SetOperation(c581014.operation1) e1:SetOperation(c581014.operation1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(581014,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCost(c581014.cost)
e2:SetTarget(c581014.target2)
e2:SetOperation(c581014.operation2)
c:RegisterEffect(e2)
end end
function c581014.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c581014.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
...@@ -40,36 +26,54 @@ function c581014.filter2(c,e,tp) ...@@ -40,36 +26,54 @@ function c581014.filter2(c,e,tp)
return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c581014.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c581014.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(chkc) end if chkc then
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil) end if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter1(chkc)
local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil) else
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(chkc,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end
end end
function c581014.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local b1=Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c581014.filter1,tp,LOCATION_GRAVE,0,3,nil)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c581014.filter2(chkc,e,tp) end local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return b1 or b2 end
and Duel.IsExistingTarget(c581014.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end local op=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if b1 and b2 then
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) op=Duel.SelectOption(tp,aux.Stringid(581014,1),aux.Stringid(581014,2))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) elseif b1 then
end op=Duel.SelectOption(tp,aux.Stringid(581014,1))
function c581014.operation1(e,tp,eg,ep,ev,re,r,rp) else
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) op=Duel.SelectOption(tp,aux.Stringid(581014,2))+1
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) e:SetLabel(op)
local g=Duel.GetOperatedGroup() if op==0 then
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if ct==3 then local g=Duel.SelectTarget(tp,c581014.filter1,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.BreakEffect() Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.Draw(tp,1,REASON_EFFECT) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c581014.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
end end
function c581014.operation2(e,tp,eg,ep,ev,re,r,rp) function c581014.operation1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() if e:GetLabel()==0 then
if tc:IsRelateToEffect(e) then local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
else
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end 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