name: Dark
card_text: If a "Spirit Message" card would be placed on your field with "Destiny Board", you can Special Summon it as a Normal Monster (Fiend/DARK/Level 1/ATK 0/DEF 0) instead, and if you do, it is unaffected by card effects, except "Destiny Board", and cannot be targeted for attacks, but does not prevent your opponent from attacking you directly. When an opponent's monster declares an attack: Toss a coin and if the result is heads, negate the attack, and if you do, inflict damage to your opponent equal to half the current ATK of that opponent's monster.
external_ids: local CARD_ID_0 = 94212438 --Destiny Board
  
lua: local CARD_ID_0 = 94212438 --Destiny Board
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--update effect check
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(id)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 0)
  	c:RegisterEffect(e2)
  	--negate attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCategory(CATEGORY_COIN)
  	e4:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCondition(s.condition)
  	e4:SetTarget(s.target)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  end
  function s.efilter(e, te)
  	local tc = te:GetHandler()
  	return not tc:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.target(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.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetAttacker()
  	local coin = Duel.TossCoin(tp, 1)
  	if coin == 1 then
  		if Duel.NegateAttack() then
  			Duel.Damage(1 - tp, math.floor(tc:GetAttack() / 2), REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Dark
  If a "Spirit Message" card would be placed on your field with "Destiny Board", you can Special Summon it as a Normal Monster (Fiend/DARK/Level 1/ATK 0/DEF 0) instead, and if you do, it is unaffected by card effects, except "Destiny Board", and cannot be targeted for attacks, but does not prevent your opponent from attacking you directly. When an opponent's monster declares an attack: Toss a coin and if the result is heads, negate the attack, and if you do, inflict damage to your opponent equal to half the current ATK of that opponent's monster.
target_text: -- Dark
  local CARD_ID_0 = 94212438 --Destiny Board
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--update effect check
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(id)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetTargetRange(1, 0)
  	c:RegisterEffect(e2)
  	--negate attack
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCategory(CATEGORY_COIN)
  	e4:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCondition(s.condition)
  	e4:SetTarget(s.target)
  	e4:SetOperation(s.operation)
  	c:RegisterEffect(e4)
  end
  function s.efilter(e, te)
  	local tc = te:GetHandler()
  	return not tc:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer()
  end
  function s.target(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.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetAttacker()
  	local coin = Duel.TossCoin(tp, 1)
  	if coin == 1 then
  		if Duel.NegateAttack() then
  			Duel.Damage(1 - tp, math.floor(tc:GetAttack() / 2), REASON_EFFECT)
  		end
  	end
  end
  
  