name: Performapal
card_text: Pendulum Scale = 5
  [ Pendulum Effect ]
  Once per turn, when an opponent's monster declares an attack: You can Tribute 1 "Performapal" monster; negate the attack, then end the Battle Phase.
  ----------------------------------------
  [ Monster Effect ]
  If a "Performapal" or "Odd-Eyes" monster you control attacks, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step.
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)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--actlimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, 1)
  	e1:SetValue(s.aclimit)
  	e1:SetCondition(s.actcon)
  	c:RegisterEffect(e1)
  	--negate attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.condition)
  	e2:SetCost(s.cost)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.aclimit(e, re, tp)
  	return re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.actcon(e)
  	local tc = Duel.GetAttacker()
  	local tp = e:GetHandlerPlayer()
  	return tc and tc:IsControler(tp) and tc:IsSetCard(SETCARD_ID_0, 0x99)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttacker():IsControler(1 - tp)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsSetCard, 1, nil, 0x9f)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsSetCard, 1, 1, nil, 0x9f)
  	Duel.Release(g, REASON_COST)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateAttack() then
  		Duel.BreakEffect()
  		Duel.SkipPhase(1 - tp, PHASE_BATTLE, RESET_PHASE + PHASE_BATTLE_STEP, 1)
  	end
  end
  
  
source_text: Performapal
  Pendulum Scale = 5
  [ Pendulum Effect ]
  Once per turn, when an opponent's monster declares an attack: You can Tribute 1 "Performapal" monster; negate the attack, then end the Battle Phase.
  ----------------------------------------
  [ Monster Effect ]
  If a "Performapal" or "Odd-Eyes" monster you control attacks, your opponent cannot activate any Spell/Trap Cards until the end of the Damage Step.
target_text: -- Performapal
  local SETCARD_ID_0 = 0x9f --Performapal
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--actlimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(0, 1)
  	e1:SetValue(s.aclimit)
  	e1:SetCondition(s.actcon)
  	c:RegisterEffect(e1)
  	--negate attack
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.condition)
  	e2:SetCost(s.cost)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  function s.aclimit(e, re, tp)
  	return re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.actcon(e)
  	local tc = Duel.GetAttacker()
  	local tp = e:GetHandlerPlayer()
  	return tc and tc:IsControler(tp) and tc:IsSetCard(SETCARD_ID_0, 0x99)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetAttacker():IsControler(1 - tp)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, Card.IsSetCard, 1, nil, 0x9f)
  	end
  	local g = Duel.SelectReleaseGroup(tp, Card.IsSetCard, 1, 1, nil, 0x9f)
  	Duel.Release(g, REASON_COST)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateAttack() then
  		Duel.BreakEffect()
  		Duel.SkipPhase(1 - tp, PHASE_BATTLE, RESET_PHASE + PHASE_BATTLE_STEP, 1)
  	end
  end
  
  