name: Performapal
card_text: If you control 2 or more "Performapal" cards, you can Normal Summon this card without Tributing. Cannot attack unless you control another "Performapal" card. When this card declares an attack: You can return all Spell and Trap Cards your opponent controls to the hand.
external_ids: local SETCARD_ID_0 = 0x9f --Performapal
  
lua: local SETCARD_ID_0 = 0x9f --Performapal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--summon with no tribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SUMMON_PROC)
  	e1:SetCondition(s.ntcon)
  	c:RegisterEffect(e1)
  	--atklimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CANNOT_ATTACK)
  	e2:SetCondition(s.atkcon)
  	c:RegisterEffect(e2)
  	--tohand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.ntcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc == 0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, c:GetControler(), LOCATION_ONFIELD, 0, 2, nil)
  end
  function s.atkcon(e)
  	return not Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_ONFIELD, 0, 1, e:GetHandler())
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, g:GetCount(), 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  end
  
  
source_text: Performapal
  If you control 2 or more "Performapal" cards, you can Normal Summon this card without Tributing. Cannot attack unless you control another "Performapal" card. When this card declares an attack: You can return all Spell and Trap Cards your opponent controls to the hand.
target_text: -- Performapal
  local SETCARD_ID_0 = 0x9f --Performapal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--summon with no tribute
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SUMMON_PROC)
  	e1:SetCondition(s.ntcon)
  	c:RegisterEffect(e1)
  	--atklimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CANNOT_ATTACK)
  	e2:SetCondition(s.atkcon)
  	c:RegisterEffect(e2)
  	--tohand
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.ntcon(e, c, minc)
  	if c == nil then
  		return true
  	end
  	return minc == 0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.cfilter, c:GetControler(), LOCATION_ONFIELD, 0, 2, nil)
  end
  function s.atkcon(e)
  	return not Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_ONFIELD, 0, 1, e:GetHandler())
  end
  function s.filter(c)
  	return c:IsType(TYPE_SPELL + TYPE_TRAP) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, 0, LOCATION_ONFIELD, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, g:GetCount(), 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, 0, LOCATION_ONFIELD, nil)
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  end
  
  