local STRINGS = GLOBAL.STRINGS
local require = GLOBAL.require
local Ingredient = GLOBAL.Ingredient
local RECIPETABS = GLOBAL.RECIPETABS
GetPlayer = GLOBAL.GetPlayer
GetWorld = GLOBAL.GetWorld
STRINGS = GLOBAL.STRINGS
RECIPETABS = GLOBAL.RECIPETABS
Recipe = GLOBAL.Recipe
Ingredient = GLOBAL.Ingredient
TECH = GLOBAL.TECH
Action = GLOBAL.Action
Vector3 = GLOBAL.Vector3
local Vector3 = GLOBAL.Vector3
require "class"
local FRAMES = GLOBAL.FRAMES
FRAMES = GLOBAL.FRAMES
local TimeEvent = GLOBAL.TimeEvent
TimeEvent = GLOBAL.TimeEvent
local EventHandler = GLOBAL.EventHandler
EventHandler = GLOBAL.EventHandler
localEQUIPSLOTS = GLOBAL.EQUIPSLOTS
EQUIPSLOTS = GLOBAL.EQUIPSLOTS
local SpawnPrefab = GLOBAL.SpawnPrefab
SpawnPrefab = GLOBAL.SpawnPrefab

STRINGS.NAMES.HAT_WARFARINHOOD = "Hidey Hood"
STRINGS.RECIPE_DESC.HAT_WARFARINHOOD = "Keep those Peeping Toms away."

STRINGS.NAMES.HAT_WARFARINMASK = "Hallowed Mask"
STRINGS.RECIPE_DESC.HAT_WARFARINMASK = "A breath of fresh air!"

STRINGS.NAMES.WARFARINKNIFE = "Throwing Knife"
STRINGS.RECIPE_DESC.WARFARINKNIFE = "Pointy end hurts things."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINKNIFE = "nil"

STRINGS.NAMES.WARFARINBOW = "Pretty Short Bow"
STRINGS.RECIPE_DESC.WARFARINBOW = "It's pretty short! Not so pretty."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINBOW = "nil"

STRINGS.NAMES.WARFARINBOWLIAR = "Songbird Longbow"
STRINGS.RECIPE_DESC.WARFARINBOWLIAR = "Music to die for!"

STRINGS.NAMES.WARFARINBOWARM = "Sturdy Bow Arm"
STRINGS.RECIPE_DESC.WARFARINBOWARM = "Won't do much with just one."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINBOWARM = "nil"

STRINGS.NAMES.WARFARINARROW_NORMAL = "Arrow"
STRINGS.RECIPE_DESC.WARFARINARROW_NORMAL = "Don't tickle your nose on that feather!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINARROW_NORMAL = "nil"

STRINGS.NAMES.WARFARINARROW_WATER = "Water Arrow"
STRINGS.RECIPE_DESC.WARFARINARROW_WATER = "Get rid of those pesky lights!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINARROW_WATER = "nil"

STRINGS.NAMES.WARFARINARROW_ROCK = "Rock Arrow"
STRINGS.RECIPE_DESC.WARFARINARROW_ROCK = "Because monsters like loud sounds!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINARROW_ROCK = "nil"

STRINGS.NAMES.WARFARINARROW_FIRE = "Explosive Arrow"
STRINGS.RECIPE_DESC.WARFARINARROW_FIRE = "Turn your foes into walking time bombs!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINARROW_FIRE = "nil"

STRINGS.NAMES.WARFARINKNIFEEX = "Explosive Throwing Knife"
STRINGS.RECIPE_DESC.WARFARINKNIFEEX = "Pointy end hurts. Then goes boom."
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINKNIFEEX = "nil"

STRINGS.NAMES.WARFARINARROW_SPIKE = "Spikey Arrow"
STRINGS.RECIPE_DESC.WARFARINARROW_SPIKE = "Are you really THAT cruel?"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINARROW_SPIKE = "nil"

