name: Physical
card_text: During your opponent's turn: Target 1 face-up monster your opponent controls; Special Summon 1 "Mirage Token" with the same Level, Type, Attribute, ATK, and DEF as that target. Destroy this Token during the End Phase.
external_ids: local CARD_ID_0 = 63442605 --Mirage Token
  
lua: local CARD_ID_0 = 63442605 --Mirage Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:GetLevel() > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, c:GetAttack(), c:GetDefense(), c:GetLevel(), c:GetRace(), c:GetAttribute())
  end
  function s.target(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.cfilter(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingTarget(s.cfilter, tp, 0, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, s.cfilter, tp, 0, LOCATION_MZONE, 1, 1, nil, tp)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) or tc:IsFacedown() then
  		return
  	end
  	if
  		Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0
  		or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, tc:GetAttack(), tc:GetDefense(), tc:GetLevel(), tc:GetRace(), tc:GetAttribute())
  	then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SET_ATTACK)
  	e1:SetValue(tc:GetAttack())
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD)
  	token:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_SET_DEFENSE)
  	e2:SetValue(tc:GetDefense())
  	token:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EFFECT_CHANGE_LEVEL)
  	e3:SetValue(tc:GetLevel())
  	token:RegisterEffect(e3)
  	local e4 = e1:Clone()
  	e4:SetCode(EFFECT_CHANGE_RACE)
  	e4:SetValue(tc:GetRace())
  	token:RegisterEffect(e4)
  	local e5 = e1:Clone()
  	e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  	e5:SetValue(tc:GetAttribute())
  	token:RegisterEffect(e5)
  	Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  	local de = Effect.CreateEffect(e:GetHandler())
  	de:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	de:SetRange(LOCATION_MZONE)
  	de:SetCode(EVENT_PHASE + PHASE_END)
  	de:SetCountLimit(1)
  	de:SetOperation(s.desop)
  	de:SetReset(RESET_EVENT + RESETS_STANDARD)
  	token:RegisterEffect(de)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  
  
source_text: Physical
  During your opponent's turn: Target 1 face-up monster your opponent controls; Special Summon 1 "Mirage Token" with the same Level, Type, Attribute, ATK, and DEF as that target. Destroy this Token during the End Phase.
target_text: -- Physical
  local CARD_ID_0 = 63442605 --Mirage Token
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:GetLevel() > 0 and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, c:GetAttack(), c:GetDefense(), c:GetLevel(), c:GetRace(), c:GetAttribute())
  end
  function s.target(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.cfilter(chkc, tp)
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingTarget(s.cfilter, tp, 0, LOCATION_MZONE, 1, nil, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	local g = Duel.SelectTarget(tp, s.cfilter, tp, 0, LOCATION_MZONE, 1, 1, nil, tp)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) or tc:IsFacedown() then
  		return
  	end
  	if
  		Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0
  		or not Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, 0, TYPES_TOKEN_MONSTER, tc:GetAttack(), tc:GetDefense(), tc:GetLevel(), tc:GetRace(), tc:GetAttribute())
  	then
  		return
  	end
  	local token = Duel.CreateToken(tp, id + 1)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SET_ATTACK)
  	e1:SetValue(tc:GetAttack())
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD - RESET_TOFIELD)
  	token:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_SET_DEFENSE)
  	e2:SetValue(tc:GetDefense())
  	token:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EFFECT_CHANGE_LEVEL)
  	e3:SetValue(tc:GetLevel())
  	token:RegisterEffect(e3)
  	local e4 = e1:Clone()
  	e4:SetCode(EFFECT_CHANGE_RACE)
  	e4:SetValue(tc:GetRace())
  	token:RegisterEffect(e4)
  	local e5 = e1:Clone()
  	e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
  	e5:SetValue(tc:GetAttribute())
  	token:RegisterEffect(e5)
  	Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  	local de = Effect.CreateEffect(e:GetHandler())
  	de:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	de:SetRange(LOCATION_MZONE)
  	de:SetCode(EVENT_PHASE + PHASE_END)
  	de:SetCountLimit(1)
  	de:SetOperation(s.desop)
  	de:SetReset(RESET_EVENT + RESETS_STANDARD)
  	token:RegisterEffect(de)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Destroy(e:GetHandler(), REASON_EFFECT)
  end
  
  