World
When this card is activated: You can target 1 Level 5 or higher monster on the field; it gains 1000 ATK/DEF until the end of this turn. Negate any opponent's Spell effect that activates in the same column as a "Mekk-Knight" monster you control.
local SETCARD_ID_0 = 0x10c --Mekk-Knight

local SETCARD_ID_0 = 0x10c --Mekk-Knight
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(TIMING_DAMAGE_STEP)
	e1:SetCondition(aux.dscon)
	e1:SetTarget(s.target)
	c:RegisterEffect(e1)
	--disable
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e2:SetCode(EVENT_CHAIN_SOLVING)
	e2:SetRange(LOCATION_SZONE)
	e2:SetCondition(s.discon)
	e2:SetOperation(s.disop)
	c:RegisterEffect(e2)
end
function s.atkfilter(c)
	return c:IsFaceup() and c:IsLevelAbove(5)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc)
	end
	if chk == 0 then
		if Duel.GetCurrentPhase() == PHASE_DAMAGE then
			return Duel.IsExistingTarget(s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
		end
		return true
	end
	if Duel.GetCurrentPhase() == PHASE_DAMAGE or (Duel.IsExistingTarget(s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 0))) then
		e:SetCategory(CATEGORY_ATKCHANGE)
		e:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_CARD_TARGET)
		e:SetOperation(s.activate)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
		Duel.SelectTarget(tp, s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
	else
		e:SetCategory(0)
		e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
		e:SetOperation(nil)
	end
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(1000)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e1)
		local e2 = e1:Clone()
		e2:SetCode(EFFECT_UPDATE_DEFENSE)
		tc:RegisterEffect(e2)
	end
end
function s.cfilter(c, seq2)
	local seq1 = aux.MZoneSequence(c:GetSequence())
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and seq1 == 4 - seq2
end
function s.discon(e, tp, eg, ep, ev, re, r, rp)
	local loc, seq = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION, CHAININFO_TRIGGERING_SEQUENCE)
	return rp == 1 - tp and re:IsActiveType(TYPE_SPELL) and loc & LOCATION_SZONE == LOCATION_SZONE and seq <= 4 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil, seq)
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_CARD, 0, id)
	Duel.NegateEffect(ev)
end


World
When this card is activated: You can target 1 Level 5 or higher monster on the field; it gains 1000 ATK/DEF until the end of this turn. Negate any opponent's Spell effect that activates in the same column as a "Mekk-Knight" monster you control.
-- World
local SETCARD_ID_0 = 0x10c --Mekk-Knight
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(TIMING_DAMAGE_STEP)
	e1:SetCondition(aux.dscon)
	e1:SetTarget(s.target)
	c:RegisterEffect(e1)
	--disable
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e2:SetCode(EVENT_CHAIN_SOLVING)
	e2:SetRange(LOCATION_SZONE)
	e2:SetCondition(s.discon)
	e2:SetOperation(s.disop)
	c:RegisterEffect(e2)
end
function s.atkfilter(c)
	return c:IsFaceup() and c:IsLevelAbove(5)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and s.atkfilter(chkc)
	end
	if chk == 0 then
		if Duel.GetCurrentPhase() == PHASE_DAMAGE then
			return Duel.IsExistingTarget(s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
		end
		return true
	end
	if Duel.GetCurrentPhase() == PHASE_DAMAGE or (Duel.IsExistingTarget(s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil) and Duel.SelectYesNo(tp, aux.Stringid(id, 0))) then
		e:SetCategory(CATEGORY_ATKCHANGE)
		e:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_CARD_TARGET)
		e:SetOperation(s.activate)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
		Duel.SelectTarget(tp, s.atkfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
	else
		e:SetCategory(0)
		e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
		e:SetOperation(nil)
	end
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(1000)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e1)
		local e2 = e1:Clone()
		e2:SetCode(EFFECT_UPDATE_DEFENSE)
		tc:RegisterEffect(e2)
	end
end
function s.cfilter(c, seq2)
	local seq1 = aux.MZoneSequence(c:GetSequence())
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and seq1 == 4 - seq2
end
function s.discon(e, tp, eg, ep, ev, re, r, rp)
	local loc, seq = Duel.GetChainInfo(ev, CHAININFO_TRIGGERING_LOCATION, CHAININFO_TRIGGERING_SEQUENCE)
	return rp == 1 - tp and re:IsActiveType(TYPE_SPELL) and loc & LOCATION_SZONE == LOCATION_SZONE and seq <= 4 and Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil, seq)
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_CARD, 0, id)
	Duel.NegateEffect(ev)
end

