--Cosmolight Pulsar function c212320.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) c:EnableReviveLimit() --draw local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(212320,0)) e1:SetCategory(CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCountLimit(1,212320) e1:SetCondition(c212320.drcon) e1:SetTarget(c212320.drtg) e1:SetOperation(c212320.drop) c:RegisterEffect(e1) --disable local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(212320,1)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_FREE_CHAIN) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,212321) e2:SetCost(c212320.cost) e2:SetTarget(c212320.distg) e2:SetOperation(c212320.disop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(212320,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,212322) e3:SetCondition(c212320.spcon) e3:SetTarget(c212320.sptg) e3:SetOperation(c212320.spop) c:RegisterEffect(e3) end function c212320.drcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function c212320.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c212320.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end function c212320.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.CheckReleaseGroup(tp,aux.AND(Card.IsFaceup,Card.IsAttribute),1,c,ATTRIBUTE_LIGHT) end local rg=Duel.SelectReleaseGroup(tp,aux.AND(Card.IsFaceup,Card.IsAttribute),1,1,c,ATTRIBUTE_LIGHT) Duel.Release(rg,REASON_COST) end function c212320.disfilter(c) return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsDisabled() end function c212320.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c212320.disfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c212320.disfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,c212320.disfilter,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0) end function c212320.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DISABLE_EFFECT) e3:SetValue(RESET_TURN_SET) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e3) if tc:IsType(TYPE_TRAPMONSTER) then local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetCode(EFFECT_DISABLE_TRAPMONSTER) e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e4) end end end function c212320.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_RELEASE) end function c212320.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c212320.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end