From c33b23fe85bf7503366410bc4b26d7551189d255 Mon Sep 17 00:00:00 2001 From: Playmaker1210 Date: Sat, 11 Dec 2021 22:31:25 +0100 Subject: [PATCH] Tuner Star Pendulum effect working --- lua/c561586063.lua | 47 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/lua/c561586063.lua b/lua/c561586063.lua index 7b0f673..c6ae39f 100644 --- a/lua/c561586063.lua +++ b/lua/c561586063.lua @@ -20,7 +20,7 @@ function s.initial_effect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetTarget(s.sptg) - e2:SetOperation(s.spop) + e2:SetOperation(s.spops) c:RegisterEffect(e2) --spsummon from extra deck when special summon local e3=Effect.Clone(e2) @@ -28,11 +28,21 @@ function s.initial_effect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) - e3:SetTarget(s.sptg) - e3:SetOperation(s.spop) + e3:SetTarget(s.sptged) + e3:SetOperation(s.spops) 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 ------Special Summon +-----Special Summon Tuner Star function s.filtersp(c) return c:IsFaceup() and c:IsSetCard(0x25e) end @@ -45,11 +55,11 @@ end 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) 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 Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) 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 g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_EXTRA,0,nil,e,tp) if #g>0 then @@ -60,3 +70,28 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummonComplete() 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 \ No newline at end of file