name: Taotie
card_text: 2+ monsters Special Summoned from the Extra Deck
  This card gains effects based on the card types (Fusion/Synchro/Xyz) of materials used for its Link Summon.
  ● Fusion: Your opponent cannot activate monster effects during the Battle Phase.
  ● Synchro: Your opponent cannot activate Spell/Trap Cards and effects during your Main Phase.
  ● Xyz: Your opponent cannot activate the effects of cards in the GY during your Main Phase or Battle Phase.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, s.matfilter, 2)
  	--effect gain
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.regcon)
  	e1:SetOperation(s.regop)
  	c:RegisterEffect(e1)
  end
  function s.matfilter(c)
  	return c:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.regcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_FUSION) > 0 then
  		--activate limit - fusion -> monster
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e1:SetRange(LOCATION_MZONE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetTargetRange(0, 1)
  		e1:SetCondition(s.condition1)
  		e1:SetValue(s.aclimit1)
  		c:RegisterEffect(e1)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 0))
  	end
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_SYNCHRO) > 0 then
  		--activate limit - synchro -> spell/trap
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD)
  		e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e2:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e2:SetRange(LOCATION_MZONE)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e2:SetTargetRange(0, 1)
  		e2:SetCondition(s.condition2)
  		e2:SetValue(s.aclimit2)
  		c:RegisterEffect(e2)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 1))
  	end
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_XYZ) > 0 then
  		--activate limit - XYZ -> grave
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e3:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e3:SetTargetRange(0, 1)
  		e3:SetCondition(s.condition3)
  		e3:SetValue(s.aclimit3)
  		c:RegisterEffect(e3)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 2))
  	end
  end
  function s.condition1(e)
  	local ph = Duel.GetCurrentPhase()
  	return ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE
  end
  function s.aclimit1(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  function s.condition2(e)
  	local ph = Duel.GetCurrentPhase()
  	return (ph == PHASE_MAIN1 or ph == PHASE_MAIN2) and Duel.GetTurnPlayer() == e:GetHandlerPlayer()
  end
  function s.aclimit2(e, re, tp)
  	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.condition3(e)
  	local ph = Duel.GetCurrentPhase()
  	return (ph == PHASE_MAIN1 or ph == PHASE_MAIN2 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE)) and Duel.GetTurnPlayer() == e:GetHandlerPlayer()
  end
  function s.aclimit3(e, re, tp)
  	return re:GetActivateLocation() == LOCATION_GRAVE
  end
  
  
source_text: Taotie
  2+ monsters Special Summoned from the Extra Deck
  This card gains effects based on the card types (Fusion/Synchro/Xyz) of materials used for its Link Summon.
  ● Fusion: Your opponent cannot activate monster effects during the Battle Phase.
  ● Synchro: Your opponent cannot activate Spell/Trap Cards and effects during your Main Phase.
  ● Xyz: Your opponent cannot activate the effects of cards in the GY during your Main Phase or Battle Phase.
target_text: -- Taotie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, s.matfilter, 2)
  	--effect gain
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.regcon)
  	e1:SetOperation(s.regop)
  	c:RegisterEffect(e1)
  end
  function s.matfilter(c)
  	return c:IsSummonLocation(LOCATION_EXTRA)
  end
  function s.regcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
  end
  function s.regop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_FUSION) > 0 then
  		--activate limit - fusion -> monster
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e1:SetRange(LOCATION_MZONE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e1:SetTargetRange(0, 1)
  		e1:SetCondition(s.condition1)
  		e1:SetValue(s.aclimit1)
  		c:RegisterEffect(e1)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 0))
  	end
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_SYNCHRO) > 0 then
  		--activate limit - synchro -> spell/trap
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_FIELD)
  		e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e2:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e2:SetRange(LOCATION_MZONE)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e2:SetTargetRange(0, 1)
  		e2:SetCondition(s.condition2)
  		e2:SetValue(s.aclimit2)
  		c:RegisterEffect(e2)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 1))
  	end
  	if c:GetMaterial():FilterCount(Card.IsLinkType, nil, TYPE_XYZ) > 0 then
  		--activate limit - XYZ -> grave
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD)
  		e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e3:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetReset(RESET_EVENT + RESETS_STANDARD)
  		e3:SetTargetRange(0, 1)
  		e3:SetCondition(s.condition3)
  		e3:SetValue(s.aclimit3)
  		c:RegisterEffect(e3)
  		c:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 2))
  	end
  end
  function s.condition1(e)
  	local ph = Duel.GetCurrentPhase()
  	return ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE
  end
  function s.aclimit1(e, re, tp)
  	return re:IsActiveType(TYPE_MONSTER)
  end
  function s.condition2(e)
  	local ph = Duel.GetCurrentPhase()
  	return (ph == PHASE_MAIN1 or ph == PHASE_MAIN2) and Duel.GetTurnPlayer() == e:GetHandlerPlayer()
  end
  function s.aclimit2(e, re, tp)
  	return re:IsActiveType(TYPE_SPELL + TYPE_TRAP)
  end
  function s.condition3(e)
  	local ph = Duel.GetCurrentPhase()
  	return (ph == PHASE_MAIN1 or ph == PHASE_MAIN2 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE)) and Duel.GetTurnPlayer() == e:GetHandlerPlayer()
  end
  function s.aclimit3(e, re, tp)
  	return re:GetActivateLocation() == LOCATION_GRAVE
  end
  
  