DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
StateManager.c
См. документацию.
6
7enum SymptomIDs
8{
29};
30
36
43
45const int MAX_QUEUE_SIZE = 5;
46
48{
51 ref map<int, int> m_ActiveSymptomTypes;//for each type(symptom id), keep track of how many times it is in queue
52
55
57
58
62 //ref array<string> m_SymptomQueueSecondaryServerDbg;
64
67
68 const int STORAGE_VERSION = 121;
69
70 bool m_ShowDebug = false;
71 bool m_ShowDebug2 = false;
72
74
75 void Init()
76 {
77 RegisterSymptom(new CoughSymptom);
79 RegisterSymptom(new BlindnessSymptom);
80 RegisterSymptom(new SneezeSymptom);
81 RegisterSymptom(new FeverBlurSymptom);
82 RegisterSymptom(new BloodLoss);
84 RegisterSymptom(new FreezeSymptom);
85 RegisterSymptom(new FreezeRattleSymptom);
86 RegisterSymptom(new HotSymptom);
87 RegisterSymptom(new PainLightSymptom);
88 RegisterSymptom(new PainHeavySymptom);
89 RegisterSymptom(new HandShiversSymptom);
91 RegisterSymptom(new HMP3Symptom);
92 RegisterSymptom(new GaspSymptom);
93 }
94
96 {
97 return STORAGE_VERSION;
98 }
99
100
102 {
103 if ( g_Game.IsClient() )
104 {
105 return;
106 }
107
108 QueueUpSecondarySymptom(SymptomIDs.SYMPTOM_BLOODLOSS);
109 }
110
128
130 {
131 foreach (SymptomBase symptomPrimary : m_SymptomQueuePrimary)
132 symptomPrimary.OnOwnerKilled();
133
134 foreach (SymptomBase symptomSecondary : m_SymptomQueueSecondary)
135 symptomSecondary.OnOwnerKilled();
136 }
137
139 {
140 return m_SymptomsUIDs.Get(SYMPTOM_uid);
141 }
142
144 {
145 return m_Player;
146 }
147
149 {
150 Symptom.Init(this, m_Player, 0);
151 int id = Symptom.GetType();
152
153 if (m_AvailableSymptoms.Contains(id))
154 {
155 ErrorEx(string.Format("Symptom %1 already registered!", Symptom.GetName()));
156 return;
157 }
158
159 m_AvailableSymptoms.Insert(id, Symptom);
160 }
161
163 {
164 if (m_AnimMeta)
165 {
166 m_AnimMeta.AnimFinished(type);
167 }
168 }
169
175
177 {
178 int uid = Math.RandomInt(1, 2147483647);
179 if (!IsUIDUsed(uid))
180 return uid;
181 else
182 return CreateUniqueID();
183 }
184
185 bool IsUIDUsed(int uid)
186 {
187 return m_SymptomsUIDs.Contains(uid);
188 }
189
190 string GetSymptomName(int symptom_id)
191 {
192 return m_AvailableSymptoms.Get(symptom_id).GetName();
193 }
194
196 {
197 SmptAnimMetaBase animMeta = m_AvailableSymptoms.Get(symptom_id).SpawnAnimMetaObject();
198 animMeta.m_StateType = symptom_id;
199
200 return animMeta;
201 }
202
204 void RequestSymptomExit(int SYMPTOM_uid)
205 {
206 if (m_SymptomsUIDs.Get(SYMPTOM_uid))
207 m_SymptomsUIDs.Get(SYMPTOM_uid).RequestDestroy();
208 }
209
210 bool IsSymptomPrimary(int symptom_id)
211 {
212 return m_AvailableSymptoms.Get(symptom_id).IsPrimary();
213 }
214
218
220 {
221 return m_CurrentCommandID;
222 }
223
224 void OnTick(float deltatime, int pCurrentCommandID, HumanMovementState movement_state)
225 {
226 // pCurrentCommandID might be the initial value, but the system itself requires
227 // current value, so retrieve the current value from player instead
228 m_CurrentCommandID = m_Player.GetCurrentCommandID();
230 {
232
234 m_Player.SetActivePrimarySymptomID(m_SymptomQueuePrimary.Get(m_ActiveSymptomIndexPrimary).GetType());
235 }
236
237 UpdateActiveSymptoms(deltatime);
238
239 if ( m_AnimMeta )
240 {
241 if ( m_AnimMeta.IsDestroyReqested() )
242 {
243 m_AnimMeta = null;
244 }
245 }
246
247 if ( m_AnimMeta )
248 {
249
250 //anim requested
251 if ( !m_AnimMeta.IsPlaying() )
252 {
253 // not playing yet and not possible to play
254 SymptomBase symptom = m_AvailableSymptoms.Get( m_AnimMeta.m_StateType );
255 if ( symptom && !symptom.CanActivate() )
256 {
257 m_AnimMeta = null;
258 }
259 else if ( m_AnimMeta.PlayRequest() == EAnimPlayState.FAILED )
260 {
262 }
263 }
264 else
265 {
266 m_AnimMeta.Update(movement_state);
267 }
268 }
269
270 #ifdef DIAG_DEVELOPER
271 #ifndef SERVER //must be here !!!
272 if ( DiagMenu.GetBool(DiagMenuIDs.MISC_PLAYER_SYMPTOMS_SHOW) )
273 {
274 //DisplayDebug(true);
275 array<ref Param> primary_debug = PrepareClientDebug(m_SymptomQueuePrimary);
276 array<ref Param> secondary_debug = PrepareClientDebug(m_SymptomQueueSecondary);
277
278 DisplayDebug1("Symptoms Client", 50, primary_debug, secondary_debug);
279 DisplayDebug2("Symptoms Server", 300, m_SymptomQueueServerDbgPrimary, m_SymptomQueueServerDbgSecondary);
280 ShowAvailableSymptoms();
281 }
282 else
283 {
284 CleanDebug1("Symptoms Client", 50);
285 CleanDebug2("Symptoms Server", 300);
286 CleanAvailableSymptoms();
287 }
288
289 int HMPRange = DiagMenu.GetRangeValue(DiagMenuIDs.MISC_PLAYER_SYMPTOMS_TOGGLE_HMP);
290 if (HMPRange == 1 && m_ActiveSymptomTypes.Get(SymptomIDs.SYMPTOM_HMP_SEVERE) == 0)
291 {
292 QueueUpSecondarySymptomEx(SymptomIDs.SYMPTOM_HMP_SEVERE);
293 }
294 else if (HMPRange == 0 && m_ActiveSymptomTypes.Get(SymptomIDs.SYMPTOM_HMP_SEVERE) > 0)
295 {
296 RemoveSecondarySymptom(SymptomIDs.SYMPTOM_HMP_SEVERE);
297 }
298 #endif
299 #endif
300 }
301
303 {
304 if (m_AnimMeta)
305 {
306 // animation meta already exists
307 // pass
308 }
309 else
310 {
311 int state_type;
312 if (ctx.Read(state_type))
313 {
314 m_AnimMeta = SpawnAnimMetaObject(state_type);
315 if (m_AnimMeta)
316 {
317 m_AnimMeta.Init(ctx, this, m_Player);
318 }
319 }
320 }
321 }
322
323 void UpdateActiveSymptoms(float deltatime)
324 {
326 if (primarySymptom)
327 {
328 if (!primarySymptom.IsActivated() && primarySymptom.CanActivate())
329 primarySymptom.Activate();
330
331 if (primarySymptom.IsActivated() && CanUpdateSymptom(primarySymptom))
332 primarySymptom.Update(deltatime);
333 else
334 primarySymptom.Destroy();
335 }
336
337 int nSecondarySymptoms = m_SymptomQueueSecondary.Count();
338 for (int i = nSecondarySymptoms - 1; i >= 0; --i)
339 {
340 SymptomBase secondarySymptom = m_SymptomQueueSecondary[i];
341 if (secondarySymptom)
342 {
343 if (!secondarySymptom.IsActivated())
344 secondarySymptom.Activate();
345
346 if (secondarySymptom.IsActivated() && CanUpdateSymptom(secondarySymptom))
347 secondarySymptom.Update(deltatime);
348 else
349 secondarySymptom.Destroy();
350 }
351 }
352 }
353
354 void OnSymptomExit(SymptomBase Symptom, int uid)
355 {
356 bool is_primary;
357 if ( Symptom )
358 {
359 is_primary = Symptom.IsPrimary();
360 DecreaseSymptomCount(Symptom.GetType());
361 }
362
363 if (m_SymptomsUIDs.Contains(uid))
364 m_SymptomsUIDs.Remove(uid);
365 else
366 Debug.LogError("Symptom with this UID does not exist", "PlayerSymptoms");
367
368 if (is_primary)
369 {
370 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
371 {
372 if ( m_SymptomQueuePrimary.Get(i) == Symptom )
373 {
374 m_SymptomQueuePrimary.RemoveOrdered(i);
375 break;
376 }
377 }
378 }
379 else
380 {
381 for (i = 0; i < m_SymptomQueueSecondary.Count(); i++)
382 {
383 if (m_SymptomQueueSecondary.Get(i) == Symptom)
384 {
385 m_SymptomQueueSecondary.RemoveOrdered(i);
386 break;
387 }
388 }
389 }
391 m_Player.SetActivePrimarySymptomID(0);
392
393 #ifdef DIAG_DEVELOPER
394 if ( g_Game ) SendServerDebugToClient();
395 #endif
396 }
397
398
399 int GetSymptomMaxCount(int symptom_id)
400 {
401 return m_AvailableSymptoms.Get(symptom_id).GetMaxCount();
402 }
403
404
405 int GetSymptomCount(int symptom_id)
406 {
407 if ( m_ActiveSymptomTypes.Contains(symptom_id) )
408 return m_ActiveSymptomTypes.Get(symptom_id);
409 else
410 return -1;
411 }
412
413 void IncreaseSymptomCount(int symptom_id)
414 {
415 if ( m_ActiveSymptomTypes.Contains(symptom_id) )
416 {
417 m_ActiveSymptomTypes.Set(symptom_id, m_ActiveSymptomTypes.Get(symptom_id) + 1);
418 }
419 else
420 {
421 m_ActiveSymptomTypes.Insert(symptom_id, 1);
422 }
423 }
424
425 void DecreaseSymptomCount(int symptom_id)
426 {
427 if ( m_ActiveSymptomTypes.Contains(symptom_id) )
428 {
429 if ( m_ActiveSymptomTypes.Get(symptom_id) == 1)
430 m_ActiveSymptomTypes.Remove(symptom_id);
431 else
432 m_ActiveSymptomTypes.Set(symptom_id, m_ActiveSymptomTypes.Get(symptom_id) - 1);
433 }
434 }
435
436 SymptomBase SpawnSymptom(int symptom_id, int uid = -1)
437 {
438 if (m_AvailableSymptoms.Get(symptom_id))
439 {
440 SymptomBase symptom = SymptomBase.Cast(m_AvailableSymptoms.Get(symptom_id).ClassName().ToType().Spawn());
441 if (uid == -1)
442 {
443 uid = CreateUniqueID();
444 }
445
446 symptom.Init(this, m_Player,uid);
447
448 if ( m_SymptomsUIDs.Contains(uid) )
449 ErrorEx(string.Format("Symptoms: Unique ID (=%1) already exists!", uid));
450
451 m_SymptomsUIDs.Insert(uid, symptom);
452 IncreaseSymptomCount(symptom_id);
453
454 return symptom;
455 }
456
457 if (!symptom)
458 {
459 Error("Symptom not registered");
460 }
461
462 return null;
463 }
464
466 {
467 foreach (SymptomBase symptom : m_SymptomQueuePrimary)
468 {
469 symptom.RequestDestroy();
470 }
471 }
472
473 SymptomBase QueueUpPrimarySymptom(int symptom_id, int uid = -1)
474 {
475 if ((GetSymptomCount(symptom_id) >= GetSymptomMaxCount(symptom_id)) && GetSymptomMaxCount(symptom_id) != -1)
476 return null;
477
478 SymptomBase symptom = m_AvailableSymptoms.Get(symptom_id);
479 if (m_Player.IsUnconscious() && !symptom.AllowInUnconscious())
480 return null;
481 else
482 symptom = null; // needed for check below
483
484 for (int i = 0; i < m_SymptomQueuePrimary.Count(); i++)
485 {
486 if (m_SymptomQueuePrimary.Get(i).CanBeInterupted() && ComparePriority(GetSymptomPriority(symptom_id), m_SymptomQueuePrimary.Get(i).GetPriority()) == 1)
487 {
488 symptom = SpawnSymptom(symptom_id, uid);
489 m_SymptomQueuePrimary.InsertAt(symptom,i);
490
492 m_SymptomQueuePrimary.Get(MAX_QUEUE_SIZE).RequestDestroy();// no need to remove from the array, that's done via Symptom callback on destruct
493
494 break;
495 }
496 }
497 if ( !symptom && m_SymptomQueuePrimary.Count() < MAX_QUEUE_SIZE)
498 {
499 symptom = SpawnSymptom( symptom_id, uid );
500 m_SymptomQueuePrimary.Insert(symptom);
501 }
502 #ifdef DIAG_DEVELOPER
503 SendServerDebugToClient();
504 #endif
505 return symptom;
506 }
507
508 void QueueUpSecondarySymptom(int symptom_id, int uid = -1)
509 {
510 QueueUpSecondarySymptomEx(symptom_id, uid);
511 }
512
513 SymptomBase QueueUpSecondarySymptomEx(int symptom_id, int uid = -1)
514 {
515 if ((GetSymptomCount(symptom_id) >= GetSymptomMaxCount(symptom_id)) && GetSymptomMaxCount(symptom_id) != -1)
516 return null;
517
518 if (m_AvailableSymptoms.Get(symptom_id).IsPrimary())
519 return null;
520
521 if (m_Player.IsUnconscious() && !m_AvailableSymptoms.Get(symptom_id).AllowInUnconscious())
522 return null;
523
524 SymptomBase Symptom = SpawnSymptom(symptom_id, uid);
525
526 m_SymptomQueueSecondary.Insert(Symptom);
527 return Symptom;
528 }
529
531 void RemoveSecondarySymptom(int symptom_id)
532 {
533 for (int i = 0; i < m_SymptomQueueSecondary.Count();i++)
534 {
535 if ( m_SymptomQueueSecondary.Get(i) && m_SymptomQueueSecondary.Get(i).GetType() == symptom_id )
536 {
537 m_SymptomQueueSecondary.Get(i).RequestDestroy();
538 return;
539 }
540 }
541 }
542
544 {
545 if ( g_Game.IsServer() )
546 {
548 {
550 }
551 }
552 if ( !g_Game.IsDedicatedServer() )
553 {
554 if ( m_SymptomQueuePrimary.Count() > 0 )
555 return m_SymptomQueuePrimary.Get(0);
556 }
557 return NULL;
558 }
559
561 {
562 for (int i = 0; i < m_SymptomQueuePrimary.Count();i++)
563 {
564 if ( m_SymptomQueuePrimary.Get(i).CanActivate() )
565 {
566 return i;
567 }
568 }
569 return -1;
570 }
571
572 int ComparePriority( int prio1, int prio2 )
573 {
574 if ( prio1 > prio2 )
575 {
576 return 1;
577 }
578 else if ( prio2 > prio1 )
579 {
580 return 2;
581 }
582 return 0;
583 }
584
585 int GetSymptomPriority(int symptom_id)
586 {
587 return m_AvailableSymptoms.Get(symptom_id).GetPriority();
588 }
589
590 void OnRPC(int rpc_type, ParamsReadContext ctx)
591 {
593 int symptom_id = CachedObjectsParams.PARAM2_INT_INT.param1;
594 int uid = CachedObjectsParams.PARAM2_INT_INT.param2;
595
596 bool is_primary = m_AvailableSymptoms.Get(symptom_id).IsPrimary();
597
598 if ( rpc_type == ERPCs.RPC_PLAYER_SYMPTOM_ON )
599 {
600 if ( is_primary )
601 {
603 QueueUpPrimarySymptom(symptom_id,uid);
604 }
605 else
606 {
607 QueueUpSecondarySymptom(symptom_id,uid);
608 }
609 }
610 else if ( rpc_type == ERPCs.RPC_PLAYER_SYMPTOM_OFF )
611 {
612 if ( is_primary )
613 {
615 }
616 else
617 {
618 RemoveSecondarySymptom( symptom_id );
619 }
620 }
621 }
622
624 {
625 array<int> m_SaveQueue = new array<int>;
626
627 for ( int i = 0; i < m_SymptomQueuePrimary.Count(); i++ )
628 {
629 if ( m_SymptomQueuePrimary.Get(i).IsPersistent() )
630 {
631 m_SaveQueue.Insert( m_SymptomQueuePrimary.Get(i).GetType() );
632 }
633 }
634
635 for ( i = 0; i < m_SymptomQueueSecondary.Count(); i++ )
636 {
637 if ( m_SymptomQueueSecondary.Get(i).IsPersistent() )
638 {
639 m_SaveQueue.Insert( m_SymptomQueueSecondary.Get(i).GetType() );
640 }
641 }
642
643 ctx.Write( m_SaveQueue );
644 }
645
646 bool OnStoreLoad( ParamsReadContext ctx, int version )
647 {
648 array<int> m_SaveQueue;
649
650 if (ctx.Read(m_SaveQueue))
651 {
652 for ( int i = 0; i < m_SaveQueue.Count(); i++ )
653 {
654 int id = m_SaveQueue.Get(i);
655
656 if ( IsSymptomPrimary(id) )
657 {
659 }
660 else
661 {
663 }
664 }
665 return true;
666 }
667 else
668 {
669 return false;
670 }
671 }
672
673 protected bool CanUpdateSymptom(SymptomBase symptom)
674 {
675 if (m_Player.IsUnconscious() && !symptom.AllowInUnconscious())
676 return false;
677
678 return true;
679 }
680
681#ifdef DIAG_DEVELOPER
682 void OnRPCDebug(int rpc_type, ParamsReadContext ctx)
683 {
684 switch (rpc_type)
685 {
686 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON:
687 {
689 {
691 {
693 }
694 else
695 {
696 QueueUpSecondarySymptom(CachedObjectsParams.PARAM1_INT.param1);
697 }
698 }
699 break;
700 }
701
702 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF:
703 {
704 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
705 RequestSymptomExit(CachedObjectsParams.PARAM1_INT.param1);
706 break;
707 }
708
709 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG:
710 {
711 int primary_Symptoms_count;
712 int secondary_Symptoms_count;
713
714 int symptom_id;
715
716 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
717 {
718 primary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
719 }
720
721 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
722 {
723 secondary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
724 }
725
729
730 int overall_count = primary_Symptoms_count + secondary_Symptoms_count;
731 for (int i = 0; i < overall_count ; ++i)
732 {
733 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
734 ctx.Read(p3);
735 bool is_primary = p3.param1;
736
737 if (is_primary)
738 {
739 m_SymptomQueueServerDbgPrimary.Insert(p3);// m_SymptomQueueServerDbg.Insert(p3);
740 }
741 else
742 {
744 }
745 //PrintString("elements m_SymptomQueueServerDbgPrimary:" + m_SymptomQueueServerDbgPrimary.Count());
746 //PrintString("elements m_SymptomQueueServerDbgSecondary:" + m_SymptomQueueServerDbgSecondary.Count());
747
748 }
749 /*
750 for(i = 0; i < secondary_Symptoms_count; i++)
751 {
752 ctx.Read(CachedObjectsParams.PARAM1_STRING);
753 m_SymptomQueueSecondaryServerDbg.Insert(CachedObjectsParams.PARAM1_STRING.param1);
754 }*/
755 break;
756 }
757 }
758 }
759
760 void SendServerDebugToClient()
761 {
762 array<ref Param> debug_list = new array<ref Param>;
763
764 Param1<int> p1 = new Param1<int>(0);
765 Param1<int> p2 = new Param1<int>(0);
766
767 p1.param1 = m_SymptomQueuePrimary.Count();
768 p2.param1 = m_SymptomQueueSecondary.Count();
769
770 debug_list.Insert(p1);
771 debug_list.Insert(p2);
772
773 Param3<bool,int,int> p;
774
775 bool is_primary;
776 int symptom_id;
777 int SYMPTOM_uid;
778
779 foreach ( SymptomBase symptom : m_SymptomQueuePrimary )
780 {
781 is_primary = symptom.IsPrimary();
782 symptom_id = symptom.GetType();
783 SYMPTOM_uid = symptom.GetUID();
784
785 p = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
786 debug_list.Insert(p);
787 }
788
789 foreach ( SymptomBase secSymptom : m_SymptomQueueSecondary )
790 {
791 is_primary = secSymptom.IsPrimary();
792 symptom_id = secSymptom.GetType();
793 SYMPTOM_uid = secSymptom.GetUID();
794
795 p = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
796 debug_list.Insert(p);
797 }
798
799 g_Game.RPC(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG, debug_list, true);
800 }
801
802 void DebugRequestExitSymptom(int SYMPTOM_uid)
803 {
804 CachedObjectsParams.PARAM1_INT.param1 = SYMPTOM_uid;
805 if (GetPlayer())
806 g_Game.RPCSingleParam(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF, CachedObjectsParams.PARAM1_INT, true, GetPlayer().GetIdentity());
807 }
808
809 array<ref Param> PrepareClientDebug(array<ref SymptomBase> Symptoms)
810 {
811 array<ref Param> debug_array = new array<ref Param>;
812
813 Param3<bool, int, int> p3;
814
815 for (int i = 0; i < Symptoms.Count(); i++)
816 {
817 bool is_primary = Symptoms.Get(i).IsPrimary();
818 int symptom_id = Symptoms.Get(i).GetType();
819 int SYMPTOM_uid = Symptoms.Get(i).GetUID();
820
821 p3 = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
822 debug_array.Insert(p3);
823 }
824 return debug_array;
825 }
826
827 void DisplayDebug1(string name, int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
828 {
829 string primary;
830 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
831
832 DbgUI.BeginCleanupScope();
833 DbgUI.Begin(name, 50, y_offset);
834 DbgUI.Text("Primary: ");
835
836 bool is_primary;
837 int symptom_id;
838 int SYMPTOM_uid;
839 string SYMPTOM_name;
840
841 for (int i = 0; i < Symptoms_primary.Count(); i++)
842 {
843 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
844
845 is_primary = p3.param1;
846 symptom_id = p3.param2;
847 SYMPTOM_uid = p3.param3;
848 SYMPTOM_name = GetSymptomName(symptom_id);
849
850 primary += SYMPTOM_name + " | ";
851 }
852
853 DbgUI.Text(primary);
854 DbgUI.Text("Secondary: ");
855 for (i = 0; i < Symptoms_secondary.Count(); i++)
856 {
857 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
858
859 is_primary = p3.param1;
860 symptom_id = p3.param2;
861 SYMPTOM_uid = p3.param3;
862 SYMPTOM_name = GetSymptomName(symptom_id);
863 DbgUI.Text(SYMPTOM_name);
864 }
865
866 DbgUI.End();
867 DbgUI.EndCleanupScope();
868 }
869
870 void DisplayDebug2(string name, int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
871 {
872 string primary;
873 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
874
875 DbgUI.BeginCleanupScope();
876 DbgUI.Begin(name, 50, y_offset);
877 DbgUI.Text("Primary: ");
878
879 bool is_primary;
880 int symptom_id;
881 int SYMPTOM_uid;
882 string SYMPTOM_name;
883
884 for (int i = 0; i < Symptoms_primary.Count(); i++)
885 {
886 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
887
888 is_primary = p3.param1;
889 symptom_id = p3.param2;
890 SYMPTOM_uid = p3.param3;
891 SYMPTOM_name = GetSymptomName(symptom_id);
892
893 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
894 {
895 DebugRequestExitSymptom(SYMPTOM_uid);
896 }
897 }
898
899 DbgUI.Text("Secondary: ");
900 for (i = 0; i < Symptoms_secondary.Count(); i++)
901 {
902 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
903
904 is_primary = p3.param1;
905 symptom_id = p3.param2;
906 SYMPTOM_uid = p3.param3;
907 SYMPTOM_name = GetSymptomName(symptom_id);
908
909 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
910 {
911 DebugRequestExitSymptom(SYMPTOM_uid);
912 }
913 }
914
915 DbgUI.End();
916 DbgUI.EndCleanupScope();
917 }
918
919 void ShowAvailableSymptoms()
920 {
921 DbgUI.BeginCleanupScope();
922 DbgUI.Begin("available Symptoms", 300, 50);
923
924 for (int i = 0; i < m_AvailableSymptoms.Count(); i++)
925 {
926 SymptomBase Symptom = m_AvailableSymptoms.GetElement(i);
927 string SYMPTOM_name = Symptom.GetName();
928 int symptom_id = Symptom.GetType();
929
930 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
931 {
932 DebugRequestActivateSymptom(symptom_id);
933 }
934 }
935
936 DbgUI.End();
937 DbgUI.EndCleanupScope();
938 }
939
940 void CleanAvailableSymptoms()
941 {
942 DbgUI.BeginCleanupScope();
943 DbgUI.Begin("available Symptoms", 300, 50);
944 DbgUI.End();
945 DbgUI.EndCleanupScope();
946 }
947
948 void CleanDebug1(string name, int y_offset)
949 {
950 DbgUI.BeginCleanupScope();
951 DbgUI.Begin(name, 50, y_offset);
952 DbgUI.End();
953 DbgUI.EndCleanupScope();
954 }
955
956 void CleanDebug2(string name, int y_offset)
957 {
958 DbgUI.BeginCleanupScope();
959 DbgUI.Begin(name, 50, y_offset);
960 DbgUI.End();
961 DbgUI.EndCleanupScope();
962 }
963
964 void DebugRequestActivateSymptom(int symptom_id)
965 {
966 CachedObjectsParams.PARAM1_INT.param1 = symptom_id;
967 if (GetPlayer())
968 g_Game.RPCSingleParam(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON, CachedObjectsParams.PARAM1_INT, true, GetPlayer().GetIdentity());
969 }
970
971#endif
972}
@ OK
0 - No error. Can be returned from any call.
Определения BIOSErrorModule.c:9
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
map
Определения ControlsXboxNew.c:4
DayZGame g_Game
Определения DayZGame.c:3942
DiagMenuIDs
Определения EDiagMenuIDs.c:2
ERPCs
Определения ERPCs.c:2
override SmptAnimMetaBase SpawnAnimMetaObject()
Определения FreezeState.c:147
@ LAST_INDEX
Определения ModifiersManager.c:17
eAnimFinishType
Определения SmptAnimMeta.c:2
enum AnimType SYMPTOM_BLINDNESS
enum AnimType SYMPTOM_VOMIT
enum AnimType SYMPTOM_BLEEDING_SOURCE
enum AnimType SYMPTOM_UNCONSCIOUS
enum AnimType SYMPTOM_PAIN_LIGHT
enum AnimType SYMPTOM_BULLET_HIT
enum AnimType SYMPTOM_GASP
enum AnimType SYMPTOM_HAND_SHIVER
const int DEBUG_PADDING_OFFSET
Определения StateManager.c:44
enum AnimType SYMPTOM_FEVERBLUR
enum AnimType SYMPTOM_FREEZE
enum AnimType SYMPTOM_BLOODLOSS
enum AnimType SYMPTOM_LAUGHTER
enum AnimType SYMPTOM_COUGH
SymptomTypes
Определения StateManager.c:32
@ PRIMARY
Определения StateManager.c:33
@ SECONDARY
Определения StateManager.c:34
EAnimPlayState
Определения StateManager.c:38
@ POSTPONED
Определения StateManager.c:40
AnimType
Определения StateManager.c:2
@ FULL_BODY
Определения StateManager.c:3
enum AnimType SYMPTOM_PAIN_HEAVY
enum AnimType SYMPTOM_SNEEZE
enum AnimType SYMPTOM_HMP_SEVERE
enum AnimType SYMPTOM_HOT
const int MAX_QUEUE_SIZE
Определения StateManager.c:45
enum AnimType SYMPTOM_DEAFNESS_COMPLETE
enum AnimType SYMPTOM_FREEZE_RATTLE
static ref Param1< int > PARAM1_INT
Определения UtilityClasses.c:11
static ref Param2< int, int > PARAM2_INT_INT
Определения UtilityClasses.c:16
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Определения 3_Game/DayZ/tools/Debug.c:305
Определения 3_Game/DayZ/tools/Debug.c:2
Определения EnDebug.c:241
Определения human.c:1154
Определения LaughterState.c:2
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
proto bool Write(void value_out)
proto bool Read(void value_in)
Определения SmptAnimMeta.c:83
bool AllowInUnconscious()
Определения StateBase.c:149
bool CanActivate()
Определения StateBase.c:354
bool IsPrimary()
Определения StateBase.c:141
void Init(SymptomManager manager, PlayerBase player, int uid)
Определения StateBase.c:39
string GetName()
Определения StateBase.c:90
void Activate()
Определения StateBase.c:175
void Destroy()
Определения StateBase.c:319
void Update(float deltatime)
Определения StateBase.c:222
bool IsActivated()
Определения StateBase.c:215
int GetType()
Определения StateBase.c:100
void AnimationStart()
Определения StateBase.c:339
Определения StateBase.c:2
const int STORAGE_VERSION
Определения StateManager.c:68
int GetSymptomCount(int symptom_id)
Определения StateManager.c:405
void DecreaseSymptomCount(int symptom_id)
Определения StateManager.c:425
void SetAnimation(ParamsReadContext ctx)
Определения StateManager.c:302
void OnInputUserDataReceived(ParamsReadContext ctx)
Определения StateManager.c:215
bool IsUIDUsed(int uid)
Определения StateManager.c:185
bool m_ShowDebug2
Определения StateManager.c:71
PlayerBase m_Player
Определения StateManager.c:49
void QueueUpSecondarySymptom(int symptom_id, int uid=-1)
Определения StateManager.c:508
int GetSymptomMaxCount(int symptom_id)
Определения StateManager.c:399
void OnPlayerKilled()
Определения StateManager.c:129
void AutoactivateSymptoms()
Определения StateManager.c:101
ref SmptAnimMetaBase m_AnimMeta
Определения StateManager.c:73
void OnStoreSave(ParamsWriteContext ctx)
Определения StateManager.c:623
int GetStorageVersion()
Определения StateManager.c:95
ref map< int, int > m_ActiveSymptomTypes
Определения StateManager.c:51
void Init()
Определения StateManager.c:75
int GetCurrentCommandID()
Определения StateManager.c:219
bool IsSymptomPrimary(int symptom_id)
Определения StateManager.c:210
int CreateUniqueID()
Определения StateManager.c:176
ref array< ref Param > m_SymptomQueueServerDbg
Определения StateManager.c:59
string GetSymptomName(int symptom_id)
Определения StateManager.c:190
int GetSymptomPriority(int symptom_id)
Определения StateManager.c:585
void OnSymptomExit(SymptomBase Symptom, int uid)
Определения StateManager.c:354
ref array< ref Param > m_SymptomQueueServerDbgPrimary
Определения StateManager.c:60
ref map< int, ref SymptomBase > m_AvailableSymptoms
Определения StateManager.c:50
SymptomBase GetCurrentPrimaryActiveSymptom()
Определения StateManager.c:543
SymptomBase QueueUpSecondarySymptomEx(int symptom_id, int uid=-1)
Определения StateManager.c:513
bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения StateManager.c:646
void OnTick(float deltatime, int pCurrentCommandID, HumanMovementState movement_state)
Определения StateManager.c:224
void RemoveSecondarySymptom(int symptom_id)
Removes a single Symptom.
Определения StateManager.c:531
SymptomBase QueueUpPrimarySymptom(int symptom_id, int uid=-1)
Определения StateManager.c:473
ref array< ref SymptomBase > m_SymptomQueueSecondary
Определения StateManager.c:54
void IncreaseSymptomCount(int symptom_id)
Определения StateManager.c:413
int m_CurrentCommandID
Определения StateManager.c:66
int m_ActiveSymptomIndexPrimary
Определения StateManager.c:65
ref array< ref SymptomBase > m_SymptomQueuePrimary
Определения StateManager.c:53
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)
Определения StateManager.c:162
ref array< ref Param > m_SymptomQueueServerDbgSecondary
Определения StateManager.c:61
SmptAnimMetaBase SpawnAnimMetaObject(int symptom_id)
Определения StateManager.c:195
void SymptomManager(PlayerBase player)
Определения StateManager.c:111
SymptomBase SpawnSymptom(int symptom_id, int uid=-1)
Определения StateManager.c:436
void UpdateActiveSymptoms(float deltatime)
Определения StateManager.c:323
int FindFirstAvailableSymptomIndex()
Определения StateManager.c:560
void OnRPC(int rpc_type, ParamsReadContext ctx)
Определения StateManager.c:590
void RequestSymptomExit(int SYMPTOM_uid)
Exits a specific Symptom with a given UID.
Определения StateManager.c:204
SymptomBase GetSymptomByUID(int SYMPTOM_uid)
Определения StateManager.c:138
void CleanUpPrimaryQueue()
Определения StateManager.c:465
void RegisterSymptom(SymptomBase Symptom)
Определения StateManager.c:148
void OnAnimationStarted()
Определения StateManager.c:170
PlayerBase GetPlayer()
Определения StateManager.c:143
int ComparePriority(int prio1, int prio2)
Определения StateManager.c:572
bool CanUpdateSymptom(SymptomBase symptom)
Определения StateManager.c:673
bool m_ShowDebug
Определения StateManager.c:70
ref map< int, SymptomBase > m_SymptomsUIDs
Определения StateManager.c:56
ref Timer m_Timer
Определения StateManager.c:63
Определения DayZPlayerImplement.c:39
Определения VomitState.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения CachedEquipmentStorage.c:4
Serializer ParamsReadContext
Определения gameplay.c:15
Serializer ParamsWriteContext
Определения gameplay.c:16
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
enum ShapeType ErrorEx
@ ADDITIVE
Определения EnDebug.c:137
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto float GetRangeValue(int id)
Get range value at the given script id.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].