Commit 73c0d624 authored by wyykak's avatar wyykak

fix 401206

Signed-off-by: wyykak's avatarwyykak <wyy_1414@126.com>
parent a1d81799
...@@ -6,6 +6,7 @@ function c401206.initial_effect(c) ...@@ -6,6 +6,7 @@ function c401206.initial_effect(c)
e4:SetCategory(CATEGORY_TOGRAVE) e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_ACTIVATE) e4:SetType(EFFECT_TYPE_ACTIVATE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE) e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCost(c401206.cost)
e4:SetTarget(c401206.target1) e4:SetTarget(c401206.target1)
e4:SetHintTiming(0,TIMING_END_PHASE) e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetOperation(c401206.operation1) e4:SetOperation(c401206.operation1)
...@@ -14,10 +15,14 @@ function c401206.initial_effect(c) ...@@ -14,10 +15,14 @@ function c401206.initial_effect(c)
function c401206.filter(c) function c401206.filter(c)
return c:IsFacedown() and c:IsSetCard(0x911) return c:IsFacedown() and c:IsSetCard(0x911)
end end
function c401206.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.SendtoDeck(Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,1,nil),tp,2,REASON_COST)
end
function c401206.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c401206.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and ce2.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and ce2.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c401206.filter,tp,LOCATION_REMOVED,0,1,nil) if chk==0 then return Duel.IsExistingTarget(c401206.filter,tp,LOCATION_REMOVED,0,1,nil) end
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(401206,3)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(401206,3))
local g=Duel.SelectTarget(tp,c401206.filter,tp,LOCATION_REMOVED,0,1,2,nil) local g=Duel.SelectTarget(tp,c401206.filter,tp,LOCATION_REMOVED,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
...@@ -25,12 +30,9 @@ function c401206.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -25,12 +30,9 @@ function c401206.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c401206.operation1(e,tp,eg,ep,ev,re,r,rp) function c401206.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=tg:Filter(Card.IsRelateToEffect,nil,e) local sg=tg:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 and Duel.SendtoDeck(g,nil,1,REASON_EFFECT)~=0 then if sg:GetCount()>0 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN) Duel.SendtoGrave(sg,REASON_EFFECT+REASON_RETURN)
end 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