name: Number
card_text: 2 Level 4 "Heraldic Beast" monsters
  Once per turn: You can target 1 face-up Xyz Monster your opponent controls; this card's name and original ATK become that monster's original name and current ATK, also replace this effect with that monster's original effects, then that monster's ATK becomes 0, also its effects are negated. This effect applies until the End Phase.
external_ids: local SETCARD_ID_0 = 0x76 --Heraldic
  
lua: local SETCARD_ID_0 = 0x76 --Heraldic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsSetCard, SETCARD_ID_0), 4, 2)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  aux.xyz_number[id] = 8
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local atk = tc:GetAttack()
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_CHANGE_CODE)
  		e1:SetValue(tc:GetOriginalCodeRule())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
  		e2:SetValue(atk)
  		c:RegisterEffect(e2)
  		local cid = c:CopyEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 1)
  		local e4 = Effect.CreateEffect(c)
  		e4:SetType(EFFECT_TYPE_SINGLE)
  		e4:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e4:SetValue(0)
  		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e4)
  		e1:SetLabelObject(e2)
  		e2:SetLabelObject(e4)
  		if aux.NegateMonsterFilter(tc) then
  			local e5 = Effect.CreateEffect(c)
  			e5:SetType(EFFECT_TYPE_SINGLE)
  			e5:SetCode(EFFECT_DISABLE)
  			e5:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e5)
  			local e6 = Effect.CreateEffect(c)
  			e6:SetType(EFFECT_TYPE_SINGLE)
  			e6:SetCode(EFFECT_DISABLE_EFFECT)
  			e6:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e6)
  			e4:SetLabelObject(e5)
  			e5:SetLabelObject(e6)
  		end
  		local e7 = Effect.CreateEffect(c)
  		e7:SetDescription(aux.Stringid(id, 1))
  		e7:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e7:SetCode(EVENT_PHASE + PHASE_END)
  		e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e7:SetCountLimit(1)
  		e7:SetRange(LOCATION_MZONE)
  		e7:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e7:SetLabel(cid)
  		e7:SetLabelObject(e1)
  		e7:SetOperation(s.rstop)
  		c:RegisterEffect(e7)
  	end
  end
  function s.rstop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local cid = e:GetLabel()
  	c:ResetEffect(cid, RESET_COPY)
  	c:ResetEffect(RESET_DISABLE, RESET_EVENT)
  	local e1 = e:GetLabelObject()
  	local e2 = e1:GetLabelObject()
  	local e4 = e2:GetLabelObject()
  	local e5 = e4:GetLabelObject()
  	e1:Reset()
  	e2:Reset()
  	e4:Reset()
  	if e5 then
  		local e6 = e5:GetLabelObject()
  		e5:Reset()
  		e6:Reset()
  	end
  	Duel.HintSelection(Group.FromCards(c))
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  end
  
  
source_text: Number
  2 Level 4 "Heraldic Beast" monsters
  Once per turn: You can target 1 face-up Xyz Monster your opponent controls; this card's name and original ATK become that monster's original name and current ATK, also replace this effect with that monster's original effects, then that monster's ATK becomes 0, also its effects are negated. This effect applies until the End Phase.
target_text: -- Number
  local SETCARD_ID_0 = 0x76 --Heraldic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsSetCard, SETCARD_ID_0), 4, 2)
  	c:EnableReviveLimit()
  	--attack up
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  aux.xyz_number[id] = 8
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local atk = tc:GetAttack()
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_CHANGE_CODE)
  		e1:SetValue(tc:GetOriginalCodeRule())
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		c:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
  		e2:SetValue(atk)
  		c:RegisterEffect(e2)
  		local cid = c:CopyEffect(tc:GetOriginalCode(), RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 1)
  		local e4 = Effect.CreateEffect(c)
  		e4:SetType(EFFECT_TYPE_SINGLE)
  		e4:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e4:SetValue(0)
  		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e4)
  		e1:SetLabelObject(e2)
  		e2:SetLabelObject(e4)
  		if aux.NegateMonsterFilter(tc) then
  			local e5 = Effect.CreateEffect(c)
  			e5:SetType(EFFECT_TYPE_SINGLE)
  			e5:SetCode(EFFECT_DISABLE)
  			e5:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e5)
  			local e6 = Effect.CreateEffect(c)
  			e6:SetType(EFFECT_TYPE_SINGLE)
  			e6:SetCode(EFFECT_DISABLE_EFFECT)
  			e6:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e6)
  			e4:SetLabelObject(e5)
  			e5:SetLabelObject(e6)
  		end
  		local e7 = Effect.CreateEffect(c)
  		e7:SetDescription(aux.Stringid(id, 1))
  		e7:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e7:SetCode(EVENT_PHASE + PHASE_END)
  		e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e7:SetCountLimit(1)
  		e7:SetRange(LOCATION_MZONE)
  		e7:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		e7:SetLabel(cid)
  		e7:SetLabelObject(e1)
  		e7:SetOperation(s.rstop)
  		c:RegisterEffect(e7)
  	end
  end
  function s.rstop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local cid = e:GetLabel()
  	c:ResetEffect(cid, RESET_COPY)
  	c:ResetEffect(RESET_DISABLE, RESET_EVENT)
  	local e1 = e:GetLabelObject()
  	local e2 = e1:GetLabelObject()
  	local e4 = e2:GetLabelObject()
  	local e5 = e4:GetLabelObject()
  	e1:Reset()
  	e2:Reset()
  	e4:Reset()
  	if e5 then
  		local e6 = e5:GetLabelObject()
  		e5:Reset()
  		e6:Reset()
  	end
  	Duel.HintSelection(Group.FromCards(c))
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  end
  
  