소스 검색

fix error and move doctor

zelpold 4 년 전
부모
커밋
e87a5e8cbf
2개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 2
      MafiaTelegramBot/Game/GameRooms/GameRoom.GameProcess.cs
  2. 1 1
      MafiaTelegramBot/Game/GameRooms/GameRoom.Role.cs

+ 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)
                 };
             }