public static string ShowPhrase(Game.Role role, string message) { if (message != String.Empty) { return(RoleReplace(Utilities.RandomChoice(Phrase[role])).Replace("{Message}", message)); } else { return(String.Empty); } }
public static string ShowWinner(Game.Role winner) { if ((int)winner < 2) { return(Utilities.RandomChoice(Winner[winner]).Replace("{Role}", ShowRoleCaseRU(winner, Noun.Plural, Case.Genitive))); } if ((int)winner >= 100) { return(Utilities.RandomChoice(Winner[winner])); } return(Utilities.RandomChoice(Winner[winner]).Replace("{Role}", ShowRoleCaseRU(winner, Noun.Singular, Case.Genitive))); }
// Отображение дневных сообщений public static string ShowBotKill(DiscordMember target) { Game.Role role = Game.Role.Nobody; if (Game.PlayersDump.ContainsKey(target)) { role = Game.PlayersDump[target].Role; } if (Game.Players.ContainsKey(target)) { role = Game.Players[target].Role; } if (Game.DeadPlayers.ContainsKey(target)) { role = Game.DeadPlayers[target].Role; } return(RoleReplace(Utilities.RandomChoice(BotKill[role])).Replace("{Mention}", target.Mention)); }
public static string ShowRoleMessage(Game.Role role) { if (role == Game.Role.Mafia) { if (Game.MafiaPlayers.Count > 1) { List <string> mentions = new List <string>(); foreach (DiscordMember mafioso in Game.MafiaPlayers) { mentions.Add(mafioso.Mention); } return(RoleReplace(Utilities.RandomChoice(MafiaRoleMessage[Noun.Plural])).Replace("{Mention}", String.Join(", ", mentions))); } else { return(RoleReplace(Utilities.RandomChoice(MafiaRoleMessage[Noun.Singular])).Replace("{Mention}", Game.FindPlayerByRole(Game.Role.Mafia).Mention)); } } else { return(RoleReplace(Utilities.RandomChoice(RoleMessage[role]))); } }
// РУССКИЙ ЯЗЫК // Склоненное название роли public static string ShowRoleCaseRU(Game.Role role, Noun noun, Case case_) { return(RoleCase[(int)role, (int)noun, (int)case_]); }
public static string ShowCancelMessage(Game.Role role) { return(RoleReplace(Utilities.RandomChoice(CancelMessage[role]))); }
public static string ShowEndMes(Game.Role winner) { StringBuilder temp = new StringBuilder(Utilities.RandomChoice(BegEndMes)); temp.Append("\n"); List <string> civilians = new List <string>(); List <string> mafia = new List <string>(); // Живые foreach (KeyValuePair <DiscordMember, Game.PlayerProperties> entry in Game.Players) { if (entry.Value.Role != Game.Role.Civilian && entry.Value.Role != Game.Role.Mafia) { if (Game.allies[winner].Contains(entry.Value.Role)) { temp.Append(UnderlineBold(Utilities.FirstCharToUpper(ShowRoleCaseRU(entry.Value.Role, Noun.Singular, Case.Nominative)))); } else { temp.Append(Bold(Utilities.FirstCharToUpper(ShowRoleCaseRU(entry.Value.Role, Noun.Singular, Case.Nominative)))); } temp.Append(": "); temp.Append(entry.Key.Mention); temp.Append("\n"); } if (entry.Value.Role == Game.Role.Mafia) { mafia.Add(entry.Key.Mention); } if (entry.Value.Role == Game.Role.Civilian) { civilians.Add(entry.Key.Mention); } } // Мертвые foreach (KeyValuePair <DiscordMember, Game.PlayerProperties> entry in Game.DeadPlayers) { if (entry.Value.Role != Game.Role.Civilian && entry.Value.Role != Game.Role.Mafia) { if (Game.allies[winner].Contains(entry.Value.Role)) { temp.Append(UnderlineBold(Utilities.FirstCharToUpper(ShowRoleCaseRU(entry.Value.Role, Noun.Singular, Case.Nominative)))); } else { temp.Append(Bold(Utilities.FirstCharToUpper(ShowRoleCaseRU(entry.Value.Role, Noun.Singular, Case.Nominative)))); } temp.Append(": "); temp.Append(Strikeout(entry.Key.Mention)); temp.Append("\n"); } if (entry.Value.Role == Game.Role.Mafia) { mafia.Add(Strikeout(entry.Key.Mention)); } if (entry.Value.Role == Game.Role.Civilian) { civilians.Add(Strikeout(entry.Key.Mention)); } } // Мафия if (Game.allies[winner].Contains(Game.Role.Mafia)) { temp.Append(UnderlineBold(Utilities.FirstCharToUpper(ShowRoleCaseRU(Game.Role.Mafia, Noun.Plural, Case.Nominative)))); } else { temp.Append(Bold(Utilities.FirstCharToUpper(ShowRoleCaseRU(Game.Role.Mafia, Noun.Plural, Case.Nominative)))); } temp.Append(": "); temp.Append(String.Join(", ", mafia)); temp.Append("\n"); // Мирные if (Game.allies[winner].Contains(Game.Role.Civilian)) { temp.Append(UnderlineBold(Utilities.FirstCharToUpper(ShowRoleCaseRU(Game.Role.Civilian, Noun.Plural, Case.Nominative)))); } else { temp.Append(Bold(Utilities.FirstCharToUpper(ShowRoleCaseRU(Game.Role.Civilian, Noun.Plural, Case.Nominative)))); } temp.Append(": "); temp.Append(String.Join(", ", civilians)); return(temp.ToString()); }