name: Hidden
card_text: Once per turn, during the Main Phase 2: The turn player can activate this effect; they gain 500 LP, and until the end of this turn apply these effects.
  ● The Normal and Special Summons of their monsters cannot be negated.
  ● If they activate a Spell/Trap Card, or monster effect, that includes an effect that Special Summons a monster, that activation cannot be negated.
  ● Their opponent cannot target Set Spells/Traps they control with card effects, also they cannot be destroyed by their opponent's card effects.
  You can only activate 1 "Hidden Springs of the Far East" per turn.
lua: 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)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	c:RegisterEffect(e1)
  	--apply
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.effcon)
  	e2:SetOperation(s.effop)
  	c:RegisterEffect(e2)
  end
  function s.effcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_MAIN2
  end
  function s.effop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if Duel.Recover(tp, 500, REASON_EFFECT) ~= 0 then
  		--cannot disable summon
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
  		e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_SET_AVAILABLE)
  		e1:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e1, tp)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
  		Duel.RegisterEffect(e2, tp)
  		--inactivatable
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetCode(EFFECT_CANNOT_INACTIVATE)
  		e3:SetValue(s.effectfilter)
  		e3:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e3, tp)
  		--protection
  		local e4 = Effect.CreateEffect(c)
  		e4:SetType(EFFECT_TYPE_FIELD)
  		e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  		e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e4:SetTargetRange(LOCATION_SZONE, 0)
  		e4:SetTarget(aux.TargetBoolFunction(Card.IsType, TYPE_SPELL + TYPE_TRAP))
  		e4:SetValue(aux.tgoval)
  		e4:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e4, tp)
  		local e5 = e4:Clone()
  		e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  		e5:SetValue(aux.indoval)
  		Duel.RegisterEffect(e5, tp)
  	end
  end
  function s.effectfilter(e, ct)
  	local p = e:GetHandlerPlayer()
  	local te, tp = Duel.GetChainInfo(ct, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  	return p == tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and te:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
  end
  
  
source_text: Hidden
  Once per turn, during the Main Phase 2: The turn player can activate this effect; they gain 500 LP, and until the end of this turn apply these effects.
  ● The Normal and Special Summons of their monsters cannot be negated.
  ● If they activate a Spell/Trap Card, or monster effect, that includes an effect that Special Summons a monster, that activation cannot be negated.
  ● Their opponent cannot target Set Spells/Traps they control with card effects, also they cannot be destroyed by their opponent's card effects.
  You can only activate 1 "Hidden Springs of the Far East" per turn.
target_text: -- Hidden
  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)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	c:RegisterEffect(e1)
  	--apply
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_FZONE)
  	e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.effcon)
  	e2:SetOperation(s.effop)
  	c:RegisterEffect(e2)
  end
  function s.effcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetCurrentPhase() == PHASE_MAIN2
  end
  function s.effop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if Duel.Recover(tp, 500, REASON_EFFECT) ~= 0 then
  		--cannot disable summon
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
  		e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_SET_AVAILABLE)
  		e1:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e1, tp)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
  		Duel.RegisterEffect(e2, tp)
  		--inactivatable
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetCode(EFFECT_CANNOT_INACTIVATE)
  		e3:SetValue(s.effectfilter)
  		e3:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e3, tp)
  		--protection
  		local e4 = Effect.CreateEffect(c)
  		e4:SetType(EFFECT_TYPE_FIELD)
  		e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  		e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  		e4:SetTargetRange(LOCATION_SZONE, 0)
  		e4:SetTarget(aux.TargetBoolFunction(Card.IsType, TYPE_SPELL + TYPE_TRAP))
  		e4:SetValue(aux.tgoval)
  		e4:SetReset(RESET_PHASE + PHASE_END)
  		Duel.RegisterEffect(e4, tp)
  		local e5 = e4:Clone()
  		e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  		e5:SetValue(aux.indoval)
  		Duel.RegisterEffect(e5, tp)
  	end
  end
  function s.effectfilter(e, ct)
  	local p = e:GetHandlerPlayer()
  	local te, tp = Duel.GetChainInfo(ct, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  	return p == tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and te:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
  end
  
  