simple deaths

This commit is contained in:
Axwabo 2023-01-28 10:03:50 +01:00
parent 9799fdd8a7
commit fb2167e223
2 changed files with 13 additions and 5 deletions

View File

@ -10,13 +10,13 @@ public sealed class DeathLogPlugin {
[PluginEntryPoint("DeathLog", "1.0.0", "DeathLog", "Axwabo")]
public void OnEnabled() {
PluginAPI.Events.EventManager.RegisterEvents(this);
Log.Debug("DeathLog loaded!");
Log.Info("DeathLog loaded!");
}
[PluginUnload]
public void OnDisabled() {
PluginAPI.Events.EventManager.UnregisterEvents(this);
Log.Debug("DeathLog disabled!");
Log.Info("DeathLog disabled!");
}
[PluginConfig]

View File

@ -24,9 +24,17 @@ public static class LogHandler {
or ItemType.ParticleDisruptor
or ItemType.Jailbird;
public static void LogSimpleDeathMessage(Player player, DamageHandlerBase handler) {
throw new System.NotImplementedException();
}
public static void LogSimpleDeathMessage(Player player, DamageHandlerBase handler) => Log("DEATH LOG" + "#" + string.Format(
GetDeathMessage(handler),
GetVictimStatus(player)
), true);
private static string GetDeathMessage(DamageHandlerBase handler) => handler switch {
CustomReasonDamageHandler custom => $"{{0}} has died: {custom._deathReason.Bold().Color("orange").Size(30)}",
UniversalDamageHandler universal => $"{{0}} has died. Reason: {universal._logsText.TrimEnd('.').Bold().Color("orange").Size(30)}",
WarheadDamageHandler => $"{{0}} died to {"the Alpha Warhead".Bold().Color("orange").Size(30)}",
_ => $"{{0}} has died. {"Reason is unknown".Italic()}"
};
public static void LogAttackerDeathMessage(Player victim, Player attacker, AttackerDamageHandler handler) {
var isCuffed = victim.IsDisarmed;