Skip to main content

Petals Evil

Based on game build 714014 | Last updated: 2026-03-06

Overview

petals_evil is a consumable item prefab in DST representing corrupted flower petals. It functions as a low-value food source that reduces sanity and provides no health or hunger restoration. It supports drying (to produce petals_evil_dried), perishable decay (replacing with spoiled_food), and acts as a lightweight fuel. It integrates with DST's ECS via multiple components: stackable, tradable, inspectable, fuel, inventoryitem, edible, perishable, dryable, and snowmandecor. It is tagged dryable for runtime optimization and integrates with the hauntable system to be launched when spawned from a haunt event.

Usage example

local inst = Prefab("petals_evil", fn, assets, prefabs)
-- To spawn an instance (e.g., in the world):
local entity = SpawnPrefab("petals_evil")
entity.Transform:SetPosition(x, y, z)
-- To pick it up and consume:
local player = ThePlayer
player:PushInventoryItem(entity)
if entity.components.edible ~= nil then
player.components.eater:Eat(entity)
end

Dependencies & tags

Components used: stackable, tradable, inspectable, fuel, inventoryitem, edible, perishable, snowmandecor, dryable
Tags: dryable — added to pristine state to enable drying; no other tags are explicitly added or removed.

Properties

PropertyTypeDefault ValueDescription
pickupsoundstring"vegetation_grassy"Sound played when the item is picked up.
fuelvaluenumberTUNING.TINY_FUELFuel value used by the fuel component.
healthvaluenumber0Health restored by consumption (none for this item).
hungervaluenumber0Hunger restored by consumption (none for this item).
sanityvaluenumber-TUNING.SANITY_TINYSanity penalty from consumption.
foodtypeFOODTYPEFOODTYPE.VEGGIEFood classification for cooking/combining.
perishtimenumberTUNING.PERISH_FASTTime in seconds before item spoils.
onperishreplacementstring"spoiled_food"Prefab name to spawn upon spoilage.
maxsizenumberTUNING.STACK_SIZE_SMALLITEMMaximum stack size for the item.
drytimenumberTUNING.DRY_FASTTime in seconds required to dry the item.
buildfilestring"meat_rack_food_petals"Build name used for the wet (pre-dry) state.
dried_buildfilestring"meat_rack_food_petals"Build name used for the dried state.
productstring"petals_evil_dried"Prefab name of the dried result.

Main functions

No custom methods are defined in this prefab's fn() function. All behavior is handled through component interactions (e.g., inst.components.perishable:StartPerishing()). Only component member functions are invoked.

Events & listeners

  • Listens to: spawnedfromhaunt — triggers OnSpawnedFromHaunt(inst, data) to launch the entity when spawned from a haunt.
  • Pushes: No events are explicitly pushed by this prefab; it relies on components (e.g., perishable, dryable) to emit events internally.