STRINGS.NAMES.WARFARINPISTOL = "Mercy"
STRINGS.NAMES.WARFARINPISTOLLAUNCHER = "Mercy and Cruelty"
STRINGS.RECIPE_DESC.WARFARINPISTOLLAUNCHER = "Show them no Mercy!"

STRINGS.NAMES.WARFARINAMMO = "Gold Bullet"
STRINGS.RECIPE_DESC.WARFARINAMMO = "Gold is surprisingly aerodynamic."

STRINGS.NAMES.WARFARINDAGGER = "Dagger"
STRINGS.RECIPE_DESC.WARFARINDAGGER = "Now you're thinking with violence!"
STRINGS.CHARACTERS.GENERIC.DESCRIBE.WARFARINDAGGER = "nil"

STRINGS.NAMES.WARFARINCUTLASS = "Multi-Colored Pestilence"
STRINGS.RECIPE_DESC.WARFARINCUTLASS = "The Foul Miamsa will consume all!"

STRINGS.NAMES.WARFARINDAGGER_MARBLE = "Majestic Dagger"
STRINGS.RECIPE_DESC.WARFARINDAGGER_MARBLE = "A master razor!"

STRINGS.NAMES.WARFARINDAGGER_LIAR = "Mr. Stabby"
STRINGS.RECIPE_DESC.WARFARINDAGGER_LIAR = "You sure this is safe?"

STRINGS.NAMES.WARFARINSMOKEBOMB = "Smokey Bomb of Distracting"
STRINGS.RECIPE_DESC.WARFARINSMOKEBOMB = "Monsters are so stupid!"

STRINGS.NAMES.LIARTHRONE = "Opulent Throne"

STRINGS.NAMES.LIARPILLAR = "Marble Pillar"

STRINGS.NAMES.LIARSPIKE1 = "Marble Pike"
STRINGS.NAMES.LIARSPIKE2 = "Marble Pike"

STRINGS.NAMES.LIARLAMP = "Lamp of Maddening Light"

STRINGS.NAMES.FAITHE = "Faithe"

STRINGS.NAMES.LIAR_GNOMEKING = "Gnome King"
STRINGS.NAMES.LIAR_GNOMEKINGITEM = "Gnome King"
STRINGS.NAMES.LIAR_SOCK= "Impossibly Stinky Sock"
STRINGS.NAMES.LIAR_KAZOO = "Real Kazoo"
STRINGS.NAMES.LIAR_KAZOOITEM = "Real Kazoo"
STRINGS.NAMES.LIAR_PHONOGRAPH = "Cursed Phonograph"
STRINGS.NAMES.LIAR_PHONOGRAPHITEM = "Cursed Phonograph"
STRINGS.NAMES.LIAR_DESK = "Strange Desk"
STRINGS.NAMES.LIARDESK = "Desk"
STRINGS.NAMES.LIARCHEST = "Locked Chest"
STRINGS.NAMES.LIARWALL = "Stone Wall"
STRINGS.NAMES.LIAR_DESK2 = "Strange Desk"
STRINGS.NAMES.LIAR_STATUE = "Harp Statue"
STRINGS.NAMES.LIAR_STATUEITEM = "Harp Statue"
STRINGS.ACTIONS.ACTIVATE.KINGOFLIES = "Wave To"

