name: The
card_text: Unaffected by Spell Cards or effects. While you control "The Sanctuary in the Sky" and your LP are higher than your opponent's, this card gains ATK/DEF equal to the difference.
external_ids: local CARD_ID_0 = 56433456 --The Sanctuary in the Sky
  
lua: local CARD_ID_0 = 56433456 --The Sanctuary in the Sky
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--immune spell
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_IMMUNE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.efilter)
  	c:RegisterEffect(e1)
  	--update atk,def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.val)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL)
  end
  function s.val(e, c)
  	local tp = c:GetControler()
  	if not Duel.IsEnvironment(CARD_ID_0, tp) then
  		return 0
  	end
  	local v = Duel.GetLP(tp) - Duel.GetLP(1 - tp)
  	if v > 0 then
  		return v
  	else
  		return 0
  	end
  end
  
  
source_text: The
  Unaffected by Spell Cards or effects. While you control "The Sanctuary in the Sky" and your LP are higher than your opponent's, this card gains ATK/DEF equal to the difference.
target_text: -- The
  local CARD_ID_0 = 56433456 --The Sanctuary in the Sky
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--immune spell
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_IMMUNE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetValue(s.efilter)
  	c:RegisterEffect(e1)
  	--update atk,def
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_UPDATE_ATTACK)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetValue(s.val)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e3)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_SPELL)
  end
  function s.val(e, c)
  	local tp = c:GetControler()
  	if not Duel.IsEnvironment(CARD_ID_0, tp) then
  		return 0
  	end
  	local v = Duel.GetLP(tp) - Duel.GetLP(1 - tp)
  	if v > 0 then
  		return v
  	else
  		return 0
  	end
  end
  
  