--Solomon, Leader of the Divine Blade function c88567310.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,nil,5,3,c88567310.ovfilter,aux.Stringid(88567310,0),3,c88567310.xyzop) c:EnableReviveLimit() --remove local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(88567310,1)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_BATTLED) e1:SetCondition(c88567310.condition) e1:SetTarget(c88567310.target) e1:SetOperation(c88567310.operation) c:RegisterEffect(e1) --Back to Deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(88567310,2)) e2:SetCategory(CATEGORY_TODECK) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(c88567310.tdcost) e2:SetTarget(c88567310.tdtg) e2:SetOperation(c88567310.tdop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(88567310,3)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_TO_GRAVE) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCountLimit(1,16691075) e3:SetCondition(c88567310.spcon) e3:SetTarget(c88567310.sptg) e3:SetOperation(c88567310.spop) c:RegisterEffect(e3) end function c88567310.ovfilter(c) return c:IsFaceup() and c:IsSetCard(0x1bc2) and c:IsType(TYPE_XYZ) and c:GetRank()==4 end function c88567310.xyzop(e,tp,chk) if chk==0 then return Duel.GetFlagEffect(tp,88567310)==0 end Duel.RegisterFlagEffect(tp,88567310,RESET_PHASE+PHASE_END,0,1) end function c88567310.condition(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetHandler():GetBattleTarget() return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) end function c88567310.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local bc=e:GetHandler():GetBattleTarget() Duel.SetOperationInfo(0,CATEGORY_REMOVE,bc,1,0,0) end function c88567310.operation(e,tp,eg,ep,ev,re,r,rp) local bc=e:GetHandler():GetBattleTarget() if bc:IsRelateToBattle() then Duel.Remove(bc,POS_FACEUP,REASON_EFFECT) end end function c88567310.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c88567310.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToDeck() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) end function c88567310.tdop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) end end function c88567310.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_XYZ) end function c88567310.spfilter(c,e,tp) return c:IsSetCard(0x1bc2) and c:GetRank()==4 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) end function c88567310.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(c88567310.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_OPSELECTED,tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c88567310.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCountFromEx(tp)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c88567310.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local tc=g:GetFirst() if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then Duel.Overlay(tc,Group.FromCards(c)) tc:CompleteProcedure() end end