Browse Source

edit message for fool role

zelpold 4 years ago
parent
commit
59d3b0ae05

+ 6 - 2
MafiaTelegramBot/Game/GameRoles/FoolRole.cs

@@ -9,9 +9,13 @@ namespace MafiaTelegramBot.Game.GameRoles
         public override Roles RoleKey => Roles.Fool;
 
         public bool _isWinner = false; 
-        public override async Task IsWon()
+        public override async Task<string> IsWon()
         {
-            if (_isWinner) await Room.PlayersCh.SendTo(Player.ChatId, strings.you_won);
+            return await Task.Run(() =>
+            {
+                if (_isWinner) return strings.the_fool_won;
+                return "";
+            });
         }
 
         public override async Task Dispatch()

+ 9 - 0
MafiaTelegramBot/Resources/strings.Designer.cs

@@ -861,6 +861,15 @@ namespace MafiaTelegramBot {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Дурачок в этой игре победил! .
+        /// </summary>
+        internal static string the_fool_won {
+            get {
+                return ResourceManager.GetString("the_fool_won", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Время вышло.
         /// </summary>

+ 3 - 0
MafiaTelegramBot/Resources/strings.resx

@@ -426,4 +426,7 @@
     <data name="you_won" xml:space="preserve">
         <value>Вы победили</value>
     </data>
+    <data name="the_fool_won" xml:space="preserve">
+        <value>Дурачок в этой игре победил! </value>
+    </data>
 </root>