S-Force
Each of your opponent's monsters in the same column as one of your "S-Force" monsters cannot change its battle position. If this card is Normal or Special Summoned: You can target 1 face-up monster your opponent controls; change its battle position. You can only use this effect of "S-Force Professor DiGamma" once per turn.
local SETCARD_ID_0 = 0x156 --S-Force

local SETCARD_ID_0 = 0x156 --S-Force
local s, id, o = GetID()
function s.initial_effect(c)
	--position change
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_POSITION)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.postg)
	e1:SetOperation(s.posop)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e2)
	--position change limit
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
	e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(0, LOCATION_MZONE)
	e3:SetTarget(s.chtg)
	c:RegisterEffect(e3)
end
function s.posfilter(c)
	return c:IsFaceup() and c:IsCanChangePosition()
end
function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.posfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.posfilter, tp, 0, LOCATION_MZONE, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_POSCHANGE)
	local g = Duel.SelectTarget(tp, s.posfilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, 1, 0, 0)
end
function s.posop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
	end
end
function s.chfilter(c, tp)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.chtg(e, c)
	local cg = c:GetColumnGroup()
	return cg:IsExists(s.chfilter, 1, nil, e:GetHandlerPlayer())
end


S-Force
Each of your opponent's monsters in the same column as one of your "S-Force" monsters cannot change its battle position. If this card is Normal or Special Summoned: You can target 1 face-up monster your opponent controls; change its battle position. You can only use this effect of "S-Force Professor DiGamma" once per turn.
-- S-Force
local SETCARD_ID_0 = 0x156 --S-Force
local s, id, o = GetID()
function s.initial_effect(c)
	--position change
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_POSITION)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.postg)
	e1:SetOperation(s.posop)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e2)
	--position change limit
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
	e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(0, LOCATION_MZONE)
	e3:SetTarget(s.chtg)
	c:RegisterEffect(e3)
end
function s.posfilter(c)
	return c:IsFaceup() and c:IsCanChangePosition()
end
function s.postg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.posfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.posfilter, tp, 0, LOCATION_MZONE, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_POSCHANGE)
	local g = Duel.SelectTarget(tp, s.posfilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_POSITION, g, 1, 0, 0)
end
function s.posop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		Duel.ChangePosition(tc, POS_FACEUP_DEFENSE, POS_FACEUP_DEFENSE, POS_FACEUP_ATTACK, POS_FACEUP_ATTACK)
	end
end
function s.chfilter(c, tp)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.chtg(e, c)
	local cg = c:GetColumnGroup()
	return cg:IsExists(s.chfilter, 1, nil, e:GetHandlerPlayer())
end

