Commit 0be8b79b authored by mercury233's avatar mercury233

fix

parent 1634c587
......@@ -12,7 +12,7 @@ function c100277002.initial_effect(c)
e1:SetCost(c100277002.spcost)
e1:SetTarget(c100277002.sptg)
e1:SetOperation(c100277002.spop)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--attack up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100277002,1))
......
......@@ -4,8 +4,8 @@
function c100416011.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
......
......@@ -4,8 +4,8 @@
function c100416012.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
......@@ -45,7 +45,6 @@ function c100416012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100416012.rfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c100416012.rfilter,1,1,nil,tp)
aux.UseExtraReleaseCount(g,tp)
Duel.Release(g,REASON_COST)
end
function c100416012.spfilter(c,e,tp)
......@@ -90,7 +89,7 @@ function c100416012.tgcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP) and c:GetSequence()<5
end
function c100416012.cfilter(c)
return not c:IsRace(RACE_REPTILE) and c:IsFaceup() and c:IsAbleToGrave()
return not c:IsRace(RACE_REPTILE) and c:IsFaceup() and c:IsAbleToGrave()
end
function c100416012.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -5,8 +5,8 @@ function c100416013.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100416013+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100416013.target)
e1:SetOperation(c100416013.operation)
......
......@@ -51,12 +51,12 @@ function c100416019.actop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c100416019.chlimit)
elseif Duel.GetCurrentChain()==1 then
c:RegisterFlagEffect(100416019,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416019.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
......@@ -99,7 +99,7 @@ function c100416019.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c100416019.pfilter(c)
function c100416019.pfilter(c)
local lsc=c:GetLeftScale()
local rsc=c:GetRightScale()
return (lsc%2~=0 or rsc%2~=0) and c:IsType(TYPE_PENDULUM)
......@@ -109,7 +109,8 @@ function c100416019.actfilter2(c,tp)
end
function c100416019.actcon2(e)
local a=Duel.GetAttacker()
return a and a:IsControler(e:GetHandlerPlayer()) and a:IsSetCard(0x265)
local tp=e:GetHandlerPlayer()
return a and a:IsControler(tp) and a:IsSetCard(0x265)
and Duel.IsExistingMatchingCard(c100416019.pfilter,tp,LOCATION_PZONE,0,1,nil)
end
function c100416019.actlimit2(e,re,tp)
......
......@@ -53,12 +53,12 @@ function c100416020.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c100416020.chlimit)
elseif Duel.GetCurrentChain()==1 then
c:RegisterFlagEffect(100416020,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(c100416020.resetop)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
local e2=e1:Clone()
e2:SetCode(EVENT_BREAK_EFFECT)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
......@@ -81,7 +81,7 @@ end
function c100416020.rfilter(c,szone)
return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or szone and c:IsType(TYPE_SPELL+TYPE_TRAP))
end
function c100416020.pfilter(c)
function c100416020.pfilter(c)
local lsc=c:GetLeftScale()
local rsc=c:GetRightScale()
return (lsc%2==0 or rsc%2==0) and c:IsType(TYPE_PENDULUM)
......
......@@ -34,14 +34,14 @@ function c100416022.toexfilter2(c)
end
function c100416022.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c100416022.pendfilter,tp,LOCATION_DECK,0,1,nil)
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
local b2=Duel.IsExistingMatchingCard(c100416022.toexfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c100416022.pendfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c100416022.pendfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.CheckLocation(tp,LOCATION_PZONE,0) and Duel.CheckLocation(tp,LOCATION_PZONE,1)
local b3=Duel.IsExistingMatchingCard(c100416022.toexfilter1,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100416022.toexfilter2,tp,LOCATION_PZONE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2)
and Duel.IsPlayerCanDraw(tp,2)
if chk==0 then return b1 or b2 or b3 end
local off=1
local ops,opval={},{}
......@@ -87,16 +87,16 @@ function c100416022.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100416022,3))
local g=Duel.SelectMatchingCard(tp,c100416022.toexfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoExtraP(g,tp,REASON_EFFECT)~=0 then
local g1=Duel.GetMatchingGroup(c100416022.pendfilter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c100416022.pendfilter2,tp,LOCATION_DECK,0,nil)
local g1=Duel.GetMatchingGroup(c100416022.pendfilter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(c100416022.pendfilter2,tp,LOCATION_DECK,0,nil)
if g1:GetCount()>0 and g2:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg1=g1:Select(tp,1,1,nil)
local sg1=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg2=g2:Select(tp,1,1,nil)
sg1:Merge(sg2)
local tc=sg1:GetFirst()
sg1:Merge(sg2)
local tc=sg1:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
tc=sg1:GetNext()
......
......@@ -39,38 +39,33 @@ function c100416023.operation(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)>0
if b1 and Duel.SelectYesNo(tp,aux.Stringid(100416023,0)) then
c100416023.place(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=Duel.SelectMatchingCard(tp,c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=sg:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
g=Duel.GetMatchingGroup(c100416023.cfilter,tp,LOCATION_ONFIELD,0,nil)
ct=g:GetClassCount(Card.GetCode)
local b2=ct>=5 and Duel.IsExistingMatchingCard(c100416023.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if b2 and Duel.SelectYesNo(tp,aux.Stringid(100416023,1)) then
Duel.BreakEffect()
c100416023.specialsummon(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100416023.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
g=Duel.GetMatchingGroup(c100416023.cfilter,tp,LOCATION_ONFIELD,0,nil)
ct=g:GetClassCount(Card.GetCode)
local b3=ct>=7 and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)>0
if b3 and Duel.SelectYesNo(tp,aux.Stringid(100416023,2)) then
Duel.BreakEffect()
c100416023.destroy(e,tp,eg,ep,ev,re,r,rp)
end
end
function c100416023.place(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sg=Duel.SelectMatchingCard(tp,c100416023.tpfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=sg:GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c100416023.specialsummon(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100416023.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c100416023.destroy(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -6,7 +6,7 @@ function c100416024.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100416024,0))
......@@ -61,7 +61,7 @@ function c100416024.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c100416024.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c100416024.scfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
local sc=g:GetFirst()
local sc=g:GetFirst()
if sc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -77,7 +77,7 @@ end
function c100416024.getscale(c)
if c:GetSequence()>0 and c:IsLocation(LOCATION_PZONE) then return c:GetRightScale() else return c:GetLeftScale() end
end
function c100416024.desfilter(c,odevity)
function c100416024.desfilter(c,odevity)
local sc=c100416024.getscale(c)
return c:IsSetCard(0x265) and c:GetOriginalType()&TYPE_PENDULUM>0 and c:IsFaceup() and sc%2==odevity
end
......
......@@ -23,7 +23,8 @@ function c100416025.chkfilter(c,tp,odevity)
end
end
function c100416025.spfilter(c,e,tp,odevity)
return c:IsFaceup() and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:GetLeftScale()%2==odevity and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
return c:IsFaceup() and c:IsSetCard(0x265) and c:IsType(TYPE_PENDULUM) and c:GetLeftScale()%2==odevity
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c100416025.chkcon(g,e,tp,odevity)
return g:IsExists(c100416025.chkfilter,1,nil,tp,odevity) and Duel.IsExistingMatchingCard(c100416025.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,odevity)
......
......@@ -49,13 +49,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -49,13 +49,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -49,13 +49,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -50,13 +50,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -50,13 +50,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -50,13 +50,11 @@ function Auxiliary.UrsarcticSpSummonCost(e,tp,eg,ep,ev,re,r,rp,chk)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:Select(tp,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local tc=g1:Select(tp,1,1,nil):GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
Duel.Release(tc,REASON_COST)
end
......
......@@ -104,20 +104,19 @@ function c100416033.tgfilter(c,e,tp,check)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c100416033.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp):Filter(c100416033.rfilter,e:GetHandler(),tp)
local g1=Duel.GetReleaseGroup(tp):Filter(c100416033.rfilter,nil,tp)
local g2=Duel.GetMatchingGroup(c100416033.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return g1:IsExists(c100416033.costfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
tc=g1:FilterSelect(tp,c100416033.costfilter,1,1,nil,e,tp):GetFirst()
if tc:IsLocation(LOCATION_GRAVE) then
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
local rg=g1:FilterSelect(tp,c100416033.costfilter,1,1,nil,e,tp)
local tc=rg:GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
aux.UseExtraReleaseCount(Group.FromCards(tc),tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(tc,REASON_COST)
end
end
......
......@@ -96,23 +96,25 @@ function c100416035.negcon(e,tp,eg,ep,ev,re,r,rp)
return tg and tg:IsExists(c100416035.negfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function c100416035.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND+LOCATION_MZONE) then
return c:IsType(TYPE_MONSTER) and c:IsReleasable()
else
return c:IsAbleToRemove() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
return c:IsType(TYPE_MONSTER) --and (c:IsControler(tp) or c:IsFaceup())
end
function c100416035.excostfilter(c,tp)
return c:IsAbleToRemove() and (c:IsHasEffect(100416036,tp) or c:IsHasEffect(100416038,tp))
end
function c100416035.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100416035.costfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) end
local g1=Duel.GetReleaseGroup(tp,true):Filter(c100416035.costfilter,nil,tp)
local g2=Duel.GetMatchingGroup(c100416035.excostfilter,tp,LOCATION_GRAVE,0,nil,tp)
g1:Merge(g2)
if chk==0 then return #g1>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c100416035.costfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,tp)
local tc=g:GetFirst()
local rg=g1:Select(tp,1,1,nil)
local tc=rg:GetFirst()
local te=tc:IsHasEffect(100416036,tp) or tc:IsHasEffect(100416038,tp)
if te then
te:UseCountLimit(tp)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
else
aux.UseExtraReleaseCount(Group.FromCards(tc),tp)
aux.UseExtraReleaseCount(rg,tp)
Duel.Release(tc,REASON_COST)
end
end
......
......@@ -100,10 +100,10 @@ function c101105204.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c:IsAbleToRemove() and aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
local g=eg:Clone()+c
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
if re:GetHandler():IsRelateToEffect(re) then
local g=eg:Clone()+c
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
end
function c101105204.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -50,7 +50,7 @@ function c101105205.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1)
else
Duel.ConfirmCards(1-tp,tc)
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
end
end
......
......@@ -38,7 +38,7 @@ function c101105206.activate(e,tp,eg,ep,ev,re,r,rp)
local chk=Duel.IsExistingMatchingCard(c101105206.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c101105206.tgfilter,tp,LOCATION_DECK,0,1,1,nil,chk)
local tc=g:GetFirst()
local tc=g:GetFirst()
if tc then
if chk and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1191,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......@@ -62,7 +62,7 @@ function c101105206.lvlop(e,tp,eg,ep,ev,re,r,rp)
if tc:IsRelateToEffect(e) then
local opt=0
if tc:IsLevel(1) then
opt=Duel.SelectOption(tp,aux.Stringid(101105206,1))
opt=Duel.SelectOption(tp,aux.Stringid(101105206,1))
else
opt=Duel.SelectOption(tp,aux.Stringid(101105206,1),aux.Stringid(101105206,2)) --increase / decrease
end
......
......@@ -30,7 +30,7 @@ function c101105207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c101105207.filter,tp,LOCATION_MZONE,0,1,1,nil)
local op
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(101105207,0),aux.Stringid(101105207,1),aux.Stringid(101105207,2))
op=Duel.SelectOption(tp,aux.Stringid(101105207,0),aux.Stringid(101105207,1),aux.Stringid(101105207,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(101105207,0))
else
......@@ -46,63 +46,47 @@ function c101105207.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c101105207.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local op=e:GetLabel()
if op==0 then
c101105207.equip(e,tp,eg,ep,ev,re,r,rp)
elseif op==1 then
c101105207.directattack(e,tp,eg,ep,ev,re,r,rp)
else
c101105207.damage(e,tp,eg,ep,ev,re,r,rp)
end
end
function c101105207.equip(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101105207.eqfilter,tp,0,LOCATION_MZONE,1,1,nil)
local ec=g:GetFirst()
if ec then
if not Duel.Equip(tp,ec,tc) then return end
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(c101105207.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c101105207.eqfilter,tp,0,LOCATION_MZONE,1,1,nil)
local ec=g:GetFirst()
if ec then
if not Duel.Equip(tp,ec,tc) then return end
--equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(c101105207.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
end
end
end
end
function c101105207.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c101105207.directattack(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
elseif op==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
else
tc:RegisterFlagEffect(101105207,RESET_EVENT+RESETS_STANDARD,0,1,tc:GetFieldID())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCondition(c101105207.damcon)
e1:SetOperation(c101105207.damop)
Duel.RegisterEffect(e1,tp)
end
end
function c101105207.damage(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
tc:RegisterFlagEffect(101105207,RESET_EVENT+RESETS_STANDARD,0,1,tc:GetFieldID())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCondition(c101105207.damcon)
e1:SetOperation(c101105207.damop)
Duel.RegisterEffect(e1,tp)
function c101105207.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c101105207.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
......@@ -114,7 +98,7 @@ function c101105207.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local bc=tc:GetBattleTarget()
if not bc then return end
local dam=math.max(bc:GetBaseAttack(),0)
local dam=bc:GetBaseAttack()
if dam>0 then
Duel.Hint(HINT_CARD,0,101105207)
Duel.Damage(1-tp,dam,REASON_EFFECT)
......
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