--Galaxy Sabers function c405102.initial_effect(c) --Discard local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCost(c405102.cost) e1:SetTarget(c405102.target) e1:SetOperation(c405102.activate) c:RegisterEffect(e1) --Spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_BATTLE_DESTROYING) e2:SetCondition(aux.bdocon) e2:SetTarget(c405102.sptg) e2:SetOperation(c405102.spop) c:RegisterEffect(e2) end function c405102.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() end Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end function c405102.filter1(c,tp) local lv1=c:GetLevel() return c:IsFaceup() and c:IsSetCard(0x55) or c:IsSetCard(0x7b) and lv1~=0 and Duel.IsExistingTarget(c405102.filter2,tp,LOCATION_MZONE,0,1,c,lv1) end function c405102.filter2(c,lv) local lv2=c:GetLevel() return c:IsFaceup() and c:IsSetCard(0x55) or c:IsSetCard(0x7b) and lv2~=0 and lv2~=lv end function c405102.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c405102.filter1,tp,LOCATION_MZONE,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g1=Duel.SelectTarget(tp,c405102.filter1,tp,LOCATION_MZONE,0,1,1,nil,tp) local tc1=g1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g2=Duel.SelectTarget(tp,c405102.filter2,tp,LOCATION_MZONE,0,1,1,tc1,tc1:GetLevel()) end function c405102.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tc1=g:GetFirst() local tc2=g:GetNext() local lv1=tc1:GetLevel() local lv2=tc2:GetLevel() if lv1==lv2 then return end if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local sg=g:Select(tp,1,1,nil) if sg:GetFirst()==tc1 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(lv1) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) tc2:RegisterEffect(e1) if lv10 and Duel.IsExistingTarget(c405102.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c405102.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c405102.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end