--Rocksaber Darius function c96643261.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(96643261,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,432611) e1:SetCondition(c96643261.spcon) e1:SetCost(c96643261.spcost) e1:SetTarget(c96643261.sptg) e1:SetOperation(c96643261.spop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(96643261,1)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,432612) e2:SetCost(c96643261.cost) e2:SetTarget(c96643261.target) e2:SetOperation(c96643261.operation) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e3) local e4=e2:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) --tohand local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(96643261,2)) e5:SetCategory(CATEGORY_TOHAND) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCode(EVENT_TO_GRAVE) e5:SetCountLimit(1,432612) e5:SetCondition(c96643261.thcon) e5:SetTarget(c96643261.thtg) e5:SetOperation(c96643261.thop) c:RegisterEffect(e5) end function c96643261.spfilter(c) return c:IsFaceup() and c:IsSetCard(0xdfa) and c:IsType(TYPE_LINK) end function c96643261.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c96643261.spfilter,tp,LOCATION_MZONE,0,1,nil) end function c96643261.cfilter(c) return c:IsFaceup() and c:IsSetCard(0xdfa) and c:IsAbleToGraveAsCost() end function c96643261.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c96643261.cfilter,tp,LOCATION_EXTRA,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c96643261.cfilter,tp,LOCATION_EXTRA,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function c96643261.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(c96643261.spfilter,tp,LOCATION_MZONE,0,nil) if g:GetCount()<=0 then return false end local zone=0 for tc in aux.Next(g) do zone=bit.bor(zone,tc:GetLinkedZone(tp)) end zone=bit.band(zone,0x1f) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c96643261.spop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local c=e:GetHandler() if c:IsRelateToEffect(e) and zone~=0 then local g=Duel.GetMatchingGroup(c96643261.spfilter,tp,LOCATION_MZONE,0,nil) if g:GetCount()<=0 then return end local zone=0 for tc in aux.Next(g) do zone=bit.bor(zone,tc:GetLinkedZone(tp)) end zone=bit.band(zone,0x1f) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP,zone) end end function c96643261.scfilter(c) return c:IsSetCard(0xdfa) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() end function c96643261.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c96643261.scfilter,tp,LOCATION_HAND,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c96643261.scfilter,tp,LOCATION_HAND,0,1,1,nil) Duel.SendtoGrave(g,REASON_COST) end function c96643261.filter(c) return c:IsSetCard(0xdfa) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c96643261.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c96643261.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c96643261.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c96643261.filter,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 c96643261.thcon(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetPreviousLocation(),LOCATION_EXTRA)~=0 end function c96643261.thfilter(c) return c:IsSetCard(0xdfa) and not c:IsCode(96643261) and c:IsAbleToHand() end function c96643261.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c96643261.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) end function c96643261.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c96643261.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end