瀏覽代碼

fix error and move doctor

zelpold 4 年之前
父節點
當前提交
e87a5e8cbf

+ 3 - 2
MafiaTelegramBot/Game/GameRooms/GameRoom.GameProcess.cs

@@ -238,10 +238,11 @@ namespace MafiaTelegramBot.Game.GameRooms
             var player = Players[playerId];
             var target = Players[targetId];
             _voteUpList.AddUnique(target);
+            target.VotedCount++;
+            if (target.VotedCount > _largeVote) _largeVote = target.VotedCount; 
             if (playerId != targetId)
             {
-                target.VotedCount++;
-                if (target.VotedCount > _largeVote) _largeVote = target.VotedCount; 
+                
                 await PlayersCh.SendExcept(player.ChatId, $"{player.NickName} {strings.vote_to} {target.NickName}");
                 return await Bot.SendWithMarkdown2(player.ChatId, $"{strings.you_vote_player} {target.NickName}");
             }

+ 1 - 1
MafiaTelegramBot/Game/GameRooms/GameRoom.Role.cs

@@ -127,7 +127,6 @@ namespace MafiaTelegramBot.Game.GameRooms
                 {
                     Roles.All => new NoneRole(),
                     Roles.None => new NoneRole(),
-                    Roles.Doctor => new DoctorRole(room, player),
                     Roles.Mafia => new MafiaRole(room, player),
                     Roles.Don => new DonRole(room, player),
                     Roles.Cop => new CopRole(room, player),
@@ -143,6 +142,7 @@ namespace MafiaTelegramBot.Game.GameRooms
                     Roles.Fool => new FoolRole(room, player),
                     Roles.Necromancer => new NecromancerRole(room, player),
                     Roles.Bodyguard => new BodyguardRole(room, player),
+                    Roles.Doctor => new DoctorRole(room, player),
                     _ => throw new ArgumentOutOfRangeException(nameof(roleKey), roleKey, null)
                 };
             }