Commit 10ecb810 authored by POLYMER's avatar POLYMER

fix

parent ac4884ed
local m=4879086
local cm=_G["c"..m]
function cm.initial_effect(c)
......@@ -17,6 +16,7 @@ function cm.initial_effect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetTarget(cm.tdtg)
e3:SetOperation(cm.tdop)
......@@ -68,7 +68,7 @@ function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return false end
local g=Duel.GetDecktopGroup(tp,5)
local result=g:FilterCount(Card.IsAbleToHand,nil)>5
local result=g:FilterCount(Card.IsAbleToHand,nil)>0
return result
end
Duel.SetTargetPlayer(tp)
......@@ -77,22 +77,22 @@ function cm.tdfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0xae5f)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.ConfirmDecktop(p,5)
local g=Duel.GetDecktopGroup(p,5)
Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5)
if not g or #g<5 then return end
g=g:Filter(cm.tdfilter,nil)
local ct=5
if #g>0 and Duel.SelectYesNo(p,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(p,1,1,nil)
Duel.DisableShuffleCheck()
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sg)
Duel.ShuffleHand(p)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
ct=ct-1
end
Duel.SortDecktop(p,p,ct)
Duel.SortDecktop(tp,tp,ct)
for i=1,ct do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
......
......@@ -39,7 +39,6 @@ function cm.initial_effect(c)
e3:SetCountLimit(1,m+1)
e3:SetHintTiming(0,TIMING_MAIN_END)
e3:SetCondition(cm.spcon1)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.activate)
c:RegisterEffect(e3)
......@@ -49,24 +48,23 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
e:SetLabelObject(g:GetFirst())
Duel.Release(g,REASON_COST)
local xg=nil
if not e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) then xg=e:GetHandler() end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,xg) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Release(c,REASON_EFFECT)
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
function cm.spcfilter(c)
return c:IsCode(4879086) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED))
......
......@@ -7,7 +7,7 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,id+o)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
......
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