name: Comic
card_text: If you control "Toon World", equip to an opponent's monster. Take control of it. It is treated as a Toon monster. If your opponent controls no Toon monsters, it can attack your opponent directly. If "Toon World" is not on the field, destroy this card.
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)
  	--Equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP + CATEGORY_CONTROL)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_SET_CONTROL)
  	e3:SetValue(s.cval)
  	c:RegisterEffect(e3)
  	--change type
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_EQUIP)
  	e4:SetCode(EFFECT_ADD_TYPE)
  	e4:SetValue(TYPE_TOON)
  	c:RegisterEffect(e4)
  	--direct attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_EQUIP)
  	e5:SetCode(EFFECT_DIRECT_ATTACK)
  	e5:SetCondition(s.dircon)
  	c:RegisterEffect(e5)
  	--self destroy
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE)
  	e6:SetCode(EFFECT_SELF_DESTROY)
  	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e6:SetRange(LOCATION_SZONE)
  	e6:SetCondition(s.descon)
  	c:RegisterEffect(e6)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, c, tc)
  	end
  end
  function s.eqlimit(e, c)
  	local tp = e:GetHandlerPlayer()
  	return s.condition(e, tp) and tp ~= c:GetControler() or e:GetHandler():GetEquipTarget() == c
  end
  function s.cval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.dirfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.dircon(e)
  	return not Duel.IsExistingMatchingCard(s.dirfilter, e:GetHandlerPlayer(), 0, LOCATION_MZONE, 1, nil)
  end
  function s.descon(e)
  	return not Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  end
  
  
source_text: Comic
  If you control "Toon World", equip to an opponent's monster. Take control of it. It is treated as a Toon monster. If your opponent controls no Toon monsters, it can attack your opponent directly. If "Toon World" is not on the field, destroy this card.
target_text: -- Comic
  local CARD_ID_0 = 15259703 --Toon World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Equip
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP + CATEGORY_CONTROL)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_EQUIP)
  	e3:SetCode(EFFECT_SET_CONTROL)
  	e3:SetValue(s.cval)
  	c:RegisterEffect(e3)
  	--change type
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_EQUIP)
  	e4:SetCode(EFFECT_ADD_TYPE)
  	e4:SetValue(TYPE_TOON)
  	c:RegisterEffect(e4)
  	--direct attack
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_EQUIP)
  	e5:SetCode(EFFECT_DIRECT_ATTACK)
  	e5:SetCondition(s.dircon)
  	c:RegisterEffect(e5)
  	--self destroy
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE)
  	e6:SetCode(EFFECT_SELF_DESTROY)
  	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e6:SetRange(LOCATION_SZONE)
  	e6:SetCondition(s.descon)
  	c:RegisterEffect(e6)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.filter(c)
  	return c:IsFaceup()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, c, tc)
  	end
  end
  function s.eqlimit(e, c)
  	local tp = e:GetHandlerPlayer()
  	return s.condition(e, tp) and tp ~= c:GetControler() or e:GetHandler():GetEquipTarget() == c
  end
  function s.cval(e, c)
  	return e:GetHandlerPlayer()
  end
  function s.dirfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.dircon(e)
  	return not Duel.IsExistingMatchingCard(s.dirfilter, e:GetHandlerPlayer(), 0, LOCATION_MZONE, 1, nil)
  end
  function s.descon(e)
  	return not Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_ONFIELD, LOCATION_ONFIELD, 1, nil)
  end
  
  