PrefabFiles = {
	"warfarin",
	"warfarinknife",
	"warfarinarrows",
	"warfarinbowstring",
	"warfarinbow",
	"warfarinbowarm",
	"warfarinarroweffects",
	"hat_warfarinhood",
	"warfarindagger",
	"warfarinsmokebomb",
	"warfarin_heart",
	"warfarinbow_projectile",
	"warfarincutlass",
	"hat_warfarinmask"
}

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

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

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

    Asset( "IMAGE", "bigportraits/warfarin.tex" ),
    Asset( "ATLAS", "bigportraits/warfarin.xml" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinknife.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinknife.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinbow.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinbow.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarincutlass.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarincutlass.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinbowliar.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinbowliar.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinbowarm.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinbowarm.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinknifeex.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinknifeex.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinarrow_normal.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinarrow_normal.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinarrow_rock.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinarrow_rock.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinarrow_water.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinarrow_water.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinarrow_fire.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinarrow_fire.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinarrow_spike.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinarrow_spike.tex" ),

	Asset( "ATLAS", "images/inventoryimages/hat_warfarinhood.xml" ),
	Asset( "IMAGE", "images/inventoryimages/hat_warfarinhood.tex" ),

	Asset( "ATLAS", "images/inventoryimages/hat_warfarinmask.xml" ),
	Asset( "IMAGE", "images/inventoryimages/hat_warfarinmask.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarinsmokebomb.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarinsmokebomb.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarindagger.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarindagger.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarindagger_marble.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarindagger_marble.tex" ),

	Asset( "ATLAS", "images/inventoryimages/warfarindagger_liar.xml" ),
	Asset( "IMAGE", "images/inventoryimages/warfarindagger_liar.tex" ),

        Asset( "ANIM", "anim/warfarin.zip" ),

	Asset("IMAGE", "images/warfarin.tex"),
	Asset("ATLAS", "images/warfarin.xml"),

	Asset("IMAGE", "images/faithe.tex"),
	Asset("ATLAS", "images/faithe.xml"),

    Asset("ANIM", "anim/warfarinsneak.zip"),

	Asset("ANIM", "anim/warfarinblooddrop.zip"),

    Asset("ATLAS", "tabs/warfarintab.xml"),
        Asset("IMAGE", "tabs/warfarintab.tex"),

    Asset("SOUNDPACKAGE", "sound/kingoflies.fev"),
    Asset("SOUND", "sound/kingoflies.fsb"),

    Asset("SOUNDPACKAGE", "sound/warfarin.fev"),
    Asset("SOUND", "sound/warfarin.fsb"),

}

STRINGS.CHARACTER_TITLES.warfarin = " The Sticky Fingered"
STRINGS.CHARACTER_NAMES.warfarin = "Wahalla S. Warfarin"
STRINGS.CHARACTER_DESCRIPTIONS.warfarin = "*Agile but frail \n*Is only young, and easily frightened \n*Effective assasin and thief"
STRINGS.CHARACTER_QUOTES.warfarin = "\"...! \""

-- Her middle name might be Stabbles, perhaps?

RemapSoundEvent( "dontstarve/characters/warfarin/death_voice", "warfarin/characters/warfarin/death_voice" )
RemapSoundEvent( "dontstarve/characters/warfarin/hurt", "warfarin/characters/warfarin/hurt" )
RemapSoundEvent( "dontstarve/characters/warfarin/warfarinbow_pullback", "warfarin/characters/warfarin/warfarinbow_pullback" )
RemapSoundEvent( "dontstarve/characters/warfarin/warfarinbow_shoot", "warfarin/characters/warfarin/warfarinbow_shoot" )

RemapSoundEvent( "dontstarve/kingaura/aura", "kingoflies/aura/aura" )
RemapSoundEvent( "dontstarve/kingaura/whispers", "kingoflies/aura/aura2" )
RemapSoundEvent( "dontstarve/kingaura/hat_ready", "kingoflies/aura/ready" )
RemapSoundEvent( "dontstarve/characters/kingoflies/death_voice", "kingoflies/characters/kingoflies/death_voice" )
RemapSoundEvent( "dontstarve/characters/kingoflies/hurt", "kingoflies/characters/kingoflies/hurt" )
RemapSoundEvent( "dontstarve/characters/kingoflies/shorttalk", "kingoflies/characters/kingoflies/shorttalk" )
RemapSoundEvent( "dontstarve/characters/kingoflies/appear", "kingoflies/characters/kingoflies/appear" )
RemapSoundEvent( "dontstarve/characters/kingoflies/fade", "kingoflies/characters/kingoflies/fade" )
RemapSoundEvent( "dontstarve/characters/kingoflies/npctalk", "kingoflies/characters/kingoflies/npctalk" )

