name: Jain,
card_text: Once per turn: You can banish 1 "Lightsworn" monster from your hand or GY, then target 1 face-up monster on the field; it loses ATK and DEF equal to the banished monster's Level x 300, until the end of this turn. Once per turn, if your other "Lightsworn" monster's effect is activated: Send the top 2 cards of your Deck to the GY.
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)
  	--reduce atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--mill
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DECKDES)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.ddcon)
  	e2:SetTarget(s.ddtg)
  	e2:SetOperation(s.ddop)
  	c:RegisterEffect(e2)
  end
  function s.atkcfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsLevelAbove(1) and c:IsAbleToRemoveAsCost()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.atkcfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.atkcfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil)
  	e:SetLabel(g:GetFirst():GetLevel())
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local lv = e:GetLabel()
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(-lv * 300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  	end
  end
  function s.ddcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = re:GetHandler()
  	return re:IsActiveType(TYPE_MONSTER) and rc ~= c and rc:IsSetCard(SETCARD_ID_0) and rc:IsControler(tp)
  end
  function s.ddtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 2)
  end
  function s.ddop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.DiscardDeck(tp, 2, REASON_EFFECT)
  end
  
  
source_text: Jain,
  Once per turn: You can banish 1 "Lightsworn" monster from your hand or GY, then target 1 face-up monster on the field; it loses ATK and DEF equal to the banished monster's Level x 300, until the end of this turn. Once per turn, if your other "Lightsworn" monster's effect is activated: Send the top 2 cards of your Deck to the GY.
target_text: -- Jain,
  local SETCARD_ID_0 = 0x38 --Lightsworn
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--reduce atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.atkcost)
  	e1:SetTarget(s.atktg)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--mill
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_DECKDES)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.ddcon)
  	e2:SetTarget(s.ddtg)
  	e2:SetOperation(s.ddop)
  	c:RegisterEffect(e2)
  end
  function s.atkcfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsLevelAbove(1) and c:IsAbleToRemoveAsCost()
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.atkcfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.atkcfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil)
  	e:SetLabel(g:GetFirst():GetLevel())
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup()
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, Card.IsFaceup, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		local lv = e:GetLabel()
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(-lv * 300)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_UPDATE_DEFENSE)
  		tc:RegisterEffect(e2)
  	end
  end
  function s.ddcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = re:GetHandler()
  	return re:IsActiveType(TYPE_MONSTER) and rc ~= c and rc:IsSetCard(SETCARD_ID_0) and rc:IsControler(tp)
  end
  function s.ddtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DECKDES, nil, 0, tp, 2)
  end
  function s.ddop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.DiscardDeck(tp, 2, REASON_EFFECT)
  end
  
  