Gradius'
This card cannot be Normal Summoned or Set. This monster can only be Special Summoned by selecting 1 face-up "Gradius" on your side of the field. The ATK and DEF of this card becomes the same as the ATK and DEF of the selected "Gradius". If the selected "Gradius" is removed from the field, destroy this card.
local CARD_ID_0 = 10992251 --Gradius

local CARD_ID_0 = 10992251 --Gradius
local s, id, o = GetID()
function s.initial_effect(c)
	c:EnableReviveLimit()
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.spcon)
	c:RegisterEffect(e1)
	local e0 = Effect.CreateEffect(c)
	e0:SetType(EFFECT_TYPE_SINGLE)
	e0:SetCode(EFFECT_SPSUMMON_COST)
	e0:SetOperation(s.spcost)
	c:RegisterEffect(e0)
	local g = Group.CreateGroup()
	g:KeepAlive()
	e0:SetLabelObject(g)
	--spsummon con
	local e2 = Effect.CreateEffect(c)
	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_SPSUMMON_CONDITION)
	e2:SetValue(s.splimit)
	c:RegisterEffect(e2)
	--set target
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e3:SetOperation(s.tgop)
	e3:SetLabelObject(e0)
	c:RegisterEffect(e3)
	--atk.def
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_SINGLE)
	e4:SetCode(EFFECT_SET_ATTACK_FINAL)
	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE, EFFECT_FLAG2_OPTION)
	e4:SetRange(LOCATION_MZONE)
	e4:SetCondition(s.adcon)
	e4:SetValue(s.atkval)
	c:RegisterEffect(e4)
	local e5 = e4:Clone()
	e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
	e5:SetValue(s.defval)
	c:RegisterEffect(e5)
	--destroy
	local e6 = Effect.CreateEffect(c)
	e6:SetType(EFFECT_TYPE_SINGLE)
	e6:SetCode(EFFECT_SELF_DESTROY)
	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCondition(s.sdcon)
	c:RegisterEffect(e6)
end
function s.filter(c)
	return c:IsFaceup() and c:IsCode(CARD_ID_0)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	return Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, c:GetControler(), LOCATION_MZONE, 0, 1, nil)
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp)
	e:GetLabelObject():Clear()
	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.HintSelection(g)
		e:GetLabelObject():Merge(g)
	end
end
function s.splimit(e, se, sp, st, pos, top)
	return Duel.IsExistingMatchingCard(s.filter, sp, LOCATION_MZONE, 0, 1, nil)
end
function s.tgop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local g = e:GetLabelObject():GetLabelObject()
	if g:GetCount() > 0 then
		c:SetCardTarget(g:GetFirst())
		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
	end
end
function s.adcon(e)
	return e:GetHandler():GetFirstCardTarget() ~= nil
end
function s.atkval(e, c)
	return c:GetFirstCardTarget():GetAttack()
end
function s.defval(e, c)
	return c:GetFirstCardTarget():GetDefense()
end
function s.sdcon(e)
	return e:GetHandler():GetFirstCardTarget() == nil and e:GetHandler():GetFlagEffect(id) ~= 0
end


Gradius'
This card cannot be Normal Summoned or Set. This monster can only be Special Summoned by selecting 1 face-up "Gradius" on your side of the field. The ATK and DEF of this card becomes the same as the ATK and DEF of the selected "Gradius". If the selected "Gradius" is removed from the field, destroy this card.
-- Gradius'
local CARD_ID_0 = 10992251 --Gradius
local s, id, o = GetID()
function s.initial_effect(c)
	c:EnableReviveLimit()
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.spcon)
	c:RegisterEffect(e1)
	local e0 = Effect.CreateEffect(c)
	e0:SetType(EFFECT_TYPE_SINGLE)
	e0:SetCode(EFFECT_SPSUMMON_COST)
	e0:SetOperation(s.spcost)
	c:RegisterEffect(e0)
	local g = Group.CreateGroup()
	g:KeepAlive()
	e0:SetLabelObject(g)
	--spsummon con
	local e2 = Effect.CreateEffect(c)
	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_SPSUMMON_CONDITION)
	e2:SetValue(s.splimit)
	c:RegisterEffect(e2)
	--set target
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e3:SetOperation(s.tgop)
	e3:SetLabelObject(e0)
	c:RegisterEffect(e3)
	--atk.def
	local e4 = Effect.CreateEffect(c)
	e4:SetType(EFFECT_TYPE_SINGLE)
	e4:SetCode(EFFECT_SET_ATTACK_FINAL)
	e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE, EFFECT_FLAG2_OPTION)
	e4:SetRange(LOCATION_MZONE)
	e4:SetCondition(s.adcon)
	e4:SetValue(s.atkval)
	c:RegisterEffect(e4)
	local e5 = e4:Clone()
	e5:SetCode(EFFECT_SET_DEFENSE_FINAL)
	e5:SetValue(s.defval)
	c:RegisterEffect(e5)
	--destroy
	local e6 = Effect.CreateEffect(c)
	e6:SetType(EFFECT_TYPE_SINGLE)
	e6:SetCode(EFFECT_SELF_DESTROY)
	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCondition(s.sdcon)
	c:RegisterEffect(e6)
end
function s.filter(c)
	return c:IsFaceup() and c:IsCode(CARD_ID_0)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	return Duel.GetLocationCount(c:GetControler(), LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, c:GetControler(), LOCATION_MZONE, 0, 1, nil)
end
function s.spcost(e, tp, eg, ep, ev, re, r, rp)
	e:GetLabelObject():Clear()
	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.HintSelection(g)
		e:GetLabelObject():Merge(g)
	end
end
function s.splimit(e, se, sp, st, pos, top)
	return Duel.IsExistingMatchingCard(s.filter, sp, LOCATION_MZONE, 0, 1, nil)
end
function s.tgop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local g = e:GetLabelObject():GetLabelObject()
	if g:GetCount() > 0 then
		c:SetCardTarget(g:GetFirst())
		c:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
	end
end
function s.adcon(e)
	return e:GetHandler():GetFirstCardTarget() ~= nil
end
function s.atkval(e, c)
	return c:GetFirstCardTarget():GetAttack()
end
function s.defval(e, c)
	return c:GetFirstCardTarget():GetDefense()
end
function s.sdcon(e)
	return e:GetHandler():GetFirstCardTarget() == nil and e:GetHandler():GetFlagEffect(id) ~= 0
end

