name: Prank-Kids
card_text: If this card is sent to the GY as material for the Fusion or Link Summon of a "Prank-Kids" monster: You can send 1 "Prank-Kids" card from your Deck to the GY, except "Prank-Kids Fansies", then you can Special Summon 1 "Prank-Kids" monster from your hand or Deck in Defense Position, except "Prank-Kids Fansies". You can only use this effect of "Prank-Kids Fansies" once per turn.
external_ids: local SETCARD_ID_0 = 0x120 --Prank-Kids
  
lua: local SETCARD_ID_0 = 0x120 --Prank-Kids
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DECKDES)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.tgcon)
  	e1:SetTarget(s.tgtg)
  	e1:SetOperation(s.tgop)
  	c:RegisterEffect(e1)
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = c:GetReasonCard()
  	return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(SETCARD_ID_0) and r & REASON_FUSION + REASON_LINK ~= 0
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToGrave() and not c:IsCode(id)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE) and not c:IsCode(id)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	local g2 = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, g:GetFirst(), e, tp)
  	if
  		#g > 0
  		and Duel.SendtoGrave(g, REASON_EFFECT) ~= 0
  		and g:GetFirst():IsLocation(LOCATION_GRAVE)
  		and #g2 > 0
  		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
  	then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g2:Select(tp, 1, 1, nil)
  		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  
source_text: Prank-Kids
  If this card is sent to the GY as material for the Fusion or Link Summon of a "Prank-Kids" monster: You can send 1 "Prank-Kids" card from your Deck to the GY, except "Prank-Kids Fansies", then you can Special Summon 1 "Prank-Kids" monster from your hand or Deck in Defense Position, except "Prank-Kids Fansies". You can only use this effect of "Prank-Kids Fansies" once per turn.
target_text: -- Prank-Kids
  local SETCARD_ID_0 = 0x120 --Prank-Kids
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_DECKDES)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.tgcon)
  	e1:SetTarget(s.tgtg)
  	e1:SetOperation(s.tgop)
  	c:RegisterEffect(e1)
  end
  function s.tgcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = c:GetReasonCard()
  	return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(SETCARD_ID_0) and r & REASON_FUSION + REASON_LINK ~= 0
  end
  function s.tgtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
  end
  function s.tgfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAbleToGrave() and not c:IsCode(id)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP_DEFENSE) and not c:IsCode(id)
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
  	local g2 = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK + LOCATION_HAND, 0, g:GetFirst(), e, tp)
  	if
  		#g > 0
  		and Duel.SendtoGrave(g, REASON_EFFECT) ~= 0
  		and g:GetFirst():IsLocation(LOCATION_GRAVE)
  		and #g2 > 0
  		and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
  	then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g2:Select(tp, 1, 1, nil)
  		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP_DEFENSE)
  	end
  end
  
  