name: Magnificent
card_text: Tribute 1 "Cyber Angel" Ritual Monster from your hand or field, then target 1 LIGHT Fairy monster you control; it gains ATK/DEF equal to the Level the monster had when Tributed x 200, until the end of this turn. This turn, if it battles an opponent's monster that was Special Summoned from the Extra Deck, that opponent's monster's effects are negated during that Battle Phase only. You can only activate 1 "Magnificent Machine Angel" per turn.
external_ids: local SETCARD_ID_0 = 0x2093 --Cyber
  
lua: local SETCARD_ID_0 = 0x2093 --Cyber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetHintTiming(TIMING_DAMAGE_STEP)
  	e1:SetCondition(aux.dscon)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_RITUAL) and c:IsLevelAbove(1) and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, c)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroupEx(tp, s.cfilter, 1, REASON_COST, true, nil, tp)
  	end
  	local g = Duel.SelectReleaseGroupEx(tp, s.cfilter, 1, 1, REASON_COST, true, nil, tp)
  	e:SetLabel(g:GetFirst():GetLevel())
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local lv = e:GetLabel()
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(lv * 200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetCode(EFFECT_DISABLE)
  		e3:SetTargetRange(0, LOCATION_MZONE)
  		e3:SetTarget(s.distg)
  		e3:SetLabel(tc:GetFieldID())
  		e3:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e3, tp)
  		local e4 = e3:Clone()
  		e4:SetCode(EFFECT_DISABLE_EFFECT)
  		Duel.RegisterEffect(e4, tp)
  	end
  end
  function s.distg(e, c)
  	if c:GetFlagEffect(id) > 0 then
  		return true
  	end
  	if c:IsSummonLocation(LOCATION_EXTRA) and c:GetBattleTarget() ~= nil and c:GetBattleTarget():GetFieldID() == e:GetLabel() then
  		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE, 0, 1)
  		Duel.AdjustInstantly(e:GetHandler())
  		return true
  	end
  	return false
  end
  
  
source_text: Magnificent
  Tribute 1 "Cyber Angel" Ritual Monster from your hand or field, then target 1 LIGHT Fairy monster you control; it gains ATK/DEF equal to the Level the monster had when Tributed x 200, until the end of this turn. This turn, if it battles an opponent's monster that was Special Summoned from the Extra Deck, that opponent's monster's effects are negated during that Battle Phase only. You can only activate 1 "Magnificent Machine Angel" per turn.
target_text: -- Magnificent
  local SETCARD_ID_0 = 0x2093 --Cyber
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetHintTiming(TIMING_DAMAGE_STEP)
  	e1:SetCondition(aux.dscon)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_RITUAL) and c:IsLevelAbove(1) and Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, 0, 1, c)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroupEx(tp, s.cfilter, 1, REASON_COST, true, nil, tp)
  	end
  	local g = Duel.SelectReleaseGroupEx(tp, s.cfilter, 1, 1, REASON_COST, true, nil, tp)
  	e:SetLabel(g:GetFirst():GetLevel())
  	Duel.Release(g, REASON_COST)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local lv = e:GetLabel()
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(lv * 200)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetCode(EFFECT_DISABLE)
  		e3:SetTargetRange(0, LOCATION_MZONE)
  		e3:SetTarget(s.distg)
  		e3:SetLabel(tc:GetFieldID())
  		e3:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e3, tp)
  		local e4 = e3:Clone()
  		e4:SetCode(EFFECT_DISABLE_EFFECT)
  		Duel.RegisterEffect(e4, tp)
  	end
  end
  function s.distg(e, c)
  	if c:GetFlagEffect(id) > 0 then
  		return true
  	end
  	if c:IsSummonLocation(LOCATION_EXTRA) and c:GetBattleTarget() ~= nil and c:GetBattleTarget():GetFieldID() == e:GetLabel() then
  		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_BATTLE, 0, 1)
  		Duel.AdjustInstantly(e:GetHandler())
  		return true
  	end
  	return false
  end
  
  