simple deaths
This commit is contained in:
parent
9799fdd8a7
commit
fb2167e223
@ -10,13 +10,13 @@ public sealed class DeathLogPlugin {
|
|||||||
[PluginEntryPoint("DeathLog", "1.0.0", "DeathLog", "Axwabo")]
|
[PluginEntryPoint("DeathLog", "1.0.0", "DeathLog", "Axwabo")]
|
||||||
public void OnEnabled() {
|
public void OnEnabled() {
|
||||||
PluginAPI.Events.EventManager.RegisterEvents(this);
|
PluginAPI.Events.EventManager.RegisterEvents(this);
|
||||||
Log.Debug("DeathLog loaded!");
|
Log.Info("DeathLog loaded!");
|
||||||
}
|
}
|
||||||
|
|
||||||
[PluginUnload]
|
[PluginUnload]
|
||||||
public void OnDisabled() {
|
public void OnDisabled() {
|
||||||
PluginAPI.Events.EventManager.UnregisterEvents(this);
|
PluginAPI.Events.EventManager.UnregisterEvents(this);
|
||||||
Log.Debug("DeathLog disabled!");
|
Log.Info("DeathLog disabled!");
|
||||||
}
|
}
|
||||||
|
|
||||||
[PluginConfig]
|
[PluginConfig]
|
||||||
|
@ -24,9 +24,17 @@ public static class LogHandler {
|
|||||||
or ItemType.ParticleDisruptor
|
or ItemType.ParticleDisruptor
|
||||||
or ItemType.Jailbird;
|
or ItemType.Jailbird;
|
||||||
|
|
||||||
public static void LogSimpleDeathMessage(Player player, DamageHandlerBase handler) {
|
public static void LogSimpleDeathMessage(Player player, DamageHandlerBase handler) => Log("DEATH LOG" + "#" + string.Format(
|
||||||
throw new System.NotImplementedException();
|
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) {
|
public static void LogAttackerDeathMessage(Player victim, Player attacker, AttackerDamageHandler handler) {
|
||||||
var isCuffed = victim.IsDisarmed;
|
var isCuffed = victim.IsDisarmed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user