PrefabFiles = {
	"venus",
	"venus_flowerhat",
	"venus_butterfy",
	"venus_flylight",
	"venus_flywings",
	"venus_miaosack",
	"venus_yangsack",
	"venus_flowerglass",
	"venus_frogglass",
	"venus_liang",
	"venus_xiaotong",
	"venus_oasislake",
	"venus_tututoy",
	"fan_wheel",
	"minifan",
	"venus_logcabin",
	"venus_butterfy_fx",
}

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

		Asset( "IMAGE", "images/selectscreen_portraits/venus.tex" ),
		Asset( "ATLAS", "images/selectscreen_portraits/venus.xml" ),
	
		Asset( "IMAGE", "images/selectscreen_portraits/venus_silho.tex" ),
		Asset( "ATLAS", "images/selectscreen_portraits/venus_silho.xml" ),

		Asset( "IMAGE", "bigportraits/venus.tex" ),
		Asset( "ATLAS", "bigportraits/venus.xml" ),
	
		Asset( "IMAGE", "images/map_icons/venus.tex" ),
		Asset( "ATLAS", "images/map_icons/venus.xml" ),
	
		Asset( "ATLAS", "images/hud/lvyetab.xml" ),  
		Asset( "IMAGE", "images/hud/lvyetab.tex" ),
	
		Asset( "IMAGE", "images/inventoryimages/venus_butterfy.tex" ),
		Asset( "ATLAS", "images/inventoryimages/venus_butterfy.xml" ),
	
		Asset("IMAGE", "images/inventoryimages/venus_flowerhat.tex"),
		Asset("ATLAS", "images/inventoryimages/venus_flowerhat.xml"),
	
		Asset("IMAGE", "images/inventoryimages/venus_flowerglass.tex"),
		Asset("ATLAS", "images/inventoryimages/venus_flowerglass.xml"),
	
		Asset("IMAGE", "images/inventoryimages/venus_xiaotong.tex"),
		Asset("ATLAS", "images/inventoryimages/venus_xiaotong.xml"),
	
		Asset("IMAGE", "images/inventoryimages/venus_miaosack.tex"),
		Asset("ATLAS", "images/inventoryimages/venus_miaosack.xml"),
		
		Asset("IMAGE", "images/inventoryimages/venus_yangsack.tex"),
		Asset("ATLAS", "images/inventoryimages/venus_yangsack.xml"),
	
		Asset( "IMAGE", "images/inventoryimages/venus_liang.tex" ),
		Asset( "ATLAS", "images/inventoryimages/venus_liang.xml" ),

		Asset( "IMAGE", "images/inventoryimages/venus_tututoy.tex" ),
		Asset( "ATLAS", "images/inventoryimages/venus_tututoy.xml" ),
	
		Asset( "IMAGE", "images/map_icons/xiaomiao_sack.tex" ),
		Asset( "ATLAS", "images/map_icons/xiaomiao_sack.xml" ),
		
		Asset( "IMAGE", "images/map_icons/xiaoyang_sack.tex" ),
		Asset( "ATLAS", "images/map_icons/xiaoyang_sack.xml" ),
	
		Asset( "IMAGE", "images/map_icons/oasis.tex" ),
		Asset( "ATLAS", "images/map_icons/oasis.xml" ),
	
		Asset( "IMAGE", "images/map_icons/venus_xiaotong.tex" ),
		Asset( "ATLAS", "images/map_icons/venus_xiaotong.xml" ),
		
		Asset( "IMAGE", "images/map_icons/venus_logcabin.tex" ),
		Asset( "ATLAS", "images/map_icons/venus_logcabin.xml" ),
}

local require = GLOBAL.require
local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
local STRINGS = GLOBAL.STRINGS
local TECH = GLOBAL.TECH
local GetWorld = GLOBAL.GetWorld
local GetClock = GLOBAL.GetClock



if GetModConfigData("Language") == false then
STRINGS.CHARACTER_TITLES.venus = "精灵族妹纸"
STRINGS.CHARACTER_NAMES.venus = "维纳斯"
STRINGS.CHARACTER_DESCRIPTIONS.venus = "*高智商\n*软妹纸\n*挑食"
STRINGS.CHARACTER_QUOTES.venus = "\"世界那么大我想去看看(#^.^#)\""

STRINGS.NAMES.VENUS_FLOWERHAT = "娜"
STRINGS.RECIPE_DESC.VENUS_FLOWERHAT = "用花编织而成!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FLOWERHAT = "小花帽" 

STRINGS.NAMES.VENUS_BUTTERFY = "楪"  
STRINGS.RECIPE_DESC.VENUS_BUTTERFY = "实用的小法杖"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_BUTTERFY = "小蝴蝶飞呀飞"

