Commit 10ecb810 authored by POLYMER's avatar POLYMER

fix

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