Skip to content

Commit

Permalink
Version 1.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Dec 15, 2023
1 parent 41d51a1 commit fba8488
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
Binary file added Art/Nutcracker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog

# 1.3.0
## Additions
- Additional death messages for other death types.
- Added new death messages for the enemies from v45.
## Fixed
- Fixed some bugs related to v45.

# 1.2.0
## Additions
Expand Down
13 changes: 8 additions & 5 deletions Coroner/AdvancedCauseOfDeath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ public static string[] SelectCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath)
};
case AdvancedCauseOfDeath.Gunshots:
return new[] {
"Shot to death by a Turret.",
"Shot to death.",
"Filled to the brim with bullets.",
};
case AdvancedCauseOfDeath.Crushing:
return new[] {
Expand Down Expand Up @@ -281,7 +282,7 @@ public static string[] SelectCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath)
};
case AdvancedCauseOfDeath.Enemy_SnareFlea:
return new[] {
"Was suffocated a Snare Flea.",
"Was suffocated by a Snare Flea.",
};
case AdvancedCauseOfDeath.Enemy_Hygrodere:
return new[] {
Expand Down Expand Up @@ -345,9 +346,11 @@ public static string[] SelectCauseOfDeath(AdvancedCauseOfDeath? causeOfDeath)
};
case AdvancedCauseOfDeath.Player_Murder_Shotgun:
return new[] {
"Was the victim of a murder.",
"Got murdered.",
"Was shot to death by a coworker.",
// "Was the victim of a murder.",
// "Got murdered.",
// "Was shot to death by a coworker.",
// "Got one-pumped by a coworker.",
"Got 360-noscoped by a coworker.",
};
case AdvancedCauseOfDeath.Player_Quicksand:
return new[] {
Expand Down
16 changes: 7 additions & 9 deletions Coroner/Patch/CauseOfDeathPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ public static void Postfix(PlayerControllerB __instance, int playerWhoHit) {
if (__instance.causeOfDeath == CauseOfDeath.Bludgeoning) {
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Melee);
} else if (__instance.causeOfDeath == CauseOfDeath.Mauling) {
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Melee);
} else if (__instance.causeOfDeath == CauseOfDeath.Gunshots) {
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
AdvancedDeathTracker.SetCauseOfDeath(__instance, AdvancedCauseOfDeath.Player_Murder_Shotgun);
Expand Down Expand Up @@ -391,7 +394,6 @@ public static void Postfix(ShotgunItem __instance, Vector3 shotgunPosition, Vect
return;
}
if (localPlayerController.isPlayerDead && localPlayerController.causeOfDeath == CauseOfDeath.Gunshots) {

if (__instance.isHeldByEnemy) {
// Enemy Nutcracker fired the shotgun.
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
Expand All @@ -402,7 +404,7 @@ public static void Postfix(ShotgunItem __instance, Vector3 shotgunPosition, Vect
AdvancedDeathTracker.SetCauseOfDeath(localPlayerController, AdvancedCauseOfDeath.Player_Murder_Shotgun);
}
} else if (localPlayerController.isPlayerDead) {
Plugin.Instance.PluginLogger.LogWarning("Player died while attacked by shotgun? Skipping...");
Plugin.Instance.PluginLogger.LogWarning("Player died while attacked by shotgun? Skipping... " + localPlayerController.causeOfDeath);
return;
}
}
Expand All @@ -420,13 +422,9 @@ public static void Postfix(MaskedPlayerEnemy __instance) {
return;
}

if (playerControllerB.isPlayerDead) {
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
AdvancedDeathTracker.SetCauseOfDeath(playerControllerB, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Victim);
} else {
Plugin.Instance.PluginLogger.LogWarning("Player is somehow still alive! Skipping...");
return;
}
// playerControllerB.isPlayerDead is false here but we just assume they will die here.
Plugin.Instance.PluginLogger.LogInfo("Player is now dead! Setting special cause of death...");
AdvancedDeathTracker.SetCauseOfDeath(playerControllerB, AdvancedCauseOfDeath.Enemy_MaskedPlayer_Victim);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Coroner/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class PluginInfo
{
public const string PLUGIN_ID = "Coroner";
public const string PLUGIN_NAME = "Coroner";
public const string PLUGIN_VERSION = "1.0.0";
public const string PLUGIN_VERSION = "1.3.0";
public const string PLUGIN_GUID = "com.elitemastereric.coroner";
}

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

A plugin which overhauls the end-of-mission Performance Report with new information, including cause of death for any deceased players. There are some fun easter eggs thrown in too.

Supports v45.

**NOTE:** [LC_API](https://thunderstore.io/c/lethal-company/p/2018/LC_API/) is an optional but highly recommended dependency!

## Issues
Report any issues on the [Lethal Company Modding Discord](https://discord.com/channels/1168655651455639582/1180049504418930709).

## Demonstration
![](https://raw.githubusercontent.com/EliteMasterEric/Coroner/master/Art/StungByBees.png)
![](https://raw.githubusercontent.com/EliteMasterEric/Coroner/master/Art/Nutcracker.png)

## Notice
- Supports More Company's changes to the Performance Report.
Expand Down

0 comments on commit fba8488

Please sign in to comment.