--created by Thauma, coded by Lyris local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddSynchroProcedure2(c,aux.FilterBoolFunction(Card.IsSetCard,0xa44),aux.NonTuner(Card.IsSetCard,0xa44)) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e1:SetCondition(function(e,tp,eg,ep,ev) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) end) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id+100) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) end s.toss_dice=true function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(aux.OR(Card.IsFaceup,aux.NOT(Card.IsLocation)),Card.IsAbleToGraveAsCost),tp,0x4e,0,6,nil,LOCATION_EXTRA) end local ct=Duel.TossDice(tp,1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.SendtoGrave(Duel.SelectMatchingCard(tp,aux.AND(aux.OR(Card.IsFaceup,aux.NOT(Card.IsLocation)),Card.IsAbleToGraveAsCost),tp,0x4e,0,ct,ct,nil,LOCATION_EXTRA),REASON_COST) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return aux.nbcon(tp,re) end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0) end end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Remove(eg,POS_FACEUP,REASON_EFFECT) end end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_PZONE) and c:GetPreviousControler()==tp end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,tp) end function s.filter(c,e,tp) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xa44) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCountFromEx(tp)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP) end