Commit bc1a71da authored by Amiya's avatar Amiya

修复

parent 8cb06d13
No preview for this file type
...@@ -22,8 +22,8 @@ function s.initial_effect(c) ...@@ -22,8 +22,8 @@ function s.initial_effect(c)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop) e2:SetOperation(s.spop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
...@@ -53,8 +53,8 @@ end ...@@ -53,8 +53,8 @@ end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) if chk==0 then return Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanDraw(tp,1) end and Duel.IsPlayerCanDraw(tp,1) end
...@@ -63,7 +63,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +63,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() if tc:IsRelateToChain()
......
...@@ -8,8 +8,8 @@ function s.initial_effect(c) ...@@ -8,8 +8,8 @@ function s.initial_effect(c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetTarget(s.lvtg) e1:SetTarget(s.artg)
e1:SetOperation(s.lvop) e1:SetOperation(s.arop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -25,67 +25,71 @@ function s.initial_effect(c) ...@@ -25,67 +25,71 @@ function s.initial_effect(c)
e2:SetOperation(s.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.lvfilter(c) function s.arfilter(c)
return c:IsFaceup() return c:IsFaceup()
end end
function s.racefilter(g) function s.gcheck(g)
local rac=g:GetFirst():GetRace() local att=0
if g:GetCount()<2 then return RACE_ALL&~rac end local race=0
local tc=g:GetNext() for tc in aux.Next(g) do
while tc do local c_att=tc:GetAttribute()
if not tc:IsRace(rac) then return RACE_ALL end local c_race=tc:GetRace()
tc=g:GetNext() att=bit.bor(att,c_att)
race=bit.bor(race,c_race)
end end
return RACE_ALL&~rac return att~=ATTRIBUTE_ALL or race~=RACE_ALL
end end
function s.attfilter(g) function s.artg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local att=g:GetFirst():GetAttribute() local tg=Duel.GetMatchingGroup(s.arfilter,tp,LOCATION_MZONE,0,nil,e)
if g:GetCount()<2 then return ATTRIBUTE_ALL&~att end if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.thfilter(chkc) end
local tc=g:GetNext() if chk==0 then return tg:CheckSubGroup(s.gcheck,1,99) end
while tc do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
if not tc:IsAttribute(att) then return ATTRIBUTE_ALL end local g=tg:SelectSubGroup(tp,s.gcheck,false,1,99)
tc=g:GetNext() local att=0
local race=0
for tc in aux.Next(g) do
local c_att=tc:GetAttribute()
local c_race=tc:GetRace()
att=bit.bor(att,c_att)
race=bit.bor(race,c_race)
end end
return ATTRIBUTE_ALL&~att local b1=att~=ATTRIBUTE_ALL
end local b2=race~=RACE_ALL
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local op=aux.SelectFromOptions(tp,
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end {b1,aux.Stringid(id,2),1},
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end {b2,aux.Stringid(id,3),2})
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) if op==1 then
tg=Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,12,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=s.attfilter(tg) ar=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL-att)
local race=s.racefilter(tg)
local op=0
op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
if op==0 then
local race=Duel.AnnounceRace(tp,1,race)
e:SetLabel(op,race)
else else
local rc=Duel.AnnounceAttribute(tp,1,att) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RACE)
e:SetLabel(op,rc) ar=Duel.AnnounceRace(tp,1,RACE_ALL-race)
end end
e:SetLabel(op,ar)
Duel.SetTargetCard(g)
end end
function s.lvop(e,tp,eg,ep,ev,re,r,rp) function s.arop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst() local tg=g:Filter(Card.IsRelateToChain,nil):Filter(Card.IsFaceup,nil)
local op,rt=e:GetLabel() local c=e:GetHandler()
while tc do local op,ar=e:GetLabel()
if op==0 then if op==1 then
local e1=Effect.CreateEffect(e:GetHandler()) for tc in aux.Next(tg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE) e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(rt) e1:SetValue(ar)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() end
else else
local e1=Effect.CreateEffect(e:GetHandler()) for tc in aux.Next(tg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE) e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(rt) e1:SetValue(ar)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext()
end end
end end
end end
......
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