name: Vaylantz
card_text: Pendulum Scale = 1
  [ Pendulum Effect ]
  If "Vaylantz World - Konig Wissen" is in a Field Zone or if you control a FIRE "Vaylantz" monster: You can Special Summon this card to your Main Monster Zone in its same column. You can only use this effect of "Vaylantz Dominator Duke" once per turn.
  ----------------------------------------
  [ Monster Effect ]
  You can target 1 Set card in the Spell & Trap Zone; that Set card cannot be activated this turn (even if this card leaves the field). If this card in the Monster Zone moves to another Monster Zone: You can target 1 face-up monster in your opponent's Main Monster Zone; take control of that face-up monster, but it cannot declare an attack nor activate its effects, also it is treated as a "Vaylantz" monster. You can only use each effect of "Vaylantz Dominator Duke" once per turn.
external_ids: local CARD_ID_0 = 75952542 --Vaylantz World - Konig Wissen
  local SETCARD_ID_0 = 0x17d --Vaylantz
  
lua: local CARD_ID_0 = 75952542 --Vaylantz World - Konig Wissen
  local SETCARD_ID_0 = 0x17d --Vaylantz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--actlimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetTarget(s.altg)
  	e2:SetOperation(s.alop)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_CONTROL)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_MOVE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1, id + 2)
  	e3:SetCondition(s.mvcon)
  	e3:SetTarget(s.mvtg)
  	e3:SetOperation(s.mvop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_0) or Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local zone = 1 << c:GetSequence()
  	if chk == 0 then
  		return c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP, tp, zone)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local zone = 1 << c:GetSequence()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP, zone)
  	end
  end
  function s.alfilter(c)
  	return c:IsFacedown() and c:GetSequence() < 5
  end
  function s.altg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_SZONE) and s.alfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.alfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	Duel.SelectTarget(tp, s.alfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil)
  end
  function s.alop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFacedown() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_TRIGGER)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.mvcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsPreviousLocation(LOCATION_MZONE) and c:IsLocation(LOCATION_MZONE) and (c:GetPreviousSequence() ~= c:GetSequence() or c:GetPreviousControler() ~= tp)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsControlerCanBeChanged() and c:GetSequence() <= 4
  end
  function s.mvtg(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.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.mvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetControl(tc, tp) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_CANNOT_TRIGGER)
  		tc:RegisterEffect(e2)
  		local e3 = e1:Clone()
  		e3:SetCode(EFFECT_ADD_SETCODE)
  		e3:SetValue(0x17d)
  		tc:RegisterEffect(e3)
  	end
  end
  
  
source_text: Vaylantz
  Pendulum Scale = 1
  [ Pendulum Effect ]
  If "Vaylantz World - Konig Wissen" is in a Field Zone or if you control a FIRE "Vaylantz" monster: You can Special Summon this card to your Main Monster Zone in its same column. You can only use this effect of "Vaylantz Dominator Duke" once per turn.
  ----------------------------------------
  [ Monster Effect ]
  You can target 1 Set card in the Spell & Trap Zone; that Set card cannot be activated this turn (even if this card leaves the field). If this card in the Monster Zone moves to another Monster Zone: You can target 1 face-up monster in your opponent's Main Monster Zone; take control of that face-up monster, but it cannot declare an attack nor activate its effects, also it is treated as a "Vaylantz" monster. You can only use each effect of "Vaylantz Dominator Duke" once per turn.
target_text: -- Vaylantz
  local CARD_ID_0 = 75952542 --Vaylantz World - Konig Wissen
  local SETCARD_ID_0 = 0x17d --Vaylantz
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_PZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--actlimit
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1, id + 1)
  	e2:SetTarget(s.altg)
  	e2:SetOperation(s.alop)
  	c:RegisterEffect(e2)
  	--control
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_CONTROL)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_MOVE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetProperty(EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET)
  	e3:SetCountLimit(1, id + 2)
  	e3:SetCondition(s.mvcon)
  	e3:SetTarget(s.mvtg)
  	e3:SetOperation(s.mvop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsEnvironment(CARD_ID_0) or Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	local zone = 1 << c:GetSequence()
  	if chk == 0 then
  		return c:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEUP, tp, zone)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local zone = 1 << c:GetSequence()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP, zone)
  	end
  end
  function s.alfilter(c)
  	return c:IsFacedown() and c:GetSequence() < 5
  end
  function s.altg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_SZONE) and s.alfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.alfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
  	Duel.SelectTarget(tp, s.alfilter, tp, LOCATION_SZONE, LOCATION_SZONE, 1, 1, nil)
  end
  function s.alop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsFacedown() and tc:IsRelateToEffect(e) then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_TRIGGER)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  	end
  end
  function s.mvcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	return c:IsPreviousLocation(LOCATION_MZONE) and c:IsLocation(LOCATION_MZONE) and (c:GetPreviousSequence() ~= c:GetSequence() or c:GetPreviousControler() ~= tp)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsControlerCanBeChanged() and c:GetSequence() <= 4
  end
  function s.mvtg(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.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.mvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetControl(tc, tp) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CANNOT_ATTACK)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		local e2 = e1:Clone()
  		e2:SetCode(EFFECT_CANNOT_TRIGGER)
  		tc:RegisterEffect(e2)
  		local e3 = e1:Clone()
  		e3:SetCode(EFFECT_ADD_SETCODE)
  		e3:SetValue(0x17d)
  		tc:RegisterEffect(e3)
  	end
  end
  
  