Class Diet
Represents the nourishment and edibility of foods for a SlugBaseCharacter.
Inherited Members
Namespace: SlugBase.DataTypes
Assembly: SlugBase.dll
Syntax
public class Diet
Constructors
View SourceDiet(JsonAny)
Creates a new Diet from JSON.
Declaration
public Diet(JsonAny json)
Parameters
Type | Name | Description |
---|---|---|
JsonAny | json | The JSON to load. |
Properties
View SourceCorpses
The food value multiplier of dead creatures.
If the creature is consumed in its entirety, such as CreatureTemplate.Type.Fly, Meat is used instead.
Declaration
public float Corpses { get; set; }
Property Value
Type | Description |
---|---|
float |
CreatureOverrides
The food value multipliers of individual creature types.
Declaration
public Dictionary<CreatureTemplate.Type, float> CreatureOverrides { get; }
Property Value
Type | Description |
---|---|
Dictionary<CreatureTemplate.Type, float> |
Meat
The food value multiplier of small creatures or living objects like AbstractPhysicalObject.AbstractObjectType.JellyFish.
Declaration
public float Meat { get; set; }
Property Value
Type | Description |
---|---|
float |
ObjectOverrides
The food value multipliers of individual object types.
Declaration
public Dictionary<AbstractPhysicalObject.AbstractObjectType, float> ObjectOverrides { get; }
Property Value
Type | Description |
---|---|
Dictionary<AbstractPhysicalObject.AbstractObjectType, float> |
Plants
The food value multiplier of non-living foods.
Declaration
public float Plants { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
View SourceGetFoodMultiplier(PhysicalObject)
Gets the food value multiplier for an object that was consumed in its entirety.
Declaration
public float GetFoodMultiplier(PhysicalObject obj)
Parameters
Type | Name | Description |
---|---|---|
PhysicalObject | obj | The object that was eaten. |
Returns
Type | Description |
---|---|
float | A multiplier for the nourishment of this object. |
GetMeatMultiplier(Player, Creature)
Gets the food value multiplier for a creature
Declaration
public float GetMeatMultiplier(Player player, Creature crit)
Parameters
Type | Name | Description |
---|---|---|
Player | player | The player to pass to Player.EatMeatOmnivoreGreenList(Creature). |
Creature | crit | The creature that is being eaten. |
Returns
Type | Description |
---|---|
float | A multiplier for the nourishment of this creature. |