Commit fe1ce61e authored by Nemo Ma's avatar Nemo Ma

del and fix

parent 08b5b1fd
No preview for this file type
...@@ -48,11 +48,11 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,11 +48,11 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
end end
function cm.efilter(c) function cm.efilter1(c)
return c:IsType(TYPE_SPELL) and c:IsFaceup() return c:IsType(TYPE_SPELL) and c:IsFaceup()
end end
function cm.econ(e) function cm.econ(e)
return Duel.IsExistingMatchingCard(cm.efilter,tp,LOCATION_SZONE,0,1,nil) return Duel.IsExistingMatchingCard(cm.efilter1,tp,LOCATION_SZONE,0,1,nil)
end end
function cm.efilter(e,te) function cm.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner() return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
......
...@@ -92,7 +92,7 @@ function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,7 +92,7 @@ function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp) function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local g=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if g:GetCount()>0 then if g>0 then
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.DiscardDeck(tp,1,REASON_EFFECT) Duel.DiscardDeck(tp,1,REASON_EFFECT)
end end
......
...@@ -13,7 +13,7 @@ function cm.initial_effect(c) ...@@ -13,7 +13,7 @@ function cm.initial_effect(c)
cm.Fusion_R_Check=true cm.Fusion_R_Check=true
function aux.Fus_R_Filter(c,tp) function aux.Fus_R_Filter(c,tp)
local re=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT) local re=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
return re and c:IsHasEffect(m) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(re,0,tp,false,false) return re and c:IsHasEffect(m) and c:IsControler(tp) and c:IsCanBeSpecialSummoned(re,0,tp,true,false)
end end
_SpecialSummon=Duel.SpecialSummon _SpecialSummon=Duel.SpecialSummon
_SpecialSummonStep=Duel.SpecialSummonStep _SpecialSummonStep=Duel.SpecialSummonStep
...@@ -26,10 +26,10 @@ function cm.initial_effect(c) ...@@ -26,10 +26,10 @@ function cm.initial_effect(c)
local rg=Duel.GetMatchingGroup(aux.Fus_R_Filter,sumplayer,LOCATION_HAND+LOCATION_DECK,0,nil,tp) local rg=Duel.GetMatchingGroup(aux.Fus_R_Filter,sumplayer,LOCATION_HAND+LOCATION_DECK,0,nil,tp)
if not rg then if not rg then
return _SpecialSummon(targets,sumtype,sumplayer,target_player,nocheck,nolimit,pos,...) return _SpecialSummon(targets,sumtype,sumplayer,target_player,nocheck,nolimit,pos,...)
elseif rg and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then elseif rg and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=rg:Select(tp,1,1,nil):GetFirst() local tc=rg:Select(tp,1,1,nil):GetFirst()
if _SpecialSummonStep(tc,sumtype,sumplayer,target_player,nocheck,nolimit,pos,...) then if _SpecialSummonStep(tc,sumtype,sumplayer,target_player,true,nolimit,pos,...) then
if aux.GetValueType(targets)=="Group" then if aux.GetValueType(targets)=="Group" then
targets=targets:GetFirst() targets=targets:GetFirst()
end end
...@@ -61,7 +61,7 @@ function cm.initial_effect(c) ...@@ -61,7 +61,7 @@ function cm.initial_effect(c)
elseif rg and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then elseif rg and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=rg:Select(tp,1,1,nil):GetFirst() local tc=rg:Select(tp,1,1,nil):GetFirst()
if _SpecialSummonStep(tc,sumtype,sumplayer,target_player,nocheck,nolimit,pos,...) then if _SpecialSummonStep(tc,sumtype,sumplayer,target_player,true,nolimit,pos,...) then
local code=targets:GetOriginalCodeRule() local code=targets:GetOriginalCodeRule()
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -30,7 +30,7 @@ function c33200424.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,7 +30,7 @@ function c33200424.con(e,tp,eg,ep,ev,re,r,rp)
end end
function c33200424.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200424.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,33200426,0,0x4011,1000,1500,4,RACE_BEASTWARRIOR,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end and Duel.IsPlayerCanSpecialSummonMonster(tp,33200426,0,0x4011,1000,1500,4,RACE_BEASTWARRIOR,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) 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
......
...@@ -205,21 +205,21 @@ function XY.mayuribfcon(e) ...@@ -205,21 +205,21 @@ function XY.mayuribfcon(e)
end end
function XY.mayuriregop(e,tp,eg,ep,ev,re,r,rp) function XY.mayuriregop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,nil,0,aux.Stringid(33401601,0)) c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(33401601,0))
end end
function XY.mayuriregcon(e,tp,eg,ep,ev,re,r,rp) function XY.mayuriregcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler()==e:GetHandler() return re:GetHandler()==e:GetHandler()
end end
function XY.mayuriregop1(e,tp,eg,ep,ev,re,r,rp) function XY.mayuriregop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,nil,0,aux.Stringid(33401601,0)) c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(33401601,0))
end end
function XY.mayuriregop2(e,tp,eg,ep,ev,re,r,rp) function XY.mayuriregop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local fs=c:GetFlagEffect(c:GetCode()) local fs=c:GetFlagEffect(c:GetCode())
c:ResetFlagEffect(c:GetCode()) c:ResetFlagEffect(c:GetCode())
for i=1,fs-1 do for i=1,fs-1 do
c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,nil,0,aux.Stringid(33401601,0)) c:RegisterFlagEffect(c:GetCode(),RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,0,0,aux.Stringid(33401601,0))
end end
end end
--sp --sp
...@@ -765,7 +765,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp) ...@@ -765,7 +765,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
Duel.SelectYesNo(tp,aux.Stringid(cd,2)) then Duel.SelectYesNo(tp,aux.Stringid(cd,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler()) local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,e:GetHandler())
if Duel.SendtoGrave(g1,REASON_EFFECT)~=0 then if Duel.SendtoGrave(g1,REASON_EFFECT)~=0 then
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(cd,3)) Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(cd,3))
local e0=Effect.CreateEffect(e:GetHandler()) local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD) e0:SetType(EFFECT_TYPE_FIELD)
...@@ -1000,7 +1000,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1000,7 +1000,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SortDecktop(tp,1-tp,3) Duel.SortDecktop(tp,1-tp,3)
else Duel.SortDecktop(tp,1-tp,4) else Duel.SortDecktop(tp,1-tp,4)
end end
if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and
Duel.SelectYesNo(tp,aux.Stringid(cd,2)) then Duel.SelectYesNo(tp,aux.Stringid(cd,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -1265,7 +1265,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1265,7 +1265,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
local e5=e4:Clone() local e5=e4:Clone()
e5:SetCode(EFFECT_SET_DEFENSE_FINAL) e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e5) tc:RegisterEffect(e5)
end end
if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(XY.maganethfilter7,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(XY.maganethfilter7,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and
Duel.SelectYesNo(tp,aux.Stringid(ac,2)) then Duel.SelectYesNo(tp,aux.Stringid(ac,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -1339,7 +1339,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp) ...@@ -1339,7 +1339,7 @@ function XY.maganechop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SortDecktop(tp,1-tp,3) Duel.SortDecktop(tp,1-tp,3)
else Duel.SortDecktop(tp,1-tp,4) else Duel.SortDecktop(tp,1-tp,4)
end end
if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) and
Duel.SelectYesNo(tp,aux.Stringid(ac,2)) then Duel.SelectYesNo(tp,aux.Stringid(ac,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -75,7 +75,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -75,7 +75,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function cm.thfilter(c) function cm.thfilter(c)
return (c:IsSetCard(0x3344) or (c:IsSetCard(0x6341) and c:IsType(TYPE_QUICKPLAY))) and c:IsAbleToHand() return c:IsSetCard(0x3344,0x6341) and c:IsAbleToHand()
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -91,24 +91,22 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,24 +91,22 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.filter(c) function cm.filter(c)
return c:IsFaceup() and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsCanAddCounter(0x1015,2) return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsCanAddCounter(0x1015,2)
end
function cm.filter2(c)
return c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and cm.filter(chkc) end if chkc then return chkc:IsOnField() and cm.filter(chkc) end
if chk==0 then return true end if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
tc:AddCounter(0x1015,2) tc:AddCounter(0x1015,2)
if tc:GetCounter(0x1015)>=6 then if tc:GetCounter(0x1015)>=6 then
if Duel.SelectYesNo(tp,aux.Stringid(m,3)) then if Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local tc2=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local tc2=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nilTYPE_SPELL+TYPE_TRAP)
Duel.Destroy(tc2,REASON_EFFECT) Duel.Destroy(tc2,REASON_EFFECT)
end end
end end
......
...@@ -34,17 +34,13 @@ function cm.lcheck(g) ...@@ -34,17 +34,13 @@ function cm.lcheck(g)
end end
function cm.desfilter(c,e,tp) function cm.desfilter(c,e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_HAND,0,1,nil,e,tp,Group.FromCards(c)) return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,c)
end end
function cm.spfilter(c,e,tp,dg) function cm.spfilter(c,e,tp,mc)
local tc=dg:GetFirst() local b1=c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
return (c:IsSetCard(0x341) or c:IsAttribute(ATTRIBUTE_WATER)) and ((c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,dg,c)>0 ) or (c:IsLocation(LOCATION_HAND) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or tc:GetSequence()<5))) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) local b2=c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetMZoneCount(tp,mc)>0
end return (c:IsSetCard(0x341) or c:IsAttribute(ATTRIBUTE_WATER)) and (b1 or b2)
function cm.spfilter2(c,e,tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return (c:IsSetCard(0x341) or c:IsAttribute(ATTRIBUTE_WATER))
and ( (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 )
or (c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) )
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end end
function cm.ckfilter(c) function cm.ckfilter(c)
return c:IsSetCard(0x3344) and c:IsFaceup() return c:IsSetCard(0x3344) and c:IsFaceup()
...@@ -56,20 +52,19 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,20 +52,19 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,e,tp,c) end if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and cm.desfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA+LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA+LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
......
--五河士道 哥哥
local m=33401318
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e0:SetCode(EVENT_CUSTOM+m)
e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e0:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e0:SetCountLimit(1,m)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--fusion success
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m+10000)
e1:SetTarget(cm.sptg2)
e1:SetOperation(cm.spop2)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(cm.regcon)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(cm.spcfilter,1,nil,0) then v=v+1 end
if eg:IsExists(cm.spcfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,e:GetLabel())
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev==tp or ev==PLAYER_ALL
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
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)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
end
function cm.spfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x341) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
...@@ -34,7 +34,7 @@ function cm.initial_effect(c) ...@@ -34,7 +34,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.ckfilter2(c,at) function cm.ckfilter2(c,at)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAttribute(at) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:GetAttribute()&at~=0
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
......
...@@ -33,7 +33,7 @@ function cm.intg(e,c) ...@@ -33,7 +33,7 @@ function cm.intg(e,c)
end end
function cm.refilter(c) function cm.refilter(c)
return c:IsAbleToRemove() and c:IsSetCard(0x6344) and c:IsType(TYPE_MONSTER) and c:IsFaceup() return c:IsAbleToRemove() and c:IsSetCard(0x6344) and c:IsType(TYPE_MONSTER)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.refilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end
...@@ -47,7 +47,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +47,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -73,7 +73,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +73,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetTarget(cm.sptg3) e2:SetTarget(cm.sptg3)
e2:SetOperation(cm.spop3) e2:SetOperation(cm.spop3)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp) function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetFlagEffect(tp,m)>Duel.GetFlagEffect(tp,m+1) return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetFlagEffect(tp,m)>Duel.GetFlagEffect(tp,m+1)
......
...@@ -49,7 +49,7 @@ function cm.initial_effect(c) ...@@ -49,7 +49,7 @@ function cm.initial_effect(c)
end end
--equip --equip
function cm.eqfilter(c,tp) function cm.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsAbleToChangeControler()) return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsAbleToChangeControler()) and c:IsFaceup()
end end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......
...@@ -67,7 +67,7 @@ function c35399317.can_equip_monster(c) ...@@ -67,7 +67,7 @@ function c35399317.can_equip_monster(c)
return true return true
end end
function c35399317.eqfilter(c,tp) function c35399317.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) or c:IsAbleToChangeControler() return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsAbleToChangeControler()) and c:IsFaceup()
end end
function c35399317.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c35399317.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
......
--后巴别塔·瑕光
function c79035100.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,79035100)
e1:SetCost(c79035100.thcost)
e1:SetTarget(c79035100.thtg)
e1:SetOperation(c79035100.thop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c79035100.efcon)
e2:SetOperation(c79035100.efop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,214010)
e3:SetTarget(c79035100.sttg)
e3:SetOperation(c79035100.stop)
c:RegisterEffect(e3)
end
function c79035100.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c79035100.thfil(c)
return c:IsAbleToHand() and c:IsSetCard(0xca3)
end
function c79035100.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035100.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c79035100.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79035100.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
local tc=tg:GetFirst()
Duel.Recover(tp,tc:GetAttack()/2,REASON_EFFECT)
end
function c79035100.efcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetReasonCard()
return r==REASON_FUSION and ec:IsSetCard(0xca3)
end
function c79035100.efop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,79035100)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--indes
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(aux.indoval)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e5)
rc:RegisterFlagEffect(79035100,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(79035100,0))
end
function c79035100.stfil(c)
return c:IsSetCard(0xca3) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function c79035100.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0xca3) and ep==tp and re:GetHandler():IsSetCard(0xca3) and Duel.IsExistingMatchingCard(c79035100.stfil,tp,LOCATION_DECK,0,2,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,LOCATION_PZONE)
end
function c79035100.stop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g1=Duel.GetMatchingGroup(c79035100.stfil,tp,LOCATION_DECK,0,nil)
if Duel.Destroy(g,REASON_EFFECT) and g1:GetCount()>1 then
local tg=g1:Select(tp,2,2,nil)
local tc=tg:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
tc=tg:GetNext()
end
end
end
--后巴别塔·清流
function c79035101.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--Recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,79035101)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c79035101.rectg)
e1:SetOperation(c79035101.recop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,214011)
e2:SetTarget(c79035101.thtg)
e2:SetOperation(c79035101.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,214011)
e4:SetTarget(c79035101.thtg1)
e4:SetOperation(c79035101.thop1)
c:RegisterEffect(e4)
end
function c79035101.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
end
function c79035101.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c79035101.thfil(c)
return c:IsAbleToHand() and c:IsSetCard(0xca3) and c:IsType(TYPE_MONSTER)
end
function c79035101.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035101.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,100)
end
function c79035101.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79035101.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
Duel.BreakEffect()
Duel.Recover(tp,100,REASON_EFFECT)
end
function c79035101.thfil1(c)
return c:IsAbleToHand() and c:IsSetCard(0xca3) and c:IsType(TYPE_SPELL)
end
function c79035101.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035101.thfil1,tp,LOCATION_DECK,0,1,nil) and e:GetHandler():IsReason(REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c79035101.thop1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79035101.thfil1,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
--后巴别塔·末药
function c79035102.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,79035102)
e1:SetTarget(c79035102.sptg)
e1:SetOperation(c79035102.spop)
c:RegisterEffect(e1)
--Recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c79035102.rectg)
e2:SetOperation(c79035102.recop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--SpecialSummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetCode(EVENT_RECOVER)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_HAND)
e4:SetCountLimit(1,214014)
e4:SetTarget(c79035102.sptg1)
e4:SetOperation(c79035102.spop1)
c:RegisterEffect(e4)
end
function c79035102.spfil(c,e,tp)
return c:IsSetCard(0xca3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 ) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 ))
end
function c79035102.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,nil,0xca3) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(c79035102.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c79035102.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
local g1=Duel.GetMatchingGroup(c79035102.spfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_EXTRA,0,nil,e,tp)
if g1:GetCount()<=0 then return end
Duel.BreakEffect()
local sg=g1:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
function c79035102.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c79035102.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c79035102.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and ep==tp end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c79035102.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--后巴别塔·苏苏洛
function c79035103.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,79035103)
e1:SetTarget(c79035103.thtg)
e1:SetOperation(c79035103.thop)
c:RegisterEffect(e1)
--Recover
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_RECOVER)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTarget(c79035103.rectg)
e4:SetOperation(c79035103.recop)
c:RegisterEffect(e4)
--SpecialSummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetCode(EVENT_RECOVER)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_HAND)
e4:SetCountLimit(1,214015)
e4:SetTarget(c79035103.sptg1)
e4:SetOperation(c79035103.spop1)
c:RegisterEffect(e4)
end
function c79035103.thfil(c)
return c:IsSetCard(0xca3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c79035103.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035103.thfil,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,LOCATION_PZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,0)
end
function c79035103.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g1=Duel.GetMatchingGroup(c79035103.thfil,tp,LOCATION_DECK,0,1,nil)
if Duel.Destroy(g,REASON_EFFECT) and g1:GetCount()>0 then
local tg=g1:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c79035103.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReason(REASON_EFFECT) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,500)
end
function c79035103.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c79035103.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and ep==tp end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c79035103.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--后巴别塔·嘉维尔
function c79035104.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,79035104)
e1:SetCost(c79035104.thcost)
e1:SetTarget(c79035104.thtg)
e1:SetOperation(c79035104.thop)
c:RegisterEffect(e1)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCost(c79035104.atkcost)
e3:SetOperation(c79035104.atkop)
c:RegisterEffect(e3)
end
function c79035104.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c79035104.thfil(c)
return c:IsAbleToHand() and c:IsSetCard(0xca3) and c:IsType(TYPE_SPELL)
end
function c79035104.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035104.thfil,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler(),0xca3) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,tp,LOCATION_ONFIELD+LOCATION_HAND)
end
function c79035104.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,e:GetHandler(),0xca3)
if g:GetCount()<=0 then return end
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
local g1=Duel.GetMatchingGroup(c79035104.thfil,tp,LOCATION_DECK,0,nil)
if g1:GetCount()<=0 then return end
local tg=g1:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
function c79035104.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return c:GetFlagEffect(79035104)==0 and bc end
c:RegisterFlagEffect(79035104,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c79035104.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(1500)
c:RegisterEffect(e1)
Duel.Recover(tp,100,REASON_EFFECT)
end
end
--后巴别塔·临光
function c79035105.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,79035105)
e1:SetTarget(c79035105.sptg1)
e1:SetOperation(c79035105.spop1)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,214017)
e2:SetCondition(c79035105.spcon)
e2:SetTarget(c79035105.sptg)
e2:SetOperation(c79035105.spop)
c:RegisterEffect(e2)
end
function c79035105.cfilter2(c,tp)
return c:IsSetCard(0xca3) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
end
function c79035105.spcon(e,tp,eg,ep,ev,re,r,rp)
if eg:IsContains(e:GetHandler()) then return false end
return eg:IsExists(c79035105.cfilter2,1,nil,tp)
end
function c79035105.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,100)
end
function c79035105.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
Duel.Recover(tp,100,REASON_EFFECT)
end
end
function c79035105.spfil(c,e,tp)
return c:IsSetCard(0xca3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c79035105.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035105.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c79035105.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c79035105.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or g:GetCount()<=0 then return end
local sg=g:Select(tp,1,1,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) then
--
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetTarget(c79035105.actfilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function c79035105.actfilter(e,c)
return c:GetControler()==e:GetHandlerPlayer() and not c:IsSetCard(0xca3)
end
--后巴别塔·哞
function c79035106.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--Recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_PZONE)
e1:SetTarget(c79035106.rectg)
e1:SetOperation(c79035106.recop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,214018)
e2:SetCondition(c79035106.spcon)
e2:SetTarget(c79035106.sptg)
e2:SetOperation(c79035106.spop)
c:RegisterEffect(e2)
--Recover
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,79035106)
e4:SetTarget(c79035106.rectg1)
e4:SetOperation(c79035106.recop1)
c:RegisterEffect(e4)
end
function c79035106.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
end
function c79035106.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function c79035106.cfilter2(c,tp)
return c:IsSetCard(0xca3) and (c:IsReason(REASON_EFFECT) or c:IsReason(REASON_BATTLE)) and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
end
function c79035106.spcon(e,tp,eg,ep,ev,re,r,rp)
if eg:IsContains(e:GetHandler()) then return false end
return eg:IsExists(c79035106.cfilter2,1,nil,tp)
end
function c79035106.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c79035106.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c79035106.rthfil(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xca3) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup()))
end
function c79035106.rectg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035106.rthfil,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) and e:GetHandler():IsReason(REASON_EFFECT) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c79035106.recop1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(c79035106.rthfil,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
if Duel.Recover(p,d,REASON_EFFECT) and g:GetCount()<=0 then return end
Duel.BreakEffect()
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
--后巴别塔·塞雷娅
function c79035107.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_RECOVER)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,79035107)
e1:SetCost(c79035107.spcost)
e1:SetTarget(c79035107.sptg)
e1:SetOperation(c79035107.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,214019)
e2:SetCost(c79035107.incost)
e2:SetTarget(c79035107.intg)
e2:SetOperation(c79035107.inop)
c:RegisterEffect(e2)
--Recover
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,314019)
e4:SetTarget(c79035107.rectg)
e4:SetOperation(c79035107.recop)
c:RegisterEffect(e4)
end
function c79035107.thfil(c)
return c:IsSetCard(0xca3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c79035107.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,Duel.GetLP(tp)/2) end
Duel.PayLPCost(tp,Duel.GetLP(tp)/2)
end
function c79035107.spfil(c,e,tp)
return c:IsSetCard(0xca3) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c79035107.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c79035107.thfil,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c79035107.spfil,tp,LOCATION_DECK,0,1,nil,e,tp)
if chk==0 then return (b1 or b2) and ep==tp end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(79035107,0),aux.Stringid(79035107,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(79035107,0))
else
op=Duel.SelectOption(tp,aux.Stringid(79035107,1))+1
end
e:SetLabel(op)
if op==0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function c79035107.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=e:GetLabel()
if op==0 then
local g=Duel.GetMatchingGroup(c79035107.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
else
local g=Duel.GetMatchingGroup(c79035107.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()<=0 then return end
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c79035107.incost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c79035107.intg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c79035107.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xca3))
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
function c79035107.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and e:GetHandler():IsReason(REASON_EFFECT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c79035107.recop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,nil,c)<=0 then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
local atk=c:GetAttack()
Duel.Recover(tp,atk,REASON_EFFECT)
end
end
--不畏苦暗·瑕光
function c79035108.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(c79035108.sfilter),1)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--atk def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c79035108.adcon)
e1:SetValue(800)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,79035108)
e3:SetRange(LOCATION_PZONE)
e3:SetCost(c79035108.spcost)
e3:SetTarget(c79035108.sptg)
e3:SetOperation(c79035108.spop)
c:RegisterEffect(e3)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(79035108,0))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c79035108.discon)
e3:SetTarget(c79035108.distg)
e3:SetOperation(c79035108.disop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(c79035108.desreptg)
e4:SetValue(c79035108.desrepval)
e4:SetOperation(c79035108.desrepop)
c:RegisterEffect(e4)
--p set
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetCondition(c79035108.pscon)
e5:SetTarget(c79035108.pstg)
e5:SetOperation(c79035108.psop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_DESTROY)
c:RegisterEffect(e6)
end
function c79035108.sfilter(c)
return c:IsSetCard(0xca3) and c:IsType(TYPE_PENDULUM)
end
function c79035108.adcon(e,c)
return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,e:GetHandler(),0xca3)
end
function c79035108.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function c79035108.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c79035108.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount()<=0 then return end
Duel.SpecialSummon(c,SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
function c79035108.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and (e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) or e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF))
end
function c79035108.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,eg,1,0,0)
end
function c79035108.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(79035109,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(79035109,0))
if Duel.NegateActivation(ev) and re:GetHandler():IsCanTurnSet() then
Duel.ChangePosition(eg,POS_FACEDOWN_DEFENSE)
local def=eg:GetFirst():GetBaseDefense()
Duel.Recover(tp,def,REASON_EFFECT)
end
end
function c79035108.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c79035108.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c79035108.repfilter,1,nil,tp)
and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c79035108.desrepval(e,c)
return c79035108.repfilter(c,e:GetHandlerPlayer())
end
function c79035108.desrepop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD)
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c79035108.retop)
Duel.RegisterEffect(e1,tp)
end
Duel.Hint(HINT_CARD,0,79035108)
end
function c79035108.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount(tp)==e:GetLabel()
end
function c79035108.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,79035108)
Duel.ReturnToField(e:GetLabelObject())
end
function c79035108.pscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ((c:IsReason(REASON_EFFECT) and rp==1-tp) or c:IsReason(REASON_BATTLE)) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c79035108.pstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c79035108.psop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--不畏苦暗·临光
function c79035109.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSetCard,0xca3),1)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
--atk def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c79035109.adcon)
e1:SetValue(800)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,79035109)
e3:SetRange(LOCATION_PZONE)
e3:SetCost(c79035109.spcost)
e3:SetTarget(c79035109.sptg)
e3:SetOperation(c79035109.spop)
c:RegisterEffect(e3)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(79035109,0))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c79035109.discon)
e3:SetTarget(c79035109.distg)
e3:SetOperation(c79035109.disop)
c:RegisterEffect(e3)
--destroy replace
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(c79035109.desreptg)
e4:SetValue(c79035109.desrepval)
e4:SetOperation(c79035109.desrepop)
c:RegisterEffect(e4)
--p set
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetCondition(c79035109.pscon)
e5:SetTarget(c79035109.pstg)
e5:SetOperation(c79035109.psop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_DESTROY)
c:RegisterEffect(e6)
end
function c79035109.adcon(e,c)
return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,e:GetHandler(),0xca3)
end
function c79035109.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function c79035109.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c79035109.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount()<=0 then return end
Duel.SpecialSummon(c,SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
function c79035109.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainDisablable(ev) and (e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) or e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF))
end
function c79035109.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c79035109.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) then
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
c:RegisterFlagEffect(79035109,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(79035109,0))
end
end
function c79035109.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD)
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c79035109.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c79035109.repfilter,1,nil,tp)
and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c79035109.desrepval(e,c)
return c79035109.repfilter(c,e:GetHandlerPlayer())
end
function c79035109.desrepop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD)
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c79035109.retop)
Duel.RegisterEffect(e1,tp)
end
Duel.Hint(HINT_CARD,0,79035109)
end
function c79035109.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,79035109)
Duel.ReturnToField(e:GetLabelObject())
end
function c79035109.pscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ((c:IsReason(REASON_EFFECT) and rp==1-tp) or c:IsReason(REASON_BATTLE)) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c79035109.pstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c79035109.psop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--涌泉净水·清流
function c79035110.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xca3),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_RECOVER)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,79035110)
e1:SetTarget(c79035110.thtg)
e1:SetOperation(c79035110.thop)
c:RegisterEffect(e1)
--up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_DEFCHANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_RECOVER)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c79035110.uptg)
e2:SetOperation(c79035110.upop)
c:RegisterEffect(e2)
end
function c79035110.thfil1(c)
return c:IsAbleToHand() and c:IsSetCard(0xca3) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))
end
function c79035110.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79035110.thfil1,tp,LOCATION_DECK,0,1,nil) and ep==tp end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c79035110.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c79035110.thfil1,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
function c79035110.uptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return ep==tp end
Duel.SetOperationInfo(0,CATEGORY_DEFCHANGE,nil,0,0,0)
end
function c79035110.upop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(300)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--驶向明日的方舟
function c79035111.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,79035111+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c79035111.tg)
e1:SetOperation(c79035111.op)
c:RegisterEffect(e1)
end
function c79035111.spfil(c,e,tp)
return c:IsSetCard(0xca3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 ) or (c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 ))
end
function c79035111.thfil(c)
return c:IsSetCard(0xca3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c79035111.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c79035111.spfil,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c79035111.thfil,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(79035111,0),aux.Stringid(79035111,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(79035111,0))
else
op=Duel.SelectOption(tp,aux.Stringid(79035111,1))+1
end
e:SetLabel(op)
if op==0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
else
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function c79035111.op(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
local g=Duel.GetMatchingGroup(c79035111.spfil,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil,e,tp)
if g:GetCount()<=0 then return end
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
else
local g=Duel.GetMatchingGroup(c79035111.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tc=g:Select(tp,1,1,nil)
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--耀眼的胜利
function c79035112.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCountLimit(1,79035112)
e1:SetTarget(c79035112.target)
e1:SetOperation(c79035112.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c79035112.eqlimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
--to grave
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetRange(LOCATION_SZONE)
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetCondition(c79035112.hdcon)
e5:SetTarget(c79035112.hdtg)
e5:SetOperation(c79035112.hdop)
c:RegisterEffect(e5)
end
function c79035112.eqlimit(e,c)
return c:IsCode(79035108,79035100)
end
function c79035112.filter(c)
return c:IsFaceup() and c:IsCode(79035108,79035100)
end
function c79035112.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c79035112.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c79035112.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c79035112.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c79035112.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.Equip(tp,e:GetHandler(),tc) and Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(79035112,0)) then
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_PZONE,0,nil)
local x=Duel.Destroy(g,REASON_EFFECT)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(x*800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function c79035112.hdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()==e:GetHandler():GetEquipTarget() and eg:GetFirst():IsStatus(STATUS_OPPO_BATTLE)
end
function c79035112.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_ONFIELD)
end
function c79035112.hdop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
...@@ -2,47 +2,46 @@ local m=82224039 ...@@ -2,47 +2,46 @@ local m=82224039
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="无限自由" cm.name="无限自由"
function cm.initial_effect(c) function cm.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,nil,3,3,cm.lcheck) aux.AddLinkProcedure(c,nil,3,3,cm.lcheck)
c:EnableReviveLimit() c:EnableReviveLimit()
--destroy --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetCost(cm.descost) e2:SetCost(cm.descost)
e2:SetTarget(cm.destg) e2:SetTarget(cm.destg)
e2:SetOperation(cm.desop) e2:SetOperation(cm.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--pendulum --pendulum
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(cm.penop) e4:SetOperation(cm.penop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.lcheck(g,lc) function cm.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_PENDULUM) and g:GetClassCount(Card.GetLinkCode)==g:GetCount() return g:IsExists(Card.IsLinkType,1,nil,TYPE_PENDULUM) and g:GetClassCount(Card.GetLinkCode)==g:GetCount()
end end
function cm.penop(e,tp,eg,ep,ev,re,r,rp) function cm.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsSummonType(TYPE_LINK) then return end if not c:IsSummonType(TYPE_LINK) or Duel.GetFlagEffect(tp,m)~=0 then return end
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON) e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
e2:SetValue(cm.pendvalue) e2:SetCountLimit(1,m)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetValue(aux.TRUE)
Duel.RegisterEffect(e2,tp) e2:SetReset(RESET_PHASE+PHASE_END)
end Duel.RegisterEffect(e2,tp)
function cm.pendvalue(e,c) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
return true end
end
function cm.cfilter(c,lg,tp) function cm.cfilter(c,lg,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsControler(tp) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsControler(tp)
and lg:IsContains(c) and lg:IsContains(c)
......
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