name: Toon
card_text: Cannot attack the turn it is Summoned. If you control "Toon World": You can Special Summon this card from your hand, then, if you control another Toon monster, you can destroy 1 Spell/Trap your opponent controls. You can only use this effect of "Toon Harpie Lady" once per turn. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack 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)
  	--summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	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.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
  function s.spcon1(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local g = Duel.GetMatchingGroup(Card.IsType, tp, 0, LOCATION_ONFIELD, nil, TYPE_SPELL + TYPE_TRAP)
  		if #g > 0 and Duel.IsExistingMatchingCard(s.cfilter2, tp, LOCATION_ONFIELD, 0, 1, c) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  			local sg = g:Select(tp, 1, 1, nil)
  			Duel.HintSelection(sg)
  			Duel.Destroy(sg, REASON_EFFECT)
  		end
  	end
  end
  
  
source_text: Toon
  Cannot attack the turn it is Summoned. If you control "Toon World": You can Special Summon this card from your hand, then, if you control another Toon monster, you can destroy 1 Spell/Trap your opponent controls. You can only use this effect of "Toon Harpie Lady" once per turn. While you control "Toon World" and your opponent controls no Toon monsters, this card can attack 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)
  	--summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon1)
  	e1:SetTarget(s.sptg1)
  	e1:SetOperation(s.spop1)
  	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.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
  function s.spcon1(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.sptg1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop1(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local g = Duel.GetMatchingGroup(Card.IsType, tp, 0, LOCATION_ONFIELD, nil, TYPE_SPELL + TYPE_TRAP)
  		if #g > 0 and Duel.IsExistingMatchingCard(s.cfilter2, tp, LOCATION_ONFIELD, 0, 1, c) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
  			Duel.BreakEffect()
  			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  			local sg = g:Select(tp, 1, 1, nil)
  			Duel.HintSelection(sg)
  			Duel.Destroy(sg, REASON_EFFECT)
  		end
  	end
  end
  
  