name: Sour
card_text: Activate this card only if your opponent controls a card in this Set card's column; return all other cards in this card's column to the hand. Neither player can use the unused zones in this card's column. You can only control 1 "Sour Scheduling - Red Vinegar Vamoose".
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--disable field
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_DISABLE_FIELD)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetValue(s.disval)
  	c:RegisterEffect(e2)
  end
  function s.disval(e, tp)
  	local c = e:GetHandler()
  	return c:GetColumnZone(LOCATION_ONFIELD, 0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsLocation(LOCATION_SZONE) and c:IsFacedown() and c:GetColumnGroup():IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local g = c:GetColumnGroup()
  	if chk == 0 then
  		return #g > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetHandler():GetColumnGroup()
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  end
  
  
source_text: Sour
  Activate this card only if your opponent controls a card in this Set card's column; return all other cards in this card's column to the hand. Neither player can use the unused zones in this card's column. You can only control 1 "Sour Scheduling - Red Vinegar Vamoose".
target_text: -- Sour
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:SetUniqueOnField(1, 0, id)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TOHAND)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	--disable field
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_DISABLE_FIELD)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetValue(s.disval)
  	c:RegisterEffect(e2)
  end
  function s.disval(e, tp)
  	local c = e:GetHandler()
  	return c:GetColumnZone(LOCATION_ONFIELD, 0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsLocation(LOCATION_SZONE) and c:IsFacedown() and c:GetColumnGroup():IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local g = c:GetColumnGroup()
  	if chk == 0 then
  		return #g > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetHandler():GetColumnGroup()
  	Duel.SendtoHand(g, nil, REASON_EFFECT)
  end
  
  