--Light-Crusader Stout Gardna function c249001225.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(c249001225.condition) e1:SetTarget(c249001225.target) e1:SetOperation(c249001225.operation) c:RegisterEffect(e1) --position local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_POSITION) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetTarget(c249001225.target2) e2:SetOperation(c249001225.operation2) c:RegisterEffect(e2) end function c249001225.cfilter(c) return c:IsSetCard(0x233) and not c:IsCode(249001255) end function c249001225.condition(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttacker() return at:IsControler(1-tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0) < Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) and Duel.IsExistingMatchingCard(c249001225.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end function c249001225.target(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 c249001225.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1,true) end end function c249001225.filter(c) return c:IsAttackPos() and c:IsCanChangePosition() end function c249001225.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001225.filter,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(c249001225.filter,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) end function c249001225.operation2(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c249001225.filter,tp,0,LOCATION_MZONE,nil) Duel.ChangePosition(g,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0) end