--Purewhite Vertex Melody --Scripted by Zerry local s,id=GetID() function s.initial_effect(c) --pendulum summon c:EnableReviveLimit() aux.EnablePendulumAttribute(c) --Material-Less Fusion Monster local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_FUSION_MATERIAL) e2:SetCondition(function(e,g) return g==nil and Auxiliary.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end) c:RegisterEffect(e2) --[[During the Standby Phase: Gain 100 LP for each card on the field.]] local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EVENT_PHASE+PHASE_STANDBY) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --[[Once per turn, the first time an "Idolescent" monster(s) you control would be destroyed by a card effect, it is not destroyed.]] local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e3:SetRange(LOCATION_PZONE) e3:SetTargetRange(LOCATION_MZONE,0) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x5a3)) e3:SetValue(s.indval) e3:SetCountLimit(1) c:RegisterEffect(e3) --[[If this card is Special Summoned: You can target 1 Set card on the field; destroy it.]] local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(60229110,0)) e4:SetCategory(CATEGORY_DESTROY) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCountLimit(1,id+100) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetTarget(s.destg) e4:SetOperation(s.desop) c:RegisterEffect(e4) --[[If this card is sent to the Extra Deck face-up: You can target 1 "Idolescent" monster in your GY; Special Summon it, then you can place 1 face-up "Deepblack Idolescent Refrain" from your Extra Deck in your Pendulum Zone.]] local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(2273734,0)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_TO_DECK) e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e5:SetCountLimit(1,id+200) e5:SetCondition(s.spcon) e5:SetTarget(s.sptg) e5:SetOperation(s.spop) c:RegisterEffect(e5) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0) Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*100) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD,0) Duel.Recover(p,ct*100,REASON_EFFECT) end function s.indval(e,re,r,rp) return r&REASON_EFFECT~=0 end function s.desfilter(c) return c:IsFacedown() end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and s.desfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end function s.filter(c,e,tp) return c:IsSetCard(0x5a3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end function s.pcfilter(c,tp) return c:IsFaceup() and c:IsCode(11111306) and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) or Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)<=0 then return end local g=Duel.GetMatchingGroup(s.pcfilter,tp,LOCATION_EXTRA,0,nil,tp) if #g>0 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local pc=g:Select(tp,1,1,nil):GetFirst() Duel.BreakEffect() Duel.MoveToField(pc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end