Commit f35132cf authored by mercury233's avatar mercury233 Committed by GitHub

fix ショット・ガン・シャッフル

parent a24f4d3d
......@@ -5,13 +5,14 @@ function c12183332.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
--shuffle
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12183332,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c12183332.cost)
e2:SetTarget(c12183332.target)
e2:SetOperation(c12183332.operation)
c:RegisterEffect(e2)
end
......@@ -19,9 +20,22 @@ function c12183332.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,300) end
Duel.PayLPCost(tp,300)
end
function c12183332.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1 end
end
function c12183332.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local opt=Duel.SelectOption(tp,aux.Stringid(12183332,1),aux.Stringid(12183332,2))
local opt
local res0=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
local res1=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1
if res0 and res1 then
opt=Duel.SelectOption(tp,aux.Stringid(12183332,1),aux.Stringid(12183332,2))
elseif res0 then
opt=Duel.SelectOption(tp,aux.Stringid(12183332,1))
elseif res1 then
opt=Duel.SelectOption(tp,aux.Stringid(12183332,2))+1
else
return
end
if opt==0 then
Duel.ShuffleDeck(tp)
else
......
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