DayZ 1.24
Loading...
Searching...
No Matches
DisplayElementTendency.c
Go to the documentation of this file.
2{
3 protected int TENDENCY_MASK = 7;// first x bits
4 protected int SERIOUSNESS_BIT_MASK = 7;// second x bits
5 protected int SERIOUSNESS_BIT_OFFSET = 3;//bit offset - points to where seriousness bit starts(TODO: get as log from mask)
6
8 {
9 NUM_OF_BITS = 6;//the overall num of bits this element occupies(can be calculated from masks, better leave it explicit)
10 }
11
13 {
14 m_Value = (~(SERIOUSNESS_BIT_MASK << SERIOUSNESS_BIT_OFFSET)) & m_Value;//clear the last value
15 m_Value = (level << SERIOUSNESS_BIT_OFFSET) | m_Value;
16 }
17
18 override void UpdateHUD()
19 {
20 super.UpdateHUD();
21 int seriousness = m_Value >> SERIOUSNESS_BIT_OFFSET;
22 int tendency = TENDENCY_MASK & m_Value;
23 //PrintString(tendency.ToString());
24
25 if (tendency > 3)
26 tendency = -(tendency - 3);
27 /*
28 PrintString(this.ToString());
29 PrintString("ser:"+ seriousness.ToString());
30 PrintString("tnd:"+ tendency.ToString());
31 */
33 }
34
36 {
37 m_Value = (~TENDENCY_MASK) & m_Value;//clear the last value
38 m_Value = tendency | m_Value;//insert the new one
39 //PrintString(m_Value.ToString());
40 }
41}
DSLevels
PluginPlayerStatus m_ModulePlayerStatus
void SetTendency(int tendency)
void SetSeriousnessLevel(DSLevels level)
void DisplayElementTendency(PlayerBase player)
override int TranslateLevelToStatus(int level)
string m_Key
Definition EnEntity.c:804
string m_Value
Definition EnEntity.c:805