|
@@ -1080,7 +1080,131 @@ namespace ET.Server
|
|
|
|
|
|
public static void Guo(this HGHuangHuangComponent self, Room room, Player player)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
+ if (!self.OperableList.Contains(player.Id))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ self.CanPgIds.Remove(player.Id);
|
|
|
+
|
|
|
+ self.OperableList.Remove(player.Id);
|
|
|
+
|
|
|
+ if (self.DrawCardPlayer.Id != player.Id)
|
|
|
+ {
|
|
|
+ if (self.CanHuIds.Contains(player.Id))
|
|
|
+ {
|
|
|
+ self.CanHuIds.Remove(player.Id);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (self.GangHuIds.Count > 0)
|
|
|
+ {
|
|
|
+ self.GangHuIds.Remove(player.Id);
|
|
|
+ if (self.GangHuIds.Count > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (self.CurrentPlayer.Id == player.Id)
|
|
|
+ {
|
|
|
+ self.CurrentPlayer = room.GetPlayer(self.GangHuIds.First());
|
|
|
+ self.Time = 15;
|
|
|
+
|
|
|
+ foreach (Player p in room.GetAllPlayers().Values.Where(p => p != null))
|
|
|
+ {
|
|
|
+ RoomInfo info = ProtoHelper.RoomToProto(room, p, player);
|
|
|
+ info.Time = 15;
|
|
|
+ MessageHelper.SendToClient(p, new G2C_OperationPush(){info = info});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (self.ClickHuIds.Count == 0)
|
|
|
+ {
|
|
|
+ self.DrawCardPlayer = self.GangPlayer;
|
|
|
+ self.Flag = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ self.SettlementHu();
|
|
|
+ self.GameOver(room);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (self.OperableList.Count == 0)
|
|
|
+ {
|
|
|
+ if (self.ClickHuIds.Count > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ self.SettlementHu();
|
|
|
+ self.GameOver(room);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ self.DrawCardPlayer = self.GetNextPlayer(self.DisCardPlayer.Pos);
|
|
|
+ self.Flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (self.CurrentPlayer.Id == player.Id)
|
|
|
+ {
|
|
|
+ long opId = 0;
|
|
|
+ if (self.CanHuIds.Count > 0)
|
|
|
+ {
|
|
|
+ self.CurrentPlayer = self.Players[room.GetPlayer(self.CanHuIds.First()).Pos];
|
|
|
+ opId = self.CanHuIds.First();
|
|
|
+ }
|
|
|
+ else if (self.CanPgIds.Count > 0)
|
|
|
+ {
|
|
|
+ self.CurrentPlayer = self.Players[room.GetPlayer(self.CanPgIds.First()).Pos];
|
|
|
+ opId = self.CanPgIds.First();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ self.CurrentPlayer = self.Players[room.GetPlayer(self.OperableList.First()).Pos];
|
|
|
+ opId = self.OperableList.First();
|
|
|
+ }
|
|
|
+
|
|
|
+ self.Time = 15;
|
|
|
+
|
|
|
+ foreach (Player p in room.GetAllPlayers().Values.Where(p => p != null))
|
|
|
+ {
|
|
|
+ RoomInfo info = ProtoHelper.RoomToProto(room, p, player);
|
|
|
+ info.Time = 15;
|
|
|
+ MessageHelper.SendToClient(p, new G2C_OperationPush(){info = info});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (self.CanHuIds.Count == 0)
|
|
|
+ {
|
|
|
+ self.GangPlayer = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (self.CanHuIds.Contains(player.Id))
|
|
|
+ {
|
|
|
+
|
|
|
+ self.CanHuIds.Remove(player.Id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ private static Player GetNextPlayer(this HGHuangHuangComponent self, int curPos)
|
|
|
+ {
|
|
|
+ return self.Players[(curPos + 1) % self.GetParent<Room>().MaxNum];
|
|
|
}
|
|
|
|
|
|
|