Commit c478abf2 authored by wind2009's avatar wind2009

Fix release

parent 81694ff8
...@@ -45,8 +45,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,8 +45,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.rcheck(g,tp,lv) function s.rcheck(g,tp,lv,ec)
return g:GetSum(Card.GetLevel)==lv and Duel.GetMZoneCount(tp,g)>0 return g:GetSum(Card.GetLevel)==lv and Duel.GetMZoneCount(tp,g+ec)>0
and Duel.CheckReleaseGroupEx(tp,Auxiliary.IsInGroup,#g,REASON_COST,false,nil,g)
end end
function s.cfilter2(c,tp) function s.cfilter2(c,tp)
return c:IsRace(RACE_FAIRY) and c:IsReleasable() and c:IsLevelAbove(1) and (c:IsControler(tp) or c:IsFaceup()) return c:IsRace(RACE_FAIRY) and c:IsReleasable() and c:IsLevelAbove(1) and (c:IsControler(tp) or c:IsFaceup())
...@@ -77,7 +78,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -77,7 +78,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(s.cfilter2,c,tp) local rg=Duel.GetReleaseGroup(tp):Filter(s.cfilter2,c,tp)
local lvt={} local lvt={}
for lv=clv,12 do for lv=clv,12 do
if lv==clv and Duel.GetMZoneCount(tp,c)>0 or rg:CheckSubGroup(s.rcheck,1,99,tp,lv-clv) then if lv==clv and Duel.GetMZoneCount(tp,c)>0 or rg:CheckSubGroup(s.rcheck,1,99,tp,lv-clv,c) then
lvt[lv]=true lvt[lv]=true
end end
end end
...@@ -96,7 +97,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -96,7 +97,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local tglv=Duel.AnnounceNumber(tp,table.unpack(alvt)) local tglv=Duel.AnnounceNumber(tp,table.unpack(alvt))
if tglv>clv then if tglv>clv then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,s.rcheck,false,1,99,tp,tglv-clv)+c local sg=rg:SelectSubGroup(tp,s.rcheck,false,1,99,tp,tglv-clv,c)+c
aux.UseExtraReleaseCount(sg,tp) aux.UseExtraReleaseCount(sg,tp)
Duel.Release(sg,REASON_COST) Duel.Release(sg,REASON_COST)
else else
......
...@@ -28,7 +28,7 @@ function s.filter(c,tp) ...@@ -28,7 +28,7 @@ function s.filter(c,tp)
return c:IsReleasable() and c:IsRace(RACE_FAIRY) and (c:IsControler(tp) or c:IsFaceup()) return c:IsReleasable() and c:IsRace(RACE_FAIRY) and (c:IsControler(tp) or c:IsFaceup())
end end
function s.rcheck(g,tp) function s.rcheck(g,tp)
return Duel.GetSZoneCount(tp,g)>0 and Duel.CheckReleaseGroupEx(tp,Auxiliary.IsInGroup,#g,REASON_COST,false,nil,g) return Duel.GetSZoneCount(tp,g)>0 and Duel.CheckReleaseGroupEx(tp,Auxiliary.IsInGroup,#g,REASON_COST,true,nil,g)
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp,true,REASON_COST):Filter(s.filter,nil,tp) local rg=Duel.GetReleaseGroup(tp,true,REASON_COST):Filter(s.filter,nil,tp)
......
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