F.A.
Gains ATK equal to its Level x 300. Unaffected by activated effects from an opponent's monster whose original Level/Rank is lower than this card's Level. Each time a "F.A." Spell/Trap Card or effect is activated: You can increase this card's Level by 1. If this card is Level 7 or higher, any card sent to your opponent's GY is banished instead.
local SETCARD_ID_0 = 0x107 --F.A.

local SETCARD_ID_0 = 0x107 --F.A.
local s, id, o = GetID()
function s.initial_effect(c)
	--atk up
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e1:SetRange(LOCATION_MZONE)
	e1:SetValue(s.atkval)
	c:RegisterEffect(e1)
	--immune
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_IMMUNE_EFFECT)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.immval)
	c:RegisterEffect(e2)
	--lv up
	local e3 = Effect.CreateEffect(c)
	e3:SetDescription(aux.Stringid(id, 0))
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e3:SetCode(EVENT_CHAINING)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
	e3:SetCondition(s.lvcon)
	e3:SetOperation(s.lvop)
	c:RegisterEffect(e3)
	--redirect
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_FIELD)
	e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
	e4:SetCode(EFFECT_TO_GRAVE_REDIRECT)
	e4:SetRange(LOCATION_MZONE)
	e4:SetCondition(s.excon)
	e4:SetTarget(s.extg)
	e4:SetTargetRange(0, LOCATION_DECK)
	e4:SetValue(LOCATION_REMOVED)
	c:RegisterEffect(e4)
end
function s.atkval(e, c)
	return c:GetLevel() * 300
end
function s.immval(e, te)
	if te:GetOwnerPlayer() ~= e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated() then
		local lv = e:GetHandler():GetLevel()
		local tc = te:GetHandler()
		if tc:GetRank() > 0 then
			return tc:GetOriginalRank() < lv
		elseif tc:GetLevel() > 0 then
			return tc:GetOriginalLevel() < lv
		else
			return false
		end
	else
		return false
	end
end
function s.lvcon(e, tp, eg, ep, ev, re, r, rp)
	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP) and re:GetHandler():IsSetCard(SETCARD_ID_0)
end
function s.lvop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) and c:IsFaceup() then
		local e4 = Effect.CreateEffect(c)
		e4:SetType(EFFECT_TYPE_SINGLE)
		e4:SetCode(EFFECT_UPDATE_LEVEL)
		e4:SetValue(1)
		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
		c:RegisterEffect(e4)
	end
end
function s.excon(e)
	return e:GetHandler():IsLevelAbove(7)
end
function s.extg(e, c)
	return c:GetOwner() ~= e:GetHandlerPlayer()
end


F.A.
Gains ATK equal to its Level x 300. Unaffected by activated effects from an opponent's monster whose original Level/Rank is lower than this card's Level. Each time a "F.A." Spell/Trap Card or effect is activated: You can increase this card's Level by 1. If this card is Level 7 or higher, any card sent to your opponent's GY is banished instead.
-- F.A.
local SETCARD_ID_0 = 0x107 --F.A.
local s, id, o = GetID()
function s.initial_effect(c)
	--atk up
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e1:SetRange(LOCATION_MZONE)
	e1:SetValue(s.atkval)
	c:RegisterEffect(e1)
	--immune
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_IMMUNE_EFFECT)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.immval)
	c:RegisterEffect(e2)
	--lv up
	local e3 = Effect.CreateEffect(c)
	e3:SetDescription(aux.Stringid(id, 0))
	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP)
	e3:SetCode(EVENT_CHAINING)
	e3:SetRange(LOCATION_MZONE)
	e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
	e3:SetCondition(s.lvcon)
	e3:SetOperation(s.lvop)
	c:RegisterEffect(e3)
	--redirect
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_FIELD)
	e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE + EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
	e4:SetCode(EFFECT_TO_GRAVE_REDIRECT)
	e4:SetRange(LOCATION_MZONE)
	e4:SetCondition(s.excon)
	e4:SetTarget(s.extg)
	e4:SetTargetRange(0, LOCATION_DECK)
	e4:SetValue(LOCATION_REMOVED)
	c:RegisterEffect(e4)
end
function s.atkval(e, c)
	return c:GetLevel() * 300
end
function s.immval(e, te)
	if te:GetOwnerPlayer() ~= e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated() then
		local lv = e:GetHandler():GetLevel()
		local tc = te:GetHandler()
		if tc:GetRank() > 0 then
			return tc:GetOriginalRank() < lv
		elseif tc:GetLevel() > 0 then
			return tc:GetOriginalLevel() < lv
		else
			return false
		end
	else
		return false
	end
end
function s.lvcon(e, tp, eg, ep, ev, re, r, rp)
	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP) and re:GetHandler():IsSetCard(SETCARD_ID_0)
end
function s.lvop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	if c:IsRelateToEffect(e) and c:IsFaceup() then
		local e4 = Effect.CreateEffect(c)
		e4:SetType(EFFECT_TYPE_SINGLE)
		e4:SetCode(EFFECT_UPDATE_LEVEL)
		e4:SetValue(1)
		e4:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
		c:RegisterEffect(e4)
	end
end
function s.excon(e)
	return e:GetHandler():IsLevelAbove(7)
end
function s.extg(e, c)
	return c:GetOwner() ~= e:GetHandlerPlayer()
end

