Tuner Star Pendulum effect working
This commit is contained in:
@@ -20,7 +20,7 @@ function s.initial_effect(c)
|
|||||||
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
|
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
|
||||||
e2:SetCode(EVENT_SUMMON_SUCCESS)
|
e2:SetCode(EVENT_SUMMON_SUCCESS)
|
||||||
e2:SetTarget(s.sptg)
|
e2:SetTarget(s.sptg)
|
||||||
e2:SetOperation(s.spop)
|
e2:SetOperation(s.spops)
|
||||||
c:RegisterEffect(e2)
|
c:RegisterEffect(e2)
|
||||||
--spsummon from extra deck when special summon
|
--spsummon from extra deck when special summon
|
||||||
local e3=Effect.Clone(e2)
|
local e3=Effect.Clone(e2)
|
||||||
@@ -28,11 +28,21 @@ function s.initial_effect(c)
|
|||||||
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
|
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
|
||||||
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
|
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
|
||||||
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
|
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
|
||||||
e3:SetTarget(s.sptg)
|
e3:SetTarget(s.sptged)
|
||||||
e3:SetOperation(s.spop)
|
e3:SetOperation(s.spops)
|
||||||
c:RegisterEffect(e3)
|
c:RegisterEffect(e3)
|
||||||
|
--Special summon from the pendulum zone
|
||||||
|
local e4=Effect.CreateEffect(c)
|
||||||
|
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
|
||||||
|
e4:SetType(EFFECT_TYPE_IGNITION)
|
||||||
|
e4:SetRange(LOCATION_PZONE)
|
||||||
|
e4:SetCountLimit(1,id)
|
||||||
|
e4:SetCost(s.cost)
|
||||||
|
e4:SetTarget(s.sptg)
|
||||||
|
e4:SetOperation(s.spop)
|
||||||
|
c:RegisterEffect(e4)
|
||||||
end
|
end
|
||||||
-----Special Summon
|
-----Special Summon Tuner Star
|
||||||
function s.filtersp(c)
|
function s.filtersp(c)
|
||||||
return c:IsFaceup() and c:IsSetCard(0x25e)
|
return c:IsFaceup() and c:IsSetCard(0x25e)
|
||||||
end
|
end
|
||||||
@@ -45,11 +55,11 @@ end
|
|||||||
function s.filter(c,e,tp)
|
function s.filter(c,e,tp)
|
||||||
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and not c:IsType(TYPE_FUSION) and not c:IsType(TYPE_SYNCHRO) and not c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
|
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and not c:IsType(TYPE_FUSION) and not c:IsType(TYPE_SYNCHRO) and not c:IsType(TYPE_XYZ) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
|
||||||
end
|
end
|
||||||
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
|
function s.sptged(e,tp,eg,ep,ev,re,r,rp,chk)
|
||||||
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
|
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
|
||||||
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
|
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
|
||||||
end
|
end
|
||||||
function s.spop(e,tp,eg,ep,ev,re,r,rp)
|
function s.spops(e,tp,eg,ep,ev,re,r,rp)
|
||||||
local c=e:GetHandler()
|
local c=e:GetHandler()
|
||||||
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
|
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
|
||||||
if #g>0 then
|
if #g>0 then
|
||||||
@@ -60,3 +70,28 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
|
|||||||
Duel.SpecialSummonComplete()
|
Duel.SpecialSummonComplete()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-----Pendulum zone sp summon
|
||||||
|
------ dark armed dragon
|
||||||
|
function s.costfilter(c)
|
||||||
|
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
|
||||||
|
end
|
||||||
|
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
|
||||||
|
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
|
||||||
|
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
|
||||||
|
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
|
||||||
|
Duel.Remove(g,POS_FACEUP,REASON_COST)
|
||||||
|
end
|
||||||
|
|
||||||
|
--abyss actor
|
||||||
|
function s.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 s.spop(e,tp,eg,ep,ev,re,r,rp)
|
||||||
|
local c=e:GetHandler()
|
||||||
|
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
|
||||||
|
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user