name: Lose
card_text: Activate only if you currently control no Special Summoned monsters. While a monster is face-up on the field, negate its effects during the turn that monster was Special Summoned. If an Effect Monster(s) is Special Summoned in Attack Position: Change it to Defense Position.
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:SetHintTiming(TIMING_SPSUMMON)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target1)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--pos
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_POSITION)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTarget(s.target2)
  	e2:SetOperation(s.operation)
  	e2:SetLabel(1)
  	c:RegisterEffect(e2)
  	--disable
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_DISABLE)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(s.distg)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	e:SetLabel(0)
  	local res, teg, tep, tev, tre, tr, trp = Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS, true)
  	if res then
  		local g = teg:Filter(s.filter1, nil)
  		if g:GetCount() > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  			Duel.SetTargetCard(g)
  			Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  			e:SetLabel(1)
  			e:GetHandler():RegisterFlagEffect(0, RESET_CHAIN, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 1))
  		end
  	end
  end
  function s.filter1(c)
  	return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT)
  end
  function s.target2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return eg:IsExists(s.filter1, 1, nil)
  	end
  	local g = eg:Filter(s.filter1, nil)
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetLabel() == 0 or not e:GetHandler():IsRelateToEffect(e) then
  		return
  	end
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.ChangePosition(g, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE)
  	end
  end
  function s.distg(e, c)
  	return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  
  
source_text: Lose
  Activate only if you currently control no Special Summoned monsters. While a monster is face-up on the field, negate its effects during the turn that monster was Special Summoned. If an Effect Monster(s) is Special Summoned in Attack Position: Change it to Defense Position.
target_text: -- Lose
  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:SetHintTiming(TIMING_SPSUMMON)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target1)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--pos
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_POSITION)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetTarget(s.target2)
  	e2:SetOperation(s.operation)
  	e2:SetLabel(1)
  	c:RegisterEffect(e2)
  	--disable
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_DISABLE)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e3:SetTarget(s.distg)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target1(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	e:SetLabel(0)
  	local res, teg, tep, tev, tre, tr, trp = Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS, true)
  	if res then
  		local g = teg:Filter(s.filter1, nil)
  		if g:GetCount() > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
  			Duel.SetTargetCard(g)
  			Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  			e:SetLabel(1)
  			e:GetHandler():RegisterFlagEffect(0, RESET_CHAIN, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 1))
  		end
  	end
  end
  function s.filter1(c)
  	return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT)
  end
  function s.target2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return eg:IsExists(s.filter1, 1, nil)
  	end
  	local g = eg:Filter(s.filter1, nil)
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if e:GetLabel() == 0 or not e:GetHandler():IsRelateToEffect(e) then
  		return
  	end
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.ChangePosition(g, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEDOWN_DEFENSE)
  	end
  end
  function s.distg(e, c)
  	return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsSummonType(SUMMON_TYPE_SPECIAL)
  end
  
  