name: Light
card_text: Each time a card(s) is sent from your Deck to the Graveyard by the effect of a "Lightsworn" monster, remove from play the top card of your opponent's Deck.
external_ids: local SETCARD_ID_0 = 0x38 --Lightsworn
  
lua: local SETCARD_ID_0 = 0x38 --Lightsworn
  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)
  	--discard deck
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCategory(CATEGORY_REMOVE)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.rmcon)
  	e2:SetTarget(s.rmtg)
  	e2:SetOperation(s.rmop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsPreviousLocation(LOCATION_DECK)
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	if not re then
  		return false
  	end
  	local rc = re:GetHandler()
  	return rp == tp and bit.band(r, REASON_EFFECT) ~= 0 and rc:IsSetCard(SETCARD_ID_0) and rc:IsType(TYPE_MONSTER) and eg:IsExists(s.cfilter, 1, nil)
  end
  function s.rmtg(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_DECK)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) == 0 then
  		return
  	end
  	local g = Duel.GetDecktopGroup(1 - tp, 1)
  	Duel.DisableShuffleCheck()
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  
  
source_text: Light
  Each time a card(s) is sent from your Deck to the Graveyard by the effect of a "Lightsworn" monster, remove from play the top card of your opponent's Deck.
target_text: -- Light
  local SETCARD_ID_0 = 0x38 --Lightsworn
  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)
  	--discard deck
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCategory(CATEGORY_REMOVE)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetCondition(s.rmcon)
  	e2:SetTarget(s.rmtg)
  	e2:SetOperation(s.rmop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsPreviousLocation(LOCATION_DECK)
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	if not re then
  		return false
  	end
  	local rc = re:GetHandler()
  	return rp == tp and bit.band(r, REASON_EFFECT) ~= 0 and rc:IsSetCard(SETCARD_ID_0) and rc:IsType(TYPE_MONSTER) and eg:IsExists(s.cfilter, 1, nil)
  end
  function s.rmtg(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_DECK)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFieldGroupCount(tp, 0, LOCATION_DECK) == 0 then
  		return
  	end
  	local g = Duel.GetDecktopGroup(1 - tp, 1)
  	Duel.DisableShuffleCheck()
  	Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
  end
  
  