|
@@ -33,8 +33,10 @@ public class ZDRoom extends Room {
|
|
|
this.data.gameType = jsonData.getInteger("gameType");
|
|
|
this.data.ownerId = player != null? player.getId() : "";
|
|
|
this.data.maxNum = 4;
|
|
|
- // 级牌 0随机打几 1固定打2
|
|
|
+ // 级牌 0:随机打几 1:固定打2
|
|
|
this.data.tc = jsonData.getInteger("tc");
|
|
|
+ // 积分 0:123 1:124
|
|
|
+ this.data.pv = jsonData.getInteger("pv");
|
|
|
this.data.mode = jsonData.getInteger("mode");
|
|
|
this.data.modev = jsonData.getInteger("modev");
|
|
|
|
|
@@ -851,42 +853,6 @@ public class ZDRoom extends Room {
|
|
|
return nextPlayer;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 判断玩家出的牌是否可以压过上一手牌
|
|
|
- *
|
|
|
- * @param disCardsList 当前玩家出的牌
|
|
|
- * @param disCardsType 当前玩家出的牌型
|
|
|
- * @param currentLevel 当前级数
|
|
|
- * @return 是否可以出牌
|
|
|
- */
|
|
|
- public boolean canDisCard(int[] disCardsList, GDUtils.CardType disCardsType, int currentLevel) {
|
|
|
- // 0.桌上无牌直接出
|
|
|
- if (this.data.curDisCardList == null || this.data.curDisCardType == null) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 1.牌型不一样,判断手牌是否是炸弹
|
|
|
- if (disCardsType != this.data.curDisCardType && !GDUtils.isBomb(disCardsType)) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- // 获取权重值
|
|
|
- int previousWeight = GDUtils.getCardTypeWeight(this.data.curDisCardType);
|
|
|
- int currentWeight = GDUtils.getCardTypeWeight(disCardsType);
|
|
|
-
|
|
|
- // 权重不同,按权重大小比较
|
|
|
- if (currentWeight > previousWeight) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 权重相同,根据牌点大小进行比较(仅适用于同类型的牌型,如炸弹或顺子)
|
|
|
- if (currentWeight == previousWeight) {
|
|
|
- return GDUtils.compareCardStrength(this.data.curDisCardList, disCardsList, currentLevel, disCardsType, this.data.wildCard) > 0;
|
|
|
- }
|
|
|
-
|
|
|
- return false; // 其他情况不能出牌
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 玩家出牌
|
|
|
*
|
|
@@ -1170,24 +1136,28 @@ public class ZDRoom extends Room {
|
|
|
switch (teammateData.getRank()) {
|
|
|
case 2:
|
|
|
// 搭档2游, +3
|
|
|
- scores = 3;
|
|
|
+ if (this.data.pv == 0) {
|
|
|
+ scores = 3;
|
|
|
+ } else {
|
|
|
+ scores = 4;
|
|
|
+ }
|
|
|
builder.append("1游玩家: ").append(winPlayer.data.name)
|
|
|
.append(", 搭档玩家: ").append(teammateData.player.data.name)
|
|
|
- .append(" 2游, +3");
|
|
|
+ .append(" 2游, +").append(scores);
|
|
|
break;
|
|
|
case 3:
|
|
|
// 搭档3游, +2
|
|
|
scores = 2;
|
|
|
builder.append("1游玩家: ").append(winPlayer.data.name)
|
|
|
.append(", 搭档玩家: ").append(teammateData.player.data.name)
|
|
|
- .append(" 3游, +2");
|
|
|
+ .append(" 3游, +").append(scores);
|
|
|
break;
|
|
|
case 4:
|
|
|
// 搭档4游, +1
|
|
|
scores = 1;
|
|
|
builder.append("1游玩家: ").append(winPlayer.data.name)
|
|
|
.append(", 搭档玩家: ").append(teammateData.player.data.name)
|
|
|
- .append(" 4游, +1");
|
|
|
+ .append(" 4游, +").append(scores);
|
|
|
break;
|
|
|
}
|
|
|
|