PrefabFiles = {
	"miaoji",
	"miaoji_none",
	"miaoji_sword",
	"miaoji_food",
}

Assets = {
    Asset( "IMAGE", "images/saveslot_portraits/miaoji.tex" ),
    Asset( "ATLAS", "images/saveslot_portraits/miaoji.xml" ),

    Asset( "IMAGE", "images/selectscreen_portraits/miaoji.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/miaoji.xml" ),
	
    Asset( "IMAGE", "images/selectscreen_portraits/miaoji_silho.tex" ),
    Asset( "ATLAS", "images/selectscreen_portraits/miaoji_silho.xml" ),

    Asset( "IMAGE", "bigportraits/miaoji.tex" ),
    Asset( "ATLAS", "bigportraits/miaoji.xml" ),
	
	Asset( "IMAGE", "images/map_icons/miaoji.tex" ),
	Asset( "ATLAS", "images/map_icons/miaoji.xml" ),
	
	Asset( "IMAGE", "images/avatars/avatar_miaoji.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_miaoji.xml" ),
	
	Asset( "IMAGE", "images/avatars/avatar_ghost_miaoji.tex" ),
    Asset( "ATLAS", "images/avatars/avatar_ghost_miaoji.xml" ),
	
	Asset( "IMAGE", "images/avatars/self_inspect_miaoji.tex" ),
    Asset( "ATLAS", "images/avatars/self_inspect_miaoji.xml" ),
	
	--Asset( "IMAGE", "images/names_miaoji.tex" ),
    --Asset( "ATLAS", "images/names_miaoji.xml" ),
	
    --Asset( "IMAGE", "bigportraits/miaoji_none.tex" ),
    --Asset( "ATLAS", "bigportraits/miaoji_none.xml" ),

}

