--Deepblack 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) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DAMAGE) 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) 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) local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(2273734,0)) 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.settg) e5:SetOperation(s.setop) 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(1-tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-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.Damage(p,ct*100,REASON_EFFECT) end function s.indval(e,re,r,rp) return r&REASON_BATTLE~=0 end function s.desfilter(c) return c:IsFaceup() and not c:IsCode(id) 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.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() end function s.setfilter(c) return c:IsSetCard(0x5a3) and c:IsST() and c:IsSSetable() end function s.pcfilter(c,tp) return c:IsFaceup() and c:IsCode(11111305) and not c:IsForbidden() and c:CheckUniqueOnField(tp) end function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.setfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local tc=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,tp,LOCATION_GRAVE) end function s.setop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc:IsRelateToEffect(e) then return end local ct=Duel.SSet(tp,tc) if ct<=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