name: Ancient
card_text: 1 Tuner + 1 or more non-Tuner monsters
  After resolving a Field Spell Card that was activated during your turn: Draw 1 card. You can only use this effect of "Ancient Pixie Dragon" once per turn. Once per turn: You can target 1 face-up Attack Position monster on the field; destroy that target. There must be a face-up Field Spell Card on the field to activate and to resolve this effect.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--draw
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.drcon)
  	e1:SetTarget(s.drtg)
  	e1:SetOperation(s.drop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(id)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1)
  	e3:SetCondition(s.descon)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  end
  function s.drcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp and re and re:IsActiveType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil)
  end
  function s.desfilter(c)
  	return c:IsPosition(POS_FACEUP_ATTACK)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.desfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) and Duel.IsExistingMatchingCard(nil, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  
source_text: Ancient
  1 Tuner + 1 or more non-Tuner monsters
  After resolving a Field Spell Card that was activated during your turn: Draw 1 card. You can only use this effect of "Ancient Pixie Dragon" once per turn. Once per turn: You can target 1 face-up Attack Position monster on the field; destroy that target. There must be a face-up Field Spell Card on the field to activate and to resolve this effect.
target_text: -- Ancient
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--synchro summon
  	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
  	c:EnableReviveLimit()
  	--draw
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DRAW)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.drcon)
  	e1:SetTarget(s.drtg)
  	e1:SetOperation(s.drop)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(id)
  	c:RegisterEffect(e2)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_DESTROY)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1)
  	e3:SetCondition(s.descon)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  end
  function s.drcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp and re and re:IsActiveType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Draw(p, d, REASON_EFFECT)
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(Card.IsFaceup, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil)
  end
  function s.desfilter(c)
  	return c:IsPosition(POS_FACEUP_ATTACK)
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and s.desfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local g = Duel.SelectTarget(tp, s.desfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) and Duel.IsExistingMatchingCard(nil, tp, LOCATION_FZONE, LOCATION_FZONE, 1, nil) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  
  