--Kitseki Rentera --Script by XGlitchy30 function c88523882.initial_effect(c) --spsummon from hand local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(88523882,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,88523882) e1:SetCondition(c88523882.sphcon) e1:SetTarget(c88523882.sphtg) e1:SetOperation(c88523882.sphop) c:RegisterEffect(e1) --spsummon from deck local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(88523882,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(c88523882.spdcon) e2:SetTarget(c88523882.spdtg) e2:SetOperation(c88523882.spdop) c:RegisterEffect(e2) end --filters function c88523882.spsum1(c,e,tp) return c:IsSetCard(0x215a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c88523882.spsum2(c,e,tp) return c:IsSetCard(0x215a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end --spsummon from hand function c88523882.sphcon(e,tp,eg,ep,ev,re,r,rp) local ec=eg:GetFirst() return ec:IsSetCard(0x215a) and ec:GetPreviousControler()==tp end function c88523882.sphtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and Duel.IsExistingMatchingCard(c88523882.spsum1,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c88523882.sphop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE,0)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c88523882.spsum1,tp,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 --spsummon from deck function c88523882.spdcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_DESTROY) end function c88523882.spdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>0 and Duel.IsExistingMatchingCard(c88523882.spsum2,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c88523882.spdop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE,0)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c88523882.spsum2,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE) end end