Commit 6c49e825 authored by yxli's avatar yxli
parents 98667d3c 5b5720e9
......@@ -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,39 @@ 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
aux.UseExtraReleaseCount(sg,tp)
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)
......
......@@ -28,12 +28,12 @@ function s.filter(c)
return c:IsReleasable() and c:IsRace(RACE_FAIRY)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,3,nil) end
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE+LOCATION_HAND,0,3,3,nil)
if chk==0 then return Duel.CheckReleaseGroup(tp,s.filter,3,nil) end
local g=Duel.SelectReleaseGroup(tp,s.filter,3,3,nil)
Duel.Release(g,REASON_COST)
end
function s.stfilter(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and c:IsSSetable()
return c:IsAllTypes(TYPE_CONTINUOUS+TYPE_SPELL) and c:IsSSetable()
end
function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_DECK,0,1,nil) end
......@@ -47,13 +47,12 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp)
if ct~=0 then
local tc=g:GetFirst()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
e1:SetCondition(s.tgcon)
e1:SetOperation(s.tgop)
Duel.RegisterEffect(e1,tp)
......@@ -61,8 +60,14 @@ function s.stop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=1-tp then return false end
local tc=e:GetLabelObject()
return tc:GetFlagEffect(id)~=0 and Duel.GetTurnPlayer()==1-tp
if tc:GetFlagEffectLabel(id)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
......@@ -78,7 +83,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter(c) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if c:IsRelateToChain() and aux.NecroValleyFilter(c) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......
......@@ -46,7 +46,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end
function s.atkval(e,c)
local tp=e:GetHandlerPlayer()
return Duel.GetMatchingGroupCount(Card.IsRace,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,RACE_FAIRY)*100
return Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceupEx,Card.IsRace),tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,RACE_FAIRY)*100
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_FAIRY) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -59,8 +59,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if tc and aux.NecroValleyFilter(tc) and tc:IsRelateToChain() then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
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