name: Photon
card_text: If a "Photon" monster is on the field, you can Special Summon this card (from your hand). You can only Special Summon "Photon Advancer" once per turn this way. Gains 1000 ATK if another "Photon" monster is on the field.
external_ids: local SETCARD_ID_0 = 0x55 --Photon
  
lua: local SETCARD_ID_0 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetCondition(s.atkcon)
  	e2:SetValue(1000)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  end
  function s.valcon(e, re, r, rp)
  	return bit.band(r, REASON_EFFECT) ~= 0 and re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.atkcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, LOCATION_MZONE, 1, e:GetHandler())
  end
  
  
source_text: Photon
  If a "Photon" monster is on the field, you can Special Summon this card (from your hand). You can only Special Summon "Photon Advancer" once per turn this way. Gains 1000 ATK if another "Photon" monster is on the field.
target_text: -- Photon
  local SETCARD_ID_0 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.sprcon)
  	c:RegisterEffect(e1)
  	--atkup
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetCondition(s.atkcon)
  	e2:SetValue(1000)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.sprcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  end
  function s.valcon(e, re, r, rp)
  	return bit.band(r, REASON_EFFECT) ~= 0 and re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.atkcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, LOCATION_MZONE, 1, e:GetHandler())
  end
  
  