name: End
card_text: If your LP are lower than 100: Draw 2 cards, then, if your LP are lower than 10, draw 2 additional cards.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetLP(tp) < 100
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = 2
  	if Duel.GetLP(tp) < 10 then
  		ct = 4
  	end
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, ct)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(ct)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	if Duel.Draw(p, 2, REASON_EFFECT) > 0 and Duel.GetLP(p) < 10 then
  		Duel.BreakEffect()
  		Duel.Draw(p, 2, REASON_EFFECT)
  	end
  end
  
  
source_text: End
  If your LP are lower than 100: Draw 2 cards, then, if your LP are lower than 10, draw 2 additional cards.
target_text: -- End
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetLP(tp) < 100
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = 2
  	if Duel.GetLP(tp) < 10 then
  		ct = 4
  	end
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, ct)
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(ct)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	if Duel.Draw(p, 2, REASON_EFFECT) > 0 and Duel.GetLP(p) < 10 then
  		Duel.BreakEffect()
  		Duel.Draw(p, 2, REASON_EFFECT)
  	end
  end
  
  