Mimicking
FLIP: Target 1 monster on the field; destroy it, and if you do, this card gains ATK equal to that monster's original ATK, then you can change this card's Type to that monster's original Type.
Cannot be destroyed by battle. Cannot be destroyed by the effects of monsters with its same Type.
local s, id, o = GetID()
function s.initial_effect(c)
	--flip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_ATKCHANGE)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
	e1:SetTarget(s.destg)
	e1:SetOperation(s.desop)
	c:RegisterEffect(e1)
	--indes
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(1)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
	e3:SetValue(s.efilter)
	c:RegisterEffect(e3)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE)
	end
	if chk == 0 then
		return true
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local g = Duel.SelectTarget(tp, aux.TRUE, 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 c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc, REASON_EFFECT) ~= 0 and c:IsRelateToEffect(e) and c:IsFaceup() then
		local atk = tc:GetBaseAttack()
		if atk <= 0 then
			return
		end
		local race = tc:GetOriginalRace()
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(atk)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
		c:RegisterEffect(e1)
		if not c:IsRace(race) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			local e2 = e1:Clone()
			e2:SetCode(EFFECT_CHANGE_RACE)
			e2:SetValue(race)
			c:RegisterEffect(e2)
		end
	end
end
function s.efilter(e, re, rp)
	if not re:IsActiveType(TYPE_MONSTER) then
		return false
	end
	local rc = re:GetHandler()
	if (re:IsActivated() and rc:IsRelateToEffect(re) or not re:IsHasProperty(EFFECT_FLAG_FIELD_ONLY)) and (rc:IsFaceup() or not rc:IsLocation(LOCATION_MZONE)) then
		return e:GetHandler():IsRace(rc:GetRace())
	else
		return e:GetHandler():IsRace(rc:GetOriginalRace())
	end
end


Mimicking
FLIP: Target 1 monster on the field; destroy it, and if you do, this card gains ATK equal to that monster's original ATK, then you can change this card's Type to that monster's original Type.
Cannot be destroyed by battle. Cannot be destroyed by the effects of monsters with its same Type.
-- Mimicking
local s, id, o = GetID()
function s.initial_effect(c)
	--flip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DESTROY + CATEGORY_ATKCHANGE)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP)
	e1:SetTarget(s.destg)
	e1:SetOperation(s.desop)
	c:RegisterEffect(e1)
	--indes
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(1)
	c:RegisterEffect(e2)
	local e3 = e2:Clone()
	e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
	e3:SetValue(s.efilter)
	c:RegisterEffect(e3)
end
function s.destg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE)
	end
	if chk == 0 then
		return true
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
	local g = Duel.SelectTarget(tp, aux.TRUE, 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 c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc, REASON_EFFECT) ~= 0 and c:IsRelateToEffect(e) and c:IsFaceup() then
		local atk = tc:GetBaseAttack()
		if atk <= 0 then
			return
		end
		local race = tc:GetOriginalRace()
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(atk)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
		c:RegisterEffect(e1)
		if not c:IsRace(race) and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			local e2 = e1:Clone()
			e2:SetCode(EFFECT_CHANGE_RACE)
			e2:SetValue(race)
			c:RegisterEffect(e2)
		end
	end
end
function s.efilter(e, re, rp)
	if not re:IsActiveType(TYPE_MONSTER) then
		return false
	end
	local rc = re:GetHandler()
	if (re:IsActivated() and rc:IsRelateToEffect(re) or not re:IsHasProperty(EFFECT_FLAG_FIELD_ONLY)) and (rc:IsFaceup() or not rc:IsLocation(LOCATION_MZONE)) then
		return e:GetHandler():IsRace(rc:GetRace())
	else
		return e:GetHandler():IsRace(rc:GetOriginalRace())
	end
end

