Jump to content

Help me out w/ Warly's Specific Boss Dish


Recommended Posts

Hello there!

i was thinking of making Boss Dish when i found out that Deerclop drops edible eye. I want to make dish that help with overheating and freeze mobs on hit. Where do i find ice staff freezing ability and apply it to new recipe?

This is code snippet of new recipe - Stuffed Eye
 

Spoiler

        stuffedeye =
    {
        test = function(cooker, names, tags) return (names.deerclops_eyeball) and tags.veggie >= 1.5 and not tags.meat and not tags.inedible and not tags.egg end,
        priority = 30,
        foodtype = FOODTYPE.VEGGIE,
        health = UNING.HEALING_HUGE,
        hunger = TUNING.CALORIES_SUPERHUGE,
        sanity = -TUNING.SANITY_MED,
        temperature = TUNING.HOT_FOOD_BONUS_TEMP,
        temperatureduration = TUNING.BUFF_FOOD_TEMP_DURATION,
        nochill = true,
        perishtime = TUNING.PERISH_SLOW,
        cooktime = 0.75,
        potlevel = "low",
        tags = { "masterfood" },
        floater = {nil, 0.1, 0.7},
    },

Thanks for attention!

Link to comment
Share on other sites

You will need to add inst.components.eater:SetOnEaten() to your food prefab.

The staff freezing ability can be found in staff.lua

Spoiler

--food prefab
local function Freeze(inst,data)
	if data and data.target then
		if data.target.components.freezable ~= nil then
        	data.target.components.freezable:AddColdness(1)
        	data.target.components.freezable:SpawnShatterFX()
        end
    end
end

local function OnEaten(inst,eater)
	if eater then
		eater:ListenForEvent("onattackother",Freeze)
		eater:DoTaskInTime(60,function() eater:RemoveEventCallback("onattackother",Freeze) --change the time to whatever you want, like this it will remove the ice attack after 1 min.
	end
end

-- in the fn of the prefab
inst.components.edible:SetOnEatenFn(OnEaten)

 

Here is some code that make it work :)

  • GL Happy 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...