153 Error(
"SymptomBase Symptom already registered !");
253 #ifdef DIAG_DEVELOPER
261 DisplayDebug1(
"Symptoms Client", 50, primary_debug, secondary_debug);
263 ShowAvailableSymptoms();
267 CleanDebug1(
"Symptoms Client", 50);
268 CleanDebug2(
"Symptoms Server", 300);
269 CleanAvailableSymptoms();
285 if (ctx.
Read(state_type))
342 Debug.
LogError(
"Symptom with this UID does not exist",
"PlayerSymptoms");
368 #ifdef DIAG_DEVELOPER
369 if (
GetGame() ) SendServerDebugToClient();
422 Error(
"Symptoms: Unique ID already exists !");
430 Error(
"Symptom not registered");
469 #ifdef DIAG_DEVELOPER
470 SendServerDebugToClient();
516 if ( !
GetGame().IsDedicatedServer() )
542 else if ( prio2 > prio1 )
562 if ( rpc_type ==
ERPCs.RPC_PLAYER_SYMPTOM_ON )
574 else if ( rpc_type ==
ERPCs.RPC_PLAYER_SYMPTOM_OFF )
607 ctx.
Write( m_SaveQueue );
614 if (ctx.
Read(m_SaveQueue))
616 for (
int i = 0; i < m_SaveQueue.Count(); i++ )
618 int id = m_SaveQueue.Get(i);
642 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON:
658 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF:
665 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG:
667 int primary_Symptoms_count;
668 int secondary_Symptoms_count;
686 int overall_count = primary_Symptoms_count + secondary_Symptoms_count;
687 for (
int i = 0; i < overall_count ; ++i)
689 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
691 bool is_primary = p3.param1;
716 void SendServerDebugToClient()
720 Param1<int> p1 =
new Param1<int>(0);
721 Param1<int> p2 =
new Param1<int>(0);
726 debug_list.Insert(p1);
727 debug_list.Insert(p2);
729 Param3<bool,int,int> p;
737 is_primary = symptom.IsPrimary();
738 symptom_id = symptom.GetType();
739 SYMPTOM_uid = symptom.GetUID();
741 p =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
742 debug_list.Insert(p);
747 is_primary = secSymptom.IsPrimary();
748 symptom_id = secSymptom.GetType();
749 SYMPTOM_uid = secSymptom.GetUID();
751 p =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
752 debug_list.Insert(p);
758 void DebugRequestExitSymptom(
int SYMPTOM_uid)
769 Param3<bool, int, int> p3;
771 for (
int i = 0; i < Symptoms.Count(); i++)
773 bool is_primary = Symptoms.Get(i).IsPrimary();
774 int symptom_id = Symptoms.Get(i).GetType();
775 int SYMPTOM_uid = Symptoms.Get(i).GetUID();
777 p3 =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
778 debug_array.Insert(p3);
786 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
797 for (
int i = 0; i < Symptoms_primary.Count(); i++)
799 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
801 is_primary = p3.param1;
802 symptom_id = p3.param2;
803 SYMPTOM_uid = p3.param3;
806 primary += SYMPTOM_name +
" | ";
811 for (i = 0; i < Symptoms_secondary.Count(); i++)
813 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
815 is_primary = p3.param1;
816 symptom_id = p3.param2;
817 SYMPTOM_uid = p3.param3;
829 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
840 for (
int i = 0; i < Symptoms_primary.Count(); i++)
842 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
844 is_primary = p3.param1;
845 symptom_id = p3.param2;
846 SYMPTOM_uid = p3.param3;
849 if (
DbgUI.
Button( i.ToString() +
" " + SYMPTOM_name, 80))
851 DebugRequestExitSymptom(SYMPTOM_uid);
856 for (i = 0; i < Symptoms_secondary.Count(); i++)
858 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
860 is_primary = p3.param1;
861 symptom_id = p3.param2;
862 SYMPTOM_uid = p3.param3;
865 if (
DbgUI.
Button( i.ToString() +
" " + SYMPTOM_name, 80))
867 DebugRequestExitSymptom(SYMPTOM_uid);
875 void ShowAvailableSymptoms()
883 string SYMPTOM_name = Symptom.
GetName();
884 int symptom_id = Symptom.
GetType();
886 if (
DbgUI.
Button( i.ToString() +
" " + SYMPTOM_name, 80))
888 DebugRequestActivateSymptom(symptom_id);
896 void CleanAvailableSymptoms()
904 void CleanDebug1(
string name,
int y_offset)
912 void CleanDebug2(
string name,
int y_offset)
920 void DebugRequestActivateSymptom(
int symptom_id)
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_HAND_SHIVER
const int DEBUG_PADDING_OFFSET
enum AnimType SYMPTOM_FEVERBLUR
enum AnimType SYMPTOM_FREEZE
enum AnimType SYMPTOM_BLOODLOSS
enum AnimType SYMPTOM_LAUGHTER
enum AnimType SYMPTOM_COUGH
enum AnimType SYMPTOM_PAIN_HEAVY
enum AnimType SYMPTOM_SNEEZE
enum AnimType SYMPTOM_HOT
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...
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
static ref Param2< int, int > PARAM2_INT_INT
static ref Param1< int > PARAM1_INT
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.
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
void Update(float deltatime)
void Init(SymptomManager manager, PlayerBase player, int uid)
void SetAnimation(ParamsReadContext ctx)
void QueueUpSecondarySymptom(int symptom_id, int uid=-1)
ref array< ref Param > m_SymptomQueueServerDbgPrimary
void OnRPC(int rpc_type, ParamsReadContext ctx)
ref map< int, int > m_ActiveSymptomTypes
void RequestSymptomExit(int SYMPTOM_uid)
Exits a specific Symptom with a given UID.
void IncreaseSymptomCount(int symptom_id)
ref array< ref Param > m_SymptomQueueServerDbg
SymptomBase QueueUpSecondarySymptomEx(int symptom_id, int uid=-1)
const int STORAGE_VERSION
int m_ActiveSymptomIndexPrimary
SymptomBase GetCurrentPrimaryActiveSymptom()
void RemoveSecondarySymptom(int symptom_id)
Removes a single Symptom.
ref array< ref SymptomBase > m_SymptomQueueSecondary
int GetSymptomPriority(int symptom_id)
SymptomBase SpawnSymptom(int symptom_id, int uid=-1)
void OnTick(float deltatime, int pCurrentCommandID, HumanMovementState movement_state)
int GetSymptomCount(int symptom_id)
ref array< ref SymptomBase > m_SymptomQueuePrimary
int ComparePriority(int prio1, int prio2)
void UpdateActiveSymptoms(float deltatime)
SymptomBase QueueUpPrimarySymptom(int symptom_id, int uid=-1)
int GetCurrentCommandID()
ref map< int, SymptomBase > m_SymptomsUIDs
ref SmptAnimMetaBase m_AnimMeta
bool IsSymptomPrimary(int symptom_id)
SymptomBase GetSymptomByUID(int SYMPTOM_uid)
int GetSymptomMaxCount(int symptom_id)
void OnAnimationStarted()
void AutoactivateSymptoms()
void OnInputUserDataReceived(ParamsReadContext ctx)
string GetSymptomName(int symptom_id)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)
void DecreaseSymptomCount(int symptom_id)
int FindFirstAvailableSymptomIndex()
void OnStoreSave(ParamsWriteContext ctx)
void OnSymptomExit(SymptomBase Symptom, int uid)
SmptAnimMetaBase SpawnAnimMetaObject(int symptom_id)
void CleanUpPrimaryQueue()
void RegisterSymptom(SymptomBase Symptom)
ref map< int, ref SymptomBase > m_AvailableSymptoms
void SymptomManager(PlayerBase player)
ref array< ref Param > m_SymptomQueueServerDbgSecondary
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
void Update(float timeslice)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static proto native bool Button(string txt, int minWidth=0)
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto void BeginCleanupScope()
static proto native void Text(string label)
static proto native void EndCleanupScope()
static proto native void End()
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].