name: Marincess
card_text: All "Marincess" monsters you control gain 200 ATK, also each one gains 600 ATK for each "Marincess" card equipped to it. Monsters you control in the Extra Monster Zone that were Link Summoned using "Marincess Crystal Heart" as material are unaffected by your opponent's card effects. When you Link Summon a "Marincess" monster to the Extra Monster Zone (except during the Damage Step): You can equip up to 3 "Marincess" Link Monsters with different names from your GY to that Link Summoned monster.
external_ids: local SETCARD_ID_0 = 0x12b --Marincess
  
lua: local SETCARD_ID_0 = 0x12b --Marincess
  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)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  	--immune
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_IMMUNE_EFFECT)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.immtg)
  	e3:SetValue(s.efilter)
  	c:RegisterEffect(e3)
  	--equip
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_EQUIP)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCondition(s.eqcon)
  	e4:SetTarget(s.eqtg)
  	e4:SetOperation(s.eqop)
  	c:RegisterEffect(e4)
  end
  function s.atkval(e, c)
  	return 200 + c:GetEquipGroup():FilterCount(Card.IsSetCard, nil, 0x12b) * 600
  end
  function s.immtg(e, c)
  	return c:GetSequence() > 4 and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetFlagEffect(id) ~= 0
  end
  function s.efilter(e, te)
  	return te:GetOwnerPlayer() ~= e:GetHandlerPlayer()
  end
  function s.cfilter(c, tp)
  	return c:IsSummonPlayer(tp) and c:GetSequence() > 4 and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp)
  end
  function s.eqfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_LINK) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	eg:GetFirst():CreateEffectRelation(e)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = eg:GetFirst()
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_SZONE)), 3)
  	local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.eqfilter), tp, LOCATION_GRAVE, 0, nil)
  	if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or ft <= 0 or g:GetCount() <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, ft)
  	if sg and sg:GetCount() > 0 then
  		local sc = sg:GetFirst()
  		while sc do
  			Duel.Equip(tp, sc, tc, false, true)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetLabelObject(tc)
  			e1:SetCode(EFFECT_EQUIP_LIMIT)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(s.eqlimit)
  			sc:RegisterEffect(e1)
  			sc = sg:GetNext()
  		end
  		Duel.EquipComplete()
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetLabelObject() == c
  end
  
  
source_text: Marincess
  All "Marincess" monsters you control gain 200 ATK, also each one gains 600 ATK for each "Marincess" card equipped to it. Monsters you control in the Extra Monster Zone that were Link Summoned using "Marincess Crystal Heart" as material are unaffected by your opponent's card effects. When you Link Summon a "Marincess" monster to the Extra Monster Zone (except during the Damage Step): You can equip up to 3 "Marincess" Link Monsters with different names from your GY to that Link Summoned monster.
target_text: -- Marincess
  local SETCARD_ID_0 = 0x12b --Marincess
  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)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard, SETCARD_ID_0))
  	e2:SetValue(s.atkval)
  	c:RegisterEffect(e2)
  	--immune
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_IMMUNE_EFFECT)
  	e3:SetRange(LOCATION_FZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.immtg)
  	e3:SetValue(s.efilter)
  	c:RegisterEffect(e3)
  	--equip
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 1))
  	e4:SetCategory(CATEGORY_EQUIP)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetRange(LOCATION_FZONE)
  	e4:SetCondition(s.eqcon)
  	e4:SetTarget(s.eqtg)
  	e4:SetOperation(s.eqop)
  	c:RegisterEffect(e4)
  end
  function s.atkval(e, c)
  	return 200 + c:GetEquipGroup():FilterCount(Card.IsSetCard, nil, 0x12b) * 600
  end
  function s.immtg(e, c)
  	return c:GetSequence() > 4 and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetFlagEffect(id) ~= 0
  end
  function s.efilter(e, te)
  	return te:GetOwnerPlayer() ~= e:GetHandlerPlayer()
  end
  function s.cfilter(c, tp)
  	return c:IsSummonPlayer(tp) and c:GetSequence() > 4 and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, tp)
  end
  function s.eqfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_LINK) and not c:IsForbidden()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	eg:GetFirst():CreateEffectRelation(e)
  	Duel.SetOperationInfo(0, CATEGORY_LEAVE_GRAVE, nil, 1, tp, LOCATION_GRAVE)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = eg:GetFirst()
  	local ft = math.min((Duel.GetLocationCount(tp, LOCATION_SZONE)), 3)
  	local g = Duel.GetMatchingGroup(aux.NecroValleyFilter(s.eqfilter), tp, LOCATION_GRAVE, 0, nil)
  	if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or ft <= 0 or g:GetCount() <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local sg = g:SelectSubGroup(tp, aux.dncheck, false, 1, ft)
  	if sg and sg:GetCount() > 0 then
  		local sc = sg:GetFirst()
  		while sc do
  			Duel.Equip(tp, sc, tc, false, true)
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetLabelObject(tc)
  			e1:SetCode(EFFECT_EQUIP_LIMIT)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  			e1:SetValue(s.eqlimit)
  			sc:RegisterEffect(e1)
  			sc = sg:GetNext()
  		end
  		Duel.EquipComplete()
  	end
  end
  function s.eqlimit(e, c)
  	return e:GetLabelObject() == c
  end
  
  