local function warfarinlines(inst)
 
local player = GLOBAL.GetPlayer()
 
if player and player.prefab == "warfarin" then
 
GLOBAL.ACTIONS.LOOKAT.fn = function(act)
    local targ = act.target or act.invobject
	hand = act.doer.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)
if targ and targ.components.combat and
 hand and hand:HasTag("liardagger") and not GLOBAL.TheInput:IsControlPressed(GLOBAL.CONTROL_FORCE_INSPECT) then
    act.doer.components.combat:SetTarget(act.target)
	else
    if targ and targ.components.inspectable then
	    local desc = targ.components.inspectable:GetDescription(act.doer)
	    if desc then
		if targ:HasTag("monster") then
       player:AddTag("warfarinsaybad")
		elseif targ:HasTag("animal") or targ:HasTag("pig") or targ:HasTag("smallcreature") or targ:HasTag("glommer") or targ:HasTag("chester") then
       player:AddTag("warfarinsaygood")
		end
	       act.doer.components.locomotor:Stop()

	       act.doer.components.talker:Say(desc, 2.5, targ.components.inspectable.noanim)
	       return true
		end
	  end
	end
end
end
 
end

AddGamePostInit(warfarinlines)
AddMinimapAtlas("images/warfarin.xml")
AddMinimapAtlas("images/faithe.xml")

STRINGS.TABS.WARFARIN = "Stealth"
GLOBAL.RECIPETABS['WARFARIN'] = {str = "WARFARIN", sort=998, icon = "warfarintab.tex", icon_atlas = "tabs/warfarintab.xml"}

GetPlayer = GLOBAL.GetPlayer

AddPrefabPostInit("warfarin", function(inst)
				warfarinlines(inst)

			local key = GetModConfigData("Sneaky Jump")
GLOBAL.TheInput:AddKeyUpHandler(key, function()
			if not inst.sg:HasStateTag("dontjump") then
			if not (inst:HasTag("hasrolled")) and not inst.components.health:IsDead() then
	    inst.components.locomotor:Stop()
			inst.sg:PushEvent("dotheroll")
		end

			if inst:HasTag("jumping") then

			if not inst:HasTag("jumproll") then
					inst:AddTag("jumproll")
					else
					inst:RemoveTag("jumproll")
					end
				end

			if inst:HasTag("jumping") and inst:HasTag("jumpfromtree") and not inst.components.health:IsDead() then
	local pt = Vector3(inst.Transform:GetWorldPosition())
			local ents = GLOBAL.TheSim:FindEntities(pt.x,pt.y,pt.z, 3, nil, {"NOBLOCK", "player", "INLIMBO", "DECOR"})

			for k, v in pairs(ents) do
					if (v:HasTag("tree") and not v:HasTag("monster") and not v:HasTag("burnt") and not v:HasTag("stump")) and (v.components.growable and v.components.growable.stage <= 3) then 
			--inst:RemoveTag("jumpfromtree")
			--inst:RemoveTag("isintree")
			--inst:RemoveTag("treewalk")
			--inst:RemoveTag("findnewtree")
   			--inst:RemoveTag("hasrolled")
			--inst:RemoveTag("jumping")
			--inst:RemoveTag("climbing")
			--inst:RemoveTag("climbtree")
			inst:AddTag("gotnewtree")
                    inst.Physics:ClearMotorVelOverride()
		inst.components.locomotor:Stop()
					inst.sg:GoToState("intree")
					end
				end
			end
		end
end )
end)

local Action = GLOBAL.Action
local ActionHandler = GLOBAL.ActionHandler

for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do 
if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "Wall Gates" then 
local OPEN = Action(3)
OPEN.str = "Close"
OPEN.id = "OPEN"
OPEN.fn = function(act)
	local tar = act.target
    if tar and tar.components.wallgates and not tar.components.wallgates:IsOpen() then
		tar.components.wallgates:OpenWall(tar)
		return true
    end
