Client LuaCsForBarotrauma
CauseOfDeath.cs
1 using System;
2 
3 namespace Barotrauma
4 {
6  {
8  }
9 
11  {
12  public readonly CauseOfDeathType Type;
13  public readonly AfflictionPrefab Affliction;
14  public readonly Character Killer;
15  public readonly Entity DamageSource;
16 
17  public CauseOfDeath(CauseOfDeathType type, AfflictionPrefab affliction, Character killer, Entity damageSource)
18  {
19  if (type == CauseOfDeathType.Affliction && affliction == null)
20  {
21  string errorMsg = "Invalid cause of death (the type of the cause of death was Affliction, but affliction was not specified).\n" + Environment.StackTrace.CleanupStackTrace();
22  DebugConsole.ThrowError(errorMsg);
23  GameAnalyticsManager.AddErrorEventOnce("InvalidCauseOfDeath", GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
24  type = CauseOfDeathType.Unknown;
25  }
26 
27  Type = type;
28  Affliction = affliction;
29  Killer = killer;
30  DamageSource = damageSource;
31  }
32  }
33 }
AfflictionPrefab is a prefab that defines a type of affliction that can be applied to a character....
readonly Character Killer
Definition: CauseOfDeath.cs:14
readonly AfflictionPrefab Affliction
Definition: CauseOfDeath.cs:13
readonly CauseOfDeathType Type
Definition: CauseOfDeath.cs:12
readonly Entity DamageSource
Definition: CauseOfDeath.cs:15
CauseOfDeath(CauseOfDeathType type, AfflictionPrefab affliction, Character killer, Entity damageSource)
Definition: CauseOfDeath.cs:17