-- Succubus Skull function c123365.initial_effect(c) --Name local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_GRAVE+LOCATION_MZONE) e1:SetValue(70781052) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetTarget(c123365.sptg) e2:SetOperation(c123365.spop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET) e3:SetCondition(c123365.atcon) e3:SetValue(1) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(c123365.adcon) e4:SetTarget(c123365.adtg) e4:SetOperation(c123365.adop) c:RegisterEffect(e4) end function c123365.adcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) end function c123365.thfilter(c) return c:IsSetCard(0x45) and c:IsAbleToHand() end function c123365.adtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c123365.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c123365.adop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c123365.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c123365.atfilter(c) return c:IsFaceup() and c:IsRace(RACE_FIEND) end function c123365.atcon(e) return Duel.IsExistingMatchingCard(c123365.atfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler()) end function c123365.spfilter(c,e,tp) return c:IsType(TYPE_NORMAL) and c:IsRace(RACE_FIEND) and c:GetLevel()==6 and c:IsCanBeSpecialSummoned(e,0,tp,true,false) end function c123365.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c123365.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c123365.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c123365.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c123365.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end