Commit afc9c104 authored by nekrozar's avatar nekrozar

fix deck sort

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=4&cid=4177
■効果処理時に、確認するデッキの上のカードの枚数を1枚~5枚で選び、処理を行います。(発動し、1枚も確認しないとする事はできません。)

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=5&fid=8178

質問の状況のように、特殊召喚に成功した「花札衛-牡丹に蝶-」のモンスター効果の処理時に、相手のデッキが2枚以下の場合でも、『自分はデッキから1枚ドローし、お互いに確認する』処理は通常通り行われます。

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=5&fid=14886

「超重武者グロウ-V」の効果で、『デッキの上からカードを5枚確認し、好きな順番でデッキの上に戻す』処理を行う際に、自分のデッキの枚数が4枚以下になっている場合、デッキの残りのカードを全て確認し、好きな順番でデッキに戻す事になります。

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=5&fid=17083

(『自分のデッキの上からカードを5枚まで確認し、好きな順番でデッキの上に戻す』処理にて確認する枚数も通常通り、任意の枚数だけ確認する事ができます。)
parent 6104bd93
......@@ -8,5 +8,16 @@ function c16768387.initial_effect(c)
c:RegisterEffect(e1)
end
function c16768387.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,tp,5)
local ct=math.min(5,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0))
if ct==0 then return end
local t={}
for i=1,ct do
t[i]=i
end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16768387,1))
ac=Duel.AnnounceNumber(tp,table.unpack(t))
end
Duel.SortDecktop(tp,tp,ac)
end
......@@ -42,7 +42,6 @@ function c4474060.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>2 end
end
function c4474060.stop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)<3 then return end
Duel.SortDecktop(tp,1-tp,3)
end
function c4474060.atkcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -12,7 +12,19 @@ function c52112003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function c52112003.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SortDecktop(tp,tp,5)
local ct=math.min(5,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0))
if ct>0 then
local t={}
for i=1,ct do
t[i]=i
end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(52112003,1))
ac=Duel.AnnounceNumber(tp,table.unpack(t))
end
Duel.SortDecktop(tp,tp,ac)
end
if Duel.GetFlagEffect(tp,52112003)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(52112003,0))
......
......@@ -61,15 +61,15 @@ function c57261568.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:IsType(TYPE_MONSTER) and tc:IsSetCard(0xe6) then
local ct=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)
if ct<3 then return end
local ct=math.min(3,Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0))
if ct==0 then return end
Duel.BreakEffect()
local g=Duel.GetDecktopGroup(1-tp,3)
local g=Duel.GetDecktopGroup(1-tp,ct)
Duel.ConfirmCards(tp,g)
local opt=Duel.SelectOption(tp,aux.Stringid(57261568,1),aux.Stringid(57261568,2))
Duel.SortDecktop(tp,1-tp,3)
Duel.SortDecktop(tp,1-tp,ct)
if opt==1 then
for i=1,3 do
for i=1,ct do
local mg=Duel.GetDecktopGroup(1-tp,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
......
......@@ -28,7 +28,6 @@ function c62017867.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end
end
function c62017867.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return end
Duel.SortDecktop(tp,tp,5)
end
function c62017867.atkcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -42,6 +42,7 @@ end
function c69394324.operation(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5
local b2=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=5
if not b1 and not b2 then return end
local op=nil
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(69394324,0),aux.Stringid(69394324,1))
......
......@@ -36,10 +36,7 @@ function c95239444.stcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(Duel.GetOperatedGroup():GetFirst():GetLevel())
end
function c95239444.stop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=ct then
Duel.SortDecktop(tp,tp,ct)
end
Duel.SortDecktop(tp,tp,e:GetLabel())
end
function c95239444.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) 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