Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
playerstomach.c File Reference

Go to the source code of this file.

Data Structures

class  StomachItem

Functions

void AddToStomach (string class_name, float amount, int food_stage=0, int agents=0, float temperature=0)
void ClearContents ()
void DigestAgents (int agents, float quantity)
int GetAgentTransferFilter ()
static string GetClassnameFromID (int id)
int GetDebugObject (array< ref Param > object_out)
int GetDigestingType ()
static int GetIDFromClassname (string name)
float GetStomachTemperature ()
float GetStomachVolume ()
int GetStorageVersion ()
float GetVolumeContainingAgent (eAgents agent)
float GetVolumeContainingAgent01 (eAgents agent)
static bool InitData ()
bool IsDigesting ()
bool OnStoreLoad (ParamsReadContext ctx, int version)
void OnStoreSave (ParamsWriteContext ctx)
void PlayerStomach (PlayerBase player)
void PrintUpdate ()
void ProcessNutrients (float delta_time)
void ReduceContents (float percent)
static void RegisterItem (string classname, int id)
void SetAgentTransferFilter (int filter_agents)
void Update (float delta_time)
void UpdateStomachTemperature ()

Variables

const int ACCEPTABLE_FOODSTAGE_MAX = FoodStageType.COUNT - 1
const int ACCEPTABLE_QUANTITY_MAX = 32768
static int CHECKSUM
const int DIGESTING_ENERGY = 2
class StomachItem DIGESTING_WATER = 1
const float DIGESTION_POINTS = PlayerConstants.DIGESTION_SPEED
const int id_bit_offset = 4
int m_AgentTransferFilter
bool m_Digesting
int m_DigestingType
static ref map< int, stringm_IDsToNames = new map<int, string>
static const bool m_InitData = PlayerStomach.InitData()
static ref map< string, intm_NamesToIDs = new map<string, int>
PlayerBase m_Player
ref array< ref StomachItemm_StomachContents = new array<ref StomachItem>
float m_StomachTemperature
float m_StomachVolume
const int quantity_bit_offset = 16
const int STORAGE_VERSION = 106

Function Documentation

◆ AddToStomach()

◆ ClearContents()

void ClearContents ( )
protected

Definition at line 158 of file playerstomach.c.

References m_StomachContents, m_StomachTemperature, and m_StomachVolume.

◆ DigestAgents()

◆ GetAgentTransferFilter()

int GetAgentTransferFilter ( )
protected

Definition at line 184 of file playerstomach.c.

References m_AgentTransferFilter.

◆ GetClassnameFromID()

string GetClassnameFromID ( int id)
staticprotected

Definition at line 197 of file playerstomach.c.

References m_IDsToNames.

Referenced by OnStoreLoad().

◆ GetDebugObject()

int GetDebugObject ( array< ref Param > object_out)
protected

◆ GetDigestingType()

int GetDigestingType ( )
protected

Definition at line 265 of file playerstomach.c.

References m_DigestingType.

◆ GetIDFromClassname()

int GetIDFromClassname ( string name)
staticprotected

Definition at line 202 of file playerstomach.c.

References m_NamesToIDs, and name.

Referenced by AddToStomach().

◆ GetStomachTemperature()

float GetStomachTemperature ( )
protected

Definition at line 153 of file playerstomach.c.

References m_StomachTemperature.

◆ GetStomachVolume()

float GetStomachVolume ( )
protected

Definition at line 148 of file playerstomach.c.

References m_StomachVolume.

Referenced by GetVolumeContainingAgent01().

◆ GetStorageVersion()

int GetStorageVersion ( )
protected

Definition at line 255 of file playerstomach.c.

References STORAGE_VERSION.

◆ GetVolumeContainingAgent()

float GetVolumeContainingAgent ( eAgents agent)
protected

Definition at line 360 of file playerstomach.c.

References m_StomachContents.

Referenced by GetVolumeContainingAgent01().

◆ GetVolumeContainingAgent01()

float GetVolumeContainingAgent01 ( eAgents agent)
protected

◆ InitData()

bool InitData ( )
staticprotected

Definition at line 209 of file playerstomach.c.

References g_Game, path, RegisterItem(), and x.

◆ IsDigesting()

