name: Unleash
card_text: All Gemini monsters that were on your side of the field when this card was activated are treated as Effect Monsters, and gain their effect(s). During the End Phase of this turn, Set all monsters affected by this card's effect.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_POSITION)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  s.has_text_type = TYPE_DUAL
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	Duel.SetTargetCard(g)
  end
  function s.filter2(c, e)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_MZONE, 0, nil, e)
  	local tc = g:GetFirst()
  	local fid = c:GetFieldID()
  	while tc do
  		tc:EnableDualState()
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, fid)
  		tc = g:GetNext()
  	end
  	g:KeepAlive()
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	e2:SetCountLimit(1)
  	e2:SetLabel(fid)
  	e2:SetLabelObject(g)
  	e2:SetCondition(s.flipcon)
  	e2:SetOperation(s.flipop)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.flipfilter(c, fid)
  	return c:GetFlagEffectLabel(id) == fid
  end
  function s.flipcon(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetLabelObject()
  	if not g:IsExists(s.flipfilter, 1, nil, e:GetLabel()) then
  		g:DeleteGroup()
  		e:Reset()
  		return false
  	else
  		return true
  	end
  end
  function s.flipop(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetLabelObject()
  	local dg = g:Filter(s.flipfilter, nil, e:GetLabel())
  	g:DeleteGroup()
  	Duel.ChangePosition(dg, POS_FACEDOWN_DEFENSE)
  end
  
  
source_text: Unleash
  All Gemini monsters that were on your side of the field when this card was activated are treated as Effect Monsters, and gain their effect(s). During the End Phase of this turn, Set all monsters affected by this card's effect.
target_text: -- Unleash
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_POSITION)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  s.has_text_type = TYPE_DUAL
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, 0, nil)
  	Duel.SetTargetCard(g)
  end
  function s.filter2(c, e)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL) and not c:IsDualState() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(s.filter2, tp, LOCATION_MZONE, 0, nil, e)
  	local tc = g:GetFirst()
  	local fid = c:GetFieldID()
  	while tc do
  		tc:EnableDualState()
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, fid)
  		tc = g:GetNext()
  	end
  	g:KeepAlive()
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetReset(RESET_PHASE + PHASE_END)
  	e2:SetCountLimit(1)
  	e2:SetLabel(fid)
  	e2:SetLabelObject(g)
  	e2:SetCondition(s.flipcon)
  	e2:SetOperation(s.flipop)
  	Duel.RegisterEffect(e2, tp)
  end
  function s.flipfilter(c, fid)
  	return c:GetFlagEffectLabel(id) == fid
  end
  function s.flipcon(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetLabelObject()
  	if not g:IsExists(s.flipfilter, 1, nil, e:GetLabel()) then
  		g:DeleteGroup()
  		e:Reset()
  		return false
  	else
  		return true
  	end
  end
  function s.flipop(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetLabelObject()
  	local dg = g:Filter(s.flipfilter, nil, e:GetLabel())
  	g:DeleteGroup()
  	Duel.ChangePosition(dg, POS_FACEDOWN_DEFENSE)
  end
  
  