name: Chemicritter
card_text: This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect.
  ● During your Main Phase: You can Special Summon 1 Gemini monster from your hand, and if you do, all Gemini monsters you currently control become that monster's original Level until the end of this turn. You can only use this effect of "Chemicritter Oxy Ox" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableDualAttribute(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1, id)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(aux.IsDualState)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, e, tp)
  	return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.lvfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 and Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP) then
  		local lv = g:GetFirst():GetOriginalLevel()
  		local tg = Duel.GetMatchingGroup(s.lvfilter, tp, LOCATION_MZONE, 0, nil)
  		local tc = tg:GetFirst()
  		while tc do
  			if not tc:IsLevel(lv) then
  				local e1 = Effect.CreateEffect(e:GetHandler())
  				e1:SetType(EFFECT_TYPE_SINGLE)
  				e1:SetCode(EFFECT_CHANGE_LEVEL)
  				e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  				e1:SetValue(lv)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  				tc:RegisterEffect(e1)
  			end
  			tc = tg:GetNext()
  		end
  	end
  end
  
  
source_text: Chemicritter
  This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect.
  ● During your Main Phase: You can Special Summon 1 Gemini monster from your hand, and if you do, all Gemini monsters you currently control become that monster's original Level until the end of this turn. You can only use this effect of "Chemicritter Oxy Ox" once per turn.
target_text: -- Chemicritter
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableDualAttribute(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetCountLimit(1, id)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(aux.IsDualState)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, e, tp)
  	return c:IsType(TYPE_DUAL) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.lvfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_DUAL)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 and Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP) then
  		local lv = g:GetFirst():GetOriginalLevel()
  		local tg = Duel.GetMatchingGroup(s.lvfilter, tp, LOCATION_MZONE, 0, nil)
  		local tc = tg:GetFirst()
  		while tc do
  			if not tc:IsLevel(lv) then
  				local e1 = Effect.CreateEffect(e:GetHandler())
  				e1:SetType(EFFECT_TYPE_SINGLE)
  				e1:SetCode(EFFECT_CHANGE_LEVEL)
  				e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  				e1:SetValue(lv)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  				tc:RegisterEffect(e1)
  			end
  			tc = tg:GetNext()
  		end
  	end
  end
  
  