From d679680ca7dc0ffd57cc915055e8826384101370 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 27 Jun 2018 11:02:03 +0800 Subject: [PATCH 1/8] update persian support chat id --- Werewolf for Telegram/Werewolf Control/Helpers/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Werewolf for Telegram/Werewolf Control/Helpers/Settings.cs b/Werewolf for Telegram/Werewolf Control/Helpers/Settings.cs index ddda555ea..e40f73835 100644 --- a/Werewolf for Telegram/Werewolf Control/Helpers/Settings.cs +++ b/Werewolf for Telegram/Werewolf Control/Helpers/Settings.cs @@ -28,7 +28,7 @@ internal static class Settings public static string TcpSecret => Environment.MachineName.GetHashCode().ToString(); - public static readonly long PersianSupportChatId = -1001059174638; + public static readonly long PersianSupportChatId = -1001398432551; public static readonly long MainChatId = -1001049529775; //Beta group public static readonly long SupportChatId = -1001060486754; //@werewolfsupport public static readonly long PrimaryChatId = -1001268085464; //@werewolfgame From f254126f06008a32c65fd8115b72a7cd9b9a9003 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 27 Jun 2018 10:53:24 +0800 Subject: [PATCH 2/8] update donate command --- .../Werewolf Control/Commands/GifCommands.cs | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/Werewolf for Telegram/Werewolf Control/Commands/GifCommands.cs b/Werewolf for Telegram/Werewolf Control/Commands/GifCommands.cs index 92ef19c55..3137238bf 100644 --- a/Werewolf for Telegram/Werewolf Control/Commands/GifCommands.cs +++ b/Werewolf for Telegram/Werewolf Control/Commands/GifCommands.cs @@ -39,26 +39,8 @@ public static void Donate(Update u, string[] args) } menu.Buttons.Add(new InlineKeyboardUrlButton("PayPal", "https://PayPal.me/greywolfdevelopment")); var markup = menu.CreateMarkupFromMenu(); - var gif = "Donate $10USD or more to unlock a custom gif pack that you can choose. "; //"Custom gif packs are not available at this time, watch the update channel for more news! "; - //using (var db = new WWContext()) - //{ - // var count = db.Players.Count(x => x.GifPurchased == true); - // if (count < 100) - // gif = "Donate $10USD or more to unlock a custom gif pack that you can choose. "; - - //} - Bot.Api.SendTextMessageAsync(u.Message.Chat.Id, - "Want to help keep Werewolf online?\n" + - "We now offer some rewards for donating!\n" + - gif + "There are also donation badges you can get in game. These badges are added to the end of your name in game, so everyone can see you donated!\n\n" + - "•$10 USD: 🥉\n" + - "•$50 USD: 🥈\n" + - "•$100 USD: 🥇\n\n" + - "You might also see this special badge: 💎\nThis is reserved for people who donated prior to there being any rewards for donating\n" + - "If you donate via PayPal, you will need to contact @werewolfsupport to claim your prize. If you donate via Telegram, it's automated, no need to contact an admin :)\n" + - "More information about the Custom Gif Packs: http://telegra.ph/Custom-Gif-Packs-and-Donation-Levels-07-31\n" + - "How would you like to donate?", - replyMarkup: markup); + var txt = $"Want to help keep Werewolf Moderator online? Donate now and gets: {"Custom gifs".ToBold()} and {"Badges".ToBold()}!\n\nClick the button below to donate, and click here to claim your reward if you donate via Paypal!\n\nMore Info: https://telegra.ph/Custom-Gif-Packs-and-Donation-Levels-06-27"; + Bot.Api.SendTextMessageAsync(u.Message.Chat.Id, txt, replyMarkup: markup, parseMode: ParseMode.Html, disableWebPagePreview: true); } [Attributes.Command(Trigger = "customgif")] From 485a27a99396d09f2852151aaf9d958054d8d339 Mon Sep 17 00:00:00 2001 From: Olgabrezel Date: Sun, 24 Jun 2018 21:34:24 +0200 Subject: [PATCH 3/8] make "hey man nice shot" achievement work with lycan --- Werewolf for Telegram/Werewolf Node/Werewolf.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index 87de845e7..85011dbea 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -4327,7 +4327,7 @@ public void HunterFinalShot(IPlayer hunter, KillMthd method) if (killed.PlayerRole == IRole.WolfCub) WolfCubKilled = true; killed.TimeDied = DateTime.Now; - if (killed.PlayerRole == IRole.Wolf || killed.PlayerRole == IRole.AlphaWolf || killed.PlayerRole == IRole.WolfCub || killed.PlayerRole == IRole.SerialKiller) + if (killed.PlayerRole == IRole.Wolf || killed.PlayerRole == IRole.AlphaWolf || killed.PlayerRole == IRole.WolfCub || killed.PlayerRole == IRole.SerialKiller || killed.PlayerRole == IRole.Lycan) AddAchievement(hunter, Achievements.HeyManNiceShot); DBKill(hunter, killed, KillMthd.HunterShot); From c05c7b51a52da7b54378d15e1406d0866d47eabc Mon Sep 17 00:00:00 2001 From: Olgabrezel Date: Sun, 24 Jun 2018 21:33:45 +0200 Subject: [PATCH 4/8] Fix Lycan+Cult end --- Werewolf for Telegram/Werewolf Node/Werewolf.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index 85011dbea..c0e28985b 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -3640,6 +3640,7 @@ private bool CheckForGameEnd(bool checkbitten = false) case IRole.Wolf: case IRole.WolfCub: case IRole.AlphaWolf: + case IRole.Lycan: return DoGameEnd(ITeam.Wolf); case IRole.CultistHunter: var cultist = alivePlayers.FirstOrDefault(x => x.PlayerRole == IRole.Cultist); From 58b8d03885e1450bd2c46e89414398c84e721e69 Mon Sep 17 00:00:00 2001 From: Olgabrezel Date: Sun, 24 Jun 2018 21:00:08 +0200 Subject: [PATCH 5/8] Fix reviewgifs queue of "submitted" gif packs --- .../Werewolf Control/Commands/AdminCommands.cs | 2 ++ .../Werewolf Control/Handlers/UpdateHandler.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Werewolf for Telegram/Werewolf Control/Commands/AdminCommands.cs b/Werewolf for Telegram/Werewolf Control/Commands/AdminCommands.cs index 622882a24..45b199dd6 100644 --- a/Werewolf for Telegram/Werewolf Control/Commands/AdminCommands.cs +++ b/Werewolf for Telegram/Werewolf Control/Commands/AdminCommands.cs @@ -621,6 +621,7 @@ public static void ReviewGifs(Update u, string[] args) Bot.Api.SendDocumentAsync(id, pack.WolfWin, "Single Wolf Wins"); Thread.Sleep(250); Bot.Api.SendDocumentAsync(id, pack.WolvesWin, "Wolf Pack Wins"); + Thread.Sleep(500); var msg = $"Approval Status: "; switch (pack.Approved) { @@ -696,6 +697,7 @@ public static void ApproveGifs(Update u, string[] args) pack.Approved = true; pack.ApprovedBy = id; pack.NSFW = nsfw; + pack.Submitted = false; var msg = $"Approval Status: "; var by = db.Players.FirstOrDefault(x => x.TelegramId == pack.ApprovedBy); msg += "Approved By " + by.Name + "\nNSFW: " + pack.NSFW; diff --git a/Werewolf for Telegram/Werewolf Control/Handlers/UpdateHandler.cs b/Werewolf for Telegram/Werewolf Control/Handlers/UpdateHandler.cs index cc6e86cc3..d537fb7e3 100644 --- a/Werewolf for Telegram/Werewolf Control/Handlers/UpdateHandler.cs +++ b/Werewolf for Telegram/Werewolf Control/Handlers/UpdateHandler.cs @@ -867,6 +867,7 @@ internal static void HandleCallback(CallbackQuery query) Bot.Api.SendDocumentAsync(id, pack.WolfWin, "Single Wolf Wins"); Thread.Sleep(250); Bot.Api.SendDocumentAsync(id, pack.WolvesWin, "Wolf Pack Wins"); + Thread.Sleep(500); var msg = $"Approval Status: "; switch (pack.Approved) { @@ -904,6 +905,7 @@ internal static void HandleCallback(CallbackQuery query) pack.Approved = true; pack.ApprovedBy = id; pack.NSFW = nsfw; + pack.Submitted = false; msg = $"Approval Status: "; by = DB.Players.FirstOrDefault(x => x.TelegramId == pack.ApprovedBy); msg += "Approved By " + by.Name + "\nNSFW: " + pack.NSFW; @@ -933,6 +935,7 @@ internal static void HandleCallback(CallbackQuery query) pack.Approved = true; pack.ApprovedBy = id; pack.NSFW = nsfw; + pack.Submitted = false; msg = $"Approval Status: "; by = DB.Players.FirstOrDefault(x => x.TelegramId == pack.ApprovedBy); msg += "Approved By " + by.Name + "\nNSFW: " + pack.NSFW; From da41199ed5b3d4359782713e45422da633b55c77 Mon Sep 17 00:00:00 2001 From: Olgabrezel Date: Sun, 24 Jun 2018 19:15:53 +0200 Subject: [PATCH 6/8] Make lycan find the detective snooping as well --- Werewolf for Telegram/Werewolf Node/Werewolf.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index c0e28985b..7241b4038 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -2360,7 +2360,8 @@ private void DayCycle() //first off, chance to tell wolves if (Program.R.Next(100) < Settings.ChanceDetectiveCaught) { - foreach (var w in Players.Where(x => !x.IsDead && (x.PlayerRole == IRole.Wolf || x.PlayerRole == IRole.AlphaWolf || x.PlayerRole == IRole.WolfCub))) + IRole[] WolfRoles = new[] { IRole.Wolf, IRole.AlphaWolf, IRole.WolfCub, IRole.Lycan }; + foreach (var w in Players.Where(x => !x.IsDead && WolfRoles.Contains(x.PlayerRole))) { Send(GetLocaleString("DetectiveCaught", $"{detect.GetName()}"), w.Id); } From 9cc1ac2eadbea0b7917e0d23486a477d826c0195 Mon Sep 17 00:00:00 2001 From: Olgabrezel Date: Sun, 24 Jun 2018 16:32:01 +0200 Subject: [PATCH 7/8] Notify cultists if one of them gets infected by alpha wolf --- Werewolf for Telegram/Werewolf Node/Werewolf.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index 7241b4038..765a9df84 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -2452,6 +2452,10 @@ private void NightCycle() foreach (var m in Players.Where(x => x.PlayerRole == IRole.Mason & !x.IsDead && x.Id != p.Id)) Send(GetLocaleString("MasonConverted", p.GetName()), m.Id); + else if (p.PlayerRole == IRole.Cultist) + foreach (var m in Players.Where(x => x.PlayerRole == IRole.Cultist & !x.IsDead && x.Id != p.Id)) + Send(GetLocaleString("CultistBitten", p.GetName()), m.Id); + p.Bitten = false; p.PlayerRole = IRole.Wolf; p.Team = ITeam.Wolf; From 9c6f9487c00f66fbe8d7110cbc0cc970ec3b75d4 Mon Sep 17 00:00:00 2001 From: Jaime Date: Tue, 12 Jun 2018 09:46:21 +0200 Subject: [PATCH 8/8] Fixing AppSeer without Seer bug (#333) Swap order of checks --- Werewolf for Telegram/Werewolf Node/Werewolf.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Werewolf for Telegram/Werewolf Node/Werewolf.cs b/Werewolf for Telegram/Werewolf Node/Werewolf.cs index 765a9df84..3e7e200dc 100644 --- a/Werewolf for Telegram/Werewolf Node/Werewolf.cs +++ b/Werewolf for Telegram/Werewolf Node/Werewolf.cs @@ -1364,15 +1364,7 @@ private void AssignRoles() var towolf = rolesToAssign.FindIndex(x => x == IRole.Sorcerer || x == IRole.Traitor); //if there are both, the random order of rolesToAssign will choose for us which one to substitute rolesToAssign[towolf] = WolfRoles[Program.R.Next(WolfRoles.Count())]; //choose randomly from WolfRoles } - - //appseer without seer -> seer - if (rolesToAssign.Contains(IRole.ApprenticeSeer) && !rolesToAssign.Contains(IRole.Seer)) - { - //substitute with seer - var apps = rolesToAssign.IndexOf(IRole.ApprenticeSeer); - rolesToAssign[apps] = IRole.Seer; - } - + //cult without CH -> add CH if (rolesToAssign.Contains(IRole.Cultist) && !rolesToAssign.Contains(IRole.CultistHunter)) { @@ -1381,6 +1373,13 @@ private void AssignRoles() rolesToAssign[vg] = IRole.CultistHunter; } + //appseer without seer -> seer + if (rolesToAssign.Contains(IRole.ApprenticeSeer) && !rolesToAssign.Contains(IRole.Seer)) + { + //substitute with seer + var apps = rolesToAssign.IndexOf(IRole.ApprenticeSeer); + rolesToAssign[apps] = IRole.Seer; + } //make sure that we have at least two teams if (