name: Second
card_text: When a coin toss is performed, you can choose to redo the coin toss. (If the toss involved multiple coin flips, redo all of them.) You can only use the effect of "Second Coin Toss" once per turn.
lua: 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:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TOSS_COIN_NEGATE)
  	e2:SetCondition(s.coincon)
  	e2:SetOperation(s.coinop)
  	c:RegisterEffect(e2)
  end
  function s.coincon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp and Duel.GetFlagEffect(tp, id) == 0
  end
  function s.coinop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	if Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  		Duel.Hint(HINT_CARD, 0, id)
  		Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  		Duel.TossCoin(tp, ev)
  	end
  end
  
  
source_text: Second
  When a coin toss is performed, you can choose to redo the coin toss. (If the toss involved multiple coin flips, redo all of them.) You can only use the effect of "Second Coin Toss" once per turn.
target_text: -- Second
  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:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TOSS_COIN_NEGATE)
  	e2:SetCondition(s.coincon)
  	e2:SetOperation(s.coinop)
  	c:RegisterEffect(e2)
  end
  function s.coincon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == tp and Duel.GetFlagEffect(tp, id) == 0
  end
  function s.coinop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	if Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  		Duel.Hint(HINT_CARD, 0, id)
  		Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  		Duel.TossCoin(tp, ev)
  	end
  end
  
  