name: Sasuke
card_text: If this card battles a monster, toss a coin and call heads or tails before damage calculation. If you call it right, destroy the opponent's monster with this effect.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_COIN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BATTLE_START)
  	e1:SetCondition(s.descon)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttackTarget() ~= nil
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COIN, nil, 0, tp, 1)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetAttackTarget()
  	if c == tc then
  		tc = Duel.GetAttacker()
  	end
  	if not tc:IsRelateToBattle() then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_COIN)
  	local coin = Duel.AnnounceCoin(tp)
  	local res = Duel.TossCoin(tp, 1)
  	if coin ~= res then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Sasuke
  If this card battles a monster, toss a coin and call heads or tails before damage calculation. If you call it right, destroy the opponent's monster with this effect.
target_text: -- Sasuke
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--destroy
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_COIN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_BATTLE_START)
  	e1:SetCondition(s.descon)
  	e1:SetTarget(s.destg)
  	e1:SetOperation(s.desop)
  	c:RegisterEffect(e1)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttackTarget() ~= nil
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_COIN, nil, 0, tp, 1)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetAttackTarget()
  	if c == tc then
  		tc = Duel.GetAttacker()
  	end
  	if not tc:IsRelateToBattle() then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_COIN)
  	local coin = Duel.AnnounceCoin(tp)
  	local res = Duel.TossCoin(tp, 1)
  	if coin ~= res then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  