DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BrainDisease.c
См. документацию.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 2000;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
5 const int SHAKE_INTERVAL_MIN = 1;
6 const int SHAKE_INTERVAL_MAX = 4;
7
8 float m_Time;
10
19
20 override string GetDebugText()
21 {
22 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
23 }
24
25 override protected bool ActivateCondition(PlayerBase player)
26 {
27 return (player.GetSingleAgentCount(eAgents.BRAIN) >= AGENT_THRESHOLD_ACTIVATE);
28 }
29
30 override protected void OnActivate(PlayerBase player)
31 {
32 player.IncreaseDiseaseCount();
33 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_LAUGHTER);
34 }
35
36 override protected void OnDeactivate(PlayerBase player)
37 {
38 player.DecreaseDiseaseCount();
39 }
40
41 override protected bool DeactivateCondition(PlayerBase player)
42 {
43 return (player.GetSingleAgentCount(eAgents.BRAIN) <= AGENT_THRESHOLD_DEACTIVATE);
44 }
45
46 override protected void OnTick(PlayerBase player, float deltaT)
47 {
48 m_Time += deltaT;
49 float brainAgents = player.GetSingleAgentCountNormalized(eAgents.BRAIN) / 8.0;
50 float chanceOfLaughter = Math.RandomFloat01();
51
52 if (chanceOfLaughter < brainAgents)
53 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_LAUGHTER);
54
55 if (m_Time >= m_ShakeTime)
56 {
57 DayZPlayerSyncJunctures.SendKuruRequest(player, brainAgents);
59 }
60
61 }
62}
eAgents
Определения EAgents.c:3
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Определения Effect.c:49
bool m_TrackActivatedTime
overall time this modifier was active
Определения ModifierBase.c:14
bool m_AnalyticsStatsEnabled
Определения ModifierBase.c:31
float m_TickIntervalActive
Определения ModifierBase.c:18
float m_TickIntervalInactive
Определения ModifierBase.c:17
const int DEFAULT_TICK_TIME_INACTIVE
Определения ModifiersManager.c:29
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
static const int AGENT_THRESHOLD_DEACTIVATE
Определения BrainDisease.c:4
void OnTick(PlayerBase player, float deltaT)
Определения BrainDisease.c:46
float m_ShakeTime
Определения BrainDisease.c:9
void OnActivate(PlayerBase player)
Определения BrainDisease.c:30
override void Init()
Определения BrainDisease.c:11
bool DeactivateCondition(PlayerBase player)
Определения BrainDisease.c:41
static const int AGENT_THRESHOLD_ACTIVATE
Определения BrainDisease.c:3
const int SHAKE_INTERVAL_MIN
Определения BrainDisease.c:5
override string GetDebugText()
Определения BrainDisease.c:20
float m_Time
Определения BrainDisease.c:8
bool ActivateCondition(PlayerBase player)
Определения BrainDisease.c:25
const int SHAKE_INTERVAL_MAX
Определения BrainDisease.c:6
void OnDeactivate(PlayerBase player)
Определения BrainDisease.c:36
Определения BrainDisease.c:2
static void SendKuruRequest(DayZPlayer pPlayer, float amount)
Определения DayZPlayerSyncJunctures.c:313
Определения EnMath.c:7
Определения BreathVapourMdfr.c:4
Определения PlayerBaseClient.c:2
eModifiers
Определения eModifiers.c:2
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:126
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].