--Light-Crusader Vetran Commander function c249001230.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(2) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetRange(LOCATION_HAND) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetCondition(c249001230.spcon) e1:SetTarget(c249001230.sptg) e1:SetOperation(c249001230.spop) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(11819616,0)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetRange(LOCATION_MZONE) e2:SetCondition(c249001230.discon) e2:SetCost(c249001230.discost) e2:SetTarget(c249001230.distg) e2:SetOperation(c249001230.disop) c:RegisterEffect(e2) --extra summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(10719350,0)) e3:SetType(EFFECT_TYPE_FIELD) e3:SetRange(LOCATION_MZONE) e3:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0) e3:SetCode(EFFECT_EXTRA_SUMMON_COUNT) e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x233)) c:RegisterEffect(e3) --to hand local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_TOHAND) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCountLimit(1) e4:SetTarget(c249001230.target) e4:SetOperation(c249001230.operation) c:RegisterEffect(e4) end function c249001230.spcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end function c249001230.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function c249001230.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function c249001230.discon(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return tg and tg:IsExists(Card.IsOnField,1,nil) and Duel.IsChainNegatable(ev) end function c249001230.discostfilter(c) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsDiscardable() end function c249001230.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001230.filter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,c249001230.filter,1,1,REASON_COST+REASON_DISCARD) end function c249001230.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c249001230.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end function c249001230.filter(c) return c:IsSetCard(0x233) and c:IsAbleToHand() and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) end function c249001230.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c249001230.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249001230.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c249001230.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c249001230.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end