--Cyrus, Swordsman of the Silent Star function c97569820.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xd0a1),4,2) c:EnableReviveLimit() --equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(97569820,0)) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c97569820.condition) e1:SetTarget(c97569820.target) e1:SetOperation(c97569820.operation) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetDescription(aux.Stringid(97569820,0)) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e2:SetRange(LOCATION_MZONE) e2:SetCost(c97569820.cost) e2:SetTarget(c97569820.sptg) e2:SetOperation(c97569820.spop) c:RegisterEffect(e2) local e5=e2:Clone() e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_FREE_CHAIN) e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e5:SetCondition(c97569820.con) c:RegisterEffect(e5) --salvage local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND) e3:SetDescription(aux.Stringid(97569820,1)) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:SetRange(LOCATION_MZONE) e3:SetCondition(c97569820.thcon) e3:SetCost(c97569820.cost) e3:SetTarget(c97569820.thtg) e3:SetOperation(c97569820.thop) c:RegisterEffect(e3) end function c97569820.con(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetEquipGroup():IsExists(Card.IsCode,1,nil,97569840) end function c97569820.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) end function c97569820.filter(c,e,tp,ec) return c:IsSetCard(0xd0a2) and c:IsCanBeEffectTarget(e) and c:CheckUniqueOnField(tp) and c:CheckEquipTarget(ec) end function c97569820.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c97569820.filter(chkc,e,tp,e:GetHandler()) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c97569820.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler()) end local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local g=Duel.GetMatchingGroup(c97569820.filter,tp,LOCATION_GRAVE,0,nil,e,tp,e:GetHandler()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g1=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode()) if ft>1 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(97569820,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g2=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,g2:GetFirst():GetCode()) g1:Merge(g2) if ft>2 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(97569820,3)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) g2=g:Select(tp,1,1,nil) g1:Merge(g2) end end Duel.SetTargetCard(g1) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g1,g1:GetCount(),0,0) end function c97569820.operation(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) if ft0 and Duel.IsExistingMatchingCard(c97569820.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND) end function c97569820.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c97569820.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c97569820.tgfilter(c,e,tp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsControler(tp) and c:IsReason(REASON_DESTROY) and c:IsSetCard(0xd0a1) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e) end function c97569820.thcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c97569820.tgfilter,1,nil,e,tp) end function c97569820.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return eg:IsContains(chkc) and c97569820.tgfilter(chkc,e,tp) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=eg:FilterSelect(tp,c97569820.tgfilter,1,1,nil,e,tp) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c97569820.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end