--Abyss Actor - Midnight Wolf --scripted by Rawstone local s,id=GetID() function s.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --Special Summon from Pzone local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetCondition(s.conditionfilter) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --add field spell local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCountLimit(1,id+100) e2:SetCondition(s.chcon2) e2:SetTarget(s.ta) e2:SetOperation(s.addde) c:RegisterEffect(e2) --Atk raise local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetCountLimit(1,id+200) e3:SetCondition(s.thcon) e3:SetTarget(s.mfield) e3:SetOperation(s.raisestats) c:RegisterEffect(e3) end function s.conditionfilter(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_PZONE,0,1,e:GetHandler(),0x10ec) end 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.SetCardOperationInfo(c,CATEGORY_SPECIAL_SUMMON) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToChain() then end Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end function s.chcon2(e,tp,eg,ep,ev,re,r,rp) local rc=eg:GetFirst() return rc:IsRelateToBattle() and rc:IsStatus(STATUS_OPPO_BATTLE) and rc:IsFaceup() and rc:IsMonster(TYPE_PENDULUM) and rc:IsSetCard(0x10ec) and rc:IsControler(tp) end function s.targetfilter(c,tp) return c:IsCode(77297908) and c:IsAbleToHand() end function s.ta(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.targetfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.addde(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.targetfilter,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 s.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 end function s.atkfilter(c) return c:IsFaceup() and c:IsSetCard(0x10ec) end function s.mfield(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if chk==0 then return #g>0 end Duel.SetCustomOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,LOCATION_MZONE,500) Duel.SetCustomOperationInfo(0,CATEGORY_DEFCHANGE,g,#g,tp,LOCATION_MZONE,500) end function s.raisestats(e,tp,eg,ep,ev,re,r,rp,chk) local tg=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if #tg>0 then local sc=tg:GetFirst() while sc do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetReset(RESET_EVENT+RESETS_STANDARD) sc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) sc:RegisterEffect(e2) sc=tg:GetNext() end end end