|
class DisplayElementTendency extends DisplayElementBase |
|
{ |
|
protected int TENDENCY_MASK = 7; |
|
protected int SERIOUSNESS_BIT_MASK = 7; |
|
protected int SERIOUSNESS_BIT_OFFSET = 3; |
|
|
|
void DisplayElementTendency(PlayerBase player) |
|
{ |
|
NUM_OF_BITS = 6; |
|
} |
|
|
|
void SetSeriousnessLevel( DSLevels level ) |
|
{ |
|
m_Value = (~(SERIOUSNESS_BIT_MASK << SERIOUSNESS_BIT_OFFSET)) & m_Value; |
|
m_Value = (level << SERIOUSNESS_BIT_OFFSET) | m_Value; |
|
} |
|
|
|
override void UpdateHUD() |
|
{ |
|
super.UpdateHUD(); |
|
int seriousness = m_Value >> SERIOUSNESS_BIT_OFFSET; |
|
int tendency = TENDENCY_MASK & m_Value; |
|
|
|
|
|
if(tendency > 3) |
|
{ |
|
tendency = -(tendency - 3); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_ModulePlayerStatus.DisplayTendency(m_Key, tendency, TranslateLevelToStatus(seriousness)); |
|
} |
|
|
|
void SetTendency(int tendency) |
|
{ |
|
m_Value = (~TENDENCY_MASK) & m_Value; |
|
m_Value = tendency | m_Value; |
|
|
|
} |
|
} |