--Unseen Counter Move - Shining Strike function c249001232.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_NEGATE+CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_BECOME_TARGET) e1:SetCondition(c249001232.condition) e1:SetTarget(c249001232.target) e1:SetOperation(c249001232.activate) c:RegisterEffect(e1) --draw local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(36484016,1)) e2:SetCategory(CATEGORY_DRAW) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(c249001232.drcon) e2:SetTarget(c249001232.drtg) e2:SetOperation(c249001232.drop) c:RegisterEffect(e2) end function c249001232.filter(c,tp) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsAttribute(ATTRIBUTE_LIGHT) or (c:IsRace(RACE_SPELLCASTER) or c:IsRace(RACE_WARRIOR)) end function c249001232.condition(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and eg:IsExists(c249001232.filter,1,nil,tp) and Duel.IsChainDisablable(ev) end function c249001232.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,re:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0) end end function c249001232.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then Duel.BreakEffect() local a=re:GetHandler():GetPreviousAttackOnField() local b=re:GetHandler():GetPreviousDefenseOnField() if b>a then a=b end if a<0 then a=0 end if a>0 then Duel.Damage(1-tp,math.ceil(a/2),REASON_EFFECT) end end end function c249001232.drcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return bit.band(r,0x41)==0x41 and rp==1-tp and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) end function c249001232.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c249001232.drop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end