Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this card is being attacked by a LIGHT monster, its DEF is halved during damage calculation only.
--闇の芸術家
--Dark Artist
local s,id=GetID()
function s.initial_effect(c)
	--defdown
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCondition(s.defcon)
	e1:SetValue(s.defval)
	c:RegisterEffect(e1)
end
function s.defcon(e)
	local c=e:GetHandler()
	local bc=c:GetBattleTarget()
	return Duel.IsPhase(PHASE_DAMAGE_CAL) and c==Duel.GetAttackTarget() and bc:IsAttribute(ATTRIBUTE_LIGHT)
end
function s.defval(e,c)
	return math.ceil(e:GetHandler():GetDefense()/2)
end