DayZ
1.24
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
value
=
Math
.
RandomFloatInclusive
(
PlayerConstants
.
HIGH_TEMPERATURE_L
,
PlayerConstants
.
HIGH_TEMPERATURE_H
);
8
else
9
value
=
Math
.
RandomFloatInclusive
(
PlayerConstants
.
NORMAL_TEMPERATURE_L
,
PlayerConstants
.
NORMAL_TEMPERATURE_H
);
10
value
=
Math
.
Round
(
value
* 10) / 10;
11
return
value
;
12
}
13
14
override
void
SetActions
()
15
{
16
super
.SetActions();
17
18
AddAction
(
ActionMeasureTemperatureTarget
);
19
AddAction
(
ActionMeasureTemperatureSelf
);
20
}
21
}
AddAction
void AddAction(typename actionName)
Definition
AdvancedCommunication.c:212
eModifierSyncIDs
eModifierSyncIDs
Definition
ModifiersManager.c:3
ActionMeasureTemperatureSelf
Definition
ActionMeasureTemperatureSelf.c:10
ActionMeasureTemperatureTarget
Definition
ActionMeasureTemperatureTarget.c:10
ItemBase
Definition
InventoryItem.c:697
ItemBase::SetActions
override void SetActions()
Definition
Thermometer.c:14
ItemBase::GetTemperatureValue
float GetTemperatureValue(PlayerBase player)
Definition
Thermometer.c:3
Math
Definition
EnMath.c:7
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
PlayerConstants
Definition
PlayerConstants.c:2
PlayerConstants::NORMAL_TEMPERATURE_L
static const float NORMAL_TEMPERATURE_L
Definition
PlayerConstants.c:51
PlayerConstants::NORMAL_TEMPERATURE_H
static const float NORMAL_TEMPERATURE_H
Definition
PlayerConstants.c:52
PlayerConstants::HIGH_TEMPERATURE_H
static const float HIGH_TEMPERATURE_H
Definition
PlayerConstants.c:54
PlayerConstants::HIGH_TEMPERATURE_L
static const float HIGH_TEMPERATURE_L
Definition
PlayerConstants.c:53
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
Math::Round
static proto float Round(float f)
Returns mathematical round of value.
scripts
4_World
Entities
ItemBase
Thermometer.c
Generated by
1.10.0