name: Raidraptor
card_text: When a "Raidraptor" monster you control is targeted for an attack by an opponent's monster: You can banish this card from your hand; destroy the attacking monster.
external_ids: local SETCARD_ID_0 = 0xba --Raidraptor
  
lua: local SETCARD_ID_0 = 0xba --Raidraptor
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_BATTLE_TARGET)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local at = eg:GetFirst()
  	return at:IsFaceup() and at:IsControler(tp) and at:IsSetCard(SETCARD_ID_0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemoveAsCost()
  	end
  	Duel.Remove(e:GetHandler(), POS_FACEUP, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local tg = Duel.GetAttacker()
  	if chk == 0 then
  		return tg:IsOnField()
  	end
  	Duel.SetTargetCard(tg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, tg, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Raidraptor
  When a "Raidraptor" monster you control is targeted for an attack by an opponent's monster: You can banish this card from your hand; destroy the attacking monster.
target_text: -- Raidraptor
  local SETCARD_ID_0 = 0xba --Raidraptor
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_BATTLE_TARGET)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local at = eg:GetFirst()
  	return at:IsFaceup() and at:IsControler(tp) and at:IsSetCard(SETCARD_ID_0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToRemoveAsCost()
  	end
  	Duel.Remove(e:GetHandler(), POS_FACEUP, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local tg = Duel.GetAttacker()
  	if chk == 0 then
  		return tg:IsOnField()
  	end
  	Duel.SetTargetCard(tg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, tg, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  