DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ProcessNutrients()

void ProcessNutrients ( float delta_time)
protected

try amount from nutritions/food stage first

food poisoning specific override by bloody hands

См. определение в файле PlayerStomach.c строка 294

295 {
296 m_DigestingType = 0;
297
298 StomachItem item;
299 int stomachItemsCount = m_StomachContents.Count();
300 if (stomachItemsCount == 0)
301 return;
302
303 float digestionPointsPerItem = (DIGESTION_POINTS / stomachItemsCount) * delta_time;
304 m_StomachVolume = 0;//reset, it's accumulated with each pass
305 for (int i = stomachItemsCount - 1; i >= 0; i--)
306 {
307 item = m_StomachContents[i];
308 float water, energy, toxicity, volume, consumedAmount;
309 int agents;
310
311 if (item.ProcessDigestion(digestionPointsPerItem, water, energy, toxicity, volume, agents, consumedAmount))
312 {
313 m_StomachContents.Remove(i);
315 }
316
317 m_StomachVolume += volume;
318 m_Player.GetStatEnergy().Add(energy);
319 m_Player.GetStatWater().Add(water);
320
321 if (energy > 0)
323
324 if (water > 0)
326
328 float amountOfAgents = item.m_Profile.m_AgentsPerDigest;
329 if (amountOfAgents == 0)
330 amountOfAgents = consumedAmount;
331
333 if ((item.m_Agents & eAgents.FOOD_POISON) == eAgents.FOOD_POISON && m_Player.HasBloodyHands())
334 amountOfAgents = Math.Max(amountOfAgents, PlayerConstants.BLOODY_HANDS_FOOD_POISON_AGENT_INCREMENT);
335
336 DigestAgents(agents, amountOfAgents);
337 }
338 }
eAgents
Определения EAgents.c:3
DayZPlayer m_Player
Определения Hand_Events.c:42
int m_DigestingType
Определения PlayerStomach.c:135
void UpdateStomachTemperature()
Определения PlayerStomach.c:270
const float DIGESTION_POINTS
Определения PlayerStomach.c:126
class StomachItem DIGESTING_WATER
void DigestAgents(int agents, float quantity)
Определения PlayerStomach.c:340
const int DIGESTING_ENERGY
Определения PlayerStomach.c:121
ref array< ref StomachItem > m_StomachContents
Определения PlayerStomach.c:132
float m_StomachVolume
Определения PlayerStomach.c:137
Определения EnMath.c:7
float m_AgentsPerDigest
Определения NutritionalProfile.c:12
static const float BLOODY_HANDS_FOOD_POISON_AGENT_INCREMENT
Определения PlayerConstants.c:265
Определения PlayerConstants.c:2
ref NutritionalProfile m_Profile
Определения PlayerStomach.c:3
bool ProcessDigestion(float digestion_points, out float water, out float energy, out float toxicity, out float volume, out int agents, out float consumed_amount)
Определения PlayerStomach.c:81
int m_Agents
Определения PlayerStomach.c:8
Определения PlayerStomach.c:2
static proto float Max(float x, float y)
Returns bigger of two given values.

Перекрестные ссылки PlayerConstants::BLOODY_HANDS_FOOD_POISON_AGENT_INCREMENT, DigestAgents(), DIGESTING_ENERGY, DIGESTING_WATER, DIGESTION_POINTS, StomachItem::m_Agents, NutritionalProfile::m_AgentsPerDigest, m_DigestingType, m_Player, StomachItem::m_Profile, m_StomachContents, m_StomachVolume, Math::Max(), StomachItem::ProcessDigestion() и UpdateStomachTemperature().

Используется в Update().