name: Performapal
card_text: Monsters you control gain 200 ATK for each monster you control with a different Type. Once per turn, if you control 4 "Performapal" monsters with different Types: You can Special Summon 1 "Odd-Eyes" monster from your hand, Deck, or Graveyard.
external_ids: local SETCARD_ID_0 = 0x9f --Performapal
  local SETCARD_ID_1 = 0x99 --Odd-Eyes
  
lua: local SETCARD_ID_0 = 0x9f --Performapal
  local SETCARD_ID_1 = 0x99 --Odd-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--atk up
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetValue(s.atkvalue)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.atkfilter(c)
  	return c:IsFaceup() and c:GetRace() ~= 0
  end
  function s.atkvalue(e, c)
  	local g = Duel.GetMatchingGroup(s.atkfilter, c:GetControler(), LOCATION_MZONE, 0, nil)
  	local ct = g:GetClassCount(Card.GetRace)
  	return ct * 200
  end
  function s.confilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1) and c:GetRace() ~= 0
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.confilter, tp, LOCATION_MZONE, 0, nil)
  	local ct = g:GetClassCount(Card.GetRace)
  	return ct == 4
  end
  function s.spfilter(c, e, sp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, sp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Performapal
  Monsters you control gain 200 ATK for each monster you control with a different Type. Once per turn, if you control 4 "Performapal" monsters with different Types: You can Special Summon 1 "Odd-Eyes" monster from your hand, Deck, or Graveyard.
target_text: -- Performapal
  local SETCARD_ID_0 = 0x9f --Performapal
  local SETCARD_ID_1 = 0x99 --Odd-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--atk up
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetValue(s.atkvalue)
  	c:RegisterEffect(e2)
  	--special summon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetCountLimit(1)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.atkfilter(c)
  	return c:IsFaceup() and c:GetRace() ~= 0
  end
  function s.atkvalue(e, c)
  	local g = Duel.GetMatchingGroup(s.atkfilter, c:GetControler(), LOCATION_MZONE, 0, nil)
  	local ct = g:GetClassCount(Card.GetRace)
  	return ct * 200
  end
  function s.confilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1) and c:GetRace() ~= 0
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.confilter, tp, LOCATION_MZONE, 0, nil)
  	local ct = g:GetClassCount(Card.GetRace)
  	return ct == 4
  end
  function s.spfilter(c, e, sp)
  	return c:IsSetCard(SETCARD_ID_1) and c:IsCanBeSpecialSummoned(e, 0, sp, false, false)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, aux.NecroValleyFilter(s.spfilter), tp, LOCATION_HAND + LOCATION_DECK + LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  