name: Level
card_text: Select 1 monster in your hand and show it to your opponent, then roll a six-sided die. If the result is 1, send the selected monster to the Graveyard. If the result is 2-6, the Level of the selected monster becomes equal to the result until the end of this turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DICE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_HAND, 0, 1, nil, TYPE_MONSTER)
  	end
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, Card.IsType, tp, LOCATION_HAND, 0, 1, 1, nil, TYPE_MONSTER)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(1 - tp, g)
  		local ct = Duel.TossDice(tp, 1)
  		if ct == 1 then
  			Duel.SendtoGrave(g, REASON_EFFECT)
  		elseif ct >= 2 and ct <= 6 then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(ct)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_PHASE + PHASE_END)
  			g:GetFirst():RegisterEffect(e1)
  			Duel.ShuffleHand(tp)
  		end
  	end
  end
  
  
source_text: Level
  Select 1 monster in your hand and show it to your opponent, then roll a six-sided die. If the result is 1, send the selected monster to the Graveyard. If the result is 2-6, the Level of the selected monster becomes equal to the result until the end of this turn.
target_text: -- Level
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DICE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.tg)
  	e1:SetOperation(s.op)
  	c:RegisterEffect(e1)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsType, tp, LOCATION_HAND, 0, 1, nil, TYPE_MONSTER)
  	end
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, Card.IsType, tp, LOCATION_HAND, 0, 1, 1, nil, TYPE_MONSTER)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(1 - tp, g)
  		local ct = Duel.TossDice(tp, 1)
  		if ct == 1 then
  			Duel.SendtoGrave(g, REASON_EFFECT)
  		elseif ct >= 2 and ct <= 6 then
  			local e1 = Effect.CreateEffect(e:GetHandler())
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetCode(EFFECT_CHANGE_LEVEL)
  			e1:SetValue(ct)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD + RESET_PHASE + PHASE_END)
  			g:GetFirst():RegisterEffect(e1)
  			Duel.ShuffleHand(tp)
  		end
  	end
  end
  
  