name: Nephe
card_text: Activate this card by declaring 1 Attribute. Equip only to a "Shaddoll" monster, and it becomes that Attribute. During your Main Phase: You can Fusion Summon 1 "Shaddoll" Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Material, including the equipped monster. You can only use this effect of "Nephe Shaddoll Fusion" once per turn.
external_ids: local SETCARD_ID_0 = 0x9d --Shaddoll
  
lua: local SETCARD_ID_0 = 0x9d --Shaddoll
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  		gc = s.gc,
  	})
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCountLimit(1, id)
  	c:RegisterEffect(e3)
  end
  
  function s.eqlimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
  	local att = Duel.AnnounceAttribute(tp, 1, ATTRIBUTE_ALL & ~g:GetFirst():GetAttribute())
  	e:SetLabel(att)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, c, tc)
  		local att = e:GetLabel()
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_EQUIP)
  		e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  		e1:SetValue(att)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  		c:SetHint(CHINT_ATTRIBUTE, att)
  	end
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.gc(e)
  	return e:GetHandler():GetEquipTarget()
  end
  
  
source_text: Nephe
  Activate this card by declaring 1 Attribute. Equip only to a "Shaddoll" monster, and it becomes that Attribute. During your Main Phase: You can Fusion Summon 1 "Shaddoll" Fusion Monster from your Extra Deck, using monsters from your hand or field as Fusion Material, including the equipped monster. You can only use this effect of "Nephe Shaddoll Fusion" once per turn.
target_text: -- Nephe
  local SETCARD_ID_0 = 0x9d --Shaddoll
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_EQUIP)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_CONTINUOUS_TARGET)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--Equip limit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_EQUIP_LIMIT)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e2:SetValue(s.eqlimit)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  		gc = s.gc,
  	})
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetCountLimit(1, id)
  	c:RegisterEffect(e3)
  end
  
  function s.eqlimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
  	local att = Duel.AnnounceAttribute(tp, 1, ATTRIBUTE_ALL & ~g:GetFirst():GetAttribute())
  	e:SetLabel(att)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, e:GetHandler(), 1, 0, 0)
  end
  
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Equip(tp, c, tc)
  		local att = e:GetLabel()
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_EQUIP)
  		e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  		e1:SetValue(att)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		c:RegisterEffect(e1)
  		c:SetHint(CHINT_ATTRIBUTE, att)
  	end
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.gc(e)
  	return e:GetHandler():GetEquipTarget()
  end
  
  