name: Stand-Off
card_text: Target 1 face-up Attack Position Effect Monster on each side of the field; if both monsters are still face-up on the field, negate their effects, then if both their effects were negated by this effect, as long as those monsters are in face-up Attack Position, they cannot be destroyed by battle, are unaffected by other card effects, also they cannot attack or change their battle positions.
lua: 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)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsPosition(POS_FACEUP_ATTACK) and aux.NegateEffectMonsterFilter(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil) and Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUPATTACK)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUPATTACK)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc1, tc2 = Duel.GetFirstTarget()
  	if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and tc2:IsRelateToEffect(e) and tc2:IsFaceup() then
  		local a = 0
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		if tc1:IsCanBeDisabledByEffect(e) then
  			tc1:RegisterEffect(e1)
  			tc1:RegisterEffect(e2)
  			a = a + 1
  		end
  		if tc2:IsCanBeDisabledByEffect(e) then
  			local e3 = e1:Clone()
  			local e4 = e2:Clone()
  			tc2:RegisterEffect(e3)
  			tc2:RegisterEffect(e4)
  			a = a + 1
  		end
  		if tc1:IsDefensePos() or tc2:IsDefensePos() or a ~= 2 then
  			return
  		end
  		Duel.BreakEffect()
  		s.reg(c, tc1, tc2)
  		s.reg(c, tc2, tc1)
  	end
  end
  function s.reg(c, tc1, tc2)
  	tc1:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_CHANGE_POS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetOperation(s.posop)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc1:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetCondition(s.effcon)
  	e2:SetValue(1)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e2:SetLabelObject(tc2)
  	tc1:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
  	tc1:RegisterEffect(e3)
  	local e4 = e2:Clone()
  	e4:SetCode(EFFECT_CANNOT_ATTACK)
  	tc1:RegisterEffect(e4)
  	local e5 = e2:Clone()
  	e5:SetCode(EFFECT_IMMUNE_EFFECT)
  	e5:SetValue(s.efilter)
  	tc1:RegisterEffect(e5)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetFlagEffect(id) ~= 0 and not c:IsPosition(POS_FACEUP_ATTACK) then
  		c:ResetFlagEffect(id)
  	end
  end
  function s.effcon(e)
  	return e:GetHandler():GetFlagEffect(id) ~= 0 and e:GetLabelObject():GetFlagEffect(id) ~= 0
  end
  function s.efilter(e, te)
  	return te:GetOwner() ~= e:GetOwner()
  end
  
  
source_text: Stand-Off
  Target 1 face-up Attack Position Effect Monster on each side of the field; if both monsters are still face-up on the field, negate their effects, then if both their effects were negated by this effect, as long as those monsters are in face-up Attack Position, they cannot be destroyed by battle, are unaffected by other card effects, also they cannot attack or change their battle positions.
target_text: -- Stand-Off
  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)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsPosition(POS_FACEUP_ATTACK) and aux.NegateEffectMonsterFilter(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, nil) and Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUPATTACK)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUPATTACK)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc1, tc2 = Duel.GetFirstTarget()
  	if tc1:IsRelateToEffect(e) and tc1:IsFaceup() and tc2:IsRelateToEffect(e) and tc2:IsFaceup() then
  		local a = 0
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		if tc1:IsCanBeDisabledByEffect(e) then
  			tc1:RegisterEffect(e1)
  			tc1:RegisterEffect(e2)
  			a = a + 1
  		end
  		if tc2:IsCanBeDisabledByEffect(e) then
  			local e3 = e1:Clone()
  			local e4 = e2:Clone()
  			tc2:RegisterEffect(e3)
  			tc2:RegisterEffect(e4)
  			a = a + 1
  		end
  		if tc1:IsDefensePos() or tc2:IsDefensePos() or a ~= 2 then
  			return
  		end
  		Duel.BreakEffect()
  		s.reg(c, tc1, tc2)
  		s.reg(c, tc2, tc1)
  	end
  end
  function s.reg(c, tc1, tc2)
  	tc1:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetCode(EVENT_CHANGE_POS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetOperation(s.posop)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc1:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e2:SetCondition(s.effcon)
  	e2:SetValue(1)
  	e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  	e2:SetLabelObject(tc2)
  	tc1:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
  	tc1:RegisterEffect(e3)
  	local e4 = e2:Clone()
  	e4:SetCode(EFFECT_CANNOT_ATTACK)
  	tc1:RegisterEffect(e4)
  	local e5 = e2:Clone()
  	e5:SetCode(EFFECT_IMMUNE_EFFECT)
  	e5:SetValue(s.efilter)
  	tc1:RegisterEffect(e5)
  end
  function s.posop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetFlagEffect(id) ~= 0 and not c:IsPosition(POS_FACEUP_ATTACK) then
  		c:ResetFlagEffect(id)
  	end
  end
  function s.effcon(e)
  	return e:GetHandler():GetFlagEffect(id) ~= 0 and e:GetLabelObject():GetFlagEffect(id) ~= 0
  end
  function s.efilter(e, te)
  	return te:GetOwner() ~= e:GetOwner()
  end
  
  