name: Light
card_text: Once per turn, during your Standby Phase: Toss a coin. If the result is Tails, the following effects are negated until your next Standby Phase.
  ● When you Summon an "Arcana Force" monster, choose which effect to apply without tossing a coin.
  ● If your "Arcana Force" monster destroys an opponent's monster by battle: You gain LP equal to the destroyed monster's original ATK.
external_ids: local SETCARD_ID_0 = 0x5 --Arcana
  
lua: local SETCARD_ID_0 = 0x5 --Arcana
  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)
  	--coin
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_COIN)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCountLimit(1)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetCondition(s.coincon)
  	e2:SetTarget(s.cointg)
  	e2:SetOperation(s.coinop)
  	c:RegisterEffect(e2)
  	--
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(id)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(1, 0)
  	e3:SetCondition(s.effectcon)
  	c:RegisterEffect(e3)
  	--
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_RECOVER)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCode(EVENT_BATTLE_DESTROYING)
  	e4:SetCondition(s.reccon)
  	e4:SetTarget(s.rectg)
  	e4:SetOperation(s.recop)
  	c:RegisterEffect(e4)
  end
  function s.coincon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.cointg(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.coinop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local res = Duel.TossCoin(tp, 1)
  	if res == 0 then
  		c:RegisterFlagEffect(73206828, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 0, 2)
  	end
  end
  function s.effectcon(e)
  	local c = e:GetHandler()
  	return c:GetFlagEffect(73206828) == 0 or c:IsHasEffect(EFFECT_CANNOT_DISABLE)
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = eg:GetFirst()
  	return s.effectcon(e) and rc:IsRelateToBattle() and rc:IsSetCard(SETCARD_ID_0) and rc:IsFaceup() and rc:IsControler(tp)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local tc = eg:GetFirst():GetBattleTarget()
  	local atk = tc:GetBaseAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(atk)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, atk)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	if d > 0 then
  		Duel.Recover(p, d, REASON_EFFECT)
  	end
  end
  
  
source_text: Light
  Once per turn, during your Standby Phase: Toss a coin. If the result is Tails, the following effects are negated until your next Standby Phase.
  ● When you Summon an "Arcana Force" monster, choose which effect to apply without tossing a coin.
  ● If your "Arcana Force" monster destroys an opponent's monster by battle: You gain LP equal to the destroyed monster's original ATK.
target_text: -- Light
  local SETCARD_ID_0 = 0x5 --Arcana
  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)
  	--coin
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_COIN)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetCountLimit(1)
  	e2:SetCode(EVENT_PHASE + PHASE_STANDBY)
  	e2:SetCondition(s.coincon)
  	e2:SetTarget(s.cointg)
  	e2:SetOperation(s.coinop)
  	c:RegisterEffect(e2)
  	--
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(id)
  	e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(1, 0)
  	e3:SetCondition(s.effectcon)
  	c:RegisterEffect(e3)
  	--
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_RECOVER)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCode(EVENT_BATTLE_DESTROYING)
  	e4:SetCondition(s.reccon)
  	e4:SetTarget(s.rectg)
  	e4:SetOperation(s.recop)
  	c:RegisterEffect(e4)
  end
  function s.coincon(e, tp, eg, ep, ev, re, r, rp)
  	return tp == Duel.GetTurnPlayer()
  end
  function s.cointg(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.coinop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local res = Duel.TossCoin(tp, 1)
  	if res == 0 then
  		c:RegisterFlagEffect(73206828, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_STANDBY + RESET_SELF_TURN, 0, 2)
  	end
  end
  function s.effectcon(e)
  	local c = e:GetHandler()
  	return c:GetFlagEffect(73206828) == 0 or c:IsHasEffect(EFFECT_CANNOT_DISABLE)
  end
  function s.reccon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = eg:GetFirst()
  	return s.effectcon(e) and rc:IsRelateToBattle() and rc:IsSetCard(SETCARD_ID_0) and rc:IsFaceup() and rc:IsControler(tp)
  end
  function s.rectg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local tc = eg:GetFirst():GetBattleTarget()
  	local atk = tc:GetBaseAttack()
  	if atk < 0 then
  		atk = 0
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(atk)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, atk)
  end
  function s.recop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	if d > 0 then
  		Duel.Recover(p, d, REASON_EFFECT)
  	end
  end
  
  