end

AddAction(OPEN)

AddStategraphActionHandler("warfarindlc", ActionHandler(OPEN, "give"))
AddStategraphActionHandler("warfarindlc2", ActionHandler(OPEN, "give"))
AddStategraphActionHandler("warfarin", ActionHandler(OPEN, "give"))
AddStategraphActionHandler("wilson", ActionHandler(OPEN, "give"))
local CLOSE = Action(3)
CLOSE.str = "Open"
CLOSE.id = "CLOSE"
CLOSE.fn = function(act)
	local tar = act.target
    if tar and tar.components.wallgates and tar.components.wallgates:IsOpen() then
        tar.components.wallgates:CloseWall(tar)
        return true
    end
end

AddAction(CLOSE)

AddStategraphActionHandler("warfarindlc", ActionHandler(CLOSE, "give"))
AddStategraphActionHandler("warfarin", ActionHandler(CLOSE, "give"))
AddStategraphActionHandler("wilson", ActionHandler(CLOSE, "give"))
end 
end

for _, moddir in ipairs(GLOBAL.KnownModIndex:GetModsToLoad()) do 
if GLOBAL.KnownModIndex:GetModInfo(moddir).name == "RPG Items" then 
STRINGS = GLOBAL.STRINGS
ACTIONS = GLOBAL.ACTIONS
local MAGNIFYIDENTIFY = GLOBAL.Action()
MAGNIFYIDENTIFY.str = "Identify"
MAGNIFYIDENTIFY.id = "MAGNIFYIDENTIFY"
MAGNIFYIDENTIFY.fn = function(act)
	if act.target and act.target.components.rpgweapon and act.target.components.rpgweapon.discovered == false and act.invobject and act.invobject.components.magnifyidentify then
		return act.invobject.components.magnifyidentify:DoIdentify(act.target, act.doer)
	end
	if act.target and act.target.components.rpgarmor and act.target.components.rpgarmor.discovered == false and act.invobject and act.invobject.components.magnifyidentify then
		return act.invobject.components.magnifyidentify:DoIdentify(act.target, act.doer)
	end
end
AddAction(MAGNIFYIDENTIFY)
AddStategraphActionHandler("warfarindlc", GLOBAL.ActionHandler(MAGNIFYIDENTIFY, "dolongaction"))
AddStategraphActionHandler("warfarin", GLOBAL.ActionHandler(MAGNIFYIDENTIFY, "dolongaction"))
AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(MAGNIFYIDENTIFY, "dolongaction"))
	end
end

AddPrefabPostInit("grass", function(inst)
	if GetPlayer().prefab == "warfarin" then
	inst:DoPeriodicTask(1/100, function()
	if inst.components.pickable and inst.components.pickable:CanBePicked() then
    inst:AddTag("sneak")
		else
    inst:RemoveTag("sneak")
		end
	end)
	end
end)

AddPrefabPostInit("sapling", function(inst)
	if GetPlayer().prefab == "warfarin" then
	inst:DoPeriodicTask(1/100, function()
	if inst.components.pickable and inst.components.pickable:CanBePicked() then
    inst:AddTag("sneak")
		else
    inst:RemoveTag("sneak")
		end
	end)
	end
end)

AddPrefabPostInit("marsh_bush", function(inst)
	if GetPlayer().prefab == "warfarin" then
	inst:DoPeriodicTask(1/100, function()
	if inst.components.pickable and inst.components.pickable:CanBePicked() then
    inst:AddTag("sneak")
		else
    inst:RemoveTag("sneak")
		end
	end)
	end
end)

AddPrefabPostInit("berrybush", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("sneak")
	end
end)

AddPrefabPostInit("berrybush2", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("sneak")
	end
end)

AddPrefabPostInit("molehat", function(inst)
	if GLOBAL.GetPlayer().prefab == "warfarin" then
        inst:AddTag("mole")
	end
end)