GLOBAL.setmetatable(env,{__index=function(t,k) return GLOBAL.rawget(GLOBAL,k) end})
TUNING.MIAOJI_SWORDD_DAMAGE = GetModConfigData("DamageOfSword")
TUNING.MIAOJI_SWORDD_USE = GetModConfigData("UsesOfSword")
TUNING.MIAOJI_LIGHT = GetModConfigData("Nightvision")
TUNING.MIAOJI_EXP = GetModConfigData("ShowExp")
if GetModConfigData("Language") == false then
STRINGS.CHARACTER_TITLES.miaoji = "普通的喵咪"
STRINGS.CHARACTER_NAMES.miaoji = "喵吉"
STRINGS.CHARACTER_DESCRIPTIONS.miaoji = "*快速移动\n*有着锋利的爪子\n*保暖的皮毛"
STRINGS.CHARACTER_QUOTES.miaoji = "\"这里是哪里喵....\""
STRINGS.CHARACTERS.MIAOJI = require "speech_wilson"
STRINGS.NAMES.MIAOJI = "喵吉"
STRINGS.NAMES.MIAOJI_SWORD = "喵刀"  
STRINGS.RECIPE_DESC.MIAOJI_SWORD = "来自异世界的刀" 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_SWORD = "这是喵的喵刀！"
STRINGS.NAMES.MIAOJI_FOOD = "鱼团"  
STRINGS.RECIPE_DESC.MIAOJI_FOOD = "鱼馅的糯米团子" 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_FOOD = "喵喜欢这个！有鱼的味道！"
STRINGS.NAMES.MIAOJI_FOODFU = "鱼团"  
STRINGS.RECIPE_DESC.MIAOJI_FOODFU = "鱼馅的糯米团子" 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_FOODFU = "喵喜欢这个！有鱼的味道！"
else
STRINGS.CHARACTER_TITLES.miaoji = "Ordinary cat"
STRINGS.CHARACTER_NAMES.miaoji = "Miaoji"
STRINGS.CHARACTER_DESCRIPTIONS.miaoji = "*Run fast\n*Sharp claws\n*Thick hair"
STRINGS.CHARACTER_QUOTES.miaoji = "\"Where is this....mew\""
STRINGS.CHARACTERS.MIAOJI = require "speech_miaoji"
STRINGS.NAMES.MIAOJI = "Miaoji"
STRINGS.NAMES.MIAOJI_SWORD = "Meow Sword"  
STRINGS.RECIPE_DESC.MIAOJI_SWORD = "A sword from another world" 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_SWORD = "This is Miaoji' sword！"
STRINGS.NAMES.MIAOJI_FOOD = "Fish Ball"  
STRINGS.RECIPE_DESC.MIAOJI_FOOD = "The glutinous rice balls stuffed with fish." 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_FOOD = "Miaoji like this! The smell of fish!"
STRINGS.NAMES.MIAOJI_FOODFU = "Fish Ball"  
STRINGS.RECIPE_DESC.MIAOJI_FOODFU = "The glutinous rice balls stuffed with fish." 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.MIAOJI_FOODFU = "Miaoji like this! The smell of fish!"
end
AddMinimapAtlas("images/map_icons/miaoji.xml")
AddModCharacter("miaoji", "MALE")
if TheSim:GetGameID() == "DST" then
AddRecipe("miaoji_sword",{Ingredient("coontail", 2),Ingredient("goldnugget", 4),Ingredient("cutstone", 3)},RECIPETABS.WAR,  TECH.SCIENCE_TWO, 
nil, nil, nil, nil, "miaoji",
"images/inventoryimages/miaoji_sword.xml", 
"miaoji_sword.tex")
AddRecipe("miaoji_food",{Ingredient("fish", 2),Ingredient("berries", 3)}, RECIPETABS.FARM,  TECH.SCIENCE_ONE, 
nil, nil, nil, nil, "miaoji",
"images/inventoryimages/miaoji_food.xml", 
"miaoji_food.tex")
AddRecipe("miaoji_foodfu",{Ingredient("fish", 2),Ingredient("berries_juicy", 3)}, RECIPETABS.FARM,  TECH.SCIENCE_ONE, 
nil, nil, nil, nil, "miaoji",
"images/inventoryimages/miaoji_food.xml", 
"miaoji_food.tex")
else
	local function MidojiPostInit() 
	if GLOBAL.SaveGameIndex:IsModeShipwrecked() then
	local miaoji_sword = 	 GLOBAL.Recipe("miaoji_sword", {Ingredient("snakeskin", 2),Ingredient("goldnugget", 4),Ingredient("cutstone", 3)},RECIPETABS.WAR,  TECH.SCIENCE_TWO)
	miaoji_sword.atlas = "images/inventoryimages/miaoji_sword.xml"
	local miaoji_food = 	 GLOBAL.Recipe("miaoji_food", {Ingredient("tropical_fish", 2),Ingredient("berries", 3)}, RECIPETABS.FARM,  TECH.SCIENCE_ONE)
	miaoji_food.atlas = "images/inventoryimages/miaoji_food.xml"
	else
	local miaoji_sword = 	 GLOBAL.Recipe("miaoji_sword", {Ingredient("coontail", 2),Ingredient("goldnugget", 4),Ingredient("cutstone", 3)},RECIPETABS.WAR,  TECH.SCIENCE_TWO)
	miaoji_sword.atlas = "images/inventoryimages/miaoji_sword.xml"
	local miaoji_food = 	 GLOBAL.Recipe("miaoji_food", {Ingredient("fish", 2),Ingredient("berries", 3)}, RECIPETABS.FARM,  TECH.SCIENCE_ONE)
	miaoji_food.atlas = "images/inventoryimages/miaoji_food.xml"	
	end
	end
AddGamePostInit(modGamePostInit)
AddSimPostInit(function(inst)
        if inst.prefab == "miaoji" then
                MidojiPostInit()
        end
end)
end
if TUNING.MIAOJI_EXP == true then
local function Addmiaojilvl(self) 
	local miaojilvl = require("widgets/miaojilvl")
	if self.owner and self.owner:HasTag("miaoji") then
		self.miaojilvlcontrol = self.bottom_root:AddChild(miaojilvl(self.owner))	
		self.miaojilvlcontrol:SetPosition(140,70,0)
		self.miaojilvlcontrol:SetHAnchor(1)
		self.miaojilvlcontrol:SetVAnchor(2)		
		self.miaojilvlcontrol:MoveToFront()
		self.miaojilvlcontrol:SetScale(1)
	end
end
AddClassPostConstruct("widgets/controls", Addmiaojilvl)
end