IW4M-Admin/Plugins/SimpleStats/Helpers/StreakMessage.cs
RaidMax 88f31bc78c removed reload command
prevent control characters from being used in name
added MOD_HEAD_SHOT to hit location increment
css fix for alias dropdown
testing view angle analysis
2018-03-22 13:50:09 -05:00

30 lines
1.1 KiB
C#

using SharedLibrary;
using SharedLibrary.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StatsPlugin.Helpers
{
public class StreakMessage
{
/// <summary>
/// Get a message from the configuration encouraging or discouraging clients
/// </summary>
/// <param name="killStreak">how many kills the client has without dying</param>
/// <param name="deathStreak">how many deaths the client has without getting a kill</param>
/// <returns>message to send to the client</returns>
public static string MessageOnStreak(int killStreak, int deathStreak)
{
var killstreakMessage = Plugin.Config.Configuration().KillstreakMessages;
var deathstreakMessage = Plugin.Config.Configuration().DeathstreakMessages;
string message = killstreakMessage.FirstOrDefault(m => m.Count == killStreak)?.Message;
message = message ?? deathstreakMessage.FirstOrDefault(m => m.Count == deathStreak)?.Message;
return message ?? "";
}
}
}