STRINGS.NAMES.VENUS_MIAOSACK = "萝"
STRINGS.RECIPE_DESC.VENUS_MIAOSACK = "喵喵喵!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_MIAOSACK = "可以用来装好多东西呢"

STRINGS.NAMES.VENUS_YANGSACK = "琳"
STRINGS.RECIPE_DESC.VENUS_YANGSACK = "咩咩咩!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_YANGSACK = "可以用来装好多东西呢"

STRINGS.NAMES.VENUS_FLOWERGLASS = "华"
STRINGS.RECIPE_DESC.VENUS_FLOWERGLASS = "具有神奇的魔力"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FLOWERGLASS = "带上它可以看得更远"

STRINGS.NAMES.VENUS_FROGGLASS = "苟"             
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FROGGLASS = "来自长者的馈赠"

STRINGS.NAMES.VENUS_LIANG = "凉"
STRINGS.RECIPE_DESC.VENUS_LIANG = "实用的小火炉!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_LIANG = "可以用它度过寒冬" 

STRINGS.NAMES.VENUS_OASISLAKE = "青"            
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_OASISLAKE = "漂亮的小湖"

STRINGS.NAMES.VENUS_LOGCABIN = "KIKI的家"            
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_LOGCABIN = "Kiki去哪里了呢？"

STRINGS.NAMES.VENUS_TUTUTOY = "菲"
STRINGS.RECIPE_DESC.VENUS_TUTUTOY = "我是兔兔"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_TUTUTOY = "看什么看，没看过这么萌的小兔几吗"

STRINGS.NAMES.VENUS_XIAOTONG = "空"
STRINGS.RECIPE_DESC.VENUS_XIAOTONG = "睡觉用哒"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_XIAOTONG = "好想睡一觉哇"

elseif GetModConfigData("Language") == true then
STRINGS.CHARACTER_TITLES.venus = "Elf Girl"
STRINGS.CHARACTER_NAMES.venus = "Venus"
STRINGS.CHARACTER_DESCRIPTIONS.venus = "*Very smart \n*Not good at fighting\n*Fussy with food"
STRINGS.CHARACTER_QUOTES.venus = "\"The world is so big that I want to have a look(#^.^#)\""
STRINGS.NAMES.VENUS_FLOWERHAT = "Na"
STRINGS.RECIPE_DESC.VENUS_FLOWERHAT = "Made of flowers"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FLOWERHAT = "Beautiful flower hat" 

STRINGS.NAMES.VENUS_BUTTERFY = "Die" 
STRINGS.RECIPE_DESC.VENUS_BUTTERFY = "It's useful!" 
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_BUTTERFY = "Fly "

STRINGS.NAMES.VENUS_MIAOSACK = "Lou"
STRINGS.RECIPE_DESC.VENUS_MIAOSACK = "Meow!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_MIAOSACK = "It can store so much"

STRINGS.NAMES.VENUS_YANGSACK = "Lin"
STRINGS.RECIPE_DESC.VENUS_YANGSACK = "咩咩咩!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_YANGSACK = "可以用来装好多东西呢"

STRINGS.NAMES.VENUS_FLOWERGLASS = "Hua"
STRINGS.RECIPE_DESC.VENUS_FLOWERGLASS = "Magic power"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FLOWERGLASS = "Make us see farther"

STRINGS.NAMES.VENUS_FROGGLASS = "Frog glass"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_FROGGLASS = "A gift form elder"

STRINGS.NAMES.VENUS_LIANG = "Liang"
STRINGS.RECIPE_DESC.VENUS_LIANG = "Small stove"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_LIANG = "Use it to cook food" 

STRINGS.NAMES.VENUS_OASISLAKE = "Qing"            
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_OASISLAKE = "Beautiful pond"

STRINGS.NAMES.VENUS_LOGCABIN = "Kiki'house"            
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_LOGCABIN = "where is Kiki?"

STRINGS.NAMES.VENUS_TUTUTOY = "Fei"
STRINGS.RECIPE_DESC.VENUS_TUTUTOY = "Rabbit toys "
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_TUTUTOY = "Can be used for fight"

STRINGS.NAMES.VENUS_XIAOTONG = "Kong"
STRINGS.RECIPE_DESC.VENUS_XIAOTONG = "Sleping"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.VENUS_XIAOTONG = "A busy life needs a rest"
end
STRINGS.CHARACTERS.VENUS = require "speech_venus"
table.insert(GLOBAL.CHARACTER_GENDERS.FEMALE, "venus")
AddMinimapAtlas("images/map_icons/venus.xml")
AddMinimapAtlas("images/map_icons/xiaomiao_sack.xml")
AddMinimapAtlas("images/map_icons/xiaoyang_sack.xml")
AddMinimapAtlas("images/map_icons/oasis.xml")
AddMinimapAtlas("images/map_icons/venus_xiaotong.xml")
AddMinimapAtlas("images/map_icons/venus_logcabin.xml")
AddModCharacter("venus")

