--Celestial Swordsman LV8 function c249001121.initial_effect(c) c:EnableReviveLimit() --cannot special summon local e1=Effect.CreateEffect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(aux.FALSE) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(1124) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCost(c249001121.descost) e2:SetTarget(c249001121.destg) e2:SetOperation(c249001121.desop) c:RegisterEffect(e2) --to hand local e3=Effect.CreateEffect(c) e3:SetDescription(505) e3:SetCategory(CATEGORY_TOHAND) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(c249001121.thtg) e3:SetOperation(c249001121.thop) c:RegisterEffect(e3) end c249001121.lvup={249001120} c249001121.lvdn={249001120,249001999} function c249001121.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,2,2,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c249001121.destg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local c1=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_MZONE,nil) local c2=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_SZONE,nil) if (c1>c2 and c2~=0) or c1==0 then c1=c2 end if c1~=0 then local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,c1,0,0) end end function c249001121.desop(e,tp,eg,ep,ev,re,r,rp) local g1=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil) local g2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_SZONE,nil) if g1:GetCount()>0 or g2:GetCount()>0 then if g1:GetCount()==0 then Duel.Destroy(g2,REASON_EFFECT) elseif g2:GetCount()==0 then Duel.Destroy(g1,REASON_EFFECT) else Duel.Hint(HINT_SELECTMSG,tp,0) local ac=Duel.SelectOption(tp,aux.Stringid(99458769,2),aux.Stringid(99458769,3)) if ac==0 then Duel.Destroy(g1,REASON_EFFECT) else Duel.Destroy(g2,REASON_EFFECT) end end end end function c249001121.filter(c) return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsFaceup() end function c249001121.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_REMOVED and c249001121.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249001121.filter,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c249001121.filter,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c249001121.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsRace(RACE_WARRIOR) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end