--Mantra Tiger --Automate ID local scard,s_id=GetID() function scard.initial_effect(c) Card.IsMantra=Card.IsMantra or (function(tc) return tc:IsSetCard(0x7d0) or (tc:GetCode()>30200 and tc:GetCode()<30230) end) --Direct Attack local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCondition(scard.condition) e1:SetTarget(scard.target) e1:SetOperation(scard.operation) c:RegisterEffect(e1) --To DEF local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DAMAGE_STEP_END) e2:SetCondition(scard.poscon) e2:SetOperation(scard.posop) c:RegisterEffect(e2) end function scard.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsMainPhase(tp,1) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end function scard.cfilter(c) return c:IsType(TYPE_MONSTER) and c:IsMantra() and c:IsAbleToGrave() end function scard.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(scard.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND) end function scard.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,scard.cfilter,tp,LOCATION_HAND,0,1,1,nil) if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and aux.PLChk(g,nil,LOCATION_GRAVE) then local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToChain() then local e1=Effect.CreateEffect(c) e1:Desc(1) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCondition(aux.BattlePhaseCond()) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end end function scard.poscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler()==Duel.GetAttacker() and e:GetHandler():IsRelateToBattle() end function scard.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsAttackPos() then Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end end