DayZ 1.27
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 ( GetGame().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 {
325 //if( GetGame().IsClient() && !m_Player.IsPlayer() ) return;
326 //primary
328 {
329 if ( !GetCurrentPrimaryActiveSymptom().IsActivated() )
330 {
333 }
334 if ( GetCurrentPrimaryActiveSymptom().IsActivated() )
335 {
337 }
338 }
339 //secondary
340 for (int i = 0; i < m_SymptomQueueSecondary.Count(); i++)
341 {
342 if ( m_SymptomQueueSecondary.Get(i) && !m_SymptomQueueSecondary.Get(i).IsActivated() )
343 {
344 m_SymptomQueueSecondary.Get(i).Activate();
345 }
346 else
347 {
348 if (m_SymptomQueueSecondary.Get(i)) m_SymptomQueueSecondary.Get(i).Update(deltatime);
349 }
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 ( GetGame() ) 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 ( GetGame().IsServer() )
546 {
548 {
550 }
551 }
552 if ( !GetGame().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#ifdef DIAG_DEVELOPER
674 void OnRPCDebug(int rpc_type, ParamsReadContext ctx)
675 {
676 switch (rpc_type)
677 {
678 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON:
679 {
681 {
683 {
685 }
686 else
687 {
688 QueueUpSecondarySymptom(CachedObjectsParams.PARAM1_INT.param1);
689 }
690 }
691 break;
692 }
693
694 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF:
695 {
696 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
697 RequestSymptomExit(CachedObjectsParams.PARAM1_INT.param1);
698 break;
699 }
700
701 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG:
702 {
703 int primary_Symptoms_count;
704 int secondary_Symptoms_count;
705
706 int symptom_id;
707
708 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
709 {
710 primary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
711 }
712
713 if (ctx.Read(CachedObjectsParams.PARAM1_INT))
714 {
715 secondary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
716 }
717
721
722 int overall_count = primary_Symptoms_count + secondary_Symptoms_count;
723 for (int i = 0; i < overall_count ; ++i)
724 {
725 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
726 ctx.Read(p3);
727 bool is_primary = p3.param1;
728
729 if (is_primary)
730 {
731 m_SymptomQueueServerDbgPrimary.Insert(p3);// m_SymptomQueueServerDbg.Insert(p3);
732 }
733 else
734 {
736 }
737 //PrintString("elements m_SymptomQueueServerDbgPrimary:" + m_SymptomQueueServerDbgPrimary.Count());
738 //PrintString("elements m_SymptomQueueServerDbgSecondary:" + m_SymptomQueueServerDbgSecondary.Count());
739
740 }
741 /*
742 for(i = 0; i < secondary_Symptoms_count; i++)
743 {
744 ctx.Read(CachedObjectsParams.PARAM1_STRING);
745 m_SymptomQueueSecondaryServerDbg.Insert(CachedObjectsParams.PARAM1_STRING.param1);
746 }*/
747 break;
748 }
749 }
750 }
751
752 void SendServerDebugToClient()
753 {
754 array<ref Param> debug_list = new array<ref Param>;
755
756 Param1<int> p1 = new Param1<int>(0);
757 Param1<int> p2 = new Param1<int>(0);
758
759 p1.param1 = m_SymptomQueuePrimary.Count();
760 p2.param1 = m_SymptomQueueSecondary.Count();
761
762 debug_list.Insert(p1);
763 debug_list.Insert(p2);
764
765 Param3<bool,int,int> p;
766
767 bool is_primary;
768 int symptom_id;
769 int SYMPTOM_uid;
770
771 foreach ( SymptomBase symptom : m_SymptomQueuePrimary )
772 {
773 is_primary = symptom.IsPrimary();
774 symptom_id = symptom.GetType();
775 SYMPTOM_uid = symptom.GetUID();
776
777 p = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
778 debug_list.Insert(p);
779 }
780
781 foreach ( SymptomBase secSymptom : m_SymptomQueueSecondary )
782 {
783 is_primary = secSymptom.IsPrimary();
784 symptom_id = secSymptom.GetType();
785 SYMPTOM_uid = secSymptom.GetUID();
786
787 p = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
788 debug_list.Insert(p);
789 }
790
791 GetGame().RPC(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG, debug_list, true);
792 }
793
794 void DebugRequestExitSymptom(int SYMPTOM_uid)
795 {
796 CachedObjectsParams.PARAM1_INT.param1 = SYMPTOM_uid;
797 if (GetPlayer())
798 GetGame().RPCSingleParam(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF, CachedObjectsParams.PARAM1_INT, true, GetPlayer().GetIdentity());
799 }
800
801 array<ref Param> PrepareClientDebug(array<ref SymptomBase> Symptoms)
802 {
803 array<ref Param> debug_array = new array<ref Param>;
804
805 Param3<bool, int, int> p3;
806
807 for (int i = 0; i < Symptoms.Count(); i++)
808 {
809 bool is_primary = Symptoms.Get(i).IsPrimary();
810 int symptom_id = Symptoms.Get(i).GetType();
811 int SYMPTOM_uid = Symptoms.Get(i).GetUID();
812
813 p3 = new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
814 debug_array.Insert(p3);
815 }
816 return debug_array;
817 }
818
819 void DisplayDebug1(string name, int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
820 {
821 string primary;
822 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
823
824 DbgUI.BeginCleanupScope();
825 DbgUI.Begin(name, 50, y_offset);
826 DbgUI.Text("Primary: ");
827
828 bool is_primary;
829 int symptom_id;
830 int SYMPTOM_uid;
831 string SYMPTOM_name;
832
833 for (int i = 0; i < Symptoms_primary.Count(); i++)
834 {
835 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
836
837 is_primary = p3.param1;
838 symptom_id = p3.param2;
839 SYMPTOM_uid = p3.param3;
840 SYMPTOM_name = GetSymptomName(symptom_id);
841
842 primary += SYMPTOM_name + " | ";
843 }
844
845 DbgUI.Text(primary);
846 DbgUI.Text("Secondary: ");
847 for (i = 0; i < Symptoms_secondary.Count(); i++)
848 {
849 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
850
851 is_primary = p3.param1;
852 symptom_id = p3.param2;
853 SYMPTOM_uid = p3.param3;
854 SYMPTOM_name = GetSymptomName(symptom_id);
855 DbgUI.Text(SYMPTOM_name);
856 }
857
858 DbgUI.End();
859 DbgUI.EndCleanupScope();
860 }
861
862 void DisplayDebug2(string name, int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
863 {
864 string primary;
865 Param3<bool, int, int> p3 = new Param3<bool, int, int>(false,0,0);
866
867 DbgUI.BeginCleanupScope();
868 DbgUI.Begin(name, 50, y_offset);
869 DbgUI.Text("Primary: ");
870
871 bool is_primary;
872 int symptom_id;
873 int SYMPTOM_uid;
874 string SYMPTOM_name;
875
876 for (int i = 0; i < Symptoms_primary.Count(); i++)
877 {
878 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
879
880 is_primary = p3.param1;
881 symptom_id = p3.param2;
882 SYMPTOM_uid = p3.param3;
883 SYMPTOM_name = GetSymptomName(symptom_id);
884
885 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
886 {
887 DebugRequestExitSymptom(SYMPTOM_uid);
888 }
889 }
890
891 DbgUI.Text("Secondary: ");
892 for (i = 0; i < Symptoms_secondary.Count(); i++)
893 {
894 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
895
896 is_primary = p3.param1;
897 symptom_id = p3.param2;
898 SYMPTOM_uid = p3.param3;
899 SYMPTOM_name = GetSymptomName(symptom_id);
900
901 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
902 {
903 DebugRequestExitSymptom(SYMPTOM_uid);
904 }
905 }
906
907 DbgUI.End();
908 DbgUI.EndCleanupScope();
909 }
910
911 void ShowAvailableSymptoms()
912 {
913 DbgUI.BeginCleanupScope();
914 DbgUI.Begin("available Symptoms", 300, 50);
915
916 for (int i = 0; i < m_AvailableSymptoms.Count(); i++)
917 {
918 SymptomBase Symptom = m_AvailableSymptoms.GetElement(i);
919 string SYMPTOM_name = Symptom.GetName();
920 int symptom_id = Symptom.GetType();
921
922 if (DbgUI.Button( i.ToString() + " " + SYMPTOM_name, 80))
923 {
924 DebugRequestActivateSymptom(symptom_id);
925 }
926 }
927
928 DbgUI.End();
929 DbgUI.EndCleanupScope();
930 }
931
932 void CleanAvailableSymptoms()
933 {
934 DbgUI.BeginCleanupScope();
935 DbgUI.Begin("available Symptoms", 300, 50);
936 DbgUI.End();
937 DbgUI.EndCleanupScope();
938 }
939
940 void CleanDebug1(string name, int y_offset)
941 {
942 DbgUI.BeginCleanupScope();
943 DbgUI.Begin(name, 50, y_offset);
944 DbgUI.End();
945 DbgUI.EndCleanupScope();
946 }
947
948 void CleanDebug2(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 DebugRequestActivateSymptom(int symptom_id)
957 {
958 CachedObjectsParams.PARAM1_INT.param1 = symptom_id;
959 if (GetPlayer())
960 GetGame().RPCSingleParam(GetPlayer(), ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON, CachedObjectsParams.PARAM1_INT, true, GetPlayer().GetIdentity());
961 }
962
963#endif
964}
@ FAILED
Определения Inventory.c:31
@ OK
0 - No error. Can be returned from any call.
Определения BIOSErrorModule.c:9
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
map
Определения ControlsXboxNew.c:4
DiagMenuIDs
Определения EDiagMenuIDs.c:2
ERPCs
Определения ERPCs.c:2
override SmptAnimMetaBase SpawnAnimMetaObject()
Определения FreezeState.c:147
override bool CanActivate()
Определения FreezeState.c:106
@ 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
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native void RPC(Object target, int rpcType, notnull array< ref Param > params, bool guaranteed, PlayerIdentity recipient=null)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
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.
Определения Debug.c:245
Определения Debug.c:2
Определения EnDebug.c:233
Определения human.c:1139
Определения 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:348
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 Update(float deltatime)
Определения StateBase.c:222
int GetType()
Определения StateBase.c:100
void AnimationStart()
Определения StateBase.c:333
Определения 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 m_ShowDebug
Определения StateManager.c:70
ref map< int, SymptomBase > m_SymptomsUIDs
Определения StateManager.c:56
ref Timer m_Timer
Определения StateManager.c:63
Определения DayZPlayerImplement.c:63
Определения VomitState.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
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].