|
@@ -42,7 +42,7 @@ namespace ET.Server
|
|
|
// 初始化牌库
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
{
|
|
|
- foreach (int value in HGHuangHuangConst.Values)
|
|
|
+ foreach (int value in HGHHConst.Values)
|
|
|
{
|
|
|
self.CardList.Add(value);
|
|
|
}
|
|
@@ -289,8 +289,8 @@ namespace ET.Server
|
|
|
// 吃,碰,杠,胡,过
|
|
|
bool hasAct = false;
|
|
|
// 检测摸牌人动作, 校验摸牌是否胡
|
|
|
- Struct.HuRes huRes = HGHuangHuangHelper.CheckHu(drawCardPlayer.RemainCards);
|
|
|
- if (huRes.Type != HGHuangHuangConst.HU_DEFAULT)
|
|
|
+ Struct.HuRes huRes = HGHHHelper.CheckHu(drawCardPlayer.RemainCards);
|
|
|
+ if (huRes.Type != HGHHConst.HU_DEFAULT)
|
|
|
{
|
|
|
hasAct = true;
|
|
|
drawCardPlayer.Act[3] = 1;
|
|
@@ -302,7 +302,7 @@ namespace ET.Server
|
|
|
}
|
|
|
// todo 玩家听牌状态不允许杠
|
|
|
// 检测摸牌人动作, 校验摸牌是否杠
|
|
|
- List<Struct.Kezi> gang = HGHuangHuangHelper.IsDrawGang(drawCardPlayer);
|
|
|
+ List<Struct.Kezi> gang = HGHHHelper.IsDrawGang(drawCardPlayer);
|
|
|
if (gang is { Count: > 0 })
|
|
|
{
|
|
|
hasAct = true;
|
|
@@ -412,13 +412,13 @@ namespace ET.Server
|
|
|
List<Struct.Kezi> chis = new List<Struct.Kezi>();
|
|
|
// todo 玩家听牌状态不允许有动作
|
|
|
// 出牌是否杠
|
|
|
- gangs = HGHuangHuangHelper.IsDiscardGang(otherPlayer, card, player.Id);
|
|
|
+ gangs = HGHHHelper.IsDiscardGang(otherPlayer, card, player.Id);
|
|
|
// 出牌是否碰
|
|
|
- pengs = HGHuangHuangHelper.IsDiscardPeng(otherPlayer, card, player.Id);
|
|
|
+ pengs = HGHHHelper.IsDiscardPeng(otherPlayer, card, player.Id);
|
|
|
// 出牌是否吃
|
|
|
if (otherPlayer.Pos == nextPos[0])
|
|
|
{
|
|
|
- chis = HGHuangHuangHelper.IsDiscardChi(otherPlayer, card, player.Id);
|
|
|
+ chis = HGHHHelper.IsDiscardChi(otherPlayer, card, player.Id);
|
|
|
}
|
|
|
// 游戏中才会动作
|
|
|
if (otherPlayer.State == 2)
|
|
@@ -429,9 +429,9 @@ namespace ET.Server
|
|
|
Array.Copy(otherPlayer.RemainCards, 0, tmpCards, 0, otherPlayer.RemainCards.Length);
|
|
|
tmpCards = CardHelper.Add(tmpCards, card);
|
|
|
// 校验胡牌
|
|
|
- Struct.HuRes huType = HGHuangHuangHelper.CheckHu(tmpCards);
|
|
|
+ Struct.HuRes huType = HGHHHelper.CheckHu(tmpCards);
|
|
|
|
|
|
- if (huType.Type != HGHuangHuangConst.HU_DEFAULT)
|
|
|
+ if (huType.Type != HGHHConst.HU_DEFAULT)
|
|
|
{
|
|
|
hasAct = true;
|
|
|
act[3] = 1;
|
|
@@ -629,7 +629,7 @@ namespace ET.Server
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (self.DisCard >= HGHuangHuangConst.DONG_FENG)
|
|
|
+ if (self.DisCard >= HGHHConst.DONG_FENG)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -645,7 +645,7 @@ namespace ET.Server
|
|
|
|
|
|
player.RemainCards = temp;
|
|
|
// 刻子
|
|
|
- player.KeZi.Add(new Struct.Kezi((int)HGHuangHuangConst.KeziType.CHI, card, self.DisCardPlayer.Id));
|
|
|
+ player.KeZi.Add(new Struct.Kezi((int)HGHHConst.KeziType.CHI, card, self.DisCardPlayer.Id));
|
|
|
|
|
|
// 重置摸牌人
|
|
|
self.DrawCardPlayer = player;
|
|
@@ -726,7 +726,7 @@ namespace ET.Server
|
|
|
player.RemainCards = remainCards;
|
|
|
|
|
|
// 刻子
|
|
|
- player.KeZi.Add(new Struct.Kezi((int)HGHuangHuangConst.KeziType.PENG, self.DisCard, self.DisCardPlayer.Id));
|
|
|
+ player.KeZi.Add(new Struct.Kezi((int)HGHHConst.KeziType.PENG, self.DisCard, self.DisCardPlayer.Id));
|
|
|
|
|
|
// 重置摸牌人
|
|
|
self.DrawCardPlayer = player;
|
|
@@ -759,7 +759,7 @@ namespace ET.Server
|
|
|
/// <returns></returns>
|
|
|
private static int GangPaiDraw(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
- int type = (int)HGHuangHuangConst.KeziType.DEFAULT;
|
|
|
+ int type = (int)HGHHConst.KeziType.DEFAULT;
|
|
|
int[] remainCards = player.RemainCards;
|
|
|
int num = CardHelper.CountCardNum(remainCards, card);
|
|
|
if (num == 4)
|
|
@@ -770,12 +770,12 @@ namespace ET.Server
|
|
|
}
|
|
|
player.RemainCards = remainCards;
|
|
|
|
|
|
- player.KeZi.Add(new Struct.Kezi((int)HGHuangHuangConst.KeziType.AN_GANG, card, player.Id));
|
|
|
+ player.KeZi.Add(new Struct.Kezi((int)HGHHConst.KeziType.AN_GANG, card, player.Id));
|
|
|
|
|
|
self.GangPlayer = player;
|
|
|
self.GangPai = card;
|
|
|
- self.GangType = (int)HGHuangHuangConst.KeziType.AN_GANG;
|
|
|
- type = (int)HGHuangHuangConst.KeziType.AN_GANG;
|
|
|
+ self.GangType = (int)HGHHConst.KeziType.AN_GANG;
|
|
|
+ type = (int)HGHHConst.KeziType.AN_GANG;
|
|
|
}
|
|
|
else if (num == 1)
|
|
|
{
|
|
@@ -788,21 +788,21 @@ namespace ET.Server
|
|
|
for (int i = 0; i < templist.Count; i++)
|
|
|
{
|
|
|
Struct.Kezi kz = templist[i];
|
|
|
- if (kz is not { Type: (int)HGHuangHuangConst.KeziType.PENG } || kz.Card != card)
|
|
|
+ if (kz is not { Type: (int)HGHHConst.KeziType.PENG } || kz.Card != card)
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
player.KeZi.RemoveAt(i);
|
|
|
remainCards = CardHelper.Remove(remainCards, card);
|
|
|
- player.KeZi.Add(new Struct.Kezi((int)HGHuangHuangConst.KeziType.HUI_GANG, card, player.Id));
|
|
|
+ player.KeZi.Add(new Struct.Kezi((int)HGHHConst.KeziType.HUI_GANG, card, player.Id));
|
|
|
}
|
|
|
|
|
|
player.RemainCards = remainCards;
|
|
|
self.GangPlayer = player;
|
|
|
self.GangPai = card;
|
|
|
- self.GangType = (int)HGHuangHuangConst.KeziType.HUI_GANG;
|
|
|
- type = (int)HGHuangHuangConst.KeziType.HUI_GANG;
|
|
|
+ self.GangType = (int)HGHHConst.KeziType.HUI_GANG;
|
|
|
+ type = (int)HGHHConst.KeziType.HUI_GANG;
|
|
|
}
|
|
|
return type;
|
|
|
}
|
|
@@ -817,7 +817,7 @@ namespace ET.Server
|
|
|
/// <returns></returns>
|
|
|
private static int GangPaiDisCard(this HGHuangHuangComponent self, Room room, Player player, int card)
|
|
|
{
|
|
|
- const int type = (int)HGHuangHuangConst.KeziType.DEFAULT;
|
|
|
+ const int type = (int)HGHHConst.KeziType.DEFAULT;
|
|
|
if (self.DisCardPlayer == null)
|
|
|
{
|
|
|
return type;
|
|
@@ -828,13 +828,13 @@ namespace ET.Server
|
|
|
{
|
|
|
player.RemainCards = CardHelper.Remove(player.RemainCards, card);
|
|
|
}
|
|
|
- player.KeZi.Add(new Struct.Kezi((int)HGHuangHuangConst.KeziType.MING_GANG, card, self.DisCardPlayer.Id));
|
|
|
+ player.KeZi.Add(new Struct.Kezi((int)HGHHConst.KeziType.MING_GANG, card, self.DisCardPlayer.Id));
|
|
|
|
|
|
self.GangPlayer = player;
|
|
|
self.GangPai = card;
|
|
|
- self.GangType = (int)HGHuangHuangConst.KeziType.MING_GANG;
|
|
|
+ self.GangType = (int)HGHHConst.KeziType.MING_GANG;
|
|
|
|
|
|
- return (int)HGHuangHuangConst.KeziType.MING_GANG;
|
|
|
+ return (int)HGHHConst.KeziType.MING_GANG;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -860,8 +860,8 @@ namespace ET.Server
|
|
|
int[] tmpCards = new int[p.RemainCards.Length];
|
|
|
Array.Copy(p.RemainCards, 0, tmpCards, 0, p.RemainCards.Length);
|
|
|
tmpCards = CardHelper.Add(tmpCards, card);
|
|
|
- Struct.HuRes result = HGHuangHuangHelper.CheckHu(tmpCards);
|
|
|
- if (result.Type != HGHuangHuangConst.HU_DEFAULT) {
|
|
|
+ Struct.HuRes result = HGHHHelper.CheckHu(tmpCards);
|
|
|
+ if (result.Type != HGHHConst.HU_DEFAULT) {
|
|
|
flag = true;
|
|
|
if (!self.CanHuIds.Contains(p.Id)) {
|
|
|
self.CanHuIds.Add(p.Id);
|
|
@@ -889,7 +889,7 @@ namespace ET.Server
|
|
|
{
|
|
|
if (card > 0 && self.IsCanPengGang(player))
|
|
|
{
|
|
|
- int type = (int)HGHuangHuangConst.KeziType.DEFAULT;
|
|
|
+ int type = (int)HGHHConst.KeziType.DEFAULT;
|
|
|
|
|
|
if (self.DrawCardPlayer.Id == player.Id)
|
|
|
{
|
|
@@ -900,11 +900,11 @@ namespace ET.Server
|
|
|
type = self.GangPaiDisCard(room, player, card);
|
|
|
}
|
|
|
|
|
|
- if (type != (int)HGHuangHuangConst.KeziType.DEFAULT)
|
|
|
+ if (type != (int)HGHHConst.KeziType.DEFAULT)
|
|
|
{
|
|
|
self.OperableList.Clear();
|
|
|
// bool flag = true;
|
|
|
- if (self.GangType == (int)HGHuangHuangConst.KeziType.HUI_GANG)
|
|
|
+ if (self.GangType == (int)HGHHConst.KeziType.HUI_GANG)
|
|
|
{
|
|
|
if (self.CheckQangGangHu(room, self.GangPlayer, self.GangPai))
|
|
|
{
|
|
@@ -941,8 +941,8 @@ namespace ET.Server
|
|
|
{
|
|
|
if (self.OperableList.Contains(player.Id) && self.CanHuIds.Contains(player.Id))
|
|
|
{
|
|
|
- Struct.HuRes res = HGHuangHuangHelper.CheckHuType(player.KeZi, player.RemainCards, self.DrawCard);
|
|
|
- if (res.Type != HGHuangHuangConst.HU_DEFAULT)
|
|
|
+ Struct.HuRes res = HGHHHelper.CheckHuType(player.KeZi, player.RemainCards, self.DrawCard);
|
|
|
+ if (res.Type != HGHHConst.HU_DEFAULT)
|
|
|
{
|
|
|
self.OperableList.Remove(player.Id);
|
|
|
self.CanHuIds.Remove(player.Id);
|
|
@@ -950,7 +950,7 @@ namespace ET.Server
|
|
|
// 将摸的牌从手牌中移除
|
|
|
player.RemainCards = CardHelper.Remove(player.RemainCards, self.DrawCard);
|
|
|
|
|
|
- self.HuResult = self.GangPlayer != null && player.Id == self.GangPlayer.Id ? (int)HGHuangHuangConst.Result.GANGKAI : (int)HGHuangHuangConst.Result.ZIMO;
|
|
|
+ self.HuResult = self.GangPlayer != null && player.Id == self.GangPlayer.Id ? (int)HGHHConst.Result.GANGKAI : (int)HGHHConst.Result.ZIMO;
|
|
|
|
|
|
// 广播
|
|
|
foreach (Player p in room.GetAllPlayers().Values.Where(p => p != null))
|
|
@@ -993,12 +993,12 @@ namespace ET.Server
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- foreach (Struct.Kezi kezi in gangPlayer.KeZi.Where(kezi => kezi.Card == self.GangPai && kezi.Type == (int)HGHuangHuangConst.KeziType.HUI_GANG))
|
|
|
+ foreach (Struct.Kezi kezi in gangPlayer.KeZi.Where(kezi => kezi.Card == self.GangPai && kezi.Type == (int)HGHHConst.KeziType.HUI_GANG))
|
|
|
{
|
|
|
- kezi.Type = (int)HGHuangHuangConst.KeziType.PENG;
|
|
|
+ kezi.Type = (int)HGHHConst.KeziType.PENG;
|
|
|
}
|
|
|
|
|
|
- self.HuResult = (int)HGHuangHuangConst.Result.QIANGGANG;
|
|
|
+ self.HuResult = (int)HGHHConst.Result.QIANGGANG;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1008,7 +1008,7 @@ namespace ET.Server
|
|
|
self.DisCardPlayer.DisCards = CardHelper.Remove(self.DisCardPlayer.DisCards, self.DisCard);
|
|
|
}
|
|
|
|
|
|
- self.HuResult = (int)HGHuangHuangConst.Result.DIANPAO;
|
|
|
+ self.HuResult = (int)HGHHConst.Result.DIANPAO;
|
|
|
}
|
|
|
player.HuCards.Add(self.GangPai);
|
|
|
// 广播
|
|
@@ -1046,8 +1046,8 @@ namespace ET.Server
|
|
|
int[] tmpCards = new int[userCards.Length];
|
|
|
Array.Copy(userCards, 0, tmpCards, 0, userCards.Length);
|
|
|
tmpCards = CardHelper.Add(tmpCards, card);
|
|
|
- Struct.HuRes res = HGHuangHuangHelper.CheckHuType(player.KeZi, tmpCards, card);
|
|
|
- if (res.Type != HGHuangHuangConst.HU_DEFAULT)
|
|
|
+ Struct.HuRes res = HGHHHelper.CheckHuType(player.KeZi, tmpCards, card);
|
|
|
+ if (res.Type != HGHHConst.HU_DEFAULT)
|
|
|
{
|
|
|
if (!self.ClickHuIds.Contains(player.Id))
|
|
|
{
|