name: Mekk-Knight
card_text: If 2 or more cards are in the same column, you can Special Summon this card (from your hand) in that column. You can only Special Summon "Mekk-Knight Red Moon" once per turn this way. You can banish 1 "Mekk-Knight" monster from your GY, then target 1 face-up monster in this card's column; destroy it.
external_ids: local SETCARD_ID_0 = 0x10c --Mekk-Knight
  
lua: local SETCARD_ID_0 = 0x10c --Mekk-Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.hspcon)
  	e1:SetValue(s.hspval)
  	c:RegisterEffect(e1)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.cost)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:GetColumnGroupCount() > 0
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local zone = 0
  	local lg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	for tc in aux.Next(lg) do
  		zone = bit.bor(zone, tc:GetColumnZone(LOCATION_MZONE, tp))
  	end
  	return Duel.GetLocationCount(tp, LOCATION_MZONE, tp, LOCATION_REASON_TOFIELD, zone) > 0
  end
  function s.hspval(e, c)
  	local tp = c:GetControler()
  	local zone = 0
  	local lg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	for tc in aux.Next(lg) do
  		zone = bit.bor(zone, tc:GetColumnZone(LOCATION_MZONE, tp))
  	end
  	return 0, zone
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.filter(c, g)
  	return c:IsFaceup() and g:IsContains(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	local cg = c:GetColumnGroup()
  	cg:AddCard(c)
  	if chkc then
  		return s.filter(chkc, cg) and chkc:IsLocation(LOCATION_MZONE)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, cg)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, cg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Mekk-Knight
  If 2 or more cards are in the same column, you can Special Summon this card (from your hand) in that column. You can only Special Summon "Mekk-Knight Red Moon" once per turn this way. You can banish 1 "Mekk-Knight" monster from your GY, then target 1 face-up monster in this card's column; destroy it.
target_text: -- Mekk-Knight
  local SETCARD_ID_0 = 0x10c --Mekk-Knight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_SPSUMMON_PROC)
  	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e1:SetRange(LOCATION_HAND)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.hspcon)
  	e1:SetValue(s.hspval)
  	c:RegisterEffect(e1)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.cost)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:GetColumnGroupCount() > 0
  end
  function s.hspcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	local zone = 0
  	local lg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	for tc in aux.Next(lg) do
  		zone = bit.bor(zone, tc:GetColumnZone(LOCATION_MZONE, tp))
  	end
  	return Duel.GetLocationCount(tp, LOCATION_MZONE, tp, LOCATION_REASON_TOFIELD, zone) > 0
  end
  function s.hspval(e, c)
  	local tp = c:GetControler()
  	local zone = 0
  	local lg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	for tc in aux.Next(lg) do
  		zone = bit.bor(zone, tc:GetColumnZone(LOCATION_MZONE, tp))
  	end
  	return 0, zone
  end
  function s.costfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.Remove(g, POS_FACEUP, REASON_COST)
  end
  function s.filter(c, g)
  	return c:IsFaceup() and g:IsContains(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	local cg = c:GetColumnGroup()
  	cg:AddCard(c)
  	if chkc then
  		return s.filter(chkc, cg) and chkc:IsLocation(LOCATION_MZONE)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, cg)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, cg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  