--RECIPETABS
AddClassPostConstruct("widgets/crafttabs", function(inst)
    if inst.prefab == "venus" then
	table.insert(tabnames, GLOBAL.RECIPETABS['VENUS'])
    end
end)
local function VenusPostInit(venus)
		if GLOBAL.IsDLCEnabled(GLOBAL.REIGN_OF_GIANTS) then 
		    local venus_flowerhat = GLOBAL.Recipe("venus_flowerhat", {Ingredient("cutgrass", 5), Ingredient("twigs", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_flowerhat.atlas = "images/inventoryimages/venus_flowerhat.xml"
			local venus_butterfy =  GLOBAL.Recipe("venus_butterfy", {Ingredient("cane", 1), Ingredient("butterfly", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_butterfy.atlas = "images/inventoryimages/venus_butterfy.xml"	
			local venus_flowerglass =  GLOBAL.Recipe("venus_flowerglass", {Ingredient("petals", 5), Ingredient("goldnugget", 5), Ingredient("twigs", 2)}, RECIPETABS.VENUS,  TECH.SCIENCE_ONE)
			venus_flowerglass.atlas = "images/inventoryimages/venus_flowerglass.xml"	
			local venus_miaosack = 	 GLOBAL.Recipe("venus_miaosack", {Ingredient("purplegem", 2), Ingredient("coontail", 2), Ingredient("bearger_fur",2)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_miaosack.atlas = "images/inventoryimages/venus_miaosack.xml" 
			local venus_yangsack = 	 GLOBAL.Recipe("venus_yangsack", {Ingredient("purplegem", 2), Ingredient("coontail", 2), Ingredient("bearger_fur",2)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_yangsack.atlas = "images/inventoryimages/venus_yangsack.xml"
			local venus_liang = 	 GLOBAL.Recipe("venus_liang", {Ingredient("goldnugget", 4), Ingredient("charcoal", 4), Ingredient("lantern",1)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_liang.atlas = "images/inventoryimages/venus_liang.xml"
			local venus_tututoy = 	 GLOBAL.Recipe("venus_tututoy", {Ingredient("manrabbit_tail", 2), Ingredient("rabbit", 1), Ingredient("carrot",2)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_tututoy.atlas = "images/inventoryimages/venus_tututoy.xml"
			local venus_xiaotong = Recipe( "venus_xiaotong", { Ingredient("boards", 10),Ingredient("cutstone", 10) ,Ingredient("purplegem", 2)}, RECIPETABS.VENUS, TECH.SCIENCE_TWO, "venus_xiaotong_placer", 3 )
			venus_xiaotong.atlas = "images/inventoryimages/venus_xiaotong.xml"
			
		elseif not GLOBAL.SaveGameIndex:IsModeShipwrecked() then
		    local venus_flowerhat = GLOBAL.Recipe("venus_flowerhat", {Ingredient("cutgrass", 5), Ingredient("twigs", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_flowerhat.atlas = "images/inventoryimages/venus_flowerhat.xml"
			local venus_butterfy =  GLOBAL.Recipe("venus_butterfy", {Ingredient("cane", 1), Ingredient("butterfly", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_butterfy.atlas = "images/inventoryimages/venus_butterfy.xml"
			local venus_flowerglass =  GLOBAL.Recipe("venus_flowerglass", {Ingredient("petals", 5), Ingredient("goldnugget", 5), Ingredient("twigs", 2)}, RECIPETABS.VENUS,  TECH.SCIENCE_ONE)
			venus_flowerglass.atlas = "images/inventoryimages/venus_flowerglass.xml"
			local venus_miaosack = 	 GLOBAL.Recipe("venus_miaosack", {Ingredient("purplegem", 2), Ingredient("coontail", 2), Ingredient("bearger_fur",2)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_miaosack.atlas = "images/inventoryimages/venus_miaosack.xml"
			local venus_yangsack = 	 GLOBAL.Recipe("venus_yangsack", {Ingredient("purplegem", 2), Ingredient("coontail", 2), Ingredient("bearger_fur",2)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_yangsack.atlas = "images/inventoryimages/venus_yangsack.xml"
			local venus_liang = 	 GLOBAL.Recipe("venus_liang", {Ingredient("goldnugget", 4), Ingredient("charcoal", 4), Ingredient("lantern",1)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_liang.atlas = "images/inventoryimages/venus_liang.xml"
			local venus_tututoy = 	 GLOBAL.Recipe("venus_tututoy", {Ingredient("manrabbit_tail", 2), Ingredient("rabbit", 1), Ingredient("carrot",2)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_tututoy.atlas = "images/inventoryimages/venus_tututoy.xml"
			local venus_xiaotong = Recipe( "venus_xiaotong", { Ingredient("boards", 10),Ingredient("cutstone", 10) ,Ingredient("purplegem", 2)}, RECIPETABS.VENUS, TECH.SCIENCE_TWO,GLOBAL.RECIPE_GAME_TYPE.COMMON, "venus_xiaotong_placer", 3 )
			venus_xiaotong.atlas = "images/inventoryimages/venus_xiaotong.xml"  
		
		elseif GLOBAL.SaveGameIndex:IsModeShipwrecked() then    	
		    local venus_flowerhat = GLOBAL.Recipe("venus_flowerhat", {Ingredient("cutgrass", 5), Ingredient("twigs", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_flowerhat.atlas = "images/inventoryimages/venus_flowerhat.xml"
			local venus_butterfy =  GLOBAL.Recipe("venus_butterfy", {Ingredient("cane", 1), Ingredient("butterfly", 5), Ingredient("petals", 5)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_butterfy.atlas = "images/inventoryimages/venus_butterfy.xml"
			local venus_flowerglass =  GLOBAL.Recipe("venus_flowerglass", {Ingredient("petals", 5), Ingredient("dubloon", 5), Ingredient("twigs", 2)}, RECIPETABS.VENUS,  TECH.SCIENCE_ONE)
			venus_flowerglass.atlas = "images/inventoryimages/venus_flowerglass.xml"			
			local venus_miaosack = 	 GLOBAL.Recipe("venus_miaosack", {Ingredient("purplegem", 2), Ingredient("doydoyfeather", 2), Ingredient("shark_gills",3)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_miaosack.atlas = "images/inventoryimages/venus_miaosack.xml"	
			local venus_yangsack = 	 GLOBAL.Recipe("venus_yangsack", {Ingredient("purplegem", 2), Ingredient("doydoyfeather", 2), Ingredient("shark_gills",3)}, RECIPETABS.VENUS,  TECH.MAGIC_TWO)
			venus_yangsack.atlas = "images/inventoryimages/venus_yangsack.xml"	
			local venus_liang = 	 GLOBAL.Recipe("venus_liang", {Ingredient("goldnugget", 4), Ingredient("charcoal", 4), Ingredient("bottlelantern",1)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_liang.atlas = "images/inventoryimages/venus_liang.xml"			
			local venus_tututoy = 	 GLOBAL.Recipe("venus_tututoy", {Ingredient("snakeskin", 2), Ingredient("jellyfish", 1), Ingredient("carrot",2)}, RECIPETABS.VENUS,  TECH.SCIENCE_TWO)
			venus_tututoy.atlas = "images/inventoryimages/venus_tututoy.xml"	
			local venus_xiaotong = Recipe( "venus_xiaotong", { Ingredient("boards", 10),Ingredient("cutstone", 10) ,Ingredient("purplegem", 2)}, RECIPETABS.VENUS, TECH.SCIENCE_TWO,  GLOBAL.RECIPE_GAME_TYPE.COMMON, "venus_xiaotong_placer", 3 )
			venus_xiaotong.atlas = "images/inventoryimages/venus_xiaotong.xml"			
		end
end
AddGamePostInit(modGamePostInit)
AddSimPostInit(function(inst)
        if inst.prefab == "venus" then
                VenusPostInit()
        end
end)
--hat
AddPrefabPostInit("petals", function(inst)
inst:AddComponent("repairer")
    inst.components.repairer.repairmaterial = "petals"
    inst.components.repairer.perishrepairvalue = .1
end)
--birdnoflyaway /thanks for tamamo mod
local function RecheckForThreat(inst)
    local busy = inst.sg:HasStateTag("sleeping") or inst.sg:HasStateTag("busy") or inst.sg:HasStateTag("flying")
    if not busy then
        local threat = GLOBAL.FindEntity(inst, 5, nil, nil, {'notarget', 'venus'}, {'player', 'monster', 'scarytoprey'})
        return threat ~= nil or GLOBAL.GetClock():IsNight() 
    end
end
AddStategraphPostInit("bird", function(sg)
	local old = sg.events.flyaway.fn
	sg.events.flyaway.fn = function(inst)
		if RecheckForThreat(inst) then
			old(inst)
		end
	end
end)
--forgglass
local function AddGLASS(inst)
	inst.components.lootdropper:AddChanceLoot('venus_frogglass',0.01)
end
AddPrefabPostInit("flup", AddGLASS)
AddPrefabPostInit("frog", AddGLASS)

