name: Elegy
card_text: Special Summoned "Melodious" monsters you control cannot be destroyed by card effects. If this card was Special Summoned, all Fairy-Type monsters you control gain 300 ATK.
external_ids: local SETCARD_ID_0 = 0x9b --Melodious
  
lua: local SETCARD_ID_0 = 0x9b --Melodious
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(s.indtg)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	--atk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_FAIRY))
  	e2:SetValue(300)
  	e2:SetCondition(s.tgcon)
  	c:RegisterEffect(e2)
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  function s.tgcon(e)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  
  
source_text: Elegy
  Special Summoned "Melodious" monsters you control cannot be destroyed by card effects. If this card was Special Summoned, all Fairy-Type monsters you control gain 300 ATK.
target_text: -- Elegy
  local SETCARD_ID_0 = 0x9b --Melodious
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, 0)
  	e1:SetTarget(s.indtg)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	--atk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(LOCATION_MZONE, 0)
  	e2:SetTarget(aux.TargetBoolFunction(Card.IsRace, RACE_FAIRY))
  	e2:SetValue(300)
  	e2:SetCondition(s.tgcon)
  	c:RegisterEffect(e2)
  end
  function s.indtg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  function s.tgcon(e)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  
  