Dayz Explorer 1.28.160049
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 {
27 tendency = -(tendency - 3);
28 }
29 /*
30 PrintString(this.ToString());
31 PrintString("ser:"+ seriousness.ToString());
32 PrintString("tnd:"+ tendency.ToString());
33 */
34 m_ModulePlayerStatus.DisplayTendency(m_Key, tendency, TranslateLevelToStatus(seriousness));
35 }
36
37 void SetTendency(int tendency)
38 {
39 m_Value = (~TENDENCY_MASK) & m_Value;//clear the last value
40 m_Value = tendency | m_Value;//insert the new one
41 //PrintString(m_Value.ToString());
42 }
43}
void SetTendency(int tendency)
void SetSeriousnessLevel(DSLevels level)
void DisplayElementTendency(PlayerBase player)
DSLevels
string m_Key
Definition enentity.c:807
string m_Value
Definition enentity.c:808
PluginPlayerStatus m_ModulePlayerStatus
max 32 synced modifiers supported, 0 == no sync