--created by Thauma, coded by Lyris local s,id=GetID() function s.initial_effect(c) aux.EnablePendulumAttribute(c) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_CHANGE_LSCALE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_PZONE) e4:SetCondition(function(e) return Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),0xa44) end) e4:SetValue(8) c:RegisterEffect(e4) local e3=e4:Clone() e3:SetCode(EFFECT_CHANGE_RSCALE) c:RegisterEffect(e3) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetCountLimit(1,id) e2:SetCategory(CATEGORY_COIN) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id+100) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e1:SetCondition(s.condition) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) end s.toss_coin=true function s.filter(c,e,tp) return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xa44) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) then return end if Duel.TossCoin(tp,1)==1 then if Duel.SendtoGrave(Duel.SelectMatchingCard(tp,aux.AND(Card.IsFaceup,Card.IsType,Card.IsAbleToGrave),tp,LOCATION_EXTRA,0,1,1,nil,TYPE_PENDULUM),REASON_EFFECT)==0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP) else Duel.Destroy(c,REASON_EFFECT) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xa44) and re:IsHasType(EFFECT_TYPE_ACTIONS) end function s.sfilter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0xa44) and c:IsAbleToHand() end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.op(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end