132 symptomPrimary.OnOwnerKilled();
135 symptomSecondary.OnOwnerKilled();
155 ErrorEx(
string.Format(
"Symptom %1 already registered!", Symptom.
GetName()));
198 animMeta.m_StateType = symptom_id;
270 #ifdef DIAG_DEVELOPER
278 DisplayDebug1(
"Symptoms Client", 50, primary_debug, secondary_debug);
280 ShowAvailableSymptoms();
284 CleanDebug1(
"Symptoms Client", 50);
285 CleanDebug2(
"Symptoms Server", 300);
286 CleanAvailableSymptoms();
312 if (ctx.
Read(state_type))
366 Debug.
LogError(
"Symptom with this UID does not exist",
"PlayerSymptoms");
391 m_Player.SetActivePrimarySymptomID(0);
393 #ifdef DIAG_DEVELOPER
394 if (
GetGame() ) SendServerDebugToClient();
449 ErrorEx(
string.Format(
"Symptoms: Unique ID (=%1) already exists!", uid));
459 Error(
"Symptom not registered");
469 symptom.RequestDestroy();
502 #ifdef DIAG_DEVELOPER
503 SendServerDebugToClient();
552 if ( !
GetGame().IsDedicatedServer() )
578 else if ( prio2 > prio1 )
598 if ( rpc_type ==
ERPCs.RPC_PLAYER_SYMPTOM_ON )
610 else if ( rpc_type ==
ERPCs.RPC_PLAYER_SYMPTOM_OFF )
643 ctx.
Write( m_SaveQueue );
650 if (ctx.
Read(m_SaveQueue))
652 for (
int i = 0; i < m_SaveQueue.Count(); i++ )
654 int id = m_SaveQueue.Get(i);
678 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_ON:
694 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG_OFF:
696 if (ctx.
Read(CachedObjectsParams.PARAM1_INT))
701 case ERPCs.DIAG_PLAYER_SYMPTOMS_DEBUG:
703 int primary_Symptoms_count;
704 int secondary_Symptoms_count;
708 if (ctx.
Read(CachedObjectsParams.PARAM1_INT))
710 primary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
713 if (ctx.
Read(CachedObjectsParams.PARAM1_INT))
715 secondary_Symptoms_count = CachedObjectsParams.PARAM1_INT.param1;
722 int overall_count = primary_Symptoms_count + secondary_Symptoms_count;
723 for (
int i = 0; i < overall_count ; ++i)
725 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
727 bool is_primary = p3.param1;
752 void SendServerDebugToClient()
754 array<ref Param> debug_list =
new array<ref Param>;
756 Param1<int> p1 =
new Param1<int>(0);
757 Param1<int> p2 =
new Param1<int>(0);
762 debug_list.Insert(p1);
763 debug_list.Insert(p2);
765 Param3<bool,int,int> p;
773 is_primary = symptom.IsPrimary();
774 symptom_id = symptom.GetType();
775 SYMPTOM_uid = symptom.GetUID();
777 p =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
778 debug_list.Insert(p);
783 is_primary = secSymptom.IsPrimary();
784 symptom_id = secSymptom.GetType();
785 SYMPTOM_uid = secSymptom.GetUID();
787 p =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
788 debug_list.Insert(p);
794 void DebugRequestExitSymptom(
int SYMPTOM_uid)
796 CachedObjectsParams.PARAM1_INT.param1 = SYMPTOM_uid;
801 array<ref Param> PrepareClientDebug(array<ref SymptomBase> Symptoms)
803 array<ref Param> debug_array =
new array<ref Param>;
805 Param3<bool, int, int> p3;
807 for (
int i = 0; i < Symptoms.Count(); i++)
809 bool is_primary = Symptoms.Get(i).IsPrimary();
810 int symptom_id = Symptoms.Get(i).GetType();
811 int SYMPTOM_uid = Symptoms.Get(i).GetUID();
813 p3 =
new Param3<bool,int,int>(is_primary, symptom_id, SYMPTOM_uid );
814 debug_array.Insert(p3);
819 void DisplayDebug1(
string name,
int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
822 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
824 DbgUI.BeginCleanupScope();
825 DbgUI.Begin(
name, 50, y_offset);
826 DbgUI.Text(
"Primary: ");
833 for (
int i = 0; i < Symptoms_primary.Count(); i++)
835 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
837 is_primary = p3.param1;
838 symptom_id = p3.param2;
839 SYMPTOM_uid = p3.param3;
842 primary += SYMPTOM_name +
" | ";
846 DbgUI.Text(
"Secondary: ");
847 for (i = 0; i < Symptoms_secondary.Count(); i++)
849 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
851 is_primary = p3.param1;
852 symptom_id = p3.param2;
853 SYMPTOM_uid = p3.param3;
855 DbgUI.Text(SYMPTOM_name);
859 DbgUI.EndCleanupScope();
862 void DisplayDebug2(
string name,
int y_offset, array<ref Param> Symptoms_primary, array<ref Param> Symptoms_secondary)
865 Param3<bool, int, int> p3 =
new Param3<bool, int, int>(
false,0,0);
867 DbgUI.BeginCleanupScope();
868 DbgUI.Begin(
name, 50, y_offset);
869 DbgUI.Text(
"Primary: ");
876 for (
int i = 0; i < Symptoms_primary.Count(); i++)
878 p3 = Param3<bool, int, int>.Cast(Symptoms_primary.Get(i));
880 is_primary = p3.param1;
881 symptom_id = p3.param2;
882 SYMPTOM_uid = p3.param3;
885 if (DbgUI.Button( i.ToString() +
" " + SYMPTOM_name, 80))
887 DebugRequestExitSymptom(SYMPTOM_uid);
891 DbgUI.Text(
"Secondary: ");
892 for (i = 0; i < Symptoms_secondary.Count(); i++)
894 p3 = Param3<bool, int, int>.Cast(Symptoms_secondary.Get(i));
896 is_primary = p3.param1;
897 symptom_id = p3.param2;
898 SYMPTOM_uid = p3.param3;
901 if (DbgUI.Button( i.ToString() +
" " + SYMPTOM_name, 80))
903 DebugRequestExitSymptom(SYMPTOM_uid);
908 DbgUI.EndCleanupScope();
911 void ShowAvailableSymptoms()
913 DbgUI.BeginCleanupScope();
914 DbgUI.Begin(
"available Symptoms", 300, 50);
919 string SYMPTOM_name = Symptom.
GetName();
920 int symptom_id = Symptom.
GetType();
922 if (DbgUI.Button( i.ToString() +
" " + SYMPTOM_name, 80))
924 DebugRequestActivateSymptom(symptom_id);
929 DbgUI.EndCleanupScope();
932 void CleanAvailableSymptoms()
934 DbgUI.BeginCleanupScope();
935 DbgUI.Begin(
"available Symptoms", 300, 50);
937 DbgUI.EndCleanupScope();
940 void CleanDebug1(
string name,
int y_offset)
942 DbgUI.BeginCleanupScope();
943 DbgUI.Begin(
name, 50, y_offset);
945 DbgUI.EndCleanupScope();
948 void CleanDebug2(
string name,
int y_offset)
950 DbgUI.BeginCleanupScope();
951 DbgUI.Begin(
name, 50, y_offset);
953 DbgUI.EndCleanupScope();
956 void DebugRequestActivateSymptom(
int symptom_id)
958 CachedObjectsParams.PARAM1_INT.param1 = symptom_id;
@ OK
0 - No error. Can be returned from any call.
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override SmptAnimMetaBase SpawnAnimMetaObject()
override bool CanActivate()
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
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_HMP_SEVERE
enum AnimType SYMPTOM_HOT
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
static ref Param2< int, int > PARAM2_INT_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.
proto bool Write(void value_out)
proto bool Read(void value_in)
bool AllowInUnconscious()
void Init(SymptomManager manager, PlayerBase player, int uid)
void Update(float deltatime)
const int STORAGE_VERSION
int GetSymptomCount(int symptom_id)
void DecreaseSymptomCount(int symptom_id)
void SetAnimation(ParamsReadContext ctx)
void OnInputUserDataReceived(ParamsReadContext ctx)
void QueueUpSecondarySymptom(int symptom_id, int uid=-1)
int GetSymptomMaxCount(int symptom_id)
void AutoactivateSymptoms()
ref SmptAnimMetaBase m_AnimMeta
void OnStoreSave(ParamsWriteContext ctx)
ref map< int, int > m_ActiveSymptomTypes
int GetCurrentCommandID()
bool IsSymptomPrimary(int symptom_id)
ref array< ref Param > m_SymptomQueueServerDbg
string GetSymptomName(int symptom_id)
int GetSymptomPriority(int symptom_id)
void OnSymptomExit(SymptomBase Symptom, int uid)
ref array< ref Param > m_SymptomQueueServerDbgPrimary
ref map< int, ref SymptomBase > m_AvailableSymptoms
SymptomBase GetCurrentPrimaryActiveSymptom()
SymptomBase QueueUpSecondarySymptomEx(int symptom_id, int uid=-1)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnTick(float deltatime, int pCurrentCommandID, HumanMovementState movement_state)
void RemoveSecondarySymptom(int symptom_id)
Removes a single Symptom.
SymptomBase QueueUpPrimarySymptom(int symptom_id, int uid=-1)
ref array< ref SymptomBase > m_SymptomQueueSecondary
void IncreaseSymptomCount(int symptom_id)
int m_ActiveSymptomIndexPrimary
ref array< ref SymptomBase > m_SymptomQueuePrimary
void OnAnimationFinished(eAnimFinishType type=eAnimFinishType.SUCCESS)
ref array< ref Param > m_SymptomQueueServerDbgSecondary
SmptAnimMetaBase SpawnAnimMetaObject(int symptom_id)
void SymptomManager(PlayerBase player)
SymptomBase SpawnSymptom(int symptom_id, int uid=-1)
void UpdateActiveSymptoms(float deltatime)
int FindFirstAvailableSymptomIndex()
void OnRPC(int rpc_type, ParamsReadContext ctx)
void RequestSymptomExit(int SYMPTOM_uid)
Exits a specific Symptom with a given UID.
SymptomBase GetSymptomByUID(int SYMPTOM_uid)
void CleanUpPrimaryQueue()
void RegisterSymptom(SymptomBase Symptom)
void OnAnimationStarted()
int ComparePriority(int prio1, int prio2)
ref map< int, SymptomBase > m_SymptomsUIDs
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].