AddPrefabPostInit("reeds", function(inst)
	if GetPlayer().prefab == "warfarin" then
	inst:DoPeriodicTask(1/100, function()
	if inst.components.pickable and inst.components.pickable:CanBePicked() then
    inst:AddTag("sneak")
		else
    inst:RemoveTag("sneak")
		end
	end)
	end
end)

AddPrefabPostInit("wall_hay", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("haywall")
	end
end)

AddPrefabPostInit("purplegem", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddComponent("fuel")
    inst.components.fuel.fuelvalue = 200
    inst.components.fuel.fueltype = "PURPLEGEM"
	end
end)

local function amulettag(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("amulet")
	end
end

AddPrefabPostInit('amulet', amulettag)
AddPrefabPostInit('blueamulet', amulettag)
AddPrefabPostInit('purpleamulet', amulettag)
AddPrefabPostInit('orangeamulet', amulettag)
AddPrefabPostInit('greenamulet', amulettag)
AddPrefabPostInit('yellowamulet', amulettag)

AddPrefabPostInit("wall_wood", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("woodwall")
	end
end)

AddPrefabPostInit("armorwood", function(inst)
	if GetPlayer().prefab == "warfarin" then 
        inst:AddComponent("tradable")
	end
end)


AddPrefabPostInit("wall_stone", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("stonewall")
	end
end)

AddPrefabPostInit("wall_ruins", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("ruinswall")
	end
end)

AddPrefabPostInit("bunnyman", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("wallerhit")
	end
end)

AddPrefabPostInit("pigman", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("wallerhit")
local grasschance = 0.8
local twigchance = 0.8
local poopchance = 0.2
local robochance = 0.04
local cupchance = 0.1
local goldchance = 0.1
local findchance = 0.1
	inst:ListenForEvent("dusktime", function(it, data) 
        inst:AddComponent("pickable")
    inst.components.pickable.picksound = "dontstarve/wilson/harvest_sticks"
    inst.components.pickable:SetUp("cutgrass", 10)
    inst.components.pickable.quickpick = true
		inst.components.pickable.onpickedfn = function(inst, picker)
   if math.random() < findchance then
	inst.components.combat:SuggestTarget(picker)
			end
	        inst:RemoveComponent("pickable")	
		end
   if math.random() < grasschance then
    inst.components.pickable:SetUp("cutgrass", 10)
	end
   if math.random() < twigchance then
    inst.components.pickable:SetUp("twigs", 10)
	end
   if math.random() < poopchance then
    inst.components.pickable:SetUp("poop", 10)
	end
   if math.random() < robochance then
    inst.components.pickable:SetUp("trinket_11", 10)
	end
   if math.random() < cupchance then
    inst.components.pickable:SetUp("trinket_7", 10)
	end
   if math.random() < goldchance then
    inst.components.pickable:SetUp("goldnugget", 10)
	end
	end, GetWorld())

	inst:ListenForEvent("daytime", function(it, data) 
	if inst.components.pickable then
	        inst:RemoveComponent("pickable")
	end
	end, GetWorld())
	end
end)

AddPrefabPostInit("nightlight", function(inst)
	if GetPlayer().prefab == "warfarin" then 
    inst:AddTag("fire")
	end
end)

AddPrefabPostInit("minerhat", function(inst)
	if GetPlayer().prefab == "warfarin" then 

	inst:DoPeriodicTask(1/100, function()
	if inst.components.equippable.isequipped then
    inst:AddTag("fire")
	else
	    inst:RemoveTag("fire")
	end
end) 
	end
end)

AddPrefabPostInit("lantern", function(inst)
	if GetPlayer().prefab == "warfarin" then 

	inst:DoPeriodicTask(1/100, function()
	if inst.components.equippable.isequipped or inst.components.machine.ison then
    inst:AddTag("fire")
	else
	    inst:RemoveTag("fire")
	end
end) 

	end
end)

table.insert(GLOBAL.CHARACTER_GENDERS.ROBOT, "warfarin")

-------------------------------------------------------------


AddModCharacter("warfarin")