Class Diet
Represents the nourishment and edibility of foods for a SlugBaseCharacter.
Inheritance
Inherited Members
Namespace: SlugBase.DataTypes
Assembly: SlugBase.dll
Syntax
public class Diet
Constructors
Diet(JsonAny)
Creates a new Diet from JSON.
Declaration
public Diet(JsonAny json)
Parameters
Type | Name | Description |
---|---|---|
JsonAny | json | The JSON to load. |
Properties
Corpses
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 |
---|---|
System.Single |
CreatureOverrides
The food value multipliers of individual creature types.
Declaration
public Dictionary<CreatureTemplate.Type, float> CreatureOverrides { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<CreatureTemplate.Type, System.Single> |
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 |
---|---|
System.Single |
ObjectOverrides
The food value multipliers of individual object types.
Declaration
public Dictionary<AbstractPhysicalObject.AbstractObjectType, float> ObjectOverrides { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<AbstractPhysicalObject.AbstractObjectType, System.Single> |
Plants
The food value multiplier of non-living foods.
Declaration
public float Plants { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
GetFoodMultiplier(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 |
---|---|
System.Single | 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 |
---|---|
System.Single | A multiplier for the nourishment of this creature. |