Commit 0695bca4 authored by wind2009's avatar wind2009

Fix Dawn Angel Kambi

parent 0d2442bd
......@@ -45,17 +45,15 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.rcheck(g,tp,lv)
return g:GetSum(Card.GetLevel)==lv and Duel.GetMZoneCount(tp,g)>0
end
function s.cfilter2(c)
return c:IsRace(RACE_FAIRY) and c:IsReleasable() and c:GetLevel()>0
return c:IsRace(RACE_FAIRY) and c:IsReleasable() and c:IsLevelAbove(1)
end
function s.filter(c,e,tp,rg)
function s.filter(c,e,tp,lvt)
local lv=c:GetLevel()
local lv0=e:GetHandler():GetLevel()
if lv>lv0 then
return lv>0 and c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and rg:CheckWithSumEqual(Card.GetLevel,lv-lv0,1,99)
else
return lv==lv0
end
return lvt[lv] and lv>0 and c:IsRace(RACE_FAIRY) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
......@@ -72,34 +70,38 @@ end
function s.splimit(e,c)
return not c:IsRace(RACE_FAIRY)
end
function s.cfilter3(g,c)
return g:IsContains(c)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local lv0=c:GetLevel()
local rg=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_MZONE,0,c)
if not c:IsReleasable() or not c:IsRace(RACE_FAIRY) then return false end
local clv=c:GetLevel()
local rg=Duel.GetReleaseGroup(tp):Filter(s.cfilter2,c)
local lvt={}
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
lvt[lv]=true
end
end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp,lvt)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp,rg) end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,e,tp,rg)
local lvt={}
local pc=1
for i=1,12 do
if g:IsExists(s.spfilter,1,nil,e,tp,i) then lvt[pc]=i pc=pc+1 end
return #g>0
end
local alvt={}
for lv=1,12 do
if lvt[lv] and g:IsExists(Card.IsLevel,1,nil,lv) then
alvt[#alvt+1]=lv
end
end
lvt[pc]=nil
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
if lv>lv0 then
local rg=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_MZONE,0,c)
local tglv=Duel.AnnounceNumber(tp,table.unpack(alvt))
if tglv>clv then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectWithSumEqual(tp,Card.GetLevel,lv-lv0,1,99)+c
local sg=rg:SelectSubGroup(tp,s.rcheck,false,1,99,tp,tglv-clv)+c
Duel.Release(sg,REASON_COST)
else
Duel.Release(c,REASON_COST)
end
e:SetLabel(lv)
e:SetLabel(tglv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spfilter(c,e,tp,lv)
......
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