Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
thermometer.c
Go to the documentation of this file.
1
class
Thermometer
extends
ItemBase
2
{
3
float
GetTemperatureValue
(
PlayerBase
player)
4
{
5
float
value;
6
if
(player && player.IsSyncedModifierActive(
eModifierSyncIDs
.MODIFIER_SYNC_FEVER))
7
{
8
value =
Math
.
RandomFloatInclusive
(
PlayerConstants
.
HIGH_TEMPERATURE_L
,
PlayerConstants
.
HIGH_TEMPERATURE_H
);
9
}
10
else
11
{
12
value =
Math
.
RandomFloatInclusive
(
PlayerConstants
.
NORMAL_TEMPERATURE_L
,
PlayerConstants
.
NORMAL_TEMPERATURE_H
);
13
}
14
value =
Math
.
Round
(value * 10) / 10;
15
return
value;
16
}
17
18
override
void
SetActions
()
19
{
20
super.SetActions();
21
22
AddAction
(
ActionMeasureTemperatureTarget
);
23
AddAction
(
ActionMeasureTemperatureSelf
);
24
}
25
}
AddAction
void AddAction(typename actionName)
Definition
advancedcommunication.c:220
ActionMeasureTemperatureSelf
Definition
actionmeasuretemperatureself.c:10
ActionMeasureTemperatureTarget
Definition
actionmeasuretemperaturetarget.c:10
ItemBase
Definition
inventoryitem.c:742
ItemBase::GetTemperatureValue
float GetTemperatureValue(PlayerBase player)
Definition
thermometer.c:3
ItemBase::SetActions
override void SetActions()
Definition
thermometer.c:18
Math
Definition
enmath.c:7
PlayerBase
Definition
playerbaseclient.c:2
PlayerConstants
Definition
playerconstants.c:2
PlayerConstants::HIGH_TEMPERATURE_L
static const float HIGH_TEMPERATURE_L
Definition
playerconstants.c:58
PlayerConstants::HIGH_TEMPERATURE_H
static const float HIGH_TEMPERATURE_H
Definition
playerconstants.c:59
PlayerConstants::NORMAL_TEMPERATURE_H
static const float NORMAL_TEMPERATURE_H
Definition
playerconstants.c:57
PlayerConstants::NORMAL_TEMPERATURE_L
static const float NORMAL_TEMPERATURE_L
Definition
playerconstants.c:56
Math::Round
static proto float Round(float f)
Returns mathematical round of value.
Math::RandomFloatInclusive
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition
enmath.c:106
eModifierSyncIDs
eModifierSyncIDs
Definition
modifiersmanager.c:3
Games
Dayz
scripts
4_world
entities
itembase
thermometer.c
Generated by
1.17.0