Commit fff2679c authored by salix5's avatar salix5 Committed by GitHub

update Spell Counter (#1593)

parent 426d25f2
--漆黒のパワーストーン
function c34029630.initial_effect(c)
c:EnableCounterPermit(0x1)
--special counter permit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_COUNTER_PERMIT+0x1)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c34029630.ctpermit)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
......@@ -31,6 +38,10 @@ function c34029630.initial_effect(c)
e4:SetCondition(c34029630.descon)
c:RegisterEffect(e4)
end
function c34029630.ctpermit(e)
local c=e:GetHandler()
return c:IsLocation(LOCATION_SZONE) and c:IsStatus(STATUS_CHAINING)
end
function c34029630.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c34029630.filter(chkc) end
local c=e:GetHandler()
......
......@@ -66,13 +66,12 @@ function c3611830.descost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveCounter(tp,1,0,0x1,6,REASON_COST)
end
function c3611830.cfilter(c)
return c:IsCanAddCounter(0x1)
return c:IsCanHaveCounter(0x1)
end
function c3611830.destg(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)
and Duel.IsCanAddCounter(tp,0x1,1,c)
and Duel.IsExistingMatchingCard(c3611830.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
and Duel.IsCanAddCounter(tp,0x1,1,c) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
......
......@@ -51,7 +51,7 @@ function c38325384.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)
end
function c38325384.spfilter(c,e,tp)
return c:IsCanAddCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanHaveCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c38325384.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -66,7 +66,7 @@ function c39000945.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c39000945.spfilter(c,e,tp)
return c:IsCanAddCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanHaveCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c39000945.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -49,7 +49,7 @@ function c54965929.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c54965929.spfilter(c,e,tp)
return c:IsCanAddCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanHaveCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c54965929.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......
......@@ -79,7 +79,7 @@ function c66104644.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c66104644.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanAddCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c)
return c:IsFaceup() and c:IsCanHaveCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c66104644.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -121,7 +121,7 @@ function c66104644.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveCounter(tp,1,0,0x1,3,REASON_COST)
end
function c66104644.spfilter2(c,e,tp)
return c:IsCanAddCounter(0x1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsCanHaveCounter(0x1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c66104644.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -75,7 +75,7 @@ function c92559258.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c92559258.spfilter(c,e,tp)
return c:IsAttackAbove(1000) and c:IsCanAddCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsAttackAbove(1000) and c:IsCanHaveCounter(0x1) and Duel.IsCanAddCounter(tp,0x1,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c92559258.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -47,7 +47,7 @@ function c94599451.ctop(e,tp,eg,ep,ev,re,r,rp)
end
function c94599451.thfilter1(c,tp)
local lv=c:GetLevel()
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and lv>0 and c:IsCanAddCounter(0x1)
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and lv>0 and c:IsCanHaveCounter(0x1)
and Duel.IsCanRemoveCounter(tp,1,0,0x1,lv,REASON_COST) and c:IsAbleToHand()
end
function c94599451.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -72,7 +72,7 @@ function c94599451.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c94599451.thfilter2(c,lv)
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsCanAddCounter(0x1)
return (c:IsLocation(LOCATION_DECK) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsCanHaveCounter(0x1)
and c:IsLevel(lv) and c:IsAbleToHand()
end
function c94599451.thop(e,tp,eg,ep,ev,re,r,rp)
......
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