|
@@ -364,6 +364,12 @@ public class ZDRoom extends Room {
|
|
|
player.data.remainCards = CardUtils.add(player.data.remainCards, card);
|
|
|
this.data.cardList.remove(0);
|
|
|
}
|
|
|
+ // todo 测试代码
|
|
|
+// if (this.data.wildCard != 0) {
|
|
|
+// player.data.remainCards = CardUtils.add(player.data.remainCards, this.data.wildCard);
|
|
|
+// player.data.remainCards = CardUtils.add(player.data.remainCards, this.data.wildCard);
|
|
|
+// player.data.remainCards = CardUtils.add(player.data.remainCards, this.data.wildCard);
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1250,6 +1256,36 @@ public class ZDRoom extends Room {
|
|
|
Log.debug("牌局结束...roomId : {}", this.data.roomId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 变更队友 0固定队友 1随机搭档 2均匀分配
|
|
|
+ */
|
|
|
+ private synchronized void changeTeam() {
|
|
|
+ // 随机搭档
|
|
|
+ if (this.jsonData.getInteger("team") == 1) {
|
|
|
+ boolean isTransPosition = ((int)(10 * Math.random())) % 2 == 1;
|
|
|
+ if (isTransPosition) {
|
|
|
+ List<String> keyList = new ArrayList<>(this.actors.keySet());
|
|
|
+ Collections.shuffle(keyList);
|
|
|
+ int pos = 0;
|
|
|
+ for (String id : keyList) {
|
|
|
+ if (!StringUtils.isEmpty(id)) {
|
|
|
+ Player tmPlayer = this.actors.getOrDefault(id, null);
|
|
|
+ if (tmPlayer != null) {
|
|
|
+ tmPlayer.data.pos = pos;
|
|
|
+ this.data.playerMap[pos] = tmPlayer;
|
|
|
+ pos += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 均匀分配
|
|
|
+ if (this.jsonData.getInteger("team") == 2) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 下一局重置房间数据
|
|
|
*/
|
|
@@ -1288,6 +1324,8 @@ public class ZDRoom extends Room {
|
|
|
|
|
|
// 初始化牌桌
|
|
|
this.initCardList();
|
|
|
+ // 变更队友
|
|
|
+ this.changeTeam();
|
|
|
}
|
|
|
|
|
|
/**
|