
local MakePlayerCharacter = require "prefabs/player_common"
local assets = {
        Asset( "ANIM", "anim/player_basic.zip" ),
        Asset( "ANIM", "anim/player_idles_shiver.zip" ),
        Asset( "ANIM", "anim/player_actions.zip" ),
        Asset( "ANIM", "anim/player_actions_axe.zip" ),
        Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
        Asset( "ANIM", "anim/player_actions_shovel.zip" ),
        Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
        Asset( "ANIM", "anim/player_actions_eat.zip" ),
        Asset( "ANIM", "anim/player_actions_item.zip" ),
        Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
        Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
        Asset( "ANIM", "anim/player_actions_fishing.zip" ),
        Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
        Asset( "ANIM", "anim/player_bush_hat.zip" ),
        Asset( "ANIM", "anim/player_attacks.zip" ),
        Asset( "ANIM", "anim/player_idles.zip" ),
Asset( "ANIM", "anim/player_rebirth.zip" ),
        Asset( "ANIM", "anim/player_jump.zip" ),
        Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
        Asset( "ANIM", "anim/player_teleport.zip" ),
        Asset( "ANIM", "anim/wilson_fx.zip" ),
        Asset( "ANIM", "anim/player_one_man_band.zip" ),
        Asset( "ANIM", "anim/shadow_hands.zip" ),
        Asset( "SOUND", "sound/sfx.fsb" ),
        Asset( "SOUND", "sound/wendy.fsb" ),
        Asset( "ANIM", "anim/beard.zip" ),
Asset("SOUNDPACKAGE", "sound/yy.fev"),
    Asset("SOUND", "sound/yy.fsb"),
        Asset( "ANIM", "anim/mk.zip" ),
 Asset( "IMAGE", "images/mtabs/mtab.tex"),
        Asset( "ATLAS", "images/mtabs/mtab.xml"),
 --character anim
}
local prefabs = { 	
	 } --no special items in mod

local start_inv = 
{   	"er"
}




local function onkill(inst, data)
if data.inst:HasTag("moose") then
       
 SpawnPrefab("cl").Transform:SetPosition(data.inst:GetPosition():Get())

elseif data.inst:HasTag("dragonfly") then
 SpawnPrefab("ly").Transform:SetPosition(data.inst:GetPosition():Get())

elseif data.inst:HasTag("bearger") then
 SpawnPrefab("xd").Transform:SetPosition(data.inst:GetPosition():Get())

elseif data.inst:HasTag("deerclops") then
 SpawnPrefab("jl").Transform:SetPosition(data.inst:GetPosition():Get())

elseif data.inst:HasTag("minotaur") then 
 SpawnPrefab("xn").Transform:SetPosition(data.inst:GetPosition():Get())

end 


end




local fn = function(inst)

 


RECIPETABS['MTAB'] = {str = "MTAB", sort=999, icon = "mtab.tex", icon_atlas = "images/mtabs/mtab.xml"}

 inst.Transform:SetScale(1.1,1.1,1.1)




	inst.MiniMapEntity:SetIcon( "mk.tex" )
	
	inst.components.health:SetMaxHealth(120)
	inst.components.hunger:SetMax(120)
	inst.components.sanity:SetMax(120)

  inst.components.locomotor.walkspeed = 4.2
     inst.components.locomotor.runspeed = 6.2
        
    inst.components.combat:AddDamageModifier("wendy", TUNING.WENDY_DAMAGE_MULT)



      local x = TUNING.x
	inst.soundsname = x
	
    
inst.components.builder.ingredientmod = .5


 inst.components.eater.stale_hunger = TUNING.WICKERBOTTOM_STALE_FOOD_HUNGER
    inst.components.eater.stale_health = TUNING.WICKERBOTTOM_STALE_FOOD_HEALTH
    inst.components.eater.spoiled_hunger = TUNING.WICKERBOTTOM_SPOILED_FOOD_HUNGER
    inst.components.eater.spoiled_health = TUNING.WICKERBOTTOM_SPOILED_FOOD_HEALTH

inst:ListenForEvent("entity_death", function(wrld, data) onkill(inst, data) end, GetWorld())

end

return MakePlayerCharacter("mk", prefabs, assets, fn, start_inv)

