Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions StatsSystem/Events/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@ public override void OnPlayerDeath(PlayerDeathEventArgs ev)
if (!Round.IsRoundStarted) return;
if (ev.Player.DoNotTrack) return;
LogManager.Debug($"Player {ev.Player.UserId} died. Attacker: {ev.Attacker?.UserId ?? "None"}");
if (StatsSystemPlugin.Singleton.Config.KillsTracking)
ev.Attacker?.IncrementStat("Kills");
if (StatsSystemPlugin.Singleton.Config.KillsTracking && ev.Attacker != null)
ev.Attacker.IncrementStat("Kills");
if (StatsSystemPlugin.Singleton.Config.DeathsTracking)
ev.Player.IncrementStat("Deaths");
if (ev.OldRole is RoleTypeId.ClassD && StatsSystemPlugin.Singleton.Config.ClassDKillsTracking)
ev.Attacker?.IncrementStat("ClassDKills");
if (ev.Attacker?.Role is RoleTypeId.ClassD && StatsSystemPlugin.Singleton.Config.KillsAsClassDTracking)
ev.Attacker?.IncrementStat("KillsAsClassD");
if (ev.OldRole.IsScp() && StatsSystemPlugin.Singleton.Config.ScpKillsTracking)
ev.Attacker?.IncrementStat("ScpKills");
if (ev.DamageHandler is MicroHidDamageHandler && StatsSystemPlugin.Singleton.Config.MicroHidKillsTracking)
ev.Attacker?.IncrementStat("MicroHidKills");
if (ev.OldRole is RoleTypeId.ClassD && StatsSystemPlugin.Singleton.Config.ClassDKillsTracking && ev.Attacker != null)
ev.Attacker.IncrementStat("ClassDKills");
if (ev.Attacker is { Role: RoleTypeId.ClassD } && StatsSystemPlugin.Singleton.Config.KillsAsClassDTracking)
ev.Attacker.IncrementStat("KillsAsClassD");
if (ev.OldRole.IsScp() && StatsSystemPlugin.Singleton.Config.ScpKillsTracking && ev.Attacker != null)
ev.Attacker.IncrementStat("ScpKills");
if (ev.DamageHandler is MicroHidDamageHandler && StatsSystemPlugin.Singleton.Config.MicroHidKillsTracking && ev.Attacker != null)
ev.Attacker.IncrementStat("MicroHidKills");
base.OnPlayerDeath(ev);
}

Expand Down
6 changes: 3 additions & 3 deletions StatsSystem/StatsSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Northwood.LabAPI">
<Version>1.1.4</Version>
</PackageReference>
<PackageReference Include="System.Net.Http">
<Version>4.3.4</Version>
</PackageReference>
Expand All @@ -51,9 +54,6 @@
<Reference Include="CommandSystem.Core">
<HintPath>$(sl_references)\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="LabApi">
<HintPath>$(sl_references)\LabApi.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(sl_references)\UnityEngine.CoreModule.dll</HintPath>
</Reference>
Expand Down
2 changes: 1 addition & 1 deletion StatsSystem/StatsSystemPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal class StatsSystemPlugin : Plugin<Config>
public override string Name => "StatsSystem";
public override string Description => "StatSystem";
public override string Author => "MedveMarci";
public override Version Version { get; } = new(1, 1, 2);
public override Version Version { get; } = new(1, 1, 3);
public override Version RequiredApiVersion => new(LabApiProperties.CompiledVersion);
public override bool IsTransparent => true;
public string githubRepo = "MedveMarci/StatsSystem";
Expand Down