name: Lunalight
card_text: Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Lunalight" monsters. This effect cannot be negated. Once per turn: You can Fusion Summon 1 "Lunalight" Fusion Monster from your Extra Deck, by banishing Fusion Materials listed on it from your field or Graveyard.
  ----------------------------------------
  [ Monster Effect ]
  If a "Lunalight" monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent.
external_ids: local SETCARD_ID_0 = 0xdf --Lunalight
  
lua: local SETCARD_ID_0 = 0xdf --Lunalight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	c:RegisterEffect(e1)
  	--fusion
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  		pre_select_mat_location = LOCATION_MZONE | LOCATION_GRAVE,
  		mat_operation_code_map = {
  			{ [LOCATION_REMOVED] = FusionSpell.FUSION_OPERATION_GRAVE },
  			{ [0xff] = FusionSpell.FUSION_OPERATION_BANISH },
  		},
  		extra_target = s.extra_target,
  	})
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCountLimit(1)
  	c:RegisterEffect(e2)
  	--pierce
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_PIERCE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.ptg)
  	c:RegisterEffect(e3)
  end
  
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	return not (c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)) and bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.extra_target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, tp, LOCATION_ONFIELD + LOCATION_GRAVE)
  end
  
  function s.ptg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
  end
  
  
source_text: Lunalight
  Pendulum Scale = 1
  [ Pendulum Effect ]
  You cannot Pendulum Summon monsters, except "Lunalight" monsters. This effect cannot be negated. Once per turn: You can Fusion Summon 1 "Lunalight" Fusion Monster from your Extra Deck, by banishing Fusion Materials listed on it from your field or Graveyard.
  ----------------------------------------
  [ Monster Effect ]
  If a "Lunalight" monster you control attacks a Defense Position monster, inflict piercing battle damage to your opponent.
target_text: -- Lunalight
  local SETCARD_ID_0 = 0xdf --Lunalight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--splimit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CAN_FORBIDDEN)
  	e1:SetTargetRange(1, 0)
  	e1:SetTarget(s.splimit)
  	c:RegisterEffect(e1)
  	--fusion
  	local e2 = FusionSpell.CreateSummonEffect(c, {
  		fusfilter = s.fusfilter,
  		pre_select_mat_location = LOCATION_MZONE | LOCATION_GRAVE,
  		mat_operation_code_map = {
  			{ [LOCATION_REMOVED] = FusionSpell.FUSION_OPERATION_GRAVE },
  			{ [0xff] = FusionSpell.FUSION_OPERATION_BANISH },
  		},
  		extra_target = s.extra_target,
  	})
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCountLimit(1)
  	c:RegisterEffect(e2)
  	--pierce
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_PIERCE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_MZONE, 0)
  	e3:SetTarget(s.ptg)
  	c:RegisterEffect(e3)
  end
  
  function s.splimit(e, c, sump, sumtype, sumpos, targetp)
  	return not (c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)) and bit.band(sumtype, SUMMON_TYPE_PENDULUM) == SUMMON_TYPE_PENDULUM
  end
  
  function s.fusfilter(c)
  	return c:IsSetCard(SETCARD_ID_0)
  end
  
  function s.extra_target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, tp, LOCATION_ONFIELD + LOCATION_GRAVE)
  end
  
  function s.ptg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
  end
  
  