Commit b5f56d59 authored by wind2009's avatar wind2009

Fix ヴァルモニカ・エレディターレ

parent 3d60ed36
......@@ -49,31 +49,25 @@ function s.tdfilter(c)
return c:IsFaceupEx() and c:IsSetCard(0x1a3) and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=0
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
for tc in aux.Next(g) do
ct=ct+tc:GetCounter(0x6a)
end
if chk==0 then return ct>0 and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
local ct=g:GetSum(Card.GetCounter,0x6a)
local tg=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED,0,nil)
if chk==0 then return ct>0 and tg:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local ct=0
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
for tc in aux.Next(g) do
ct=ct+tc:GetCounter(0x6a)
end
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
local ct=g:GetSum(Card.GetCounter,0x6a)
if ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(s.tdfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED,0,1,ct,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local dr=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
local dr=math.ceil(dr/3)
if dr>0 and Duel.IsPlayerCanDraw(tp,dr) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tdfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED,0,1,ct,nil)
if tg:GetCount()>0 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local dr=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
local drc=math.floor(dr/3)
if drc>0 and Duel.IsPlayerCanDraw(tp,drc) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Draw(tp,dr,REASON_EFFECT)
Duel.Draw(tp,drc,REASON_EFFECT)
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