Commit 98c5983b authored by wind2009's avatar wind2009

Fix アルカナフォースⅩⅨ-THE SUN

parent efc9dcfb
......@@ -54,35 +54,37 @@ end
function s.setfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSSetable() and c.toss_coin
end
function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5
end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local res=0
if c:IsHasEffect(73206827) then
local off=1
local ops={}
local opval={}
if Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) then
ops[off]=aux.Stringid(id,2)
opval[off-1]=1
off=off+1
local b1=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
if b1 and not b2 then
Duel.Hint(HINT_OPSELECTED,1-tp,60)
res=1
end
if b2 and not b1 then
Duel.Hint(HINT_OPSELECTED,1-tp,61)
res=2
end
if Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) then
ops[off]=aux.Stringid(id,3)
opval[off-1]=0
off=off+1
if b1 and b2 then
res=aux.SelectFromOptions(tp,
{b1,60},
{b2,61})
end
if off==1 then return end
local op=Duel.SelectOption(tp,table.unpack(ops))
res=opval[op]
else res=Duel.TossCoin(tp,1) end
if res==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.stfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
else
local sg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
local sg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
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