name: Toon
card_text: If your opponent controls a monster and you control no monsters, you can Special Summon this card (from your hand). Cannot attack the turn it is Summoned. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack your opponent directly.
external_ids: local CARD_ID_0 = 15259703 --Toon World
  
lua: local CARD_ID_0 = 15259703 --Toon World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.spcon)
  	c:RegisterEffect(e1)
  	--cannot attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetOperation(s.atklimit)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	local e4 = e2:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  	--direct attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_DIRECT_ATTACK)
  	e5:SetCondition(s.dircon)
  	c:RegisterEffect(e5)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_MZONE, 0) == 0
  		and Duel.GetFieldGroupCount(c:GetControler(), 0, LOCATION_MZONE) > 0
  		and Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0
  end
  function s.atklimit(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	e:GetHandler():RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.dircon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil) and not Duel.IsExistingMatchingCard(s.cfilter2, tp, 0, LOCATION_MZONE, 1, nil)
  end
  
  
source_text: Toon
  If your opponent controls a monster and you control no monsters, you can Special Summon this card (from your hand). Cannot attack the turn it is Summoned. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack your opponent directly.
target_text: -- Toon
  local CARD_ID_0 = 15259703 --Toon World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCondition(s.spcon)
  	c:RegisterEffect(e1)
  	--cannot attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_SUMMON_SUCCESS)
  	e2:SetOperation(s.atklimit)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	local e4 = e2:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  	--direct attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_DIRECT_ATTACK)
  	e5:SetCondition(s.dircon)
  	c:RegisterEffect(e5)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_MZONE, 0) == 0
  		and Duel.GetFieldGroupCount(c:GetControler(), 0, LOCATION_MZONE) > 0
  		and Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0
  end
  function s.atklimit(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_CANNOT_ATTACK)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  	e:GetHandler():RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.dircon(e)
  	local tp = e:GetHandlerPlayer()
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil) and not Duel.IsExistingMatchingCard(s.cfilter2, tp, 0, LOCATION_MZONE, 1, nil)
  end
  
  