Commit c6ecec9f authored by nekrozar's avatar nekrozar

fix IGAS

parent d4cfd73d
...@@ -64,32 +64,31 @@ function c11711438.stgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,32 +64,31 @@ function c11711438.stgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
end end
end end
function c11711438.cfilter(c) function c11711438.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x137) return c:IsFaceup() and c:IsSetCard(0x137) and c:GetSummonPlayer()==tp
end end
function c11711438.tgfilter(c,tp,eg) function c11711438.tgfilter(c,tp,g)
return eg:IsContains(c) and Duel.IsExistingMatchingCard(c11711438.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode()) return g:IsContains(c) and Duel.IsExistingMatchingCard(c11711438.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end end
function c11711438.thfilter(c,code) function c11711438.thfilter(c,code)
return c:IsSetCard(0x137) and c:IsType(TYPE_MONSTER) and not c:IsCode(code) and c:IsAbleToHand() return c:IsSetCard(0x137) and c:IsType(TYPE_MONSTER) and not c:IsCode(code) and c:IsAbleToHand()
end end
function c11711438.thcon(e,tp,eg,ep,ev,re,r,rp) function c11711438.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and rp==tp and eg:IsExists(c11711438.cfilter,1,nil) return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and eg:IsExists(c11711438.cfilter,1,nil,tp)
end end
function c11711438.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c11711438.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11711438.tgfilter(chkc,tp,eg) end local g=eg:Filter(c11711438.cfilter,nil,tp)
if chk==0 then return Duel.IsExistingTarget(c11711438.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg) and Duel.GetFlagEffect(tp,c11711438)==0 end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c11711438.tgfilter(chkc,tp,g) end
Duel.RegisterFlagEffect(tp,c11711438,RESET_CHAIN,0,1) if chk==0 then return Duel.IsExistingTarget(c11711438.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,g) end
if eg:GetCount()==1 then if g:GetCount()==1 then
Duel.SetTargetCard(eg) Duel.SetTargetCard(g)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c11711438.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,eg) Duel.SelectTarget(tp,c11711438.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,g)
end end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c11711438.thop(e,tp,eg,ep,ev,re,r,rp) function c11711438.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local code=tc:GetCode() local code=tc:GetCode()
...@@ -102,13 +101,14 @@ function c11711438.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,13 +101,14 @@ function c11711438.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c11711438.spfilter(c,e,tp) function c11711438.spfilter(c,e,tp)
return c:IsSetCard(0x137) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x137) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c11711438.spcon(e,tp,eg,ep,ev,re,r,rp) function c11711438.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end end
function c11711438.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c11711438.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c11711438.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c11711438.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c11711438.spop(e,tp,eg,ep,ev,re,r,rp) function c11711438.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -62,10 +62,10 @@ function c13923256.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,10 +62,10 @@ function c13923256.descon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x137) and rp==tp and re:GetHandler()~=e:GetHandler() and e:GetHandler():GetFlagEffect(1)>0 return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x137) and rp==tp and re:GetHandler()~=e:GetHandler() and e:GetHandler():GetFlagEffect(1)>0
end end
function c13923256.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c13923256.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_SZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_SZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c13923256.desop(e,tp,eg,ep,ev,re,r,rp) function c13923256.desop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -12,11 +12,11 @@ function c1759808.initial_effect(c) ...@@ -12,11 +12,11 @@ function c1759808.initial_effect(c)
e1:SetOperation(c1759808.activate) e1:SetOperation(c1759808.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c1759808.cfilter1(c,e,tp) function c1759808.filter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode()) local loc=0
end if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
function c1759808.cfilter2(c,e,tp) if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
return c:IsFaceup() and Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode()) return loc~=0 and c:IsFaceup() and Duel.IsExistingMatchingCard(c1759808.spfilter,tp,loc,0,1,nil,e,tp,c:GetCode())
end end
function c1759808.cfilter(c,e,tp) function c1759808.cfilter(c,e,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode()) return c:IsFaceup() and Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode())
...@@ -25,60 +25,36 @@ function c1759808.spfilter(c,e,tp,code) ...@@ -25,60 +25,36 @@ function c1759808.spfilter(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c1759808.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c1759808.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ez=Duel.GetLocationCountFromEx(tp)
local b1=Duel.IsExistingTarget(c1759808.cfilter1,tp,0,LOCATION_MZONE,1,nil,e,tp) and mz>0
local b2=Duel.IsExistingTarget(c1759808.cfilter2,tp,0,LOCATION_MZONE,1,nil,e,tp) and ez>0
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and c1759808.cfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c:IsControler(1-tp) and c1759808.cfilter(chkc,e,tp) end
if chk==0 then return b1 or b2 end if chk==0 then return Duel.IsExistingTarget(c1759808.filter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c1759808.cfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c1759808.filter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
local tc=g:GetFirst() Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
local d1=Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,tc:GetCode())
local d2=Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,tc:GetCode())
if d1 and not d2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
if not d1 and d2 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
if bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_PENDULUM)==TYPE_PENDULUM then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
end end
function c1759808.activate(e,tp,eg,ep,ev,re,r,rp) function c1759808.activate(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE) if loc~=0~=0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local ez=Duel.GetLocationCountFromEx(tp)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetCode() local code=tc:GetCode()
local d1=Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,code) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local d2=Duel.IsExistingMatchingCard(c1759808.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,code) local g=Duel.SelectMatchingCard(tp,c1759808.spfilter,tp,loc,0,1,1,nil,e,tp,code)
if (bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_PENDULUM)==TYPE_PENDULUM local sc=g:GetFirst()
and ((d1 and mz>0) or (d2 and ez>0))) or (d1 and not d2 and mz>0) or (not d1 and d2 and ez>0) then if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) tc:RegisterFlagEffect(1759808,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local g=Duel.GetMatchingGroup(c1759808.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil,e,tp,code) local e1=Effect.CreateEffect(e:GetHandler())
if mz<=0 then e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
g=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA) e1:SetCode(EVENT_PHASE+PHASE_END)
end e1:SetCountLimit(1)
if ez<=0 then e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
g=g:Filter(Card.IsLocation,nil,LOCATION_DECK) e1:SetLabel(Duel.GetTurnCount())
end e1:SetLabelObject(sc)
local sg=g:Select(tp,1,1,nil) e1:SetCondition(c1759808.tdcon)
local sc=sg:GetFirst() e1:SetOperation(c1759808.tdop)
if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then e1:SetReset(RESET_PHASE+PHASE_END,2)
sc:RegisterFlagEffect(1759808,RESET_EVENT+RESETS_STANDARD,0,1) Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(e:GetHandler()) Duel.SpecialSummonComplete()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetLabelObject(sc)
e1:SetCondition(c1759808.tdcon)
e1:SetOperation(c1759808.tdop)
Duel.RegisterEffect(e1,tp)
end
end end
end end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
...@@ -94,12 +70,7 @@ function c1759808.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,12 +70,7 @@ function c1759808.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function c1759808.tdcon(e,tp,eg,ep,ev,re,r,rp) function c1759808.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if tc:GetFlagEffect(1759808)~=0 then return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(1759808)~=0
return Duel.GetTurnCount()==e:GetLabel()
else
e:Reset()
return false
end
end end
function c1759808.tdop(e,tp,eg,ep,ev,re,r,rp) function c1759808.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
......
...@@ -14,13 +14,13 @@ function c1799464.initial_effect(c) ...@@ -14,13 +14,13 @@ function c1799464.initial_effect(c)
end end
function c1799464.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c1799464.sptg(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
and Duel.IsPlayerCanSpecialSummonMonster(tp,1799465,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) end and Duel.IsPlayerCanSpecialSummonMonster(tp,1799465,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end end
function c1799464.spop(e,tp,eg,ep,ev,re,r,rp) function c1799464.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,1799465,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) then and Duel.IsPlayerCanSpecialSummonMonster(tp,1799465,0,0x4011,0,0,3,RACE_INSECT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,1799465) local token=Duel.CreateToken(tp,1799465)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -80,7 +80,8 @@ function c1966438.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +80,8 @@ function c1966438.spcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c1966438.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c1966438.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c1966438.spop(e,tp,eg,ep,ev,re,r,rp) function c1966438.spop(e,tp,eg,ep,ev,re,r,rp)
...@@ -109,7 +110,8 @@ function c1966438.spcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,7 +110,8 @@ function c1966438.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1966438)>0 return e:GetHandler():GetFlagEffect(1966438)>0
end end
function c1966438.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c1966438.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE)
end end
function c1966438.spop2(e,tp,eg,ep,ev,re,r,rp) function c1966438.spop2(e,tp,eg,ep,ev,re,r,rp)
...@@ -122,7 +124,7 @@ function c1966438.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -122,7 +124,7 @@ function c1966438.spop2(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT) e1:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e1,true) c:RegisterEffect(e1)
end end
end end
end end
--グラビティ・コントローラー --グラビティ・コントローラー
function c23656668.initial_effect(c) function c23656668.initial_effect(c)
--link summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,c23656668.mfilter,1,1) aux.AddLinkProcedure(c,c23656668.mfilter,1,1)
--cannot link material --cannot link material
...@@ -29,7 +30,7 @@ function c23656668.initial_effect(c) ...@@ -29,7 +30,7 @@ function c23656668.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c23656668.mfilter(c) function c23656668.mfilter(c)
return not c:IsType(TYPE_LINK) and c:GetSequence()>4 return not c:IsLinkType(TYPE_LINK) and c:GetSequence()>4
end end
function c23656668.lmlimit(e) function c23656668.lmlimit(e)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -48,9 +49,7 @@ function c23656668.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -48,9 +49,7 @@ function c23656668.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if chk==0 then return tc and c:IsAbleToDeck() and tc:IsAbleToDeck() end if chk==0 then return tc and c:IsAbleToDeck() and tc:IsAbleToDeck() end
local g=Group.CreateGroup() local g=Group.FromCards(c,tc)
g:AddCard(c)
g:AddCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end end
function c23656668.tdop(e,tp,eg,ep,ev,re,r,rp) function c23656668.tdop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -2,19 +2,14 @@ ...@@ -2,19 +2,14 @@
function c25726386.initial_effect(c) function c25726386.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--ritual summon --ritual summon
local e1=Effect.CreateEffect(c) local e1=aux.AddRitualProcGreater2(c,c25726386.filter,nil,nil,c25726386.matfilter)
e1:SetDescription(aux.Stringid(25726386,0)) e1:SetDescription(aux.Stringid(25726386,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,25726386) e1:SetCountLimit(1,25726386)
e1:SetCondition(c25726386.rscon) e1:SetCondition(c25726386.rscon)
e1:SetCost(c25726386.rscost) e1:SetCost(c25726386.rscost)
e1:SetTarget(c25726386.rstg)
e1:SetOperation(c25726386.rsop)
c:RegisterEffect(e1)
--negate --negate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25726386,1)) e2:SetDescription(aux.Stringid(25726386,1))
...@@ -29,8 +24,11 @@ function c25726386.initial_effect(c) ...@@ -29,8 +24,11 @@ function c25726386.initial_effect(c)
e2:SetOperation(c25726386.disop) e2:SetOperation(c25726386.disop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c25726386.filter(c) function c25726386.filter(c,e,tp)
return c:IsSetCard(0x138) return c:IsSetCard(0x138) and c~=e:GetHandler()
end
function c25726386.matfilter(c,e,tp)
return c~=e:GetHandler()
end end
function c25726386.rscon(e,tp,eg,ep,ev,re,r,rp) function c25726386.rscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
...@@ -39,46 +37,6 @@ function c25726386.rscost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,46 +37,6 @@ function c25726386.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end end
function c25726386.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
if mg:IsContains(c) then
mg:RemoveCard(c)
end
local sg=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,c,c25726386.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c25726386.rsop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c25726386.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c25726386.tfilter(c,tp) function c25726386.tfilter(c,tp)
return c:IsOnField() and c:IsControler(tp) return c:IsOnField() and c:IsControler(tp)
end end
...@@ -101,9 +59,8 @@ function c25726386.distg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -101,9 +59,8 @@ function c25726386.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c25726386.disop(e,tp,eg,ep,ev,re,r,rp) function c25726386.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c25726386.disfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c25726386.disfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 and Duel.SendtoDeck(g,nil,1,REASON_EFFECT)~=0 then
Duel.SendtoDeck(g,nil,1,REASON_EFFECT)
if g:GetFirst():IsLocation(LOCATION_DECK) and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then if g:GetFirst():IsLocation(LOCATION_DECK) and Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
......
...@@ -37,7 +37,8 @@ function c2801664.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,7 +37,8 @@ function c2801664.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c2801664.cfilter,tp,LOCATION_MZONE,0,2,nil) return Duel.IsExistingMatchingCard(c2801664.cfilter,tp,LOCATION_MZONE,0,2,nil)
end end
function c2801664.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c2801664.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c2801664.spop(e,tp,eg,ep,ev,re,r,rp) function c2801664.spop(e,tp,eg,ep,ev,re,r,rp)
...@@ -57,7 +58,7 @@ function c2801664.xatkcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +58,7 @@ function c2801664.xatkcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c2801664.xatktg(e,tp,eg,ep,ev,re,r,rp,chk) function c2801664.xatktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsFaceup() and not c:IsHasEffect(EFFECT_EXTRA_ATTACK_MONSTER) end if chk==0 then return not c:IsHasEffect(EFFECT_EXTRA_ATTACK_MONSTER) end
end end
function c2801664.xatkop(e,tp,eg,ep,ev,re,r,rp) function c2801664.xatkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -26,9 +26,6 @@ function c35394356.initial_effect(c) ...@@ -26,9 +26,6 @@ function c35394356.initial_effect(c)
e2:SetOperation(c35394356.rop) e2:SetOperation(c35394356.rop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c35394356.cfilter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c35394356.atkcon(e,tp,eg,ep,ev,re,r,rp) function c35394356.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end end
...@@ -37,10 +34,10 @@ function c35394356.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -37,10 +34,10 @@ function c35394356.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end end
function c35394356.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c35394356.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c35394356.cfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(c35394356.cfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c35394356.cfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
end end
function c35394356.atkop(e,tp,eg,ep,ev,re,r,rp) function c35394356.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
...@@ -55,7 +52,7 @@ function c35394356.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +52,7 @@ function c35394356.atkop(e,tp,eg,ep,ev,re,r,rp)
end end
function c35394356.rcon(e,tp,eg,ep,ev,re,r,rp) function c35394356.rcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e) and bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) return aux.exccon(e) and bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ)
and re:GetHandler():GetOverlayCount()>=ev-1 and e:GetHandler():IsAbleToRemoveAsCost() and ep==e:GetOwnerPlayer() and re:GetHandler():GetOverlayCount()>=ev-1 and e:GetHandler():IsAbleToRemoveAsCost() and ep==e:GetOwnerPlayer()
end end
function c35394356.rop(e,tp,eg,ep,ev,re,r,rp) function c35394356.rop(e,tp,eg,ep,ev,re,r,rp)
return Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) return Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
......
...@@ -38,7 +38,8 @@ function c36016907.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,7 +38,8 @@ function c36016907.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c36016907.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function c36016907.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c36016907.spop1(e,tp,eg,ep,ev,re,r,rp) function c36016907.spop1(e,tp,eg,ep,ev,re,r,rp)
...@@ -56,7 +57,8 @@ end ...@@ -56,7 +57,8 @@ end
function c36016907.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c36016907.sptg2(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 c36016907.spfilter2(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c36016907.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c36016907.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and c:IsAbleToRemove() end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c36016907.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and c:IsAbleToRemove() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c36016907.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c36016907.spfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
...@@ -43,62 +43,44 @@ function c36239585.posop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,62 +43,44 @@ function c36239585.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE) Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end end
end end
function c36239585.spfilter(c,e,tp) function c36239585.setfilter(c,e,tp)
return c:IsSetCard(0x8d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) if not c:IsSetCard(0x8d) then return false end
if c:IsType(TYPE_MONSTER) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
else return c:IsCanTurnSet() end
end end
function c36239585.sefilter(c) function c36239585.sefilter(c)
return c:IsSetCard(0x8d) and c:IsSSetable() return c:IsSetCard(0x8d) and c:IsSSetable()
end end
function c36239585.setfilter(c,e,tp) function c36239585.filter(c,e,tp)
return c:IsSetCard(0x8d) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) or c:IsSSetable()) return c:IsSetCard(0x8d) and (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) or c:IsSSetable())
end end
function c36239585.posfilter(c) function c36239585.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet() return c:IsFaceup() and c:IsCanTurnSet()
end end
function c36239585.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c36239585.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c36239585.filter(chkc,e,tp) end
and (c36239585.spfilter(chkc,e,tp) or c36239585.sefilter(chkc)) end if chk==0 then return Duel.IsExistingTarget(c36239585.setfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sz=Duel.GetLocationCount(tp,LOCATION_SZONE)
local b1=mz>0 and Duel.IsExistingTarget(c36239585.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b2=sz>0 and Duel.IsExistingTarget(c36239585.sefilter,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
if b1 and not b2 then local g=Duel.SelectTarget(tp,c36239585.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,c36239585.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetFirst():IsType(TYPE_MONSTER) then
local cat=e:GetCategory() e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end else
if not b1 and b2 then e:SetCategory(CATEGORY_POSITION)
Duel.SelectTarget(tp,c36239585.sefilter,tp,LOCATION_GRAVE,0,1,1,nil)
end
if b1 and b2 then
local g=Duel.SelectTarget(tp,c36239585.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if bit.band(g:GetFirst():GetOriginalType(),TYPE_MONSTER)~=0 then
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
end end
end end
function c36239585.setop(e,tp,eg,ep,ev,re,r,rp) function c36239585.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local ty=tc:GetOriginalType() local res=false
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE) if tc:IsType(TYPE_MONSTER) then
local sz=Duel.GetLocationCount(tp,LOCATION_SZONE) res=Duel.SpecialSummon(tc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
if (mz<=0 and bit.band(ty,TYPE_MONSTER)~=0) or (sz<=0 and bit.band(ty,TYPE_SPELL+TYPE_TRAP)~=0) then return end else
local set=0 res=Duel.SSet(tp,tc,1-tp)
if mz>0 and bit.band(ty,TYPE_MONSTER)~=0 then
set=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
end end
if sz>0 and bit.band(ty,TYPE_SPELL+TYPE_TRAP)~=0 then if res~=0 then
set=Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end
if set~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
...@@ -106,15 +88,14 @@ function c36239585.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -106,15 +88,14 @@ function c36239585.setop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED) e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
end local ct=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_ONFIELD,0,nil)
if set~=0 and Duel.IsExistingMatchingCard(Card.IsPosition,tp,LOCATION_ONFIELD,0,1,nil,POS_FACEDOWN) if ct>0 and Duel.IsExistingMatchingCard(c36239585.posfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c36239585.posfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(36239585,2)) then
and Duel.SelectYesNo(tp,aux.Stringid(36239585,2)) then Duel.BreakEffect()
Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local gc=Duel.GetMatchingGroupCount(Card.IsPosition,tp,LOCATION_ONFIELD,0,nil,POS_FACEDOWN) local g=Duel.SelectMatchingCard(tp,c36239585.posfilter,tp,0,LOCATION_MZONE,1,ct,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.HintSelection(g)
local g=Duel.SelectMatchingCard(tp,c36239585.posfilter,tp,0,LOCATION_MZONE,1,gc,nil) Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
Duel.HintSelection(g) end
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end end
end end
...@@ -54,24 +54,19 @@ function c36849933.rstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,24 +54,19 @@ function c36849933.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c36849933.rsop(e,tp,eg,ep,ev,re,r,rp) function c36849933.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp) mg=mg:Filter(tc.mat_filter,tc,tp)
else else
......
...@@ -38,34 +38,30 @@ function c37351133.spcon1(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,34 +38,30 @@ function c37351133.spcon1(e,tp,eg,ep,ev,re,r,rp)
end end
function c37351133.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c37351133.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c37351133.spop1(e,tp,eg,ep,ev,re,r,rp) function c37351133.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
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 c37351133.cfilter2(c,tp,rp) function c37351133.cfilter2(c,tp,rp)
return c:GetPreviousControler()==1-tp and c:GetPreviousSequence()>4 and (c:IsReason(REASON_BATTLE) return c:GetPreviousControler()==1-tp and c:GetPreviousSequence()>4 and c:IsPreviousLocation(LOCATION_MZONE)
or (rp==tp and c:IsReason(REASON_EFFECT))) and c:IsPreviousLocation(LOCATION_MZONE) and (c:IsReason(REASON_BATTLE) or (rp==tp and c:IsReason(REASON_EFFECT)))
end
function c37351133.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end end
function c37351133.spcon2(e,tp,eg,ep,ev,re,r,rp) function c37351133.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c37351133.cfilter2,1,nil,tp,rp) return eg:IsExists(c37351133.cfilter2,1,nil,tp,rp)
end end
function c37351133.spop2(e,tp,eg,ep,ev,re,r,rp) function c37351133.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(c37351133.disfilter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(37351133,2)) then and Duel.SelectYesNo(tp,aux.Stringid(37351133,2)) then
Duel.BreakEffect() Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,c37351133.disfilter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(g)
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
......
...@@ -27,18 +27,15 @@ function c38143903.initial_effect(c) ...@@ -27,18 +27,15 @@ function c38143903.initial_effect(c)
end end
c38143903.toss_coin=true c38143903.toss_coin=true
function c38143903.condition(e,tp,eg,ep,ev,re,r,rp) function c38143903.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE and Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end end
function c38143903.negcon(e,tp,eg,ep,ev,re,r,rp) function c38143903.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) return Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev) and Duel.IsChainNegatable(ev)
end end
function c38143903.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function c38143903.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
local p=re:GetHandlerPlayer()
if chk==0 then return e:GetHandler():IsAbleToGrave() if chk==0 then return e:GetHandler():IsAbleToGrave()
and ((Duel.GetLocationCount(1-p,LOCATION_MZONE)>0 and re:GetHandler():IsControler(p)) and (not re:GetHandler():IsRelateToEffect(re) or re:GetHandler():IsAbleToChangeControler()) end
or re:GetHandler():IsControler(1-p)
or not re:GetHandler():IsRelateToEffect(re)) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,p,1) Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,p,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
...@@ -47,7 +44,7 @@ function c38143903.negtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -47,7 +44,7 @@ function c38143903.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function c38143903.negop(e,tp,eg,ep,ev,re,r,rp) function c38143903.negop(e,tp,eg,ep,ev,re,r,rp)
local p=re:GetHandlerPlayer() local p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_COIN) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(p) local coin=Duel.AnnounceCoin(p)
local res=Duel.TossCoin(p,1) local res=Duel.TossCoin(p,1)
......
...@@ -45,12 +45,11 @@ function c38783169.initial_effect(c) ...@@ -45,12 +45,11 @@ function c38783169.initial_effect(c)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c38783169.tntg(e,tp,eg,ep,ev,re,r,rp,chk) function c38783169.tntg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return not e:GetHandler():IsType(TYPE_TUNER) end
if chk==0 then return c:IsFaceup() and c:IsLevelAbove(1) and not c:IsType(TYPE_TUNER) and c:IsRelateToEffect(e) end
end end
function c38783169.tnop(e,tp,eg,ep,ev,re,r,rp) function c38783169.tnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsLevelAbove(1) then if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE) e1:SetCode(EFFECT_ADD_TYPE)
......
...@@ -47,14 +47,14 @@ end ...@@ -47,14 +47,14 @@ end
function c40140448.atcon(e) function c40140448.atcon(e)
return Duel.IsExistingMatchingCard(c40140448.atfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) return Duel.IsExistingMatchingCard(c40140448.atfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end end
function c40140448.srfilter(c)
return c:IsSetCard(0x137) and c:IsAbleToHand() and not c:IsCode(40140448) and c:IsType(TYPE_MONSTER)
end
function c40140448.srcost(e,tp,eg,ep,ev,re,r,rp,chk) function c40140448.srcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c40140448.srfilter(c)
return c:IsSetCard(0x137) and c:IsAbleToHand() and not c:IsCode(40140448) and c:IsType(TYPE_MONSTER)
end
function c40140448.srtg(e,tp,eg,ep,ev,re,r,rp,chk) function c40140448.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c40140448.srfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c40140448.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
......
...@@ -46,14 +46,17 @@ end ...@@ -46,14 +46,17 @@ end
function c40428851.spcon(e,tp,eg,ep,ev,re,r,rp) function c40428851.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0) return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)
end end
function c40428851.costfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0 and c:IsAbleToGraveAsCost()
end
function c40428851.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c40428851.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c40428851.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c40428851.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c40428851.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c40428851.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c40428851.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c40428851.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 c40428851.spop(e,tp,eg,ep,ev,re,r,rp) function c40428851.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -68,15 +68,13 @@ function c42149850.setcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,15 +68,13 @@ function c42149850.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(42149850)>0 return e:GetHandler():GetFlagEffect(42149850)>0
end end
function c42149850.settg(e,tp,eg,ep,ev,re,r,rp,chk) function c42149850.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() if chk==0 then return e:GetHandler():IsSSetable() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and c:IsSSetable() end
end end
function c42149850.setop(e,tp,eg,ep,ev,re,r,rp) function c42149850.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
local flag=Duel.SSet(tp,c) if Duel.SSet(tp,c)~=0 then
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
if flag~=0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......
...@@ -14,17 +14,19 @@ end ...@@ -14,17 +14,19 @@ end
function c46271408.cfilter(c) function c46271408.cfilter(c)
return c:GetSequence()<5 return c:GetSequence()<5
end end
function c46271408.thfilter(c) function c46271408.thfilter(c,e,tp)
return c:IsSetCard(0x1115) and c:IsLevel(4) and c:IsAbleToHand() return c:IsSetCard(0x1115) and c:IsLevel(4) and (c:IsAbleToHand() or (spchk and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end end
function c46271408.condition(e,tp,eg,ep,ev,re,r,rp) function c46271408.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c46271408.cfilter,tp,LOCATION_MZONE,0,1,nil) return not Duel.IsExistingMatchingCard(c46271408.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c46271408.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c46271408.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c46271408.thfilter(chkc) end local spchk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingTarget(c46271408.thfilter,tp,LOCATION_GRAVE,0,1,nil) end and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c46271408.thfilter(chkc,e,tp,spchk) end
if chk==0 then return Duel.IsExistingTarget(c46271408.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,spchk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c46271408.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c46271408.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,spchk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
...@@ -38,7 +40,6 @@ function c46271408.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,7 +40,6 @@ function c46271408.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else else
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end end
end end
end end
...@@ -36,7 +36,7 @@ function c4810585.initial_effect(c) ...@@ -36,7 +36,7 @@ function c4810585.initial_effect(c)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,4810585) e3:SetCountLimit(1,4810585)
e3:SetCondition(c4810585.spcon) e3:SetCondition(c4810585.spcon)
e3:SetCost(c4810585.spcost) e3:SetCost(aux.bfgcost)
e3:SetTarget(c4810585.sptg) e3:SetTarget(c4810585.sptg)
e3:SetOperation(c4810585.spop) e3:SetOperation(c4810585.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -58,7 +58,7 @@ function c4810585.atcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +58,7 @@ function c4810585.atcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c4810585.atcost(e,tp,eg,ep,ev,re,r,rp,chk) function c4810585.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsFaceup() and c:IsLocation(LOCATION_SZONE) and c:IsAbleToGraveAsCost() end if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SendtoGrave(c,REASON_COST) Duel.SendtoGrave(c,REASON_COST)
end end
function c4810585.atop(e,tp,eg,ep,ev,re,r,rp) function c4810585.atop(e,tp,eg,ep,ev,re,r,rp)
...@@ -74,18 +74,14 @@ function c4810585.atlimit(e,c) ...@@ -74,18 +74,14 @@ function c4810585.atlimit(e,c)
return c:IsSetCard(0x137) and c:IsFaceup() return c:IsSetCard(0x137) and c:IsFaceup()
end end
function c4810585.spfilter(c,e,tp) function c4810585.spfilter(c,e,tp)
return c:IsSetCard(0x137) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x137) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c4810585.spcon(e,tp,eg,ep,ev,re,r,rp) function c4810585.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c4810585.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function c4810585.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c4810585.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c4810585.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c4810585.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 c4810585.spop(e,tp,eg,ep,ev,re,r,rp) function c4810585.spop(e,tp,eg,ep,ev,re,r,rp)
......
--クロシープ --クロシープ
function c50277355.initial_effect(c) function c50277355.initial_effect(c)
--link summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2,c50277355.lcheck) aux.AddLinkProcedure(c,nil,2,2,c50277355.lcheck)
--activate --activate
...@@ -28,15 +29,17 @@ function c50277355.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,15 +29,17 @@ function c50277355.condition(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c50277355.cfilter,1,nil,lg) return eg:IsExists(c50277355.cfilter,1,nil,lg)
end end
function c50277355.lkfilter(c,type)
return c:IsFaceup() and c:IsType(type)
end
function c50277355.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50277355.target(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup() local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(Card.IsType,1,nil,TYPE_RITUAL) local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_RITUAL)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c50277355.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(Card.IsType,1,nil,TYPE_FUSION) local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(c50277355.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_FUSION)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_XYZ) local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_SYNCHRO)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_XYZ)
if chk==0 then return b1 or b2 or b3 or b4 end if chk==0 then return b1 or b2 or b3 or b4 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,2) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
...@@ -44,55 +47,57 @@ end ...@@ -44,55 +47,57 @@ end
function c50277355.activate(e,tp,eg,ep,ev,re,r,rp) function c50277355.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local lg=e:GetHandler():GetLinkedGroup() local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(Card.IsType,1,nil,TYPE_RITUAL) local b1=Duel.IsPlayerCanDraw(tp,2) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_RITUAL)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c50277355.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(Card.IsType,1,nil,TYPE_FUSION) local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c50277355.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_FUSION)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(Card.IsType,1,nil,TYPE_XYZ) local b3=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_SYNCHRO)
local b4=Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and lg:IsExists(c50277355.lkfilter,1,nil,TYPE_XYZ)
local res=0 local res=0
if b1 then if b1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) res=Duel.Draw(tp,2,REASON_EFFECT)
res=Duel.Draw(p,d,REASON_EFFECT)
if res==2 then if res==2 then
Duel.ShuffleHand(p) Duel.ShuffleHand(tp)
Duel.BreakEffect() Duel.BreakEffect()
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0) Duel.DiscardHand(tp,aux.TRUE,2,2,REASON_EFFECT+REASON_DISCARD)
local sg=g:Select(p,2,2,nil)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end end
end end
if b2 then if b2 then
if res~=0 then Duel.BreakEffect() end if res~=0 then Duel.BreakEffect() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50277355.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c50277355.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
res=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) if g1:GetCount()>0 then
res=Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end
end end
if b3 then if b3 then
if res~=0 then Duel.BreakEffect() end if res~=0 then Duel.BreakEffect() end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc1=g2:GetFirst()
while tc do while tc1 do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(700) e1:SetValue(700)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc1:RegisterEffect(e1)
res=res+1 res=res+1
tc=g:GetNext() tc1=g2:GetNext()
end end
end end
if b4 then if b4 then
if res~=0 then Duel.BreakEffect() end if res~=0 then Duel.BreakEffect() end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g3=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst() local tc2=g3:GetFirst()
while tc do while tc2 do
local e1=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-700) e2:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetValue(-700)
tc:RegisterEffect(e1) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc=g:GetNext() tc2:RegisterEffect(e2)
tc2=g3:GetNext()
end end
end end
end end
...@@ -50,14 +50,29 @@ function c58116537.actcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,14 +50,29 @@ function c58116537.actcon(e,tp,eg,ep,ev,re,r,rp)
return sg and sg:GetClassCount(Card.GetAttribute)>=2 return sg and sg:GetClassCount(Card.GetAttribute)>=2
end end
function c58116537.acttg(e,tp,eg,ep,ev,re,r,rp,chk) function c58116537.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then
if g:GetCount()==0 then return false end
local tc=g:GetFirst()
local att=0
while tc do
att=bit.bor(att,tc:GetAttribute())
tc=g:GetNext()
end
return att~=0
end
local tc=g:GetFirst()
local att=0
while tc do
att=bit.bor(att,tc:GetAttribute())
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xffff) local ac=Duel.AnnounceAttribute(tp,1,att)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) e:SetLabel(ac)
e:SetLabel(att)
end end
function c58116537.actop(e,tp,eg,ep,ev,re,r,rp) function c58116537.actop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local sg=g:Filter(Card.IsAttribute,nil,e:GetLabel()) local sg=g:Filter(Card.IsAttribute,nil,e:GetLabel())
if sg:GetCount()<=0 then return end if sg:GetCount()<=0 then return end
local tc=sg:GetFirst() local tc=sg:GetFirst()
......
...@@ -14,14 +14,11 @@ function c62411042.initial_effect(c) ...@@ -14,14 +14,11 @@ function c62411042.initial_effect(c)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_SZONE,0) e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c62411042.tgtg) e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SPELL+TYPE_TRAP))
e2:SetValue(aux.tgoval) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c62411042.indcon(e,c) function c62411042.indcon(e,c)
return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end end
function c62411042.tgtg(e,c)
return c:IsFaceup()
end
...@@ -23,12 +23,12 @@ function c63056220.initial_effect(c) ...@@ -23,12 +23,12 @@ function c63056220.initial_effect(c)
e2:SetOperation(c63056220.rsop) e2:SetOperation(c63056220.rsop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c63056220.srfilter(c)
return c:IsSetCard(0x138) and c:IsType(TYPE_MONSTER) and not c:IsCode(63056220) and c:IsAbleToHand()
end
function c63056220.srcon(e,tp,eg,ep,ev,re,r,rp) function c63056220.srcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end end
function c63056220.srfilter(c)
return c:IsSetCard(0x138) and c:IsType(TYPE_MONSTER) and not c:IsCode(63056220) and c:IsAbleToHand()
end
function c63056220.srtg(e,tp,eg,ep,ev,re,r,rp,chk) function c63056220.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63056220.srfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c63056220.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
...@@ -45,24 +45,19 @@ function c63056220.rstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,24 +45,19 @@ function c63056220.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c63056220.rsop(e,tp,eg,ep,ev,re,r,rp) function c63056220.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp) mg=mg:Filter(tc.mat_filter,tc,tp)
else else
......
...@@ -2,16 +2,13 @@ ...@@ -2,16 +2,13 @@
function c63233638.initial_effect(c) function c63233638.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--ritual summon --ritual summon
local e1=Effect.CreateEffect(c) local e1=aux.AddRitualProcGreater2(c,c63233638.filter,nil,nil,c63233638.matfilter)
e1:SetDescription(aux.Stringid(63233638,0)) e1:SetDescription(aux.Stringid(63233638,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(0)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,63233638) e1:SetCountLimit(1,63233638)
e1:SetCost(c63233638.rscost) e1:SetCost(c63233638.rscost)
e1:SetTarget(c63233638.rstg)
e1:SetOperation(c63233638.rsop)
c:RegisterEffect(e1)
--atk/def up --atk/def up
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
...@@ -24,58 +21,19 @@ function c63233638.initial_effect(c) ...@@ -24,58 +21,19 @@ function c63233638.initial_effect(c)
e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c63233638.filter(c) function c63233638.filter(c,e,tp)
return c:IsSetCard(0x138) return c:IsSetCard(0x138) and c~=e:GetHandler()
end
function c63233638.matfilter(c,e,tp)
return c~=e:GetHandler()
end end
function c63233638.rscost(e,tp,eg,ep,ev,re,r,rp,chk) function c63233638.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end end
function c63233638.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
if mg:IsContains(c) then
mg:RemoveCard(c)
end
local sg=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,c,c63233638.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c63233638.rsop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c63233638.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c63233638.cfilter(c) function c63233638.cfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end end
function c63233638.val(e,c) function c63233638.val(e,c)
local g=Duel.GetFieldGroup(e:GetHandlerPlayer(),LOCATION_GRAVE,0) return Duel.GetMatchingGroupCount(c63233638.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)*300
local sg=g:Filter(c63233638.cfilter,nil)
return sg:GetCount()*300
end end
...@@ -43,12 +43,12 @@ function c63633694.spcon1(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,12 +43,12 @@ function c63633694.spcon1(e,tp,eg,ep,ev,re,r,rp)
end end
function c63633694.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function c63633694.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c63633694.spop1(e,tp,eg,ep,ev,re,r,rp) function c63633694.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
...@@ -62,7 +62,8 @@ function c63633694.eqcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,7 +62,8 @@ function c63633694.eqcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c63633694.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c63633694.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c63633694.eqfilter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c63633694.eqfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c63633694.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c63633694.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c63633694.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp) local g=Duel.SelectTarget(tp,c63633694.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
...@@ -97,7 +98,8 @@ function c63633694.spfilter(c,e,tp) ...@@ -97,7 +98,8 @@ function c63633694.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c63633694.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c63633694.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c63633694.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c63633694.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end end
function c63633694.spop2(e,tp,eg,ep,ev,re,r,rp) function c63633694.spop2(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -19,42 +19,40 @@ function c64178868.initial_effect(c) ...@@ -19,42 +19,40 @@ function c64178868.initial_effect(c)
e2:SetCondition(c64178868.regcon) e2:SetCondition(c64178868.regcon)
e2:SetOperation(c64178868.regop) e2:SetOperation(c64178868.regop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
e1:SetLabelObject(e2) local ng=Group.CreateGroup()
ng:KeepAlive()
e1:SetLabelObject(ng)
e2:SetLabelObject(ng)
end end
function c64178868.regcon(e,tp,eg,ep,ev,re,r,rp) function c64178868.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end end
function c64178868.regop(e,tp,eg,ep,ev,re,r,rp) function c64178868.regop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(Card.IsControler,1,nil,tp) then local c=e:GetHandler()
local g=eg:Filter(Card.IsControler,nil,tp) local sg=e:GetLabelObject()
local ng=Group.CreateGroup() if c:GetFlagEffect(64178868)==0 then
ng:KeepAlive() sg:Clear()
ng=e:GetLabelObject() c:RegisterFlagEffect(64178868,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
if ng then end
ng:Merge(g) local g=eg:Filter(Card.IsControler,nil,tp)
e:SetLabelObject(ng) local tc=g:GetFirst()
else while tc do
g:KeepAlive() tc:RegisterFlagEffect(64178868,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
e:SetLabelObject(g) sg:AddCard(tc)
end tc=g:GetNext()
local tc=g:GetFirst()
while tc do
tc:RegisterFlagEffect(64178868,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE,0,1)
tc=g:GetNext()
end
end end
end end
function c64178868.thfilter(c) function c64178868.thfilter(c)
return c:GetFlagEffect(64178868)~=0 and c:IsAbleToHand() and not c:IsCode(64178868) return c:GetFlagEffect(64178868)~=0 and c:IsAbleToHand() and not c:IsCode(64178868) and c:IsLocation(LOCATION_GRAVE)
end end
function c64178868.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c64178868.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ng=e:GetLabelObject():GetLabelObject() local ng=e:GetLabelObject()
if chk==0 then return ng and ng:IsExists(c64178868.thfilter,1,nil) end if chk==0 then return ng and ng:GetCount()>0 and ng:IsExists(c64178868.thfilter,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function c64178868.thop(e,tp,eg,ep,ev,re,r,rp) function c64178868.thop(e,tp,eg,ep,ev,re,r,rp)
local ng=e:GetLabelObject():GetLabelObject() local ng=e:GetLabelObject()
if not ng then return end if not ng or ng:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=ng:FilterSelect(tp,aux.NecroValleyFilter(c64178868.thfilter),1,1,nil) local g=ng:FilterSelect(tp,aux.NecroValleyFilter(c64178868.thfilter),1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -52,13 +52,15 @@ function c74578720.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,13 +52,15 @@ function c74578720.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,74578720,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,74578720,RESET_PHASE+PHASE_END,0,1)
end end
function c74578720.cfilter(c,tp) function c74578720.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsReason(REASON_EFFECT) and bit.band(c:GetPreviousTypeOnField(),TYPE_XYZ)~=0 and c:IsPreviousLocation(LOCATION_MZONE) return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsReason(REASON_EFFECT)
and bit.band(c:GetPreviousTypeOnField(),TYPE_XYZ)~=0 and c:IsPreviousLocation(LOCATION_MZONE)
end end
function c74578720.spcon(e,tp,eg,ep,ev,re,r,rp) function c74578720.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c74578720.cfilter,1,nil,tp) return eg:IsExists(c74578720.cfilter,1,nil,tp)
end end
function c74578720.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c74578720.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c74578720.spop(e,tp,eg,ep,ev,re,r,rp) function c74578720.spop(e,tp,eg,ep,ev,re,r,rp)
...@@ -70,6 +72,6 @@ function c74578720.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,6 +72,6 @@ function c74578720.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED) e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true) c:RegisterEffect(e1)
end end
end end
...@@ -19,26 +19,25 @@ function c76209339.initial_effect(c) ...@@ -19,26 +19,25 @@ function c76209339.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c76209339.filter(c,e,tp) function c76209339.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x138) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) return c:IsSetCard(0x138) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end end
function c76209339.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c76209339.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c76209339.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c76209339.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c76209339.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c76209339.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c76209339.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c76209339.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c76209339.spop(e,tp,eg,ep,ev,re,r,rp) function c76209339.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetValue(LOCATION_DECKBOT)
e1:SetValue(LOCATION_DECKBOT) tc:RegisterEffect(e1,true)
tc:RegisterEffect(e1,true)
end
end end
end end
...@@ -34,10 +34,11 @@ function c76416959.initial_effect(c) ...@@ -34,10 +34,11 @@ function c76416959.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c76416959.spcon(e,tp,eg,ep,ev,re,r,rp) function c76416959.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)~=0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(1-tp,LOCATION_MZONE,0)>0
end end
function c76416959.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c76416959.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function c76416959.spop(e,tp,eg,ep,ev,re,r,rp) function c76416959.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -40,12 +40,13 @@ function c77539547.thfilter(c) ...@@ -40,12 +40,13 @@ function c77539547.thfilter(c)
end end
function c77539547.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c77539547.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c77539547.tgfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c77539547.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c77539547.tgfilter,tp,LOCATION_SZONE,0,1,nil) and Duel.IsExistingMatchingCard(c77539547.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c77539547.tgfilter,tp,LOCATION_SZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) and Duel.IsExistingMatchingCard(c77539547.thfilter,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.SelectTarget(tp,c77539547.tgfilter,tp,LOCATION_SZONE,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) local g=Duel.SelectTarget(tp,c77539547.tgfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c77539547.thop(e,tp,eg,ep,ev,re,r,rp) function c77539547.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
...@@ -57,17 +58,14 @@ function c77539547.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,17 +58,14 @@ function c77539547.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function c77539547.disfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function c77539547.discon(e,tp,eg,ep,ev,re,r,rp) function c77539547.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x137) and rp==tp and re:GetHandler()~=e:GetHandler() and e:GetHandler():GetFlagEffect(1)>0 return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x137) and rp==tp and re:GetHandler()~=e:GetHandler() and e:GetHandler():GetFlagEffect(1)>0
end end
function c77539547.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c77539547.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c77539547.disfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c77539547.disfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local g=Duel.SelectTarget(tp,c77539547.disfilter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end end
function c77539547.disop(e,tp,eg,ep,ev,re,r,rp) function c77539547.disop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -17,14 +17,16 @@ function c83266006.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -17,14 +17,16 @@ function c83266006.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end end
function c83266006.cfilter(c,e,tp) function c83266006.cfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsRace(RACE_ZOMBIE) and Duel.IsExistingMatchingCard(c83266006.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,c:GetAttribute()) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsRace(RACE_ZOMBIE)
and Duel.IsExistingMatchingCard(c83266006.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,c:GetAttribute())
end end
function c83266006.spfilter(c,e,tp,att) function c83266006.spfilter(c,e,tp,att)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsRace(RACE_ZOMBIE) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsRace(RACE_ZOMBIE) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c83266006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c83266006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c83266006.cfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c83266006.cfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c83266006.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c83266006.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c83266006.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) Duel.SelectTarget(tp,c83266006.cfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
...@@ -36,14 +38,14 @@ function c83266006.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,14 +38,14 @@ function c83266006.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c83266006.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,att) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c83266006.spfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,att)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local gc=g:GetFirst() local tc=g:GetFirst()
gc:RegisterFlagEffect(83266006,RESET_EVENT+RESETS_STANDARD,0,1) tc:RegisterFlagEffect(83266006,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetLabelObject(gc) e1:SetLabelObject(tc)
e1:SetCondition(c83266006.rmcon) e1:SetCondition(c83266006.rmcon)
e1:SetOperation(c83266006.rmop) e1:SetOperation(c83266006.rmop)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
......
...@@ -39,12 +39,12 @@ end ...@@ -39,12 +39,12 @@ end
function c84504242.cfilter(c) function c84504242.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x138) return c:IsFaceup() and c:IsSetCard(0x138)
end end
function c84504242.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c84504242.thcon(e,tp,eg,ep,ev,re,r,rp) function c84504242.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c84504242.cfilter,1,nil) return eg:IsExists(c84504242.cfilter,1,nil)
end end
function c84504242.thfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c84504242.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c84504242.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c84504242.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c84504242.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c84504242.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c84504242.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
...@@ -56,6 +56,5 @@ function c84504242.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,6 +56,5 @@ function c84504242.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end end
end end
...@@ -16,14 +16,15 @@ function c9028399.initial_effect(c) ...@@ -16,14 +16,15 @@ function c9028399.initial_effect(c)
end end
function c9028399.cfilter(c,tp,rp) function c9028399.cfilter(c,tp,rp)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_EARTH)~=0 and c:IsPreviousPosition(POS_FACEUP) and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_EARTH)~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end end
function c9028399.spcon(e,tp,eg,ep,ev,re,r,rp) function c9028399.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9028399.cfilter,1,nil,tp) return eg:IsExists(c9028399.cfilter,1,nil,tp)
end end
function c9028399.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c9028399.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
nd e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK)
end end
...@@ -35,7 +36,7 @@ function c9028399.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +36,7 @@ function c9028399.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c9028399.tgfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c9028399.tgfilter,tp,LOCATION_DECK,0,nil)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9028399,1)) then and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9028399,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
......
...@@ -45,24 +45,19 @@ function c90444325.rstg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,24 +45,19 @@ function c90444325.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
return mg:IsContains(c) and Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c90444325.rsop(e,tp,eg,ep,ev,re,r,rp) function c90444325.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end if c:GetControler()~=tp or not c:IsRelateToEffect(e) or not mg:IsContains(c) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,sg,Card.GetLevel,"Greater",c) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,aux.TRUE,e,tp,mg,nil,Card.GetLevel,"Greater",c)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp) mg=mg:Filter(tc.mat_filter,tc,tp)
else else
......
...@@ -24,12 +24,13 @@ function c98806751.initial_effect(c) ...@@ -24,12 +24,13 @@ function c98806751.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c98806751.spfilter(c,tp) function c98806751.spfilter(c,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and Duel.GetMZoneCount(tp,c)>0 and c:IsFaceup() return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and Duel.GetMZoneCount(tp,c)>0 and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end end
function c98806751.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98806751.sptg(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_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c98806751.spfilter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c98806751.spfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c98806751.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.IsExistingTarget(c98806751.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c98806751.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectTarget(tp,c98806751.spfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
...@@ -43,12 +44,13 @@ function c98806751.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,12 +44,13 @@ function c98806751.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c98806751.thfilter(c) function c98806751.thfilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and c:IsFaceup() return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemove() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end end
function c98806751.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98806751.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_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c98806751.thfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(tp) and c98806751.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c98806751.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,c) and c:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(c98806751.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,c)
and c:IsAbleToHand() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c98806751.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,c) local g=Duel.SelectTarget(tp,c98806751.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
......
...@@ -2,16 +2,13 @@ ...@@ -2,16 +2,13 @@
function c99628747.initial_effect(c) function c99628747.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--ritual summon --ritual summon
local e1=Effect.CreateEffect(c) local e1=aux.AddRitualProcGreater2(c,c99628747.filter,nil,nil,c99628747.matfilter)
e1:SetDescription(aux.Stringid(99628747,0)) e1:SetDescription(aux.Stringid(99628747,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(0)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,99628747) e1:SetCountLimit(1,99628747)
e1:SetCost(c99628747.rscost) e1:SetCost(c99628747.rscost)
e1:SetTarget(c99628747.rstg)
e1:SetOperation(c99628747.rsop)
c:RegisterEffect(e1)
--destroy --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99628747,1)) e2:SetDescription(aux.Stringid(99628747,1))
...@@ -25,53 +22,16 @@ function c99628747.initial_effect(c) ...@@ -25,53 +22,16 @@ function c99628747.initial_effect(c)
e2:SetOperation(c99628747.desop) e2:SetOperation(c99628747.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c99628747.filter(c) function c99628747.filter(c,e,tp)
return c:IsSetCard(0x138) return c:IsSetCard(0x138) and c~=e:GetHandler()
end
function c99628747.matfilter(c,e,tp)
return c~=e:GetHandler()
end end
function c99628747.rscost(e,tp,eg,ep,ev,re,r,rp,chk) function c99628747.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end end
function c99628747.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
if mg:IsContains(c) then
mg:RemoveCard(c)
end
local sg=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,c,c99628747.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c99628747.rsop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c99628747.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c99628747.cfilter(c) function c99628747.cfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER) return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)
end end
...@@ -80,7 +40,8 @@ function c99628747.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +40,8 @@ function c99628747.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function c99628747.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99628747.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c99628747.cfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c99628747.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c99628747.cfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c99628747.cfilter,tp,LOCATION_GRAVE,0,nil)
local gc=g:GetClassCount(Card.GetCode) local gc=g:GetClassCount(Card.GetCode)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
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