bool IsDigesting ( )
protected

Definition at line 260 of file playerstomach.c.

References m_DigestingType.

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext ctx,
int version )
protected

◆ OnStoreSave()

◆ PlayerStomach()

◆ PrintUpdate()

void PrintUpdate ( )
protected

Definition at line 381 of file playerstomach.c.

References m_StomachContents, m_StomachVolume, and Print().

◆ ProcessNutrients()

void ProcessNutrients ( float delta_time)
protected

◆ ReduceContents()

void ReduceContents ( float percent)
protected

Definition at line 166 of file playerstomach.c.

References Math::Clamp(), m_StomachContents, and m_StomachVolume.

◆ RegisterItem()

void RegisterItem ( string classname,
int id )
staticprotected

Definition at line 189 of file playerstomach.c.

References CHECKSUM, string::Hash(), m_IDsToNames, and m_NamesToIDs.

Referenced by InitData().

◆ SetAgentTransferFilter()

void SetAgentTransferFilter ( int filter_agents)
protected

Definition at line 179 of file playerstomach.c.

References m_AgentTransferFilter.

◆ Update()

void Update ( float delta_time)
protected

Definition at line 289 of file playerstomach.c.

References ProcessNutrients().

◆ UpdateStomachTemperature()

void UpdateStomachTemperature ( )
protected

Variable Documentation

◆ ACCEPTABLE_FOODSTAGE_MAX

const int ACCEPTABLE_FOODSTAGE_MAX = FoodStageType.COUNT - 1

Definition at line 128 of file playerstomach.c.

Referenced by AddToStomach().

◆ ACCEPTABLE_QUANTITY_MAX

const int ACCEPTABLE_QUANTITY_MAX = 32768

Definition at line 127 of file playerstomach.c.

Referenced by AddToStomach().

◆ CHECKSUM

int CHECKSUM
static

Definition at line 125 of file playerstomach.c.

Referenced by OnStoreLoad(), and RegisterItem().

◆ DIGESTING_ENERGY

const int DIGESTING_ENERGY = 2

Definition at line 121 of file playerstomach.c.

Referenced by ProcessNutrients().

◆ DIGESTING_WATER

class StomachItem DIGESTING_WATER = 1

Referenced by ProcessNutrients().

◆ DIGESTION_POINTS

const float DIGESTION_POINTS = PlayerConstants.DIGESTION_SPEED

Definition at line 126 of file playerstomach.c.

Referenced by ProcessNutrients().

◆ id_bit_offset

const int id_bit_offset = 4

Definition at line 124 of file playerstomach.c.

Referenced by OnStoreLoad(), and OnStoreSave().

◆ m_AgentTransferFilter

int m_AgentTransferFilter

Definition at line 133 of file playerstomach.c.

Referenced by DigestAgents(), GetAgentTransferFilter(), and SetAgentTransferFilter().

◆ m_Digesting

bool m_Digesting

Definition at line 134 of file playerstomach.c.

◆ m_DigestingType

int m_DigestingType

Definition at line 135 of file playerstomach.c.

Referenced by GetDigestingType(), IsDigesting(), and ProcessNutrients().

◆ m_IDsToNames

ref map<int, string> m_IDsToNames = new map<int, string>
static

Definition at line 130 of file playerstomach.c.

Referenced by GetClassnameFromID(), and RegisterItem().

◆ m_InitData

const bool m_InitData = PlayerStomach.InitData()
static

Definition at line 131 of file playerstomach.c.

◆ m_NamesToIDs

ref map<string, int> m_NamesToIDs = new map<string, int>
static

Definition at line 129 of file playerstomach.c.

Referenced by GetIDFromClassname(), and RegisterItem().

◆ m_Player

Definition at line 136 of file playerstomach.c.

◆ m_StomachContents

◆ m_StomachTemperature

float m_StomachTemperature
protected

◆ m_StomachVolume

◆ quantity_bit_offset

const int quantity_bit_offset = 16

Definition at line 123 of file playerstomach.c.

Referenced by OnStoreLoad(), and OnStoreSave().

◆ STORAGE_VERSION

const int STORAGE_VERSION = 106
protected

Definition at line 139 of file playerstomach.c.