name: Armor
card_text: When an opponent's monster declares an attack, if you control a "Ninja" monster: You can flip this card face-up; negate that attack and end the Battle Phase. While this card is face-up on the field and you control a "Ninja" monster, monsters your opponent controls cannot change their battle positions.
external_ids: local SETCARD_ID_0 = 0x2b --Ninja
  
lua: local SETCARD_ID_0 = 0x2b --Ninja
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--pos limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
  	e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.poscon)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateAttack() then
  		Duel.SkipPhase(1 - tp, PHASE_BATTLE, RESET_PHASE + PHASE_BATTLE_STEP, 1)
  	end
  end
  function s.poscon(e)
  	return Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  
  
source_text: Armor
  When an opponent's monster declares an attack, if you control a "Ninja" monster: You can flip this card face-up; negate that attack and end the Battle Phase. While this card is face-up on the field and you control a "Ninja" monster, monsters your opponent controls cannot change their battle positions.
target_text: -- Armor
  local SETCARD_ID_0 = 0x2b --Ninja
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--pos limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
  	e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.poscon)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return tp ~= Duel.GetTurnPlayer() and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateAttack() then
  		Duel.SkipPhase(1 - tp, PHASE_BATTLE, RESET_PHASE + PHASE_BATTLE_STEP, 1)
  	end
  end
  function s.poscon(e)
  	return Duel.IsExistingMatchingCard(s.cfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  
  