name: War
card_text: You must control a "War Rock" monster to activate either of these effects.
  ● When a monster your opponent controls activates its effect: Negate that effect.
  ● During the Battle Phase, when your opponent activates a Spell/Trap Card, or monster effect: Negate that effect.
  You can only activate 1 "War Rock Dignity" per turn.
external_ids: local SETCARD_ID_0 = 0x15f --War
  
lua: local SETCARD_ID_0 = 0x15f --War
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.actcon)
  	e1:SetTarget(s.acttg)
  	e1:SetOperation(s.actop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.actcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp
  		and Duel.IsChainDisablable(ev)
  		and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  		and (
  			(re:IsActiveType(TYPE_MONSTER) and Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION) == LOCATION_MZONE)
  			or (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)))
  		)
  end
  function s.acttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.actop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  
source_text: War
  You must control a "War Rock" monster to activate either of these effects.
  ● When a monster your opponent controls activates its effect: Negate that effect.
  ● During the Battle Phase, when your opponent activates a Spell/Trap Card, or monster effect: Negate that effect.
  You can only activate 1 "War Rock Dignity" per turn.
target_text: -- War
  local SETCARD_ID_0 = 0x15f --War
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Negate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DISABLE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.actcon)
  	e1:SetTarget(s.acttg)
  	e1:SetOperation(s.actop)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.actcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp
  		and Duel.IsChainDisablable(ev)
  		and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  		and (
  			(re:IsActiveType(TYPE_MONSTER) and Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION) == LOCATION_MZONE)
  			or (Duel.GetCurrentPhase() >= PHASE_BATTLE_START and Duel.GetCurrentPhase() <= PHASE_BATTLE and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)))
  		)
  end
  function s.acttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  end
  function s.actop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateEffect(ev)
  end
  
  