--Salazar, Phantom of Silent Star function c97569821.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(97569821,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(c97569821.condition) e1:SetTarget(c97569821.target) e1:SetOperation(c97569821.operation) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(97569821,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e2:SetCost(c97569821.descost) e2:SetTarget(c97569821.destg) e2:SetOperation(c97569821.desop) 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(c97569821.con) c:RegisterEffect(e5) end function c97569821.con(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetEquipGroup():IsExists(Card.IsCode,1,nil,97569840) end function c97569821.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) end function c97569821.filter(c,e,tp,ec) return c:IsSetCard(0xd0a2) and c:IsCanBeEffectTarget(e) and c:CheckUniqueOnField(tp) and c:CheckEquipTarget(ec) end function c97569821.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c97569821.filter(chkc,e,tp,e:GetHandler()) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c97569821.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,e:GetHandler()) end local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local g=Duel.GetMatchingGroup(c97569821.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(97569821,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(97569821,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 c97569821.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 then Duel.Destroy(g,REASON_EFFECT) end end