Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс PlayerAgentPool

Закрытые члены

void PlayerAgentPool (PlayerBase player)
 
void ~PlayerAgentPool ()
 
int GetStorageVersion ()
 
void PrintAgents ()
 
void ImmuneSystemTick (float value, float deltaT)
 
void GrowAgents (float deltaT)
 
void OnStoreSave (ParamsWriteContext ctx)
 
bool OnStoreLoad (ParamsReadContext ctx, int version)
 
void DigestAgent (int agent_id, float count)
 
void AddAgent (int agent_id, float count)
 
void RemoveAgent (int agent_id)
 
void RemoveAllAgents ()
 
int GetAgents ()
 
int GetSingleAgentCount (int agent_id)
 
float GetTotalAgentCount ()
 
void SpawnAgents (float deltaT)
 
void SetAgentCount (int agent_id, float count)
 
void AntibioticsAttack (float attack_value)
 
void RemoteGrowRequestDebug (ParamsReadContext ctx)
 
void GetDebugObject (array< ref Param > object_out)
 

Закрытые данные

ref map< int, floatm_VirusPool = new map<int,float>
 
ref array< intm_VirusPoolArray = new array<int>
 
float m_LastTicked = 0
 
float m_TotalAgentCount
 
PlayerBase m_Player
 
int m_AgentMask
 
const int STORAGE_VERSION = 100
 
PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))
 

Подробное описание

Конструктор(ы)

◆ PlayerAgentPool()

void PlayerAgentPool ( PlayerBase player)
inlineprivate
15 {
17 }
Definition EntityAI.c:95
PlayerBase m_Player
Definition PlayerAgentPool.c:7

Перекрестные ссылки m_Player.

◆ ~PlayerAgentPool()

void ~PlayerAgentPool ( )
inlineprivate
20 {
21
22 }

Методы

◆ AddAgent()

void AddAgent ( int agent_id,
float count )
inlineprivate
140 {
141 int max_count = m_PluginTransmissionAgents.GetAgentMaxCount(agent_id);
142
143 if( !m_VirusPool.Contains(agent_id) && count > 0 )//if it contains, maybe add count only ?
144 {
145 //m_VirusPool.Insert( agent_id, Math.Clamp(count,0,max_count) );
147 }
148 else
149 {
150 float new_value = m_VirusPool.Get(agent_id) + count;
151 //Print(new_value);
153 }
154 }
void SetAgentCount(int agent_id, float count)
Definition PlayerAgentPool.c:230
PluginTransmissionAgents m_PluginTransmissionAgents
Definition PlayerAgentPool.c:12
ref map< int, float > m_VirusPool
Definition PlayerAgentPool.c:3

Перекрестные ссылки m_PluginTransmissionAgents, m_VirusPool и SetAgentCount().

Используется в DigestAgent(), RemoteGrowRequestDebug() и SpawnAgents().

◆ AntibioticsAttack()

void AntibioticsAttack ( float attack_value)
inlineprivate
252 {
253 for(int i = 0; i < m_VirusPool.Count(); i++)
254 {
255 int agent_id = m_VirusPool.GetKey(i);
256 float antibiotics_resistance = 1 - m_PluginTransmissionAgents.GetAgentAntiboticsResistanceEx(agent_id, m_Player);
258 float old_count = m_VirusPool.Get( agent_id );
259 float new_count = old_count - delta;
260 //PrintString("delta:"+delta.ToString());
261 //PrintString("old_count:"+old_count.ToString());
262 //PrintString("new_count:"+new_count.ToString());
264 }
265 }

Перекрестные ссылки m_Player, m_PluginTransmissionAgents, m_VirusPool и SetAgentCount().

◆ DigestAgent()

void DigestAgent ( int agent_id,
float count )
inlineprivate
135 {
136 AddAgent(agent_id, m_PluginTransmissionAgents.GetAgentDigestibility(agent_id) * count);
137 }
void AddAgent(int agent_id, float count)
Definition PlayerAgentPool.c:139

Перекрестные ссылки AddAgent() и m_PluginTransmissionAgents.

◆ GetAgents()

int GetAgents ( )
inlineprivate
191 {
192 return m_AgentMask;
193 }
int m_AgentMask
Definition PlayerAgentPool.c:8

Перекрестные ссылки m_AgentMask.

◆ GetDebugObject()

void GetDebugObject ( array< ref Param > object_out)
inlineprivate
285 {
286 int count = m_PluginTransmissionAgents.GetAgentList().Count();
287 for(int i = 0; i < count;i++)
288 {
289 AgentBase agent = m_PluginTransmissionAgents.GetAgentList().GetElement(i);
290 string agent_name = agent.GetName();
291 int agent_id = agent.GetAgentType();
292 int max_agents = m_PluginTransmissionAgents.GetAgentMaxCount(agent_id);
293 string amount = GetSingleAgentCount(agent_id).ToString() + "/" + max_agents.ToString();
295 }
296 object_out.InsertAt(new Param1<int>(count) ,0);
297 }
Definition BrainAgent.c:2
int GetSingleAgentCount(int agent_id)
Definition PlayerAgentPool.c:195

Перекрестные ссылки GetSingleAgentCount() и m_PluginTransmissionAgents.

◆ GetSingleAgentCount()

int GetSingleAgentCount ( int agent_id)
inlineprivate
196 {
197 if( m_VirusPool.Contains(agent_id) )
198 {
199 return m_VirusPool.Get( agent_id );
200 }
201 else return 0;
202 }

Перекрестные ссылки m_VirusPool.

Используется в GetDebugObject() и SpawnAgents().

◆ GetStorageVersion()

int GetStorageVersion ( )
inlineprivate
25 {
26 return STORAGE_VERSION;
27 }
const int STORAGE_VERSION
Definition PlayerAgentPool.c:10

Перекрестные ссылки STORAGE_VERSION.

◆ GetTotalAgentCount()

float GetTotalAgentCount ( )
inlineprivate
205 {
206 float agent_count;
207 for(int i = 0; i < m_VirusPool.Count(); i++)
208 {
209 agent_count += m_VirusPool.GetElement(i);
210 }
211 return agent_count;
212 }

Перекрестные ссылки m_VirusPool.

◆ GrowAgents()

void GrowAgents ( float deltaT)
inlineprivate
49 {
50 if ( !IsPluginManagerExists() )//check if modules are running
51 return;
52
53 EStatLevels immunity_level = m_Player.GetImmunityLevel();
54
56 for(int i = 0; i < m_VirusPool.Count(); i++)
57 {
58 int agent_id = m_VirusPool.GetKey(i);
59 int max_count = m_PluginTransmissionAgents.GetAgentMaxCount( agent_id );
60
62
63 float grow_delta;
64
66 {
67 bool grow_during_antibiotics = m_PluginTransmissionAgents.GrowDuringAntibioticsAttack(agent_id, m_Player);
68 if (m_Player.IsAntibioticsActive() && !grow_during_antibiotics)
69 continue;
70 float invasibility = m_PluginTransmissionAgents.GetAgentInvasibilityEx( agent_id, m_Player );
72 }
73 else
74 {
75 float dieoff_speed = m_PluginTransmissionAgents.GetAgentDieOffSpeedEx( agent_id, m_Player );
77 }
78
79 //Print( agent_id );
80 //Print( grow_delta );
81
82 float old_count = m_VirusPool.Get( agent_id );
85
88 }
89 }
EStatLevels
Definition EStatLevels.c:2
bool IsPluginManagerExists()
Definition PluginManager.c:306
Definition EnMath.c:7
float m_TotalAgentCount
Definition PlayerAgentPool.c:6
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), IsPluginManagerExists(), m_Player, m_PluginTransmissionAgents, m_TotalAgentCount, m_VirusPool и SetAgentCount().

Используется в ImmuneSystemTick().

◆ ImmuneSystemTick()

void ImmuneSystemTick ( float value,
float deltaT )
inlineprivate
43 {
46 }
void SpawnAgents(float deltaT)
Definition PlayerAgentPool.c:214
void GrowAgents(float deltaT)
Definition PlayerAgentPool.c:48

Перекрестные ссылки GrowAgents() и SpawnAgents().

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprivate
106 {
107 //Debug.Log("PlayerAgentPool OnStoreLoad called", "Agents");
108 int count;
109
110 if(!ctx.Read(count))
111 {
112 return false;
113 }
114
115 for(int i = 0; i < count;i++)
116 {
117 int key;
118 int value;
119 if(!ctx.Read(key))
120 {
121 return false;
122 }
123
124 if(!ctx.Read(value))
125 {
126 return false;
127 }
128
130 }
131
132 return true;
133 }

Перекрестные ссылки SetAgentCount().

◆ OnStoreSave()

void OnStoreSave ( ParamsWriteContext ctx)
inlineprivate
92 {
93 //Debug.Log("PlayerAgentPool OnStoreSave called", "Agents");
94
95 ctx.Write( m_VirusPool.Count() );
96 for(int i = 0; i < m_VirusPool.Count();i++)
97 {
98 int key = m_VirusPool.GetKey(i);
99 int value = m_VirusPool.GetElement(i);
100 ctx.Write( key );
101 ctx.Write( value );
102 }
103 }

Перекрестные ссылки m_VirusPool.

◆ PrintAgents()

void PrintAgents ( )
inlineprivate
30 {
31 if( m_VirusPool )
32 {
33 for(int i = 0; i < m_VirusPool.Count(); i++)
34 {
35 Debug.Log("Agent: "+ m_VirusPool.GetKey(i).ToString(), "Agents");
36 Debug.Log("Count: "+ m_VirusPool.GetElement(i).ToString(), "Agents");
37 }
38
39 }
40 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:136

Перекрестные ссылки Debug::Log() и m_VirusPool.

◆ RemoteGrowRequestDebug()

void RemoteGrowRequestDebug ( ParamsReadContext ctx)
inlineprivate
269 {
271 int id = CachedObjectsParams.PARAM1_INT.param1;
272 int max = m_PluginTransmissionAgents.GetAgentMaxCount(Math.AbsInt(id));
273 int grow = max / 10;
274 if(id > 0)
275 {
276 AddAgent(id, grow);
277 }
278 else if( id < 0)
279 {
280 AddAgent(-id, -grow);
281 }
282 }
Definition UtilityClasses.c:10
static ref Param1< int > PARAM1_INT
Definition UtilityClasses.c:11
static proto int AbsInt(int i)
Returns absolute value.

Перекрестные ссылки Math::AbsInt(), AddAgent(), m_PluginTransmissionAgents и CachedObjectsParams::PARAM1_INT.

◆ RemoveAgent()

void RemoveAgent ( int agent_id)
inlineprivate
166 {
168 }

Перекрестные ссылки SetAgentCount().

◆ RemoveAllAgents()

void RemoveAllAgents ( )
inlineprivate
171 {
172 m_AgentMask = 0;
173 m_VirusPool.Clear();
174 }

Перекрестные ссылки m_AgentMask и m_VirusPool.

◆ SetAgentCount()

void SetAgentCount ( int agent_id,
float count )
inlineprivate
231 {
232 if(count > 0)
233 {
234 //Debug.Log("+ growing agent"+ agent_id.ToString() +"to count: "+count.ToString(), "Agents");
237 }
238 else
239 {
240 //Debug.Log("- REMOVING agent"+ agent_id.ToString(), "Agents");
241 m_VirusPool.Remove( agent_id );
243 }
244 if(m_Player.m_Agents != m_AgentMask)
245 {
246 m_Player.m_Agents = m_AgentMask;
247 m_Player.SetSynchDirty();
248 }
249 }

Перекрестные ссылки m_AgentMask, m_Player и m_VirusPool.

Используется в AddAgent(), AntibioticsAttack(), GrowAgents(), OnStoreLoad() и RemoveAgent().

◆ SpawnAgents()

void SpawnAgents ( float deltaT)
inlineprivate
215 {
216 int count = m_PluginTransmissionAgents.GetAgentList().Count();
217 for(int i = 0; i < count;i++)
218 {
219 AgentBase agent = m_PluginTransmissionAgents.GetAgentList().GetElement(i);
220 int agent_id = agent.GetAgentType();
221
222 if( GetSingleAgentCount(agent_id)==0 && agent.AutoinfectCheck(deltaT, m_Player) )
223 {
224 AddAgent(agent_id,100);
225 }
226 }
227 }

Перекрестные ссылки AddAgent(), GetSingleAgentCount(), m_Player и m_PluginTransmissionAgents.

Используется в ImmuneSystemTick().

Поля

◆ m_AgentMask

int m_AgentMask
private

Используется в GetAgents(), RemoveAllAgents() и SetAgentCount().

◆ m_LastTicked

float m_LastTicked = 0
private

◆ m_Player

PlayerBase m_Player
private

◆ m_PluginTransmissionAgents

PluginTransmissionAgents m_PluginTransmissionAgents = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents))
private

◆ m_TotalAgentCount

float m_TotalAgentCount
private

Используется в GrowAgents().

◆ m_VirusPool

◆ m_VirusPoolArray

ref array<int> m_VirusPoolArray = new array<int>
private

◆ STORAGE_VERSION

const int STORAGE_VERSION = 100
private

Используется в GetStorageVersion().


Объявления и описания членов класса находятся в файле: