Commit 92cda8cb authored by mercury233's avatar mercury233

fix

parent 68198b23
...@@ -72,8 +72,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,8 +72,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
local race=e:GetLabel() local race=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,race) local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,race)
if g:GetCount()>0 then if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -24,16 +24,16 @@ function s.initial_effect(c) ...@@ -24,16 +24,16 @@ function s.initial_effect(c)
e2:SetOperation(s.repop) e2:SetOperation(s.repop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE) e3:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,id+o*2) e3:SetCountLimit(1,id+o*2)
e2:SetTarget(s.sptg) e3:SetTarget(s.sptg)
e2:SetOperation(s.spop) e3:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e3)
end end
function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -55,7 +55,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x2f) and c:IsLevelBelow(5) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x2f) and c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -66,7 +66,9 @@ function s.spop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,9 @@ function s.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
function s.actcon(e) function s.actcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
......
...@@ -79,8 +79,9 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -79,8 +79,9 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.rmop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp) local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #sg>0 then if #sg>0 then
Duel.HintSelection(sg)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end end
end end
...@@ -93,10 +94,12 @@ function s.spfilter(c,e,tp) ...@@ -93,10 +94,12 @@ function s.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xbb) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xbb) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -30,21 +30,22 @@ function s.cgcost(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -30,21 +30,22 @@ function s.cgcost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,s.cgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabelObject(g:GetFirst()) local rc=g:GetFirst()
local tuner=rc:IsType(TYPE_TUNER) and 1 or 0
e:SetLabel(rc:GetAttribute(),tuner)
end end
function s.cgop(e,tp,eg,ep,ev,re,r,rp) function s.cgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=e:GetLabelObject() if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
if c:IsRelateToEffect(e) and c:IsFaceup() then local att,tuner=e:GetLabel()
local att=tc:GetAttribute() if c:IsAttribute(att) then return end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_ATTRIBUTE) e1:SetCode(EFFECT_ADD_ATTRIBUTE)
e1:SetValue(att) e1:SetValue(att)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end if tuner==1 and not c:IsType(TYPE_TUNER)
if c:IsFaceup() and tc:IsType(TYPE_TUNER) and not c:IsType(TYPE_TUNER)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect() Duel.BreakEffect()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -68,27 +69,31 @@ end ...@@ -68,27 +69,31 @@ end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tgfilter(chkc) and chkc~=c end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tgfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_GRAVE,0,1,c) and c:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_GRAVE,0,1,c)
and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_GRAVE,0,1,1,c) local g=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_GRAVE,0,1,1,c)
local g2=Group.GetFirst(g1) Duel.SetTargetCard(c)
local g3=Duel.SetTargetCard(c) g:AddCard(c)
local g=Group.FromCards(g2,g3)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,2,0,0)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e) local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>=0 then if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e3:SetTargetRange(0xff,0)
e3:SetValue(LOCATION_REMOVED)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(0xff,0xfe)
e1:SetTarget(s.rmtg)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.rmtg(e,c)
local tp=e:GetHandlerPlayer()
return c:GetOwner()==tp
end end
...@@ -16,7 +16,7 @@ function s.initial_effect(c) ...@@ -16,7 +16,7 @@ function s.initial_effect(c)
--to deck --to deck
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -55,17 +55,19 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,17 +55,19 @@ function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) return eg:IsExists(s.cfilter,1,nil,tp)
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x2f) and (c:IsAbleToHand() or c:IsAbleToDeck()) return c:IsFaceup() and c:IsSetCard(0x2f) and (c:IsAbleToHand() or c:IsAbleToDeck())
end end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_MZONE,0,1,nil) end
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=tg:GetFirst()
if not tc then return end if not tc then return end
local res=false local res=false
if tc:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and tc:IsAbleToDeck() then Duel.HintSelection(tg)
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then if tc:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) then
if Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then
res=true res=true
end end
elseif tc:IsType(TYPE_TOKEN) then elseif tc:IsType(TYPE_TOKEN) then
...@@ -77,31 +79,34 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,31 +79,34 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
else else
if Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) then if Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_DECK) then
res=true res=true
Duel.ShuffleDeck(tc:GetControler())
end end
end end
if res and Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) if res and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.BreakEffect() Duel.BreakEffect()
local g2=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil) local g2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.HintSelection(g2)
Duel.SendtoDeck(g2,nil,SEQ_DECKBOTTOM,REASON_EFFECT) Duel.SendtoDeck(g2,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end end
end end
function s.sfilter(c)
return c:IsSetCard(0x2f) and c:IsFacedown()
end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function s.sfilter(c)
return c:IsSetCard(0x2f) and c:IsFaceup()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil) local g1=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetClassCount(Card.GetCode)<3 then local g2=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)
if (g1:GetClassCount(Card.GetCode)+#g2)<3 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end end
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil) local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_EXTRA,0,nil,0x2f)
if g:GetClassCount(Card.GetCode)>=3 and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then if g:GetClassCount(Card.GetCode)>=3 and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3) local sg=g:SelectSubGroup(tp,aux.dncheck,false,3,3)
......
...@@ -46,8 +46,10 @@ end ...@@ -46,8 +46,10 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
local ct=Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD) local ct=Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
if ct>0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,ct,REASON_EFFECT) Duel.Draw(tp,ct,REASON_EFFECT)
end
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFacedown() or not c:IsRace(RACE_FIEND) return c:IsFacedown() or not c:IsRace(RACE_FIEND)
......
...@@ -6,7 +6,6 @@ function s.initial_effect(c) ...@@ -6,7 +6,6 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
...@@ -23,6 +22,7 @@ function s.initial_effect(c) ...@@ -23,6 +22,7 @@ function s.initial_effect(c)
e2:SetValue(1) e2:SetValue(1)
e2:SetOperation(s.synop) e2:SetOperation(s.synop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
......
...@@ -75,8 +75,8 @@ end ...@@ -75,8 +75,8 @@ end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.tdfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,aux.dabcheck,false,1,6) local sg=g:SelectSubGroup(tp,aux.dabcheck,false,1,6)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,0)
...@@ -86,13 +86,13 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,13 +86,13 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
if #tg==0 then return end if #tg==0 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup() local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:GetCount() local ct=g:GetCount()
local dg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil) local dg=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,nil)
if ct>0 and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if ct>0 and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg2=dg:Select(tp,1,ct,nil) local sg2=dg:Select(tp,1,ct,nil)
Duel.HintSelection(sg2)
Duel.Destroy(sg2,REASON_EFFECT) Duel.Destroy(sg2,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -44,19 +44,19 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,19 +44,19 @@ function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKTOP,REASON_COST) Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKTOP,REASON_COST)
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp) local tc=Duel.SelectTarget(tp,s.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetTargetsRelateToChain():GetFirst() local tc=Duel.GetTargetsRelateToChain():GetFirst()
if not tc then return end if not tc then return end
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -9,7 +9,7 @@ function s.initial_effect(c) ...@@ -9,7 +9,7 @@ function s.initial_effect(c)
--tohand --tohand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
...@@ -25,6 +25,7 @@ function s.initial_effect(c) ...@@ -25,6 +25,7 @@ function s.initial_effect(c)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_HAND) e2:SetCode(EVENT_TO_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(s.smcon) e2:SetCondition(s.smcon)
e2:SetTarget(s.smtg) e2:SetTarget(s.smtg)
e2:SetOperation(s.smop) e2:SetOperation(s.smop)
...@@ -63,10 +64,7 @@ function s.smcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,10 +64,7 @@ function s.smcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.trigfilter,1,nil,tp) return eg:IsExists(s.trigfilter,1,nil,tp)
end end
function s.smtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return Duel.IsExistingMatchingCard(s.smfilter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.smfilter,tp,LOCATION_HAND,0,1,nil)
and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end end
function s.smop(e,tp,eg,ep,ev,re,r,rp) function s.smop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -4,7 +4,7 @@ function s.initial_effect(c) ...@@ -4,7 +4,7 @@ function s.initial_effect(c)
--token --token
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
......
...@@ -31,12 +31,17 @@ end ...@@ -31,12 +31,17 @@ end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp) function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,e:GetHandler(),1-tp) return eg:IsExists(Card.IsSummonPlayer,1,e:GetHandler(),1-tp)
end end
function s.filter(c,e,tp) function s.spfilter1(c,e,tp)
return c:IsSetCard(0x2f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) if not (c:IsSetCard(0x2f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
end end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():GetFlagEffect(id)==0 if chk==0 then return e:GetHandler():GetFlagEffect(id)==0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA)
e:GetHandler():RegisterFlagEffect(id,RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(id,RESET_CHAIN,0,1)
end end
...@@ -44,35 +49,34 @@ function s.posfilter(c) ...@@ -44,35 +49,34 @@ function s.posfilter(c)
return c:IsAttackPos() and c:IsCanChangePosition() return c:IsAttackPos() and c:IsCanChangePosition()
end end
function s.spop1(e,tp,eg,ep,ev,re,r,rp) function s.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0
and Duel.IsExistingMatchingCard(s.posfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(s.posfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2))then and Duel.SelectYesNo(tp,aux.Stringid(id,2))then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tg=Duel.SelectMatchingCard(tp,s.posfilter,tp,0,LOCATION_MZONE,1,1,nil) local tg=Duel.SelectMatchingCard(tp,s.posfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(tg)
Duel.ChangePosition(tg:GetFirst(),POS_FACEUP_DEFENSE) Duel.ChangePosition(tg:GetFirst(),POS_FACEUP_DEFENSE)
end end
end end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x2f) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsPreviousLocation(LOCATION_MZONE) return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-tp and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-tp
end end
function s.spfilter2(c,e,tp)
return c:IsSetCard(0x2f) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function s.spop2(e,tp,eg,ep,ev,re,r,rp) function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
tc:SetMaterial(nil) tc:SetMaterial(nil)
......
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