diff --git a/robots/zhipai/.idea/.gitignore b/robots/zhipai/.idea/.gitignore new file mode 100644 index 0000000..b6b1ecf --- /dev/null +++ b/robots/zhipai/.idea/.gitignore @@ -0,0 +1,10 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 已忽略包含查询文件的默认文件夹 +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ diff --git a/robots/zhipai/game_mj_fulushou/config/game-config.xml b/robots/zhipai/game_mj_fulushou/config/game-config.xml new file mode 100644 index 0000000..98458c1 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/config/game-config.xml @@ -0,0 +1,11 @@ + + + + + 192.168.1.6 + 192.168.1.6 + 8971 + 8971 + 107 + true + \ No newline at end of file diff --git a/robots/zhipai/game_mj_fulushou/config/log4j.properties b/robots/zhipai/game_mj_fulushou/config/log4j.properties new file mode 100644 index 0000000..6786dba --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/config/log4j.properties @@ -0,0 +1,20 @@ + +log4j.rootLogger = INFO,consoleAppender,fileAppender + +# ConsoleAppender +log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender +log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.consoleAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{2} %3x - %m%n + + +# Regular FileAppender +log4j.appender.fileAppender=org.apache.log4j.DailyRollingFileAppender +log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout +log4j.appender.fileAppender.File=${WORKDIR}/logs/web_main.log +log4j.appender.fileAppender.layout.ConversionPattern=%d{dd MMM yyyy | HH:mm:ss,SSS} | %-5p | %t | %c{3} | %3x | %m%n +log4j.appender.fileAppender.Encoding=UTF-8 +log4j.appender.fileAppender.DatePattern='.'yyyy-MM-dd +log4j.appender.dailyFile.Append=true + +# The file is rolled over very day +log4j.appender.fileAppender.DatePattern ='.'yyyy-MM-dd \ No newline at end of file diff --git a/robots/zhipai/game_mj_fulushou/config/taurus-core.xml b/robots/zhipai/game_mj_fulushou/config/taurus-core.xml new file mode 100644 index 0000000..2219d52 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/config/taurus-core.xml @@ -0,0 +1,50 @@ + + + log4j.properties + + + redis + com.taurus.core.plugin.redis.RedisPlugin + + + + 80 + + 20 + + 5 + + -1 + + true + + true + + true + + 100 + + 60000 + + 30000 + + 1800000 + + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/robots/zhipai/game_mj_fulushou/config/taurus-permanent.xml b/robots/zhipai/game_mj_fulushou/config/taurus-permanent.xml new file mode 100644 index 0000000..856ea37 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/config/taurus-permanent.xml @@ -0,0 +1,75 @@ + + + 1 + + 512 + + Heap + + Heap + + 524288 + + 1024 + + 32768 + + 160 + + + 1 + 2 + 1 + + + true + + 15 + + + + + + + + + + 1.2.3.4 + + + 127.0.0.1 + + 10000 + + + + false +
0.0.0.0
+ 80 +
+ + + + extension - test + extend.mj.EXMainServer + + + + + Sys + 2 + 8 + 60000 + 20000 + + + + + Ext + 2 + 8 + 60000 + 20000 + + +
\ No newline at end of file diff --git a/robots/zhipai/game_mj_fulushou/pom.xml b/robots/zhipai/game_mj_fulushou/pom.xml new file mode 100644 index 0000000..c05bcde --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/pom.xml @@ -0,0 +1,44 @@ + + 4.0.0 + + com.game + game_mj_fulushou + 1.0.0 + jar + + game_mj_fulushou + http://maven.apache.org + + + UTF-8 + + + + + + com.game + game_common + 1.0.0 + + + + + game_mj_fulushou + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + + 1.8 + 1.8 + UTF-8 + + + + + + + diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/CardNiao.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/CardNiao.java new file mode 100644 index 0000000..12b4af9 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/CardNiao.java @@ -0,0 +1,22 @@ +package extend.mj; + +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; + +public class CardNiao { + public int card; + + public int playerId=0; + public int seat = 0; + public int score = 0; + + + public ITObject toMP(){ + ITObject obj = TObject.newInstance(); + obj.putInt("card", card); + obj.putInt("score", score); + obj.putInt("playerId", playerId); + obj.putInt("seat", seat); + return obj; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/Config.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/Config.java new file mode 100644 index 0000000..9b1b631 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/Config.java @@ -0,0 +1,203 @@ +package extend.mj; + +public class Config { + public static final int XIPAI_SCORE = 10; + public static final int ANCHOU_SCORE = 10; + + public static final String ROOM_CONFIG_CHUIPAI = "chipai"; //吃牌 + public static final String ROOM_CONFIG_DIANPAO = "dianpao"; //接炮胡 + public static final String ROOM_CONFIG_HUNYISE = "hunyise"; //混一色 + public static final String ROOM_CONFIG_QINGYISE = "qingyise"; //清一色 + public static final String ROOM_CONFIG_PENGPENGHU = "pengpenghu"; //碰碰胡 + public static final String ROOM_CONFIG_QIDUI = "qidui"; //七小对 + public static final String ROOM_CONFIG_HAOHUA_QIDUI = "haohua_qidui"; //豪华七小对 + public static final String ROOM_CONFIG_HAOHUA2_QIDUI = "haohua2_qidui"; //双豪华七小对 + public static final String ROOM_CONFIG_HAOHUA3_QIDUI = "haohua3_qidui"; //三豪华七小对 + public static final String ROOM_CONFIG_GANGSHANGKAIHUA_2bei = "gangshangkaihua"; //杠上开花2倍 + public static final String ROOM_CONFIG_GANGSHANGPAO_2bei = "gangshangpao_2bei"; //杠上炮2倍 + public static final String ROOM_CONFIG_SHISHANGYAO = "shishanyao"; //十三幺 + public static final String ROOM_CONFIG_TIANDIHU = "tiandihu"; //天地胡 + public static final String ROOM_CONFIG_SHIBALUOHAN = "shibaluohan"; //十八罗汉 + public static final String ROOM_CONFIG_XIAOSHANYUAN = "xiaoshanyuan"; //小三元 + public static final String ROOM_CONFIG_XIAOSIXI = "xiaosixi"; //小四喜 + public static final String ROOM_CONFIG_DASHANYUAN = "dashanyuan"; //大三元 + public static final String ROOM_CONFIG_DASIXI = "dasixi"; //大四喜 + public static final String ROOM_CONFIG_LOUHU = "louhu"; //漏胡 + public static final String ROOM_CONFIG_GUO_PENG = "guopeng"; //过碰不碰 + public static final String ROOM_CONFIG_GUO_GONG = "guogang"; //过杠不杠 + public static final String ROOM_CONFIG_YAO_JIU = "yao_jiu"; //混幺九 + public static final String ROOM_CONFIG_QING_YAO_JIU = "qing_yao_jiu"; //清幺九 + public static final String ROOM_CONFIG_LAIZI4_HU = "laizi4_hu"; //四鬼胡牌 + public static final String ROOM_CONFIG_LAIZI4_HU_2BEI = "laizi4_hu_2bei"; //四鬼胡牌两倍 + public static final String ROOM_CONFIG_QUAN_FENG = "quan_feng"; //全风 + public static final String ROOM_CONFIG_12ZHANG_LUODI_QUANBAO = "twelve_zhang_luodi_quanbao";//12张落地全包 + public static final String ROOM_CONFIG_QUAN_FENG_SCORE = "quan_qiu_ren"; //全求人 + public static final String ROOM_CONFIG_han19 = "han19"; //含19即可 + public static final String ROOM_CONFIG_ZIYISE = "ziyise"; //字一色 + public static final String ROOM_CONFIG_HAI_DI_NAO_YUE = "haidinaoyue"; //海底捞月 + + public static final String ROOM_CONFIG_XIPAI = "xi_pai"; + public static final String ROOM_CONFIG_XIPAI_SCORE = "xi_pai_score"; + + public static final String ROOM_CONFIG_ANCHOU_SCORE = "an_chou_score"; + + /** + * 飘分玩法 + */ + public static final String ROOM_CONFIG_PIAO = "piao"; // 0:不嫖 1:热票 2:冷票 3:固定票分 + public static final String ROOM_CONFIG_PIAO_FEN = "piao_fen"; // 固定票分时, 票分 + public static final String ROOM_CONFIG_ZHUANGXIAN = "zhuangxian"; + public static final String ROOM_CONFIG_QIDUI_JIA_FAN = "qidui_jiafan"; //七对2倍 + public static final String ROOM_CONFIG_QIDUI_4BEI = "qidui_4bei"; //七对4倍 + public static final String ROOM_CONFIG_NIAO = "niao"; //0无马 1有马 2爆炸马 3抓马 + public static final String ROOM_CONFIG_NIAO_OPT = "niao_opt"; //爆炸马 0 加分 1 加倍 + public static final String ROOM_CONFIG_MAI_NIAO = "mai_niao"; //0无马 1有马 + public static final String ROOM_CONFIG_MAI_NIAO_OPT = "mai_niao_opt"; //1买一码 2买二马 3罚一码 4罚二马 + public static final String ROOM_CONFIG_WU_FENG = "wu_feng"; + public static final String ROOM_CONFIG_LAIZI = "laizi"; ////0 无鬼 1白板做鬼 2翻鬼(随机一个牌做鬼) 3翻双鬼 4红中做鬼 + + public static final String ROOM_CONFIG_QIANGKONG = "qiangkong"; //可抢杠胡 + public static final String ROOM_CONFIG_QIANGKONG_2BEI = "qiangkong_2bei"; //可抢杠胡2倍 + public static final String ROOM_CONFIG_QIANGKONG_MING = "qiangkong_ming"; //明杠可抢 + public static final String ROOM_CONFIG_QIANGKONG_NIAO = "qiangkong_niao"; + public static final String ROOM_CONFIG_NONEALL = "none_is_all"; + public static final String ROOM_CONFIG_NIAO_SCORE = "niao_score"; + public static final String ROOM_CONFIG_QG_TYPE = "qianggang_type"; //抢杠全包 + public static final String ROOM_CONFIG_GANGBAO_TYPE = "gangbao_type"; //杠爆全包 + public static final String ROOM_CONFIG_JIANGMA = "jiangma"; + public static final String ROOM_CONFIG_HZ_HU = "hz_hu"; + public static final String ROOM_CONFIG_GENGZHUAN = "geng_zhuan"; + public static final String ROOM_CONFIG_JIEJIEGAO = "jiejiegao"; + public static final String ROOM_CONFIG_JIEJIEGAO_FIRST_NO = "jiejiegao_first"; + public static final String ROOM_CONFIG_LIAN_ZHUANG = "lian_zhuang"; + public static final String ROOM_CONFIG_WUGUI_JIABEI = "wuguijiabei"; + public static final String ROOM_CONFIG_NO_WAN = "no_wan"; + public static final String ROOM_CONFIG_MA_GEN_DI_FEN = "ma_gen_di_fen";//马跟底分 + public static final String ROOM_CONFIG_MA_GEN_GONG = "ma_gen_gong";//马跟杠 + public static final String ROOM_CONFIG_LIU_GOU_MA = "liu_gou_ma";//留够马牌 + public static final String ROOM_CONFIG_HUANGZHUANGHUANGGANG = "huangzhuang_huanggang";//荒庄荒杠 + public static final String ROOM_CONFIG_LIUJU_2BEI = "liuju_2bei";//流局翻倍 + public static final String ROOM_CONFIG_DAHU_CHENG = "da_hu_cheng";//大胡相乘 + public static final String ROOM_CONFIG_JIHU_NOTCHIHU = "jihunotchihu"; //鸡胡不能吃胡 + public static final String ROOM_CONFIG_XIAOHU_BEI = "xiaohu_bei"; //小胡的倍数另算 + public static final String ROOM_CONFIG_SPECAIL_ZIMO = "special_zimo"; //潮州特殊自摸 + public static final String ROOM_CONFIG_MUST_HU = "must_hu"; //必胡,必须胡牌,不能过 + public static final String ROOM_CONFIG_10_BEI_BUJIFEN = "10bei_bu_jifen"; //十倍不计分 + public static final String ROOM_CONFIG_10_BEI_FENGDING = "10bei_fengding"; //封顶十倍 + public static final String ROOM_CONFIG_ZI_DONG_HU = "zi_dong_hu"; //自动胡 + public static final String ROOM_CONFIG_USE_BASE_HU_SCORE = "use_base_hu_score"; //使用默认基础胡分 + public static final String ROOM_CONFIG_MENG_QING = "men qing"; //门清 + public static final String ROOM_CONFIG_JIHU_SHI_PINGHU = "ji hu shi ping hu"; //没有鸡胡,统一叫平胡 + + public static final String ROOM_CONFIG_XUAN_ZHUANG = "xuan_zhuang"; // 0:轮庄 1:胡牌庄 + public static final String ROOM_CONFIG_QING_ZUI_HU = "qing_zui_hu"; // 0:亲嘴0胡 1:亲嘴2胡 + public static final String ROOM_CONFIG_GANG_ZHAO_LIU_XI = "gang_zhao_liu_xi"; //杠招6息 bool + public static final String ROOM_CONFIG_SPECIAL_PENG_PENG_HU = "special_peng_peng_hu"; //碰碰胡每个字不少于2个 + public static final String ROOM_CONFIG_FEN_DIEJIA = "fen_diejia"; //算分叠加 + + + + public static final String SETTLE_DIAN_PAO = "dian_pao"; + public static final String SETTLE_JIE_PAO = "jie_pao"; + public static final String SETTLE_ZIMO = "zimo"; + public static final String SETTLE_AN_KONG = "an_kong"; + public static final String SETTLE_MING_KONG = "ming_kong"; + + public static final int MING_GANG_SCORE = 3; + public static final int BU_GANG_SCORE = 1; + public static final int AN_GANG_SCORE = 2; + + + public static final int NIAO_TYPE_WU =0; + public static final int NIAO_TYPE_159 =1; + public static final int NIAO_TYPE_ALL =2; //爆炸马 + public static final int NIAO_TYPE_ZHUAMA =3; + + /** + * + */ + public static final String GAME_EVT_PLAYER_DEAL = "811"; + + /** + * + */ + public static final String GAME_DIS_CARD = "611"; + + /** + * + */ + public static final String GAME_EVT_DISCARD = "812"; + + /** + * + */ + public static final String GAME_EVT_DISCARD_TIP = "813"; + + /** + * + */ + public static final String GAME_EVT_FZTIPS = "814"; + + /** + * + */ + public static final String GAME_ACTION = "612"; + + /** + * + */ + + public static final String GAME_EVT_ACTION = "815"; + + /** + * + */ + public static final String GAME_EVT_HU = "816"; + + /** + * + */ + public static final String GAME_EVT_RESULT1 = "817"; + + /** + * + */ + public static final String GAME_EVT_RESULT2 = "818"; + + /** + * + */ + public static final String GAME_EVT_DRAW = "819"; + + /** + * + */ + public static final String GAME_EVT_CHANGE_ACTIVE_PLAYER = "820"; + + /** + * + */ + public static final String GAME_EVT_NIAO = "821"; + + /** + * + */ + public static final String GAME_EVT_MAI_NIAO = "20822"; + + /** + * + */ + public static final String GAME_EVT_PIAONIAO_TIP = "833"; + + /** + * + */ + public static final String GAME_PIAO = "1015"; + + /** + * 飘鸟提示 + */ + public static final String GAME_EVT_PIAO_TIP = "2031"; + public static final String GAME_EVT_PIAO = "2032"; + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXActionEvent.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXActionEvent.java new file mode 100644 index 0000000..18229b3 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXActionEvent.java @@ -0,0 +1,19 @@ +package extend.mj; + +public class EXActionEvent { + + public static final String EVENT_ACTION = "action"; + + public static final String EVENT_DISCARD = "discard"; + + public static final String EVENT_OTHER_DISCARD = "other_discard"; + + public static final String EVENT_START_GAME ="start_game"; + + public static final String EVENT_EXIT_ROOM = "exit_room"; + + public static final String EVENT_KONG_WIN = "kong_win"; + + public static final String EVENT_OTHER_PAO = "other_pao"; + public static final String EVENT_PIAO= "1015"; +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXGameController.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXGameController.java new file mode 100644 index 0000000..2b62901 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXGameController.java @@ -0,0 +1,576 @@ +package extend.mj; + +import com.game.GameController; +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.game.player.state.PlayerWaitState; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import com.taurus.core.entity.TObject; +import com.taurus.core.routes.ActionKey; +import com.taurus.permanent.data.Session; +import extend.mj.tip.Tip; +import extend.mj.tip.TipManager; +import extend.mj.uitl.CardUtil; +import extend.mj.uitl.WinCard; + +import java.util.*; +import java.util.Map.Entry; + +/** + * + * + * + * EXGameController.java + */ +public class EXGameController extends GameController { + + public EXGameController() { + super(); + } + + @ActionKey(Config.GAME_ACTION) + public void RouterAction(Session sender,ITObject params,int gid,Player owner) { + if(Global.loggerDebug) { + int id = params.getInt("id"); + if(id ==0) { + Global.logger.info(owner + " pass!"); + }else { + TipManager tipMgr =((EXPlayer)owner).tipMgr; + if(tipMgr.tipMap.containsKey(id)) { + Tip tip = tipMgr.tipMap.get(id); + Global.logger.info(owner + " select_action type:"+tip.weight+" card:"+tip.card); + } + } + } + owner.stateMachine.execute(EXActionEvent.EVENT_ACTION, 0, params); + } + + @ActionKey(Config.GAME_DIS_CARD) + public void RouterDisCard(Session sender,ITObject params,int gid,Player owner) { + owner.stateMachine.execute(EXActionEvent.EVENT_DISCARD, 0, params); + } + + @ActionKey(Config.GAME_PIAO) + public void RouterPiao(Session sender,ITObject params,int gid,Player owner) { + owner.stateMachine.execute(EXActionEvent.EVENT_PIAO, 0, params); + } + + public void changeActiveSeat(EXRoom owner,int activeSeat) { + owner.activeSeat = activeSeat; + TObject param = new TObject(); + param.putInt("seat", activeSeat); + owner.broadCastToClient(0, Config.GAME_EVT_CHANGE_ACTIVE_PLAYER, param); + } + + public void getCard(EXPlayer player,int leftCount){ + ITObject otherParam = new TObject(); + otherParam.putInt("card", 0); + otherParam.putInt("seat", player.room.activeSeat); + otherParam.putInt("left_count", leftCount); + + ITObject param = new TObject(); + param.putInt( "card", player.drawCard ); + param.putInt("seat", player.room.activeSeat); + param.putInt("left_count", leftCount); + player.cardInhand.add(player.drawCard); + param.putTArray("card_list", Util.toTArray(player.cardInhand)); + param.putTArray("outcard_list", Util.toTArray(player.outcardList)); + long start_time = System.currentTimeMillis(); + param.putTArray("ting_list", getTingList(player)); + long use_time = System.currentTimeMillis() - start_time; + Global.logger.info("---------------getTingList use time:" + use_time); + player.sendEvent(Config.GAME_EVT_DRAW, param); + if(Global.loggerDebug) { + Global.logger.info(player + " drawcard["+player.drawCard+"]"); + } + player.room.broadCastToClient(player.playerid, Config.GAME_EVT_DRAW, otherParam); + ((EXPlayBack)player.getRoom().playBackData).addGetCardCommand(player.room.activeSeat, player.drawCard,leftCount); + } + + public void outCard(EXPlayer player,int discard){ + ITObject response = new TObject(); + response.putInt("seat", player.seat); + response.putInt("card", discard); + player.room.broadCastToClient(0, Config.GAME_EVT_DISCARD, response); + EXRoom room = player.getRoom(); + ((EXPlayBack)room.playBackData).addOutCardCommand(player.seat, discard); + + room.activeCard = discard; + room.lastDiscardSeat = player.seat; + room.currenDiscardSeat = 0; + if (room.isGengZhuang) + { + if (room.bankerSeat == player.seat && player.opCardList.size() == 0 && player.outcardList.size() == 0) + { + if (room.gent_zhuan_nextSeat == 0 && room.first_zhuang_card == 0) + { + room.first_zhuang_card = discard; + room.geng_zhuan_num = 1; + room.gent_zhuan_nextSeat = player.nextSeat; + } + else + { + room.isGengZhuang = false; + } + } + else if (room.gent_zhuan_nextSeat == player.seat && player.opCardList.size() == 0 && player.outcardList.size() == 0 && room.first_zhuang_card == discard) + { + room.geng_zhuan_num += 1; + room.gent_zhuan_nextSeat = player.nextSeat; + if (room.geng_zhuan_num >= room.maxPlayers) + { + if (room.config.getBoolean(Config.ROOM_CONFIG_GENGZHUAN)) + { + EXPlayer bankerPlayer = (EXPlayer)room.playerMapBySeat.get(room.bankerSeat); + for (Entry entry : room.playerMapById.entrySet()) { + EXPlayer otherPlayer = (EXPlayer) entry.getValue(); + if (otherPlayer.playerid != bankerPlayer.playerid) + { + room.addScore(otherPlayer,bankerPlayer, 1, EXScore.GENG_ZHUAN); + } + } + } + room.isGengZhuang = false; + } + } + else + { + room.isGengZhuang = false; + } + } + + player.outcardList.add(discard); + Util.removeCard(player.cardInhand, discard, 1); + if(Global.loggerDebug) { + Global.logger.info(player + " outcard["+discard+"]"); + } + room.broadCastToServer(player.playerid, EXActionEvent.EVENT_OTHER_DISCARD, discard); + } + + + + public void actionCard(EXPlayer player,int card,int type,int from_seat,ITArray opcardArray){ + EXRoom room = player.getRoom(); + ITObject paramBroadCast = new TObject(); + paramBroadCast.putInt("playerid", player.playerid); + paramBroadCast.putInt("card", card); + paramBroadCast.putInt("type", type); + paramBroadCast.putInt("from_seat", from_seat); + int huxi = player.getShowHuXi(true); + paramBroadCast.putInt("hu_xi", huxi); + if(opcardArray!=null){ + paramBroadCast.putTArray("opcard", opcardArray); + } + ITArray result = new TArray(); + for (Entry entry : room.playerMapById.entrySet()) { + EXPlayer __player = (EXPlayer) entry.getValue(); + ITObject __info = new TObject(); + __info.putInt("playerid", __player.playerid); + __info.putTArray("outcard_list", Util.toTArray(__player.outcardList)); + result.addTObject(__info); + } + paramBroadCast.putTArray("outcard_list", result); + + if(Global.loggerDebug) { + Global.logger.info(String.format("%s from_seat:%d card:%d type:%d ", player,from_seat,card,type)); + } + room.broadCastToClient(player.playerid, Config.GAME_EVT_ACTION, paramBroadCast); + + if (type == RuleWeight.TYPE_CHOW || type == RuleWeight.TYPE_PONG) + { + paramBroadCast.putTArray("ting_list", getTingList(player)); + } + + player.sendEvent(Config.GAME_EVT_ACTION, paramBroadCast); + + ((EXPlayBack)room.playBackData).addActionCommand(player.seat, type, card, from_seat,opcardArray); + } + + public void dealCard(EXRoom owner) { + for (Entry entry : owner.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer)entry.getValue(); + player.cardInhand = owner.card.deal(); + Collections.sort(player.cardInhand); + if(Global.loggerDebug) { + Global.logger.info(player + " cardlist:" + player.cardInhand); + } + if (owner.config.getInt(Config.ROOM_CONFIG_MAI_NIAO) == 1) + { + int maiNiaoOpt = owner.config.getInt(Config.ROOM_CONFIG_MAI_NIAO_OPT); + //买一马 + if (maiNiaoOpt == 1) + { + CardNiao niao = new CardNiao(); + niao.playerId = player.playerid; + niao.seat = player.seat; + niao.card = owner.card.pop(); + niao.score = 0; + player.mai_niao.add(niao); + } + //买二马 + else if (maiNiaoOpt == 2) + { + for(int i = 0; i < 2; i++) + { + CardNiao niao = new CardNiao(); + niao.playerId = player.playerid; + niao.seat = player.seat; + niao.card = owner.card.pop(); + niao.score = 0; + player.mai_niao.add(niao); + } + } + //罚一马 + else if (maiNiaoOpt == 3) + { + if (player.seat == owner.bankerSeat) + { + CardNiao niao = new CardNiao(); + niao.playerId = player.playerid; + niao.seat = player.seat; + niao.card = owner.card.pop(); + niao.score = 0; + player.mai_niao.add(niao); + } + } + //罚二马 + else if (maiNiaoOpt == 4) + { + if (player.seat == owner.bankerSeat) + { + for(int i = 0; i < 2; i++) + { + CardNiao niao = new CardNiao(); + niao.playerId = player.playerid; + niao.seat = player.seat; + niao.card = owner.card.pop(); + niao.score = 0; + player.mai_niao.add(niao); + } + } + } + } + ITObject param = new TObject(); + ITArray handCard = Util.toTArray(player.cardInhand); + param.putTArray("card_list", handCard); + param.putInt("bank_seat", player.room.bankerSeat); + param.putInt("laiziCard", owner.card.laiziCard); + param.putInt("laiziCard2", owner.card.laiziCard2); + param.putInt("laiziCardBefore", owner.card.laiziCardBefore); + param.putInt("laiziCard2Before", owner.card.laiziCard2Before); + player.sendEvent(Config.GAME_EVT_PLAYER_DEAL, param); + player.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + } + } + + public void tipEvent(EXPlayer owner) { + ITObject param = owner.tipMgr.toMP(); + owner.sendEvent(Config.GAME_EVT_FZTIPS, param); + } + + public void discardTipEvent(EXPlayer owner) { + owner.getRoom().currenDiscardSeat = owner.seat; + owner.sendEvent(Config.GAME_EVT_DISCARD_TIP, null); + } + + public void winEvent(EXPlayer owner,int from_seat,int win_card) { + ITArray cardInHand = TArray.newInstance(); + for (int card1 : owner.cardInhand) { + cardInHand.addInt(card1); + } + ITObject param = new TObject(); + param.putTArray("card", cardInHand); + param.putInt("seat", owner.seat); + param.putInt("win_card", win_card); + param.putInt("from_seat", from_seat); + ITArray array = CardUtil.toMPData_WinMap(owner.winMap); + if (array != null) { + param.putTArray("win_list", array); + } + if(Global.loggerDebug) { + Global.logger.info(owner + " hupai!["+(owner.seat == from_seat?"self":"other")+"]"); + } + EXRoom room = owner.getRoom(); + room.broadCastToClient(0, Config.GAME_EVT_HU, param); + ((EXPlayBack)room.playBackData).addWinCardCommand(owner.seat, false); + } + + public void sendNiaoEvt(EXPlayer owner, int seat) { + EXRoom room = owner.getRoom(); + ITObject param = new TObject(); +// param.putInt("playerid", owner.playerid); + ITArray array = new TArray(); + for (int index = 0; index < room.niao.size(); index++) { + array.addTObject(room.niao.get(index).toMP()); + } + param.putTArray("niao", array); + param.putInt("start_seat", seat); + + room.broadCastToClient(0, Config.GAME_EVT_NIAO, param); + ((EXPlayBack)room.playBackData).addNiaoCommand(owner.seat, param); + } + + public void sendMaiNiaoEvt(EXPlayer owner, int seat) { + EXRoom room = owner.getRoom(); + ITObject param = new TObject(); + ITArray array = new TArray(); + for (Entry entry : room.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + for (int index = 0; index < player.mai_niao.size(); index++) { + array.addTObject(player.mai_niao.get(index).toMP()); + } + } + + param.putTArray("mai_niao", array); + param.putInt("start_seat", seat); + + room.broadCastToClient(0, Config.GAME_EVT_MAI_NIAO, param); + ((EXPlayBack)room.playBackData).addMaiNiaoCommand(owner.seat, param); + } + + /** + * Ʊ����ʾ + * @param owner + */ + public void piaoNiaoTipEvent(EXPlayer owner) { + owner.sendEvent(Config.GAME_EVT_PIAONIAO_TIP, null); + } + + private ITObject getRoomResultData(EXRoom owner) { + ITObject mp = TObject.newInstance(); + mp.putBoolean("liuju", owner.liuju); + mp.putInt("active_player", owner.playerMapBySeat.get(owner.activeSeat).playerid); + mp.putInt("xipai_score", owner.xi_pai_score); + mp.putInt("anchou_score", owner.an_chou_score); + long time = System.currentTimeMillis(); + long t = time / 1000; + mp.putLong("time", t); + ITArray niao = new TArray(); + for (int index = 0; index < owner.niao.size(); index++) { + niao.addTObject(owner.niao.get(index).toMP()); + } + mp.putTArray("niao", niao); + mp.putTArray("left_card", Util.toTArray(owner.card.cardList)); + ITArray infoList = new TArray(); + for (Entry entry : owner.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + ITObject param = new TObject(); + param.putInt("seat", player.seat); + param.putInt("win_card", player.winCard); + param.putInt("piao", player.piao); + param.putBoolean("is_win", player.winer == 1); + param.putInt("hu_score", player.score.round_log.get(EXScore.WIN)); + param.putInt("niao_score", player.score.round_log.get(EXScore.NIAO)); + param.putInt("gang_score", player.score.round_log.get(EXScore.KONG)); + param.putInt("piao_niao_score", player.score.round_log.get(EXScore.PIAO_NIAO)); + param.putInt("geng_zhuan", player.score.round_log.get(EXScore.GENG_ZHUAN)); + param.putInt("ma_geng_gong", player.score.round_log.get(EXScore.MA_GENG_GONG)); + if ((owner.config.getBoolean(Config.ROOM_CONFIG_JIEJIEGAO) || owner.config.getBoolean(Config.ROOM_CONFIG_LIAN_ZHUANG)) && player.repeat_win > 0) + { + param.putInt("repeat_win", player.repeat_win); + } + else + { + param.putInt("repeat_win", 0); + } + + param.putInt("mai_niao_score", player.score.round_log.get(EXScore.MAI_NIAO)); + player.hp_info(param); + param.putInt("round_score", player.score.round_score); + param.putInt("total_score", player.score.total_score); + ITArray handCard = Util.toTArray(player.cardInhand); + param.putTArray("hand_card", handCard); + ITArray array = CardUtil.toMPData_WinMap(player.winMap); + if (array != null) { + param.putTArray("win_list", array); + } + ITArray mai_niao = new TArray(); + for (int index = 0; index < player.mai_niao.size(); index++) { + mai_niao.addTObject(player.mai_niao.get(index).toMP()); + } + param.putTArray("mai_niao", mai_niao); + param.putInt("ming_gang_num", player.ming_gang_num); + param.putInt("an_gang_num", player.an_gang_num); + param.putInt("dian_gang_num", player.dian_gang_num); + ITArray opCardList = TArray.newInstance(); + + for (OpCard opCard : player.opCardList) { + ITObject obj = TObject.newInstance(); + obj.putInt("type", opCard.type); + obj.putInt("card", opCard.card); + if(opCard.opCard!=null) { + obj.putTArray("opcard", opCard.opCard); + } + opCardList.addTObject(obj); + } + param.putTArray("opCardList", opCardList); + + infoList.addTObject(param); + } + mp.putTArray("info_list", infoList); + return mp; + } + public void roomResult(EXRoom owner) { + ITObject mp = TObject.newInstance(); + mp.putInt("type", 0); + ITObject result = getRoomResultData(owner); + owner.playBackData.addResult(result); + mp.putTObject("result", result); + owner.broadCastToClient(0, Config.GAME_EVT_RESULT1, mp); + } + + + public void roomTotalResult(EXRoom owner,boolean dissmiss) { + ITObject data = TObject.newInstance(); + long t = System.currentTimeMillis() / 1000; + data.putLong("time", t); + ITArray infoList = new TArray(); + for (Entry entry : owner.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + ITObject param = new TObject(); + param.putInt("seat", player.seat); + param.putTObject("settle_log", player.settleLog.toTObject()); + param.putInt("total_score", player.score.total_score); + player.hp_info(param); + infoList.addTObject(param); + } + data.putTArray("info_list", infoList); + + ITObject mp = TObject.newInstance(); + mp.putInt("type", dissmiss?2:1); + if(!dissmiss) { + ITObject result = getRoomResultData(owner); + owner.playBackData.addResult(result); + mp.putTObject("result", result); + } + mp.putTObject("total_result", data); + + owner.broadCastToClient(0, Config.GAME_EVT_RESULT1, mp); + + } + + /** + * 票鸟提示 + * @param owner + */ + public void piaoTipEvent(EXPlayer owner,int reload) { + ITObject response = new TObject(); + response.putInt("piao", owner.room.config.getInt(Config.ROOM_CONFIG_PIAO)); + response.putInt("last_piao", owner.last_piao); + response.putInt("last_winer", owner.last_winer); + response.putInt("reload", reload); + owner.sendEvent(Config.GAME_EVT_PIAO_TIP, response); + } + + /** + * 票鸟事件 + * @param owner + */ + public void piaoEvent(EXPlayer owner) { + if(owner.piao==-1)return; + + ITObject param = new TObject(); + param.putInt("seat", owner.seat); + param.putInt("piao", owner.piao); + owner.room.broadCastToClient(0, Config.GAME_EVT_PIAO, param); + } + + public boolean isTingPai(EXPlayer player, int drawCard, List delPai, List opCards) + { + EXRoom room = player.getRoom(); + + List tempList = new ArrayList(); + for (int index = 1; index <= 8; index++) { + tempList.add(100*index + 1); + tempList.add(100*index + 2); + tempList.add(100*index + 3); + } + HashMap map = new HashMap(); + List tempCardList = new ArrayList(); + tempCardList.addAll(player.cardInhand); + if (drawCard > 0) + { + Util.removeCard(tempCardList, drawCard, 1); + } + if (delPai != null) + { + for(int i = 0; i < delPai.size(); i++) + { + Util.removeCard(tempCardList, delPai.get(i), 1); + } + } + + for(int j = 0; j < tempList.size(); j++) + { + int laizi = room.config.getInt(Config.ROOM_CONFIG_LAIZI); + map.clear(); + WinCard win = new WinCard(tempCardList, tempList.get(j), room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, true, true); + if (win.checkWinOpList(map, player, opCards, room, true)) { + return true; + } + } + + return false; + } + + public ITArray getTingList(EXPlayer player) + { + EXRoom room = player.getRoom(); + + Map cardMap = new HashMap<>(); + List tempList = new ArrayList(); + for (int index = 1; index <= 8; index++) { + tempList.add(100*index + 1); + tempList.add(100*index + 2); + tempList.add(100*index + 3); + } + HashMap map = new HashMap(); + + for(int i = 0; i < player.cardInhand.size(); i++) + { + int tempCard = player.cardInhand.get(i); + if (player.getRoom().isLaizi(tempCard)) + { + continue; + } + + List tempCardList = new ArrayList(); + tempCardList.addAll(player.cardInhand); + Util.removeCard(tempCardList, tempCard, 1); + + for(int j = 0; j < tempList.size(); j++) + { + int laizi = room.config.getInt(Config.ROOM_CONFIG_LAIZI); + map.clear(); + WinCard win = new WinCard(tempCardList, tempList.get(j), room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, true, true); + if (win.checkWin(map, player, room, true)) { + if (!cardMap.containsKey(tempCard)) + { + ITArray cardMapList = new TArray(); + cardMapList.addInt(tempList.get(j)); + cardMap.put(tempCard, cardMapList); + } + else + { + ITArray cardMapList = cardMap.get(tempCard); + cardMapList.addInt(tempList.get(j)); + } + } + } + } + + ITArray array = TArray.newInstance(); + for (Map.Entry entry : cardMap.entrySet()) { + ITObject obj = TObject.newInstance(); + obj.putInt("card", entry.getKey()); + obj.putTArray("value", entry.getValue()); + Global.logger.info("del card:"+entry.getKey()+" hu card:"+ entry.getValue().toJson()); + array.addTObject(obj); + } + + return array; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXMainServer.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXMainServer.java new file mode 100644 index 0000000..f3a586a --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXMainServer.java @@ -0,0 +1,99 @@ +package extend.mj; + +import java.util.Map; + +import com.game.GameController; +import com.game.Global; +import com.game.MainServer; +import com.game.data.Player; +import com.game.data.Room; +import com.game.player.state.PlayerWaitState; +import com.game.room.state.RoomStartGameState; + +import extend.mj.player.rulestate.*; +import extend.mj.player.state.EXPlayerDisCardTipState; +import extend.mj.player.state.EXPlayerDiscardState; +import extend.mj.player.state.EXPlayerDrawState; +import extend.mj.player.state.EXPlayerKongDrawState; +import extend.mj.player.state.EXPlayerDrawTipState; +import extend.mj.player.state.EXPlayerKongWinState; +import extend.mj.player.state.EXPlayerPiaoNiaoTipState; +import extend.mj.player.state.EXPlayerWaitKongWinState; +import extend.mj.player.state.EXPlayerWaitState; +import extend.mj.room.state.EXRoomDealState; +import extend.mj.room.state.EXRoomPiaoState; +import extend.mj.room.state.EXRoomSetpState; +import extend.mj.room.state.EXRoomStartGameState; + +/** + * + * + * EXMainServer.java + */ +public class EXMainServer extends MainServer{ + + + public static PlayerRuleManager playerRuleMgr; + + public static EXGameController gameCtr; + + @Override + public void onStart() { + super.onStart(); + gameCtr = (EXGameController)Global.gameCtr; + + registerState(); + + playerRuleMgr = new PlayerRuleManager(); + } + + + private final void registerState() { + Global.registerState(RoomStartGameState.class, new EXRoomStartGameState()); + Global.registerState(EXRoomSetpState.class, new EXRoomSetpState()); + Global.registerState(EXRoomDealState.class, new EXRoomDealState()); + Global.registerState(EXRoomPiaoState.class, new EXRoomPiaoState()); + + Global.registerState(PlayerWaitState.class, new EXPlayerWaitState()); + Global.registerState(EXPlayerDrawState.class, new EXPlayerDrawState()); + Global.registerState(EXPlayerKongDrawState.class, new EXPlayerKongDrawState()); + + Global.registerState(EXPlayerDiscardState.class, new EXPlayerDiscardState()); + Global.registerState(EXPlayerDisCardTipState.class, new EXPlayerDisCardTipState()); + Global.registerState(EXPlayerDrawTipState.class, new EXPlayerDrawTipState()); + Global.registerState(EXPlayerWaitKongWinState.class, new EXPlayerWaitKongWinState()); + Global.registerState(EXPlayerKongWinState.class, new EXPlayerKongWinState()); + Global.registerState(EXPlayerPiaoNiaoTipState.class, new EXPlayerPiaoNiaoTipState()); + + Global.registerState(PROtherKongState.class, new PROtherKongState()); + Global.registerState(PROtherWinState.class, new PROtherWinState()); + Global.registerState(PRPongState.class, new PRPongState()); + Global.registerState(PRChowState.class, new PRChowState()); + Global.registerState(PRSelfKongState.class, new PRSelfKongState()); + Global.registerState(PRSelfWinState.class, new PRSelfWinState()); + Global.registerState(PROtherGongSelfWinState.class, new PROtherGongSelfWinState()); + + + } + + + @Override + public Room newRoom(String roomid, Map redis_room_map) { + // TODO Auto-generated method stub + return new EXRoom(roomid, redis_room_map); + } + + + @Override + public Player newPlayer(int playerid, Room room, String session_id) { + // TODO Auto-generated method stub + return new EXPlayer(playerid, room, session_id); + } + + + @Override + protected GameController newController() { + // TODO Auto-generated method stub + return new EXGameController(); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayBack.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayBack.java new file mode 100644 index 0000000..4349aa8 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayBack.java @@ -0,0 +1,71 @@ +package extend.mj; + +import com.game.Util; +import com.game.data.BasePlayBack; +import com.game.data.Player; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; + +public class EXPlayBack extends BasePlayBack{ + + + public EXPlayBack(EXRoom room){ + super(room); + info.putInt("left_card", room.card.getCount()); + } + + protected ITObject getPlayerInfo(Player player) { + ITObject obj =super.getPlayerInfo(player); + EXPlayer p = (EXPlayer)player; + ITArray cardInhand = Util.toTArray(p.cardInhand); + obj.putTArray("hand_card", cardInhand); + obj.putInt("score", player.score.total_score); + obj.putInt("piao", p.piao); + return obj; + } + + public void addGetCardCommand(int seat,int card,int left_count){ + ITObject data = TObject.newInstance(); + data.putInt("card", card); + data.putInt("left_count", left_count); + addCommand("GetCard",seat,data); + } + + + public void addOutCardCommand(int seat,int card){ + ITObject data = TObject.newInstance(); + data.putInt("card", card); + addCommand("OutCard",seat,data); + } + + public void addOutCardKongCommand(int seat,ITArray card){ + ITObject data = TObject.newInstance(); + data.putTArray("cardList", card); + addCommand("OutCardKong",seat,data); + } + + public void addActionCommand(int seat,int type,int card,int from_seat,ITArray opcardArray){ + ITObject cmdData = TObject.newInstance(); + cmdData.putInt("card", card); + cmdData.putInt("type", type); + cmdData.putInt("from_seat", from_seat); + if(opcardArray!=null) + cmdData.putTArray("opcard", opcardArray); + addCommand("Action",seat,cmdData); + } + + public void addWinCardCommand(int seat,boolean zimo){ + ITObject cmdData = TObject.newInstance(); + addCommand("Win",seat,cmdData); + } + + public void addNiaoCommand(int seat,ITObject param){ + addCommand("Niao",seat,param); + } + + public void addMaiNiaoCommand(int seat,ITObject param){ + addCommand("Mai_Niao",seat,param); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayer.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayer.java new file mode 100644 index 0000000..9fd0061 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXPlayer.java @@ -0,0 +1,262 @@ +package extend.mj; + +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.game.data.Room; +import com.game.data.Score; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import com.taurus.core.entity.TObject; +import extend.mj.tip.TipManager; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * + * + * + * 2017��8��30�� + * EXPlayer.java + */ +public class EXPlayer extends Player { + // ���� + public List cardInhand; + + // ������ + public List outcardList; + + public ITArray opCard; + + public List pongGroup; + public List kongGroup; + public List selfKongGroup; + public List opCardList; + + public int drawCard = 0; + public int winCard = 0; + + public TipManager tipMgr; + + public SettleLog settleLog; + + /** + * ©�� + */ + public boolean louhu = false; + + /** + * ǿ�Ƽ����� + */ + public boolean forceCheckWin = false; + /** + * 0 С�� 1 ���ܺ� + */ + public int winType = 0; + + /** + * 0 无 1 胡 2 输 + */ + public int last_winer = 0; + + public List notPongKongList = new ArrayList<>(); + public List notPongList = new ArrayList<>(); + + public int niaoCount; + + public int repeat_win; + + public Map winMap; + + public int niao_score; + + public int hu_score; + + public int di_score; + + public ArrayList mai_niao; + + public int ming_gang_num = 0; + public int an_gang_num = 0; + public int dian_gang_num = 0; + + public boolean tinghu10bei = false; + + public boolean gangshangpao = false; + + public int piao = -1; + public int last_piao = -1; + + public boolean is_gang = false; + + public EXPlayer(int playerid, Room table, String session_id) { + super(playerid, table, session_id); + + cardInhand = new ArrayList<>(); + outcardList = new ArrayList<>(); + + pongGroup = new ArrayList<>(); + kongGroup = new ArrayList<>(); + selfKongGroup = new ArrayList<>(); + opCardList = new ArrayList<>(); + + opCard = new TArray(); + + tipMgr = new TipManager(this); + + settleLog = new SettleLog(); + settleLog.put(Config.SETTLE_DIAN_PAO, 0); + settleLog.put(Config.SETTLE_JIE_PAO, 0); + settleLog.put(Config.SETTLE_ZIMO, 0); + settleLog.put(Config.SETTLE_AN_KONG, 0); + settleLog.put(Config.SETTLE_MING_KONG, 0); + + repeat_win = -1; + niao_score = 2; + hu_score = 0; + di_score = 0; + + ming_gang_num = 0; + an_gang_num = 0; + dian_gang_num = 0; + + last_winer = 0; + + tinghu10bei = false; + gangshangpao = false; + is_gang = false; + + this.mai_niao = new ArrayList(); + } + + protected Score newScore() { + return new EXScore(this); + } + + public void initOpCard(ITArray opcard) { + this.opCard.clear(); + for (int i = 0; i < opcard.size(); ++i) { + this.opCard.addInt(opcard.getInt(i)); + } + } + + public ITObject getReloadInfo() { + ITObject playerData = super.getReloadInfo(); + ITArray disCard = Util.toTArray(this.outcardList); + playerData.putTArray("outcard_list", disCard); + playerData.putInt("card_count", cardInhand.size()); + playerData.putInt("score", score.total_score); + playerData.putInt("piao", this.piao); + playerData.putInt("last_piao", this.last_piao); + ITArray opcards = TArray.newInstance(); + for (OpCard opcard : opCardList) { + ITObject opcardParam = new TObject(); + opcardParam.putInt("type", opcard.type); + opcardParam.putInt("card", opcard.card); + if(opcard.opCard!=null) { + opcardParam.putTArray("opcard", opcard.opCard); + } + opcards.addTObject(opcardParam); + } + playerData.putTArray("opcard", opcards); + + return playerData; + } + + public void clear() { + super.clear(); + this.cardInhand.clear(); + this.notPongKongList.clear(); + this.notPongList.clear(); + this.winer = 0; + this.louhu = false; + this.outcardList.clear(); + this.drawCard = 0; + this.kongGroup.clear(); + this.pongGroup.clear(); + this.selfKongGroup.clear(); + this.opCardList.clear(); + this.score.resetRound(); + this.niaoCount = 0; + this.winMap = null; + this.niao_score = 2; + this.hu_score = 0; + this.di_score = 0; + this.mai_niao.clear(); + this.ming_gang_num = 0; + this.an_gang_num = 0; + this.dian_gang_num = 0; + this.tinghu10bei = false; + this.piao = -1; + this.is_gang = false; + } + + public int getShowHuXi(boolean self) { + int huXi = 0; + for (OpCard opCard : this.opCardList) { + /*if (!self) { + if (opCard.type == RuleWeight.TYPE_KAN || opCard.type == RuleWeight.TYPE_WEI) { + continue; + } + } else {*/ + if (opCard.type == RuleWeight.TYPE_CHOW) { + huXi += 4; + } + if (opCard.type == RuleWeight.TYPE_PONG) { + if (IsShangFu(opCard.card)) + { + huXi += 3 * 4; + } + else { + huXi += 2; + } + } + if(opCard.type == RuleWeight.TYPE_KONG){ + if (room.config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) { + huXi += 6; + }else{ + huXi += 4; + } + } + if(opCard.type == RuleWeight.TYPE_SELF_KONG){ + if (room.config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) { + huXi += 6; + }else{ + huXi += 4; + } + } + if(opCard.type == RuleWeight.TYPE_ZHAO){ + if (room.config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) { + huXi += 6; + }else{ + huXi += 4; + } + } + if(opCard.type == RuleWeight.TYPE_SELF_ZHAO){ + if (room.config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) { + huXi += 6; + }else{ + huXi += 4; + } + } + + } + return huXi; + } + public boolean IsShangFu(int card) + { + if (card == 101 || card == 801) + { + return true; + } + return false; + } + + + public EXRoom getRoom() { + return (EXRoom) room; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXRoom.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXRoom.java new file mode 100644 index 0000000..eb49257 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXRoom.java @@ -0,0 +1,790 @@ +package extend.mj; + +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.game.data.Room; +import com.game.player.state.PlayerWaitState; +import com.taurus.core.entity.ITObject; +import extend.mj.player.state.EXPlayerDisCardTipState; +import extend.mj.tip.Action; +import extend.mj.tip.TipManager; +import extend.mj.uitl.WinCard; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +public class EXRoom extends Room { + + // + public Map tipMap; + public List actionList; + + public RoomCard card; + + public int activeCard; + public int currenDiscardSeat; + public int lastDiscardSeat; + public int winCount = 0; + public boolean liuju = false; + public boolean last_liuju = false; + + public ArrayList niao; + + public int piaoNiaoCount; + public int adminSeat = 0; + public int lastWinPlayerId = 0; + public boolean isGengZhuang = false; + public int first_zhuang_card = 0; + public int geng_zhuan_num = 0; + public int gent_zhuan_nextSeat = 0; + /* + * 上一次庄家座位号 + */ + public int lastBankerSeat = 0; + public int piaoCount = 0; + + public EXRoom(String roomid, Map redis_room_map) { + super(roomid, redis_room_map); + card = new RoomCard(this); + + this.tipMap = new HashMap(); + this.actionList = new ArrayList(); + this.niao = new ArrayList(); + + if (!this.config.containsKey(Config.ROOM_CONFIG_DIANPAO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_DIANPAO, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_HUNYISE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HUNYISE, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_QINGYISE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QINGYISE, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_PENGPENGHU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_PENGPENGHU, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_QIDUI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIDUI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_HAOHUA_QIDUI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HAOHUA_QIDUI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_HAOHUA2_QIDUI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HAOHUA2_QIDUI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_HAOHUA3_QIDUI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HAOHUA3_QIDUI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_GANGSHANGKAIHUA_2bei)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GANGSHANGKAIHUA_2bei, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_SHISHANGYAO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_SHISHANGYAO, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_TIANDIHU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_TIANDIHU, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_SHIBALUOHAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_SHIBALUOHAN, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_XIAOSHANYUAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_XIAOSHANYUAN, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_DASHANYUAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_DASHANYUAN, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_DASIXI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_DASIXI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_XIAOSIXI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_XIAOSIXI, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_LOUHU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LOUHU, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_GUO_PENG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GUO_PENG, false); + } + if (!this.config.containsKey(Config.ROOM_CONFIG_GUO_GONG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GUO_GONG, false); + } + + this.config.putBoolean(Config.ROOM_CONFIG_NONEALL, false); + this.config.putBoolean(Config.ROOM_CONFIG_ZHUANGXIAN, false); + this.config.putBoolean(Config.ROOM_CONFIG_QIANGKONG_NIAO, true); + + //可抢杠胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_QIANGKONG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIANGKONG, false); + } + + //可抢杠胡2倍 + if (!this.config.containsKey(Config.ROOM_CONFIG_QIANGKONG_2BEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIANGKONG_2BEI, false); + } + + //明杠可抢 + if (!this.config.containsKey(Config.ROOM_CONFIG_QIANGKONG_MING)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIANGKONG_MING, false); + } + + //抢杠全包 + if (!this.config.containsKey(Config.ROOM_CONFIG_QG_TYPE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QG_TYPE, false); + } + + //杠爆全包 + if (!this.config.containsKey(Config.ROOM_CONFIG_GANGBAO_TYPE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GANGBAO_TYPE, false); + } + + this.config.putBoolean(Config.ROOM_CONFIG_HZ_HU, false); + + if (!this.config.containsKey(Config.ROOM_CONFIG_GENGZHUAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GENGZHUAN, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_JIEJIEGAO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_JIEJIEGAO, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_JIEJIEGAO_FIRST_NO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_JIEJIEGAO_FIRST_NO, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_LIAN_ZHUANG)) { + this.config.putBoolean(Config.ROOM_CONFIG_LIAN_ZHUANG, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_WUGUI_JIABEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_WUGUI_JIABEI, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_NO_WAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_NO_WAN, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_QIDUI_JIA_FAN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIDUI_JIA_FAN, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_QIDUI_4BEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QIDUI_4BEI, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_MA_GEN_GONG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_MA_GEN_GONG, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_WU_FENG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_WU_FENG, false); + } + + ////幺九 + if (!this.config.containsKey(Config.ROOM_CONFIG_YAO_JIU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_YAO_JIU, false); + } + + //清幺九 + if (!this.config.containsKey(Config.ROOM_CONFIG_QING_YAO_JIU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QING_YAO_JIU, false); + } + + //有没有癞子 + if (!this.config.containsKey(Config.ROOM_CONFIG_LAIZI)) + { + this.config.putInt(Config.ROOM_CONFIG_LAIZI, 0); + } + + //四鬼胡牌 + if (!this.config.containsKey(Config.ROOM_CONFIG_LAIZI4_HU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LAIZI4_HU, false); + } + + //四鬼胡牌两倍 + if (!this.config.containsKey(Config.ROOM_CONFIG_LAIZI4_HU_2BEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LAIZI4_HU_2BEI, false); + } + + //全风 + if (!this.config.containsKey(Config.ROOM_CONFIG_QUAN_FENG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QUAN_FENG, false); + } + + ////12张落地全包 + if (!this.config.containsKey(Config.ROOM_CONFIG_12ZHANG_LUODI_QUANBAO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_12ZHANG_LUODI_QUANBAO, false); + } + + ////留够马牌 + if (!this.config.containsKey(Config.ROOM_CONFIG_LIU_GOU_MA)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LIU_GOU_MA, false); + } + + //全求人 + if (!this.config.containsKey(Config.ROOM_CONFIG_QUAN_FENG_SCORE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QUAN_FENG_SCORE, false); + } + + // ROOM_CONFIG_han19 = "han19"; //含19即可 + if (!this.config.containsKey(Config.ROOM_CONFIG_han19)) + { + this.config.putBoolean(Config.ROOM_CONFIG_han19, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_ZIYISE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_ZIYISE, false); + } + + + //大胡相乘 + if (!this.config.containsKey(Config.ROOM_CONFIG_DAHU_CHENG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_DAHU_CHENG, false); + } + + //鸡胡不能吃胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_JIHU_NOTCHIHU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_JIHU_NOTCHIHU, false); + } + + //小胡的倍数另算 + if (!this.config.containsKey(Config.ROOM_CONFIG_XIAOHU_BEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_XIAOHU_BEI, false); + } + + //流局两倍 + if (!this.config.containsKey(Config.ROOM_CONFIG_LIUJU_2BEI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LIUJU_2BEI, false); + } + + //荒庄荒杠 + if (!this.config.containsKey(Config.ROOM_CONFIG_HUANGZHUANGHUANGGANG)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HUANGZHUANGHUANGGANG, false); + } + + //潮州特殊自摸 + if (!this.config.containsKey(Config.ROOM_CONFIG_SPECAIL_ZIMO)) + { + this.config.putBoolean(Config.ROOM_CONFIG_SPECAIL_ZIMO, false); + } + + //必胡,必须胡牌,不能过 + if (!this.config.containsKey(Config.ROOM_CONFIG_MUST_HU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_MUST_HU, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_LIU_GOU_MA)) + { + this.config.putBoolean(Config.ROOM_CONFIG_LIU_GOU_MA, false); + } + + //买马,提前预定马,猜谁胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_MAI_NIAO)) + { + this.config.putInt(Config.ROOM_CONFIG_MAI_NIAO, 0); + } + + //买马值 + if (!this.config.containsKey(Config.ROOM_CONFIG_MAI_NIAO_OPT)) + { + this.config.putInt(Config.ROOM_CONFIG_MAI_NIAO_OPT, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_MA_GEN_DI_FEN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_MA_GEN_DI_FEN, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_NIAO)) + { + this.config.putInt(Config.ROOM_CONFIG_NIAO, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_NIAO_OPT)) + { + this.config.putInt(Config.ROOM_CONFIG_NIAO_OPT, 0); + } + + //10倍不计分 + if (!this.config.containsKey(Config.ROOM_CONFIG_10_BEI_BUJIFEN)) + { + this.config.putBoolean(Config.ROOM_CONFIG_10_BEI_BUJIFEN, false); + } + + //封顶十倍 + if (!this.config.containsKey(Config.ROOM_CONFIG_10_BEI_FENGDING)) + { + this.config.putBoolean(Config.ROOM_CONFIG_10_BEI_FENGDING, false); + } + + //自动胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_ZI_DONG_HU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_ZI_DONG_HU, false); + } + + //海底捞月 + //自动胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_HAI_DI_NAO_YUE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_HAI_DI_NAO_YUE, false); + } + + ////使用默认基础胡分 + if (!this.config.containsKey(Config.ROOM_CONFIG_USE_BASE_HU_SCORE)) + { + this.config.putBoolean(Config.ROOM_CONFIG_USE_BASE_HU_SCORE, false); + } + + //门清 + if (!this.config.containsKey(Config.ROOM_CONFIG_MENG_QING)) + { + this.config.putBoolean(Config.ROOM_CONFIG_MENG_QING, false); + } + + //没有鸡胡,统一叫平胡 + if (!this.config.containsKey(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU, false); + } + + //杠上炮2倍 + if (!this.config.containsKey(Config.ROOM_CONFIG_GANGSHANGPAO_2bei)) + { + this.config.putBoolean(Config.ROOM_CONFIG_GANGSHANGPAO_2bei, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_CHUIPAI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_CHUIPAI, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_PIAO)) + { + this.config.putInt(Config.ROOM_CONFIG_PIAO, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_PIAO_FEN)) + { + this.config.putInt(Config.ROOM_CONFIG_PIAO_FEN, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_XUAN_ZHUANG)) + { + this.config.putInt(Config.ROOM_CONFIG_XUAN_ZHUANG, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_QING_ZUI_HU)) + { + this.config.putInt(Config.ROOM_CONFIG_QING_ZUI_HU, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_QING_ZUI_HU, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_SPECIAL_PENG_PENG_HU)) + { + this.config.putBoolean(Config.ROOM_CONFIG_SPECIAL_PENG_PENG_HU, false); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_FEN_DIEJIA)) + { + this.config.putInt(Config.ROOM_CONFIG_FEN_DIEJIA, 0); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_XIPAI_SCORE)) + { + this.config.putInt(Config.ROOM_CONFIG_XIPAI_SCORE, 0); + this.xi_pai_score = 1; + } + else { + this.xi_pai_score = this.config.getInt(Config.ROOM_CONFIG_XIPAI_SCORE); + } + + if (!this.config.containsKey(Config.ROOM_CONFIG_ANCHOU_SCORE)) + { + this.config.putFloat(Config.ROOM_CONFIG_ANCHOU_SCORE, 0); + this.an_chou_score = 1; + }else { + this.an_chou_score = this.config.getInt(Config.ROOM_CONFIG_ANCHOU_SCORE); + } + + + if (!this.config.containsKey(Config.ROOM_CONFIG_XIPAI)) + { + this.config.putBoolean(Config.ROOM_CONFIG_XIPAI, false); + } + + this.isEntrust=true; + this.adminSeat = 0; + this.lastWinPlayerId =0; + + this.first_zhuang_card = 0; + this.geng_zhuan_num = 0; + this.gent_zhuan_nextSeat = 0; + + if (this.config.getBoolean(Config.ROOM_CONFIG_GENGZHUAN)) + { + this.isGengZhuang = true; + } + + this.lastBankerSeat = 0; + this.last_liuju = false; + + //初始化房间的特殊参数 + WinCardType.InitRoomSpecialConfig(this); + } + + public boolean isLiuJu() + { + if (card.cardList.size() == 0) + { + return true; + } + + return false; + } + + public void endGameByLiuJu() + { + if (config.getBoolean(Config.ROOM_CONFIG_HUANGZHUANGHUANGGANG)) + { + for (Entry entry : this.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + int score = player.score.round_log.get(EXScore.KONG); + player.score.round_score -= score; + player.score.total_score -= score; + player.score.round_log.put(EXScore.KONG, 0); + } + } + liuju = true; + clear_repeatwin(); + + endGame(); + } + + public void endGame() + { + last_liuju = liuju; + for (Entry entry : this.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + if (player.winer != 1) + { + player.last_winer = 0; + player.repeat_win = -1; + } + else + { + player.last_winer = 1; + } + } + super.endGame(); + } + + public void addAction(Action action) { + if (this.actionList.size() == 0) { + this.actionList.add(action); + } else if (action.tip.weight > this.actionList.get(0).tip.weight) { + this.actionList.clear(); + this.actionList.add(action); + } else if (action.tip.weight == this.actionList.get(0).tip.weight) { + this.actionList.add(action); + } + + checkAction(); + } + + public boolean isLaizi(int card) { + return this.card.isLaizi(card); + } + + public void checkAction() { + boolean isWeightest = this.isWeightestAction(); + if (!isWeightest) { + return; + } + if (this.isAllPass()) { + Player activePlayer = this.playerMapBySeat.get(this.activeSeat); + activePlayer.stateMachine.toNextState(); + } else { + + for (Action action : this.actionList) { + action.run(); + } + this.actionList.clear(); + } + } + + public boolean isAllPass() { + return this.actionList.size() == 0 && this.tipMap.size() == 0; + } + + public boolean isWeightestAction() { + + if (this.isAllPass()) { + return true; + } + if (this.actionList.size() == 0) { + return false; + } + + Action curaction = this.actionList.get(0); + for (Entry entry : this.tipMap.entrySet()) { + TipManager tip = entry.getValue(); + if (curaction.tip.weight <= tip.getWeightest()) { + return false; + } + } + + for (Entry entry : this.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + if (player.stateMachine.curState instanceof EXPlayerDisCardTipState) { + player.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + } + } + return true; + + } + + /** + * 获取房间信息 + * + * @return + */ + public ITObject getRoomInfo() { + ITObject data = super.getRoomInfo(); + if (data != null) + { + data.putInt("laiziCard", this.card.laiziCard); + data.putInt("laiziCard2", this.card.laiziCard2); + data.putInt("laiziCardBefore", this.card.laiziCardBefore); + data.putInt("laiziCard2Before", this.card.laiziCard2Before); + } + + return data; + } + + public ITObject getReloadInfo(Player player) { + ITObject data = super.getReloadInfo(player); + EXPlayer p = (EXPlayer) player; + data.putTArray("hand_card", Util.toTArray(p.cardInhand)); + data.putInt("left_card", card.getCount()); + data.putInt("curren_outcard_seat", currenDiscardSeat); + data.putInt("last_outcard_seat", lastDiscardSeat); + return data; + } + + public void addScore(EXPlayer destPlayer, EXPlayer fromPlayer, int score, int type) { + boolean zhuangxian = this.config.getBoolean(Config.ROOM_CONFIG_ZHUANGXIAN); + if(type == EXScore.WIN) { + if (zhuangxian) { + if (destPlayer.seat == this.bankerSeat || fromPlayer.seat == this.bankerSeat) { + score += 1; + } + } + } + + if (type == EXScore.WIN || type == EXScore.NIAO) + { + if (fromPlayer.tinghu10bei) + { + return; + } + } + + destPlayer.score.round_log.put(type, destPlayer.score.round_log.get(type) + score); + fromPlayer.score.round_log.put(type, fromPlayer.score.round_log.get(type) - score); + + destPlayer.score.round_score += score; + destPlayer.score.total_score += score; + + fromPlayer.score.round_score -= score; + fromPlayer.score.total_score -= score; + + } + + public void addMaGengGongScore(EXPlayer destPlayer, EXPlayer fromPlayer, int score) { + this.addScore(destPlayer, fromPlayer, score, EXScore.MA_GENG_GONG); + } + + public void addAllMaGengGongScore(EXPlayer destPlayer, int score) { + for (Entry entry : this.playerMapById.entrySet()) { + if (entry.getKey().equals(destPlayer.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + addMaGengGongScore(destPlayer, fromPlayer, score); + } + } + + public int GetGongScore(EXPlayer destPlayer) + { + return destPlayer.score.round_log.get(EXScore.KONG); + } + + public void addAllScore(EXPlayer destPlayer, int socre, int type) { + for (Entry entry : this.playerMapById.entrySet()) { + if (entry.getKey().equals(destPlayer.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + this.addScore(destPlayer, fromPlayer, socre, type); + } + } + + public void addMaiNiaoScore(EXPlayer destPlayer, EXPlayer fromPlayer, int score) { + this.addScore(destPlayer, fromPlayer, score, EXScore.MAI_NIAO); + } + + public void addAllMaiNiaoScore(EXPlayer destPlayer, int score) { + for (Entry entry : this.playerMapById.entrySet()) { + if (entry.getKey().equals(destPlayer.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + addMaiNiaoScore(destPlayer, fromPlayer, score); + } + } + + public void addNiaoScore(EXPlayer destPlayer, EXPlayer fromPlayer, int score) { + this.addScore(destPlayer, fromPlayer, score, EXScore.NIAO); + } + + public void addAllNiaoScore(EXPlayer destPlayer, int score) { + for (Entry entry : this.playerMapById.entrySet()) { + if (entry.getKey().equals(destPlayer.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + addNiaoScore(destPlayer, fromPlayer, score); + } + } + + public void addPiaoNiaoScore(EXPlayer destPlayer, EXPlayer fromPlayer) { + int piao_niao = this.config.getInt(Config.ROOM_CONFIG_PIAO); //0:热票 1:冷票 2:不嫖 3:固定票分 + if(piao_niao == 0)return; + this.addScore(destPlayer, fromPlayer,destPlayer.piao + fromPlayer.piao, EXScore.PIAO_NIAO); + } + + public void addAllPiaoNiaoScore(EXPlayer destPlayer) { + int piao_niao = this.config.getInt(Config.ROOM_CONFIG_PIAO); //0:不嫖 1:冷票 2: 3:固定票分 + if(piao_niao == 0)return; + for (Entry entry : this.playerMapById.entrySet()) { + if (entry.getKey().equals(destPlayer.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + addPiaoNiaoScore(destPlayer,fromPlayer); + } + } + + public void handle_repeatwin(EXPlayer owner) + { + if (owner.last_winer == 1) + { + owner.repeat_win += 1; + } + else + { + owner.repeat_win += 1; + } + } + + public void clear_repeatwin() + { + for (Entry entry : this.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + player.repeat_win = -1; + player.last_winer = 0; + } + } + + @Override + public void saveMilitaryTotal(boolean dissmiss) { + super.saveMilitaryTotal(dissmiss); + EXMainServer.gameCtr.roomTotalResult(this, dissmiss); + } + @Override + protected void roomResult() { + EXMainServer.gameCtr.roomResult(this); + } + + @Override + public void clear() { + super.clear(); + + this.liuju = false; + this.activeSeat = this.lastDiscardSeat = this.currenDiscardSeat = 0; + this.winCount = this.piaoNiaoCount = 0; + this.niao.clear(); + + this.isGengZhuang = false; + this.first_zhuang_card = 0; + this.geng_zhuan_num = 0; + this.gent_zhuan_nextSeat = 0; + if (this.config.getBoolean(Config.ROOM_CONFIG_GENGZHUAN)) + { + this.isGengZhuang = true; + } + this.lastBankerSeat = 0; + } + + public void winCallback(EXPlayer owner, int card) { + this.endGame(); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXScore.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXScore.java new file mode 100644 index 0000000..91596ad --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/EXScore.java @@ -0,0 +1,29 @@ +package extend.mj; + +import com.game.data.Score; + + +public class EXScore extends Score{ + public static final int WIN = 1; + public static final int KONG = 2; + public static final int NIAO = 3; + public static final int PIAO_NIAO = 4; + public static final int GENG_ZHUAN = 5; + public static final int MA_GENG_GONG = 6; + public static final int MAI_NIAO = 7; + + public EXScore(EXPlayer owner){ + super(owner); + } + + protected void initLog() { + this.round_log.put(WIN, 0); + this.round_log.put(KONG, 0); + this.round_log.put(NIAO, 0); + this.round_log.put(PIAO_NIAO, 0); + this.round_log.put(GENG_ZHUAN, 0); + this.round_log.put(MA_GENG_GONG, 0); + this.round_log.put(MAI_NIAO, 0); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/OpCard.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/OpCard.java new file mode 100644 index 0000000..a71c560 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/OpCard.java @@ -0,0 +1,23 @@ +package extend.mj; + +import com.taurus.core.entity.ITArray; + +public class OpCard { + public int type; + public int card; + public int card_seat; + public ITArray opCard; + public int huXi; + + public OpCard(int type, int card) { + this.type = type; + this.card = card; + this.card_seat = 0; + } + + public OpCard(int type, int card, int card_seat) { + this.type = type; + this.card = card; + this.card_seat = card_seat; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/PlayerRuleManager.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/PlayerRuleManager.java new file mode 100644 index 0000000..edb6259 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/PlayerRuleManager.java @@ -0,0 +1,108 @@ +package extend.mj; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import com.game.Global; + +import extend.mj.player.rule.*; +import extend.mj.player.state.EXPlayerDisCardTipState; +import extend.mj.player.state.EXPlayerDrawTipState; +import extend.mj.player.state.EXPlayerKongWinState; +import extend.mj.player.state.EXPlayerTipState; +import extend.mj.tip.IRuleBase; + +/** + * ����������� + * + * + * + * 2017��9��19�� PlayerRuleManager.java + */ +public class PlayerRuleManager { + + /** + * ����ץ�� + */ + public static final int DRAW_RULE = 1; + + /** + * ���˳��� + */ + public static final int OTHER_DISCARD_RULE = 2; + /** + * ���ܺ����� + */ + public static final int KONG_HU_RULE = 3; + /** + * �������Ժ���ƹ��� + */ + public static final int CHOW_PONG_DISCARD_RULE = 7; + + public static final int KONG_DRAW_RULE = 8; + + public HashMap> ruleMap = null; + public HashMap tipMap = null; + + public PlayerRuleManager() { + ruleMap = new HashMap>(); + + tipMap = new HashMap(); + tipMap.put(PlayerRuleManager.DRAW_RULE, (EXPlayerTipState) Global.getState(EXPlayerDrawTipState.class)); + tipMap.put(PlayerRuleManager.KONG_DRAW_RULE, (EXPlayerTipState) Global.getState(EXPlayerDrawTipState.class)); + tipMap.put(PlayerRuleManager.OTHER_DISCARD_RULE, (EXPlayerTipState) Global.getState(EXPlayerDisCardTipState.class)); + tipMap.put(PlayerRuleManager.KONG_HU_RULE, (EXPlayerKongWinState) Global.getState(EXPlayerKongWinState.class)); + tipMap.put(PlayerRuleManager.CHOW_PONG_DISCARD_RULE, (EXPlayerDrawTipState) Global.getState(EXPlayerDrawTipState.class)); + + List drawRuleList = new ArrayList(); + drawRuleList.add(new RuleSelfKong()); + //drawRuleList.add(new RulePongKong()); + drawRuleList.add(new RuleSelfWin()); + ruleMap.put(PlayerRuleManager.DRAW_RULE, drawRuleList); + + List kongDrawRuleList = new ArrayList(); + kongDrawRuleList.add(new RuleSelfKong()); + //kongDrawRuleList.add(new RulePongKong()); + kongDrawRuleList.add(new RuleOtherKongSelfWin()); + ruleMap.put(PlayerRuleManager.KONG_DRAW_RULE, kongDrawRuleList); + + List otherDiscardList = new ArrayList(); + otherDiscardList.add(new RuleOtherKong()); + otherDiscardList.add(new RulePong()); + otherDiscardList.add(new RuleChow()); + otherDiscardList.add(new RuleOtherWin()); + ruleMap.put(PlayerRuleManager.OTHER_DISCARD_RULE, otherDiscardList); + + List konghuList = new ArrayList(); + ruleMap.put(PlayerRuleManager.KONG_HU_RULE, konghuList); + + List cpDiscardRuleList = new ArrayList(); + cpDiscardRuleList.add(new RuleSelfKong()); + //cpDiscardRuleList.add(new RulePongKong()); + ruleMap.put(PlayerRuleManager.CHOW_PONG_DISCARD_RULE, cpDiscardRuleList); + + } + + public boolean condition(int type, EXPlayer player) { + return condition(type, player, true); + } + + public boolean condition(int type, EXPlayer player, boolean tonextState) { + List ruleList = this.ruleMap.get(type); + boolean result = false; + + for (IRuleBase rule : ruleList) { + result = rule.condition(player) || result; + } + + if (result) { + player.stateMachine.changeState(this.tipMap.get(type)); + } else { + if (tonextState) + player.stateMachine.toNextState(); + } + return result; + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RoomCard.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RoomCard.java new file mode 100644 index 0000000..e1f909a --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RoomCard.java @@ -0,0 +1,139 @@ +package extend.mj; + +import com.game.Global; +import com.game.Util; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class RoomCard { + public List cardList; + EXRoom room; + public ArrayList subCardList; + public Integer laiziCard; + public Integer laiziCard2; + public Integer laiziCardBefore; + public Integer laiziCard2Before; + + public RoomCard(EXRoom table) { + this.cardList = new ArrayList(); + subCardList = new ArrayList<>(); + this.room = table; + laiziCard = 0; + laiziCard2 = 0; + laiziCardBefore = 0; + laiziCard2Before = 0; + } + + public void init() { + this.cardList.clear(); + this.subCardList.clear(); + this.initCard(); + this.shuffle(); + } + + private void initCard() { + for (int index = 1; index <= 8; index++) { + for (int index2 = 0; index2 < 4; index2++) { + this.cardList.add(100*index + 1); + this.cardList.add(100*index + 2); + this.cardList.add(100*index + 3); + } + this.cardList.add(100*index + 4); + } + } + + private void initCard2() { + List list = Arrays.asList(101, 101, 101, 202, 204, 302, 302, 304, 402, 403, 502, 502, 504, 801, 701, 701, 701); + List list2 = Arrays.asList(101, 101, 101, 802, 202, 204, 302, 302, 304, 402, 403, 502, 502, 504, 801, 701, 701, 701); + List list3 = Arrays.asList(701,202, 202, 203, 301,302, 303, 303, 304, 501, 502, 501, 502, 601, 602, 802); + + this.cardList.addAll(list); + this.cardList.addAll(list2); + this.cardList.addAll(list3); + } + + private void shuffle() { + Collections.shuffle(this.cardList); + } + + public boolean isLaizi(int card) + { + return false; + } + + public void reInitCards(List cards) { + //从底牌移除 + for(Integer card : cards) { + for(int i = cardList.size() - 1;i >= 0;i--) { + if(cardList.get(i).intValue() == card.intValue()) { + if(cardList.remove(i) > 0) { + this.subCardList.add(card); + } + break; + } + } + } + } + +// public int pop() { +// +// if (this.cardList.size() == 0) { +// this.room.bankerSeat = this.room.activeSeat; +//// this.room.roundSettle(); +// } +// +// int card = this.cardList.remove(0); +// +// return card; +// +// } + + public int pop() { + Global.logger.info("pop cardlist size=>"+this.cardList.size()+":sub size==>"+subCardList.size()); + int card = 0; + if (this.cardList.size() == 0) { + if(this.subCardList.size() > 0) { + card = this.subCardList.remove(0); + }else { + this.room.bankerSeat = this.room.activeSeat; + } + }else { + card = this.cardList.remove(0); + } + return card; + + } + + public int popsub() { + Global.logger.info("pop sub cardlist size=>"+this.cardList.size()+":sub size==>"+subCardList.size()); + int card = 0; + if (this.subCardList.size() == 0) { + if (this.cardList.size() == 0) { + this.room.bankerSeat = this.room.activeSeat; + }else { + card = this.cardList.remove(0); + } + }else { + card = this.subCardList.remove(0); + } + return card; + } + + public int getCount() { + return this.cardList.size() + this.subCardList.size(); + } + + public List deal() { + List dealCards = new ArrayList(); + + for (int index = 0; index < 18; index++) { + dealCards.add(this.pop()); + } + + return dealCards; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RuleWeight.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RuleWeight.java new file mode 100644 index 0000000..a8e33f7 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/RuleWeight.java @@ -0,0 +1,22 @@ +package extend.mj; + +public class RuleWeight { + public final static int CHOW = 0b00001; + public final static int PONG = 0b00010; + public final static int ZHAO = 0b00100; + public final static int SELFZHAO = 0b00100; + public final static int KONG = 0b01000; + public final static int SELFKONG = 0b01000; + public final static int WIN = 0b10000; + public final static int SELF_WIN = 0b100000; + + + public final static int TYPE_CHOW = 1; + public final static int TYPE_PONG = 2; + public final static int TYPE_KONG = 3; + public final static int TYPE_SELF_KONG = 4; + public final static int TYPE_ZHAO = 5; + public final static int TYPE_SELF_ZHAO = 6; + public final static int TYPE_WIN = 7; +} + diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/SettleLog.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/SettleLog.java new file mode 100644 index 0000000..a7c6e67 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/SettleLog.java @@ -0,0 +1,44 @@ +package extend.mj; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; + +public class SettleLog { + private Map log; + + public SettleLog() { + log = new HashMap(); + } + + public void put(String key,Integer value) { + log.put(key, value); + } + + public void add(String key) { + if(!log.containsKey(key)) { + return; + } + int value = log.get(key); + value++; + log.put(key, value); + } + + public Integer get(String key) { + if(!log.containsKey(key)) { + return null; + } + return log.get(key); + } + + public ITObject toTObject() { + ITObject obj = TObject.newInstance(); + for (Entry entry : this.log.entrySet()) { + obj.putInt(entry.getKey(), entry.getValue()); + } + return obj; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagAnalyseItem.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagAnalyseItem.java new file mode 100644 index 0000000..e61f46a --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagAnalyseItem.java @@ -0,0 +1,22 @@ +package extend.mj; + +import com.taurus.core.entity.ITArray; + +import java.util.ArrayList; +import java.util.List; + +public class TagAnalyseItem { + //分析子项 + public int cbCardEye; //牌眼麻将 + public int huxi; + public List cbCardEyeList; //牌眼麻将 + public List cbOpCard; //组合类型 + + public TagAnalyseItem() + { + this.huxi = 0; + this.cbCardEye = 0; + this.cbOpCard = new ArrayList(); + this.cbCardEyeList = new ArrayList(); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagKindItem.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagKindItem.java new file mode 100644 index 0000000..fe18c06 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/TagKindItem.java @@ -0,0 +1,17 @@ +package extend.mj; + +import java.util.ArrayList; +import java.util.List; + +public class TagKindItem { + public int type; //组合类型 + public int card; //中心麻将 + public Integer[] cbCardList; //麻将索引 + + public TagKindItem() + { + type = 0; + card = 0; + cbCardList = new Integer[3]; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/WinCardType.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/WinCardType.java new file mode 100644 index 0000000..29f18c8 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/WinCardType.java @@ -0,0 +1,173 @@ +package extend.mj; + +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; + +public class WinCardType { + public static final int JIHU = 1; //鸡胡类型 + + public static final int PINGHU = 2; //平胡类型 + + public static final int QIXIAODUI = 3; //七小对 + + public static final int HAOHUA_QIXIAODUI = 4; //豪华七小对 + + public static final int HAOHUA2_QIXIAODUI = 5; //双豪华七小对 + + public static final int HAOHUA3_QIXIAODUI = 6; //三豪华七小对 + + public static final int QINGYISE = 7; //清一色 + + public static final int PENGPENGHU = 8; //碰碰胡 + + public static final int GANGSHANGHUA = 9; //杠上开花 + + public static final int GANGSHANGPAO = 10; //杠上炮 + + public static final int QIANG_GANG_HU = 11; //抢杠胡 + + public static final int HUN_YI_SE = 12; //混一色 + + public static final int SHI_SHAN_YAO = 13; //十三幺 + + public static final int TIAN_HU = 14; //天胡 十倍 + + public static final int DI_HU = 15; //地胡 十倍 + + public static final int REN_HU = 16; //人胡 十倍 + + public static final int SHI_BA_LUO_HAN = 17; //十八罗汉 + + public static final int XIAO_SHAN_YUAN = 18; //小三元 + + public static final int DA_SHAN_YUAN = 19; //大三元 + + public static final int XIAO_SI_XI = 20; //小四喜 + + public static final int DA_SI_XI = 21; //大四喜 + + public static final int YAO_JIU = 22; //幺九 + + public static final int LAIZI4_HU = 23; //四鬼胡牌 + + public static final int QUAN_FENG = 24;//全风 + + public static final int QUAN_QIU_REN = 25;//全求人 + + public static final int QING_YAO_JIU = 26; //清幺九 + + public static final int ZI_YI_SE = 27; //字一色 + + public static final int WU_GUI_JIABEI = 28; //无鬼两倍 + public static final int LIU_JU_2BEI = 29; //流局两倍 + public static final int HAI_DI_NAO_YUE = 30; //海底捞月 + public static final int MEN_QING = 31; //门清 捉炮门清 + public static final int XIAO_HU_ZHONG_DA_HU = 32; //选小胡有大胡的情况下,不显示具体的胡牌类型,只显示大胡几分 + public static final int MAN_TIAN_HU = 33; //满天胡 + public static final int ZIMO_MEN_QING = 34; //自摸门清 + public static final int GUN_GUN = 35; //滚滚 +//////////////////////////////////////////////////////////// + public static int BASE_HU_SCORE = 2; //基础分数 + public static int DA_HU_BEI_SCORE = 1; //大胡倍数 + public static int JIHU_SCORE = 1; //鸡胡类型 + public static int PINGHU_SCORE = 1; //平胡类型 + public static int MENGQING_SCORE = 3; //门清类型 + public static int QIXIAODUI_SOCRE = 1; //七小对 倍数 + public static int HAOHUA_QIXIAODUI_SCORE = 1; //豪华七小对 + public static int HAOHUA2_QIXIAODUI_SCORE = 1; //双豪华七小对 + public static int HAOHUA3_QIXIAODUI_SCORE = 1; //三豪华七小对 + public static int QINGYISE_SCORE = 1; //清一色 + public static int GANGSHANGHUA_SCORE = 3; //杠上开花 + public static int PENGPENGHU_SCORE = 3; //碰碰胡 + public static int GANGSHANGPAO_SOCRE = 3; //杠上炮 + public static int QIANG_GANG_HU_SOCRE = 1; //抢杠胡 + public static int HUN_YI_SE_SCORE = 1; //混一色 + public static int SHI_SHAN_YAO_SCORE = 1; //十三幺 + public static int TIAN_DI_HU_SCORE = 1; //天地胡 十倍 + public static int TIAN_HU_SCORE = 1; //天胡 20倍 + public static int DI_HU_SCORE = 1; //地胡 10倍 + public static int SHI_BA_LUO_HAN_SCORE = 1; //十八罗汉 + public static int DA_SHAN_YUAN_SCORE = 1; //大三元 + public static int XIAO_SHAN_YUAN_SCORE = 1; //小三元 + public static int XIAO_SI_XI_SCORE = 1; //小四喜 + public static int DA_SI_XI_SCORE = 1; //大四喜 + public static int YAO_JIU_SCORE = 1; //幺九 + public static int LAIZI4_HU_SCORE = 1; //四鬼胡牌 + public static int QUAN_FENG_SCORE = 1;//全风 + public static int QUAN_QIU_REN_SCORE = 1;//全求人 + public static int QING_YAO_JIU_SCORE = 1; //清幺九 + public static int ZI_YI_SE_SCORE = 1; //字一色 + public static int WU_GUI_JIABEI_SCORE = 1; //无鬼两倍 + public static int LIU_JU_2BEI_SCORE = 1; //流局两倍 + public static int HAI_DI_NAO_YUE_SCORE = 3; //海底捞月 + public static int MAN_TIAN_HU_SCORE = 1;//满天胡 + public static int ZIMO_MEN_QING_SCORE = 3; //自摸门清 + public static int GUN_GUN_SCORE = 5; //滚滚 + + public int type; + + public int value; + + public int score; + + public boolean is_dahu; + + public String desc; + + public ITArray opcard; + + //初始化房间的特殊参数 + static public void InitRoomSpecialConfig(EXRoom room) + { + //潮汕鬼牌特殊配置 + //this.config.putInt(Config.ROOM_CONFIG_LAIZI, 0); //没有癞子 + + room.config.putBoolean(Config.ROOM_CONFIG_PENGPENGHU, true); + room.config.putBoolean(Config.ROOM_CONFIG_MENG_QING, true); + room.config.putBoolean(Config.ROOM_CONFIG_MENG_QING, true); + room.config.putBoolean(Config.ROOM_CONFIG_HAI_DI_NAO_YUE, true); + room.config.putBoolean(Config.ROOM_CONFIG_CHUIPAI, true); + //荒庄荒杠 + if (!room.config.containsKey(Config.ROOM_CONFIG_HUANGZHUANGHUANGGANG)) + { + room.config.putBoolean(Config.ROOM_CONFIG_HUANGZHUANGHUANGGANG, true); + } + room.config.putBoolean(Config.ROOM_CONFIG_USE_BASE_HU_SCORE, true); + room.config.putBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU, true); + room.config.putBoolean(Config.ROOM_CONFIG_DIANPAO, true); + + } + + public WinCardType(int type, int value, int score, boolean is_dahu, String desc) { + this.type = type; + this.value = value; + this.score = score; + this.is_dahu = is_dahu; + this.desc = desc; + } + + public boolean IsDaHu() + { + return is_dahu; + } + + public ITObject toTObject() { + return toTObject(false); + } + + public ITObject toTObject(boolean is_opcard) { + ITObject obj = TObject.newInstance(); + obj.putInt("type", type); + obj.putInt("value", value); + obj.putInt("score", score); + if(is_opcard&&opcard!=null) { + obj.putTArray("opcard", opcard); + } + return obj; + } + + public String toString() { + return "type:" + type + " value:" + value + " score:" + score + " desc:" + desc; + } +} \ No newline at end of file diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleChow.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleChow.java new file mode 100644 index 0000000..1e8d348 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleChow.java @@ -0,0 +1,130 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.game.Util; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.Config; +import extend.mj.EXPlayer; +import extend.mj.EXRoom; +import extend.mj.RuleWeight; +import extend.mj.player.rulestate.PRChowState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; +import extend.mj.uitl.CardUtil; + +import java.util.ArrayList; +import java.util.List; + +/** + * ����״̬ + * + * + * 2017��11��2�� + * PRChowRule.java + */ +public class RuleChow implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + EXRoom room = player.getRoom(); + if (player.isEntrust() || !room.config.getBoolean(Config.ROOM_CONFIG_CHUIPAI)) { + return false; + } + + if (player.lastSeat != room.activeSeat) { + return false; + } + + if (player.is_gang) + { + return false; + } + + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(room.activeSeat); + if (activePlayer.gangshangpao) + { + return false; + } + + int eventCard = room.activeCard; + boolean result = check(player,eventCard); + + return result; + } + + private boolean check(EXPlayer player,int eventCard){ + if (eventCard % 100 == 4) + { + return false; + } + + boolean result = false; + List cardInhand = player.cardInhand; + if (Util.checkCard(eventCard - 1, cardInhand) && Util.checkCard(eventCard - 2, cardInhand) && (eventCard-1) % 100 != 4 && (eventCard-2) % 100 != 4) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard - 1); + opcard.addInt(eventCard - 2); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + if (Util.checkCard(eventCard - 1, cardInhand) && (eventCard-1) % 100 != 4 && Util.checkCard(eventCard / 100 * 100 + 4, cardInhand)) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard - 1); + opcard.addInt(eventCard / 100 * 100 + 4); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + if (Util.checkCard(eventCard - 2, cardInhand) && (eventCard-2) % 100 != 4 && Util.checkCard(eventCard / 100 * 100 + 4, cardInhand)) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard - 2); + opcard.addInt(eventCard / 100 * 100 + 4); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + + if (Util.checkCard(eventCard + 1, cardInhand) && Util.checkCard(eventCard - 1, cardInhand) && (eventCard + 1) % 100 != 4 && (eventCard - 1) % 100 != 4) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard + 1); + opcard.addInt(eventCard - 1); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + if (Util.checkCard(eventCard + 1, cardInhand) && (eventCard + 1) % 100 != 4 && Util.checkCard(eventCard / 100 * 100 + 4, cardInhand)) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard + 1); + opcard.addInt(eventCard / 100 * 100 + 4); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + if (Util.checkCard(eventCard + 1, cardInhand) && Util.checkCard(eventCard + 2, cardInhand) && (eventCard + 1) % 100 != 4 && (eventCard + 2) % 100 != 4) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard + 1); + opcard.addInt(eventCard + 2); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + if (Util.checkCard(eventCard + 2, cardInhand) && (eventCard + 2) % 100 != 4 && Util.checkCard(eventCard / 100 * 100 + 4, cardInhand)) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard + 2); + opcard.addInt(eventCard / 100 * 100 + 4); + Tip tip = new Tip(eventCard,opcard, RuleWeight.CHOW,this, RuleWeight.TYPE_CHOW); + player.tipMgr.addTip(tip); + result = result || true; + } + return result; + } + + @Override + public void action(EXPlayer player,Tip tip) { + player.getRoom().activeCard = tip.card; + player.stateMachine.changeState(Global.getState(PRChowState.class)); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKong.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKong.java new file mode 100644 index 0000000..3520ceb --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKong.java @@ -0,0 +1,158 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.rulestate.PROtherKongState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * ���ܼ�� + * + * + * 2017��8��30�� + * RuleOtherKong.java + */ +public class RuleOtherKong implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + EXRoom room = player.getRoom(); + + int eventCard = room.activeCard; + if (player.isEntrust()) { + return false; + } + + if (player.is_gang) + { + return false; + } + + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(room.activeSeat); + if (activePlayer.gangshangpao) + { + return false; + } + + if (Util.checkCard(eventCard, player.cardInhand, 3)) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + if (player.notPongKongList.contains(eventCard)) + { + return false; + } + } + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard); + player.is_gang = false; + + List delPai = new ArrayList<>(); + delPai.add(eventCard); + delPai.add(eventCard); + delPai.add(eventCard); + List opCards = new ArrayList<>(); + opCards.addAll(player.opCardList); + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, eventCard); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard); + opCards.add(pongCard); + if (((EXGameController) Global.gameCtr).isTingPai(player, 0, delPai, opCards)) + { + Tip tip = new Tip(eventCard,opcard, RuleWeight.SELFKONG,this, RuleWeight.TYPE_KONG); + player.tipMgr.addTip(tip); + Tip tip2 = new Tip(eventCard,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_ZHAO); + player.tipMgr.addTip(tip2); + } + else { + Tip tip = new Tip(eventCard,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_ZHAO); + player.tipMgr.addTip(tip); + } + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + player.notPongKongList.add(eventCard); + } + return true; + } + else if (Util.checkCard(eventCard, player.cardInhand, 2) && Util.checkCard(eventCard /100 * 100 + 4, player.cardInhand, 1)) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + if (player.notPongKongList.contains(eventCard)) + { + return false; + } + } + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard); + opcard.addInt(eventCard /100 * 100 + 4); + player.is_gang = false; + List delPai = new ArrayList<>(); + delPai.add(eventCard); + delPai.add(eventCard); + delPai.add(eventCard /100 * 100 + 4); + List opCards = new ArrayList<>(); + opCards.addAll(player.opCardList); + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, eventCard); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard); + pongCard.opCard.addInt(eventCard /100 * 100 + 4); + opCards.add(pongCard); + if (((EXGameController) Global.gameCtr).isTingPai(player, 0, delPai, opCards)) + { + Tip tip = new Tip(eventCard,opcard, RuleWeight.SELFKONG,this, RuleWeight.TYPE_KONG); + player.tipMgr.addTip(tip); + Tip tip2 = new Tip(eventCard,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_ZHAO); + player.tipMgr.addTip(tip2); + } + else { + Tip tip = new Tip(eventCard, opcard, RuleWeight.ZHAO, this, RuleWeight.TYPE_ZHAO); + player.tipMgr.addTip(tip); + } + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + player.notPongKongList.add(eventCard); + } + return true; + } + return false; + } + + @Override + public void action(EXPlayer player, Tip tip) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + Util.removeCard(player.notPongKongList, tip.card, 4); + } + if (tip.type == RuleWeight.TYPE_KONG) + { + player.is_gang = true; + if (tip.card > 0) + { + for (Map.Entry entry : player.getRoom().playerMapById.entrySet()) { + EXPlayer pp = (EXPlayer) entry.getValue(); + pp.notPongList.add(tip.card/100*100+1); + pp.notPongList.add(tip.card/100*100+2); + pp.notPongList.add(tip.card/100*100+3); + pp.notPongList.add(tip.card/100*100+4); + } + } + } + player.stateMachine.changeState(Global.getState(PROtherKongState.class)); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKongSelfWin.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKongSelfWin.java new file mode 100644 index 0000000..c7cf4d7 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherKongSelfWin.java @@ -0,0 +1,100 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.rulestate.PROtherGongSelfWinState; +import extend.mj.player.rulestate.PRSelfWinState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; +import extend.mj.uitl.WinCard; + +import java.util.HashMap; +import java.util.Map; + +/** + * ������� + * + * + * 2017��8��30�� + * RuleSelfWin.java + */ +public class RuleOtherKongSelfWin implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + // TODO Auto-generated method stub + ITObject config = player.room.config; + EXRoom room = player.getRoom(); + int laizi = config.getInt(Config.ROOM_CONFIG_LAIZI); + HashMap map = new HashMap(); + if (player.is_gang) + { + if (room.config.getBoolean(Config.ROOM_CONFIG_GANGSHANGKAIHUA_2bei)) + { + WinCard.putWinCardType(map, WinCardType.GANGSHANGHUA, 1,WinCardType.GANGSHANGHUA_SCORE*2, true, "杠上开花"); + } + else + { + WinCard.putWinCardType(map, WinCardType.GANGSHANGHUA, 1,WinCardType.GANGSHANGHUA_SCORE, true, "杠上开花"); + } + } + + WinCard win = new WinCard(player.cardInhand, room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, false); + if (win.checkWin(map, player, room, true)) { + ITArray opcard = TArray.newInstance(); + opcard.addInt(player.drawCard); + Tip tip = new Tip(player.drawCard,opcard, RuleWeight.SELF_WIN,this, RuleWeight.TYPE_WIN); + tip.winMap = map; + player.tipMgr.addTip(tip); + + return true; + } + + return false; + } + + @Override + public void action(EXPlayer player,Tip tip) { + // TODO Auto-generated method stub + player.is_gang = false; + player.winType = 1; + player.winCard = tip.card; + player.drawCard = tip.card; + + player.winMap = tip.winMap; + EXRoom room = player.getRoom(); + player.niao_score = WinCardType.BASE_HU_SCORE; + player.hu_score = WinCardType.BASE_HU_SCORE; + player.di_score = WinCardType.BASE_HU_SCORE; + + Global.logger.info("player:" + player.playerid + " di fen:" + player.di_score + " hu fen:" + player.hu_score + " niao fen:" + player.niao_score); + + room.handle_repeatwin(player); + boolean isDaHu = false; + for (Map.Entry entry : player.winMap.entrySet()) { + WinCardType cardType = entry.getValue(); + Global.logger.info("player:" + player.playerid + " hu:" + cardType.toString()); + if (cardType.IsDaHu()) + { + isDaHu = true; + } + } + + if (isDaHu) + { + player.hu_score = 3; + } + + if (player.is_gang) + { + player.stateMachine.changeState(Global.getState(PROtherGongSelfWinState.class)); + } + else { + player.stateMachine.changeState(Global.getState(PRSelfWinState.class)); + } + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherWin.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherWin.java new file mode 100644 index 0000000..77ebeb5 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleOtherWin.java @@ -0,0 +1,108 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.rulestate.PROtherWinState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; +import extend.mj.uitl.WinCard; + +import java.util.HashMap; +import java.util.Map; + +/** + * ���Ƽ�� + * + * + * 2017��8��30�� + * RuleOtherWin.java + */ +public class RuleOtherWin implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + if(player.louhu)return false; + EXRoom room = player.getRoom(); + ITObject config = room.config; + if (!config.getBoolean(Config.ROOM_CONFIG_DIANPAO)) { + if (!config.getBoolean(Config.ROOM_CONFIG_SPECAIL_ZIMO)) + { + return false; + } + } + + if (player.lastSeat != room.activeSeat) { + return false; + } + + if(room.activeSeat == player.seat)return false; + + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(room.activeSeat); + + if (player.cardInhand.size() == 1 && room.isLaizi(player.cardInhand.get(0))) + { + return false; + } + + if (room.activeCard % 100 == 4) + { + return false; + } + + int activieCard = room.activeCard; + int laizi = room.config.getInt(Config.ROOM_CONFIG_LAIZI); + HashMap map = new HashMap(); + if (activePlayer.gangshangpao) + { + if ( room.config.getBoolean(Config.ROOM_CONFIG_GANGSHANGPAO_2bei)) + { + WinCard.putWinCardType(map, WinCardType.GANGSHANGPAO, 1,WinCardType.GANGSHANGPAO_SOCRE*2, true, "杠上炮"); + } + else { + WinCard.putWinCardType(map, WinCardType.GANGSHANGPAO, 1,WinCardType.GANGSHANGPAO_SOCRE, true, "杠上炮"); + } + } + WinCard win = new WinCard(player.cardInhand, room.activeCard, room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, false, false); + if (win.checkWin(map, player, room, false)) { + if (map.containsKey(WinCardType.MEN_QING) || map.containsKey(WinCardType.PENGPENGHU) || map.containsKey(WinCardType.GANGSHANGPAO)) + { + ITArray opcard = TArray.newInstance(); + opcard.addInt(activieCard); + Tip tip = new Tip(room.activeCard,opcard, RuleWeight.WIN,this, RuleWeight.TYPE_WIN); + tip.winType = player.forceCheckWin? 1 :0; + tip.winMap = map; + player.tipMgr.addTip(tip); + + return true; + } + } + + return false; + } + + @Override + public void action(EXPlayer player,Tip tip) { + player.winType = tip.winType; + player.getRoom().activeCard = tip.card; + player.winMap = tip.winMap; + EXRoom room = player.getRoom(); + player.niao_score = WinCardType.BASE_HU_SCORE; + + player.hu_score = 1; + player.di_score = 1; + + if (tip.winMap.containsKey(WinCardType.PENGPENGHU)) + { + player.hu_score = WinCardType.PENGPENGHU_SCORE; + } + + Global.logger.info("player:" + player.playerid + " di fen:" + player.di_score + " hu fen:" + player.hu_score + " niao fen:" + player.niao_score); + + room.handle_repeatwin(player); + + player.stateMachine.changeState(Global.getState(PROtherWinState.class)); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RulePong.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RulePong.java new file mode 100644 index 0000000..b77d885 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RulePong.java @@ -0,0 +1,97 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.game.Util; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.Config; +import extend.mj.EXPlayer; +import extend.mj.EXRoom; +import extend.mj.RuleWeight; +import extend.mj.player.rulestate.PRPongState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; + +/** + * ����� + * + * + * 2017��8��30�� + * RulePong.java + */ +public class RulePong implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + EXRoom room = player.getRoom(); + int eventCard = room.activeCard; + if (player.isEntrust()) { + return false; + } + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_PENG)) + { + if (player.notPongList.contains(eventCard)) + { + return false; + } + } + + if (eventCard % 100 == 4) + { + return false; + } + + if (player.is_gang) + { + return false; + } + + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(room.activeSeat); + if (activePlayer.gangshangpao) + { + return false; + } + + if (Util.checkCard(eventCard, player.cardInhand, 2)) { + + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard); + Tip tip = new Tip(eventCard, opcard, RuleWeight.PONG, this, RuleWeight.TYPE_PONG); + player.tipMgr.addTip(tip); + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_PENG)) + { + player.notPongList.add(eventCard); + } + return true; + } + else if (Util.checkCard(eventCard, player.cardInhand, 1) && Util.checkCard(eventCard /100 * 100 + 4, player.cardInhand, 1)) + { + ITArray opcard = TArray.newInstance(); + opcard.addInt(eventCard); + opcard.addInt(eventCard /100 * 100 + 4); + Tip tip = new Tip(eventCard, opcard, RuleWeight.PONG, this, RuleWeight.TYPE_PONG); + player.tipMgr.addTip(tip); + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_PENG)) + { + player.notPongList.add(eventCard); + } + return true; + } + return false; + } + + @Override + public void action(EXPlayer player, Tip tip) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_PENG)) + { + Util.removeCard(player.notPongList, tip.card, 4); + } + + player.stateMachine.changeState(Global.getState(PRPongState.class)); + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfKong.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfKong.java new file mode 100644 index 0000000..41cb634 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfKong.java @@ -0,0 +1,165 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.rulestate.PRSelfKongState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +/** + * ���ܼ�� + * + * + * 2017��8��30�� + * RuleSelfKong.java + */ +public class RuleSelfKong implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + if (player.isEntrust()) { + return false; + } + + if (player.is_gang) + { + return false; + } + + Map cardMap = Util.getCardNumMap(player.cardInhand); + boolean result = false; + + for (Entry entry : cardMap.entrySet()) { + + int card = entry.getKey(); + + int num = entry.getValue(); + if (num >= 4) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + if (player.notPongKongList.contains(card)) + { + continue; + } + } + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + player.is_gang = false; + List delPai = new ArrayList<>(); + delPai.add(card); + delPai.add(card); + delPai.add(card); + delPai.add(card); + List opCards = new ArrayList<>(); + opCards.addAll(player.opCardList); + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + opCards.add(pongCard); + if (((EXGameController) Global.gameCtr).isTingPai(player, 0, delPai, opCards)) + { + Tip tip = new Tip(card,opcard, RuleWeight.SELFKONG,this, RuleWeight.TYPE_SELF_KONG); + player.tipMgr.addTip(tip); + Tip tip2 = new Tip(card,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_SELF_ZHAO); + player.tipMgr.addTip(tip2); + } + else { + Tip tip = new Tip(card,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_SELF_ZHAO); + player.tipMgr.addTip(tip); + } + + result = true; + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + player.notPongKongList.add(card); + } + } + else if (num == 3 && Util.checkCard(card /100 * 100 + 4, player.cardInhand, 1)) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + if (player.notPongKongList.contains(card)) + { + continue; + } + } + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card /100 * 100 + 4); + player.is_gang = false; + + List delPai = new ArrayList<>(); + delPai.add(card); + delPai.add(card); + delPai.add(card); + delPai.add(card /100 * 100 + 4); + List opCards = new ArrayList<>(); + opCards.addAll(player.opCardList); + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card /100 * 100 + 4); + opCards.add(pongCard); + if (((EXGameController) Global.gameCtr).isTingPai(player, 0, delPai, opCards)) + { + Tip tip = new Tip(card,opcard, RuleWeight.SELFKONG,this, RuleWeight.TYPE_SELF_KONG); + player.tipMgr.addTip(tip); + Tip tip2 = new Tip(card,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_SELF_ZHAO); + player.tipMgr.addTip(tip2); + } + else { + Tip tip = new Tip(card,opcard, RuleWeight.SELFZHAO,this, RuleWeight.TYPE_SELF_ZHAO); + player.tipMgr.addTip(tip); + } + + result = true; + + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + player.notPongKongList.add(card); + } + } + } + return result; + } + + @Override + public void action(EXPlayer player,Tip tip) { + if (player.getRoom().config.getBoolean(Config.ROOM_CONFIG_GUO_GONG)) + { + Util.removeCard(player.notPongKongList, tip.card, 4); + } + if (tip.type == RuleWeight.TYPE_SELF_KONG) + { + player.is_gang = true; + if (tip.card > 0) + { + for (Entry entry : player.getRoom().playerMapById.entrySet()) { + EXPlayer pp = (EXPlayer) entry.getValue(); + pp.notPongList.add(tip.card/100*100+1); + pp.notPongList.add(tip.card/100*100+2); + pp.notPongList.add(tip.card/100*100+3); + pp.notPongList.add(tip.card/100*100+4); + } + } + } + player.stateMachine.changeState(Global.getState(PRSelfKongState.class)); + + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfWin.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfWin.java new file mode 100644 index 0000000..8bea773 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rule/RuleSelfWin.java @@ -0,0 +1,94 @@ +package extend.mj.player.rule; + +import com.game.Global; +import com.game.data.Player; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.rulestate.PRSelfWinState; +import extend.mj.tip.IRuleBase; +import extend.mj.tip.Tip; +import extend.mj.uitl.WinCard; + +import java.util.HashMap; +import java.util.Map; + +/** + * ������� + * + * + * 2017��8��30�� + * RuleSelfWin.java + */ +public class RuleSelfWin implements IRuleBase { + + @Override + public boolean condition(EXPlayer player) { + // TODO Auto-generated method stub + ITObject config = player.room.config; + EXRoom room = player.getRoom(); + int laizi = config.getInt(Config.ROOM_CONFIG_LAIZI); + HashMap map = new HashMap(); + WinCard win = new WinCard(player.cardInhand, room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, false); + if (win.checkWin(map, player, room, true)) { + if (player.cardInhand.size() == 0 && player.opCardList.size() == 6) + { + //WinCard.putWinCardType(map, WinCardType.MAN_TIAN_HU, 1,WinCardType.MAN_TIAN_HU_SCORE, false, "满天胡"); + } + + if (map.containsKey(WinCardType.PENGPENGHU)) + { + if (room.maxPlayers == 4 && (room.bankerSeat+2)%room.maxPlayers+1 == player.seat) + { + map.remove(WinCardType.PENGPENGHU); + WinCard.putWinCardType(map, WinCardType.GUN_GUN, 1,WinCardType.GUN_GUN_SCORE, true, "滚滚"); + } + } + + ITArray opcard = TArray.newInstance(); + opcard.addInt(player.drawCard); + Tip tip = new Tip(player.drawCard,opcard, RuleWeight.SELF_WIN,this, RuleWeight.TYPE_WIN); + tip.winMap = map; + tip.self = true; + player.tipMgr.addTip(tip); + + return true; + } + return false; + } + + @Override + public void action(EXPlayer player,Tip tip) { + // TODO Auto-generated method stub + player.winCard = tip.card; + player.drawCard = tip.card; + player.winMap = tip.winMap; + EXRoom room = player.getRoom(); + + player.niao_score = WinCardType.BASE_HU_SCORE; + player.hu_score = WinCardType.BASE_HU_SCORE; + player.di_score = WinCardType.BASE_HU_SCORE; + + Global.logger.info("player:" + player.playerid + " di fen:" + player.di_score + " hu fen:" + player.hu_score + " niao fen:" + player.niao_score); + + room.handle_repeatwin(player); + boolean isDaHu = false; + for (Map.Entry entry : player.winMap.entrySet()) { + WinCardType cardType = entry.getValue(); + Global.logger.info("player:" + player.playerid + " hu:" + cardType.toString()); + if (cardType.IsDaHu()) + { + isDaHu = true; + } + } + + if (isDaHu) + { + player.hu_score = 3; + } + + player.stateMachine.changeState(Global.getState(PRSelfWinState.class)); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRChowState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRChowState.java new file mode 100644 index 0000000..f6a9125 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRChowState.java @@ -0,0 +1,62 @@ +package extend.mj.player.rulestate; + +import com.game.Global; +import com.game.Util; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.state.EXPlayerDiscardState; + +/** + * + */ +public class PRChowState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + + EXRoom room = owner.getRoom(); + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(owner.room.activeSeat); + if(activePlayer.outcardList.get(activePlayer.outcardList.size() - 1)!=room.activeCard){ + activePlayer.outcardList.remove(activePlayer.outcardList.size() - 2); + }else{ + activePlayer.outcardList.remove(activePlayer.outcardList.size() - 1); + } + activePlayer.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + int fromseat = activePlayer.seat; + EXMainServer.gameCtr.changeActiveSeat(room, owner.seat); + + ITArray opcard = owner.opCard; + int chowcard1 = opcard.getInt(0); + int chowcard2 = opcard.getInt(1); + int card= room.activeCard; + Util.removeCard(owner.cardInhand, chowcard1, 1); + Util.removeCard(owner.cardInhand, chowcard2, 1); + room.activeCard = 0; + + + OpCard opc = new OpCard(RuleWeight.TYPE_CHOW, card); + opc.opCard = new TArray(); + opc.opCard.addInt(card); + opc.opCard.addInt(chowcard1); + opc.opCard.addInt(chowcard2); + owner.opCardList.add(opc); + + ITArray opcard2 = TArray.newInstance(); + opcard2.addInt(chowcard1); + opcard2.addInt(chowcard2); + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_CHOW, fromseat, opcard2); + + if(!EXMainServer.playerRuleMgr.condition(PlayerRuleManager.CHOW_PONG_DISCARD_RULE, owner,false)){ + toNextState(owner); + } + } + + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class)); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherGongSelfWinState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherGongSelfWinState.java new file mode 100644 index 0000000..ff1aee8 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherGongSelfWinState.java @@ -0,0 +1,104 @@ +package extend.mj.player.rulestate; + + +import com.game.Util; +import com.game.data.Player; +import com.game.state.StateBase; +import extend.mj.*; + +import java.util.Map; + +/** + * ��Ӧ��������״̬ + * + * + * 2017��8��30�� + * PRSelfWinState.java + */ +public class PROtherGongSelfWinState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + + EXRoom room = owner.getRoom(); + owner.winCard = owner.drawCard; + owner.winer = 1; + Util.removeCard(owner.cardInhand, owner.winCard, 1); + if (owner.opCardList.size() > 0) + { + OpCard opCard = owner.opCardList.get(owner.opCardList.size()-1); + if ((opCard.type == RuleWeight.TYPE_KONG) && opCard.card_seat > 0) + { + owner.room.activeSeat = opCard.card_seat; + + room.addAllScore(owner, owner.hu_score, EXScore.WIN); + + room.addAllPiaoNiaoScore(owner); + for (Map.Entry entry : room.playerMapById.entrySet()) { + if (entry.getKey().equals(owner.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + fromPlayer.winer = 2; + fromPlayer.last_winer = 2; + } + + EXMainServer.gameCtr.winEvent(owner,owner.seat,owner.winCard); + if (room.lastBankerSeat == 0) + { + room.lastBankerSeat = room.bankerSeat; + } + owner.room.bankerSeat = owner.seat; + owner.settleLog.add(Config.SETTLE_ZIMO); + + room.endGame(); + return; + } + else if (opCard.type == RuleWeight.TYPE_SELF_KONG + || (opCard.type == RuleWeight.TYPE_KONG && opCard.card_seat == 0)) + { + room.addAllScore(owner, owner.hu_score,EXScore.WIN); + + room.addAllPiaoNiaoScore(owner); + for (Map.Entry entry : room.playerMapById.entrySet()) { + if (entry.getKey().equals(owner.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + fromPlayer.winer = 2; + fromPlayer.last_winer = 2; + } + + EXMainServer.gameCtr.winEvent(owner,owner.seat,owner.winCard); + if (room.lastBankerSeat == 0) + { + room.lastBankerSeat = room.bankerSeat; + } + owner.room.bankerSeat = owner.seat; + owner.settleLog.add(Config.SETTLE_ZIMO); + + room.endGame(); + return; + } + } + } + + @Override + public void toNextState(EXPlayer owner) { + // TODO Auto-generated method stub + + } + + @Override + public void exit(EXPlayer owner) { + // TODO Auto-generated method stub + + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + // TODO Auto-generated method stub + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherKongState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherKongState.java new file mode 100644 index 0000000..af62fce --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherKongState.java @@ -0,0 +1,165 @@ +package extend.mj.player.rulestate; + +import com.game.Global; +import com.game.Util; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.state.EXPlayerKongDrawState; +import extend.mj.player.state.EXPlayerWaitKongWinState; + +/** + * ��Ӧ���ܴ���״̬ + * + * + * 2017��8��30�� + * PROtherKongState.java + */ +public class PROtherKongState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + // TODO Auto-generated method stub + + EXRoom room = owner.getRoom(); + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(owner.room.activeSeat); + activePlayer.outcardList.remove(activePlayer.outcardList.size()-1); + activePlayer.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + int fromseat = activePlayer.seat; + //room.addScore(owner,activePlayer, Config.MING_GANG_SCORE,EXScore.KONG); + owner.ming_gang_num++; + activePlayer.dian_gang_num++; + + EXMainServer.gameCtr.changeActiveSeat(room,owner.seat); + owner.cardInhand.add(owner.getRoom().activeCard); + + + int [] kongGroup = new int [4]; + int card = room.activeCard; + if (Util.checkCard(card, owner.cardInhand, 4)) { + kongGroup[0] = card; + kongGroup[1] = card; + kongGroup[2] = card; + kongGroup[3] = card; + + owner.kongGroup.add(kongGroup); + if (owner.is_gang) + { + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, card, activePlayer.seat); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + owner.opCardList.add(pongCard); + owner.gangshangpao = true; + } + else { + OpCard pongCard = new OpCard(RuleWeight.TYPE_ZHAO, card, activePlayer.seat); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + owner.opCardList.add(pongCard); + } + + Util.removeCard(owner.cardInhand, card, 4); + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card); + if (owner.is_gang) + { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_KONG, fromseat,opcard); + } + else { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_ZHAO, fromseat,opcard); + } + } + else if (Util.checkCard(card, owner.cardInhand, 3) && Util.checkCard(card /100 * 100 + 4, owner.cardInhand, 1)) { + kongGroup[0] = card; + kongGroup[1] = card; + kongGroup[2] = card; + kongGroup[3] = card /100 * 100 + 4; + + owner.kongGroup.add(kongGroup); + if (owner.is_gang) + { + OpCard pongCard = new OpCard(RuleWeight.TYPE_KONG, card, activePlayer.seat); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card /100 * 100 + 4); + owner.opCardList.add(pongCard); + owner.gangshangpao = true; + } + else { + OpCard pongCard = new OpCard(RuleWeight.TYPE_ZHAO, card, activePlayer.seat); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card /100 * 100 + 4); + owner.opCardList.add(pongCard); + } + + Util.removeCard(owner.cardInhand, card, 3); + Util.removeCard(owner.cardInhand, card /100 * 100 + 4, 1); + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card /100 * 100 + 4); + if (owner.is_gang) + { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_KONG, fromseat,opcard); + } + else { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_ZHAO, fromseat,opcard); + } + } + + room.activeCard = card; + boolean qiangkong = room.config.getBoolean(Config.ROOM_CONFIG_QIANGKONG_MING); + if(qiangkong) { + owner.room.broadCastToServer(owner.playerid, EXActionEvent.EVENT_KONG_WIN, null); + if(room.tipMap.size() == 0){ + room.activeCard = 0; + room.lastDiscardSeat = 0; + owner.settleLog.add(Config.SETTLE_MING_KONG); + toNextState(owner); + }else{ + owner.stateMachine.changeState(Global.getState(EXPlayerWaitKongWinState.class)); + } + }else { + room.activeCard = 0; + room.lastDiscardSeat = 0; + owner.settleLog.add(Config.SETTLE_MING_KONG); + toNextState(owner); + } + } + + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.changeState(Global.getState(EXPlayerKongDrawState.class)); + + } + + @Override + public void exit(EXPlayer owner) { + // TODO Auto-generated method stub + + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + // TODO Auto-generated method stub + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherWinState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherWinState.java new file mode 100644 index 0000000..943d815 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PROtherWinState.java @@ -0,0 +1,48 @@ +package extend.mj.player.rulestate; + +import com.game.state.StateBase; +import extend.mj.*; +import extend.mj.uitl.WinCard; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * ��Ӧ���ƴ���״̬ + * + * + * 2017��8��30�� + * PROtherWinState.java + */ +public class PROtherWinState extends StateBase{ + + @Override + public void enter(EXPlayer owner) { + EXRoom room = (EXRoom) owner.room; + owner.winer = 1; + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(owner.room.activeSeat); + + room.addScore(owner,activePlayer, owner.hu_score, EXScore.WIN); + + room.addPiaoNiaoScore(owner, activePlayer); + activePlayer.settleLog.add(Config.SETTLE_DIAN_PAO); + activePlayer.winer = 2; + activePlayer.last_winer = 2; + + owner.settleLog.add(Config.SETTLE_JIE_PAO); + EXMainServer.gameCtr.winEvent(owner,activePlayer.seat,room.activeCard); + + if (room.lastBankerSeat == 0) + { + room.lastBankerSeat = room.bankerSeat; + } + room.bankerSeat = owner.seat; + room.winCount += 1; + + owner.winCard = room.activeCard; + + room.winCallback( owner ,owner.winCard); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRPongState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRPongState.java new file mode 100644 index 0000000..1493738 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRPongState.java @@ -0,0 +1,92 @@ +package extend.mj.player.rulestate; + +import com.game.Global; +import com.game.Util; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.state.EXPlayerDiscardState; + +/** + * ��Ӧ���ƴ���״̬ + * + * + * 2017��8��30�� + * PRPongState.java + */ +public class PRPongState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + // TODO Auto-generated method stub + EXRoom room = (EXRoom) owner.room; + EXPlayer activePlayer = (EXPlayer)room.playerMapBySeat.get(owner.room.activeSeat); + activePlayer.outcardList.remove(activePlayer.outcardList.size() - 1); + activePlayer.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + int fromseat = activePlayer.seat; + + EXMainServer.gameCtr.changeActiveSeat(room, owner.seat); + owner.cardInhand.add(room.activeCard); + + int[] pongGroup = new int[3]; + int card = room.activeCard; + OpCard pongCard = new OpCard(RuleWeight.TYPE_PONG, card, activePlayer.seat); + pongCard.opCard = new TArray(); + if (Util.checkCard(card, owner.cardInhand, 3)) { + pongGroup[0] = card; + pongGroup[1] = card; + pongGroup[2] = card; + owner.pongGroup.add(pongGroup); + Util.removeCard(owner.cardInhand, card, 3); + + room.activeCard = 0; + room.lastDiscardSeat = 0; + + + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + owner.opCardList.add(pongCard); + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card); + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_PONG, fromseat,opcard); + } + else if (Util.checkCard(card, owner.cardInhand, 2) && Util.checkCard(card / 100 * 100 + 4, owner.cardInhand, 1)) { + pongGroup[0] = card; + pongGroup[1] = card; + pongGroup[2] = card / 100 * 100 + 4; + owner.pongGroup.add(pongGroup); + Util.removeCard(owner.cardInhand, card, 2); + Util.removeCard(owner.cardInhand, card / 100 * 100 + 4, 1); + + room.activeCard = 0; + room.lastDiscardSeat = 0; + + + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card / 100 * 100 + 4); + owner.opCardList.add(pongCard); + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card / 100 * 100 + 4); + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_PONG, fromseat,opcard); + } + + if(!EXMainServer.playerRuleMgr.condition(PlayerRuleManager.CHOW_PONG_DISCARD_RULE, owner,false)){ + toNextState(owner); + } + } + + @Override + public void toNextState(EXPlayer owner) { + owner.drawCard = 0; + owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class)); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfKongState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfKongState.java new file mode 100644 index 0000000..a59db82 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfKongState.java @@ -0,0 +1,120 @@ +package extend.mj.player.rulestate; + +import com.game.Global; +import com.game.Util; +import com.game.state.StateBase; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.*; +import extend.mj.player.state.EXPlayerDrawState; +import extend.mj.player.state.EXPlayerKongDrawState; + +/** + * ��Ӧ���ܴ���״̬ + * + * + * 2017��8��30�� + * PRSelfKongState.java + */ +public class PRSelfKongState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + EXRoom room = owner.getRoom(); + + ITArray opCard = owner.opCard; + int card = opCard.getInt(0); + int [] kongGroup = new int [4]; + if (opCard.size() >= 2) + { + Util.removeCard(owner.cardInhand, card, 3); + Util.removeCard(owner.cardInhand, card/100*100+4, 1); + kongGroup[0] = card; + kongGroup[1] = card; + kongGroup[2] = card; + kongGroup[3] = card/100*100+4; + owner.selfKongGroup.add(kongGroup); + if (owner.is_gang) + { + OpCard pongCard = new OpCard(RuleWeight.TYPE_SELF_KONG, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card/100*100+4); + owner.opCardList.add(pongCard); + owner.gangshangpao = true; + } + else { + OpCard pongCard = new OpCard(RuleWeight.TYPE_SELF_ZHAO, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card/100*100+4); + owner.opCardList.add(pongCard); + } + + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card/100*100+4); + if (owner.is_gang) + { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_SELF_KONG, owner.seat,opcard); + } + else { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_SELF_ZHAO, owner.seat,opcard); + } + } + else { + Util.removeCard(owner.cardInhand, card, 4); + kongGroup[0] = card; + kongGroup[1] = card; + kongGroup[2] = card; + kongGroup[3] = card; + owner.selfKongGroup.add(kongGroup); + if (owner.is_gang) + { + OpCard pongCard = new OpCard(RuleWeight.TYPE_SELF_KONG, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + owner.opCardList.add(pongCard); + owner.gangshangpao = true; + } + else { + OpCard pongCard = new OpCard(RuleWeight.TYPE_SELF_ZHAO, card); + pongCard.opCard = new TArray(); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + pongCard.opCard.addInt(card); + owner.opCardList.add(pongCard); + } + + ITArray opcard = TArray.newInstance(); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card); + opcard.addInt(card); + if (owner.is_gang) + { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_SELF_KONG, owner.seat,opcard); + } + else { + EXMainServer.gameCtr.actionCard(owner, card, RuleWeight.TYPE_SELF_ZHAO, owner.seat,opcard); + } + } + + + //room.addAllScore(owner, Config.AN_GANG_SCORE, EXScore.KONG); + owner.an_gang_num++; + owner.stateMachine.changeState(Global.getState(EXPlayerKongDrawState.class)); + owner.settleLog.add(Config.SETTLE_AN_KONG); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfWinState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfWinState.java new file mode 100644 index 0000000..810c451 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/rulestate/PRSelfWinState.java @@ -0,0 +1,70 @@ +package extend.mj.player.rulestate; + + +import com.game.Util; +import com.game.data.Player; +import com.game.state.StateBase; +import extend.mj.*; + +import java.util.Map.Entry; + +/** + * ��Ӧ��������״̬ + * + * + * 2017��8��30�� + * PRSelfWinState.java + */ +public class PRSelfWinState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + + EXRoom room = owner.getRoom(); + owner.winCard = owner.drawCard; + owner.winer = 1; + + Util.removeCard(owner.cardInhand, owner.winCard, 1); + + room.addAllScore(owner, owner.hu_score,EXScore.WIN); + + room.addAllPiaoNiaoScore(owner); + for (Entry entry : room.playerMapById.entrySet()) { + if (entry.getKey().equals(owner.playerid)) { + continue; + } + EXPlayer fromPlayer = (EXPlayer) entry.getValue(); + fromPlayer.winer = 2; + fromPlayer.last_winer = 2; + } + + EXMainServer.gameCtr.winEvent(owner,owner.seat,owner.winCard); + + if (room.lastBankerSeat == 0) + { + room.lastBankerSeat = room.bankerSeat; + } + owner.room.bankerSeat = owner.seat; + owner.settleLog.add(Config.SETTLE_ZIMO); + room.endGame(); + } + + @Override + public void toNextState(EXPlayer owner) { + // TODO Auto-generated method stub + + } + + @Override + public void exit(EXPlayer owner) { + // TODO Auto-generated method stub + + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + // TODO Auto-generated method stub + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDisCardTipState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDisCardTipState.java new file mode 100644 index 0000000..2e3d968 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDisCardTipState.java @@ -0,0 +1,54 @@ +package extend.mj.player.state; + +import java.util.Map.Entry; + +import com.game.ActionEvent; +import com.taurus.core.entity.ITObject; + +import extend.mj.EXActionEvent; +import extend.mj.EXPlayer; +import extend.mj.RuleWeight; +import extend.mj.tip.Tip; + +/** + * ��ҳ�����ʾ״̬ + * + * + * 2017��8��30�� + * EXPlayerDisCardTipState.java + */ +public class EXPlayerDisCardTipState extends EXPlayerTipState { + + @Override + public void enter(EXPlayer owner) { + super.enter(owner); + owner.getRoom().tipMap.put(owner.playerid, owner.tipMgr); + } + + @Override + public void exit(EXPlayer owner) { + super.exit(owner); + owner.getRoom().tipMap.remove(owner.playerid); + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + super.execute(owner, cmd, gid, param); + if (cmd.equals(EXActionEvent.EVENT_ACTION)) { + ITObject netParam = (ITObject) param; + int id = netParam.getInt("id"); + owner.tipMgr.choicAction(id); + }else if(cmd.equals(ActionEvent.EVENT_TIMER_AUTO)) { + int id = 0; + for (Entry entry : owner.tipMgr.tipMap.entrySet()) { + Tip tip = entry.getValue(); + if(tip.type == RuleWeight.TYPE_WIN) { + id = tip.id; + break; + } + } + owner.tipMgr.choicAction(id); + } + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDiscardState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDiscardState.java new file mode 100644 index 0000000..c00db97 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDiscardState.java @@ -0,0 +1,114 @@ +package extend.mj.player.state; + +import com.game.ActionEvent; +import com.game.Global; +import com.game.Router; +import com.game.Util; +import com.game.player.state.PlayerPauseState; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; +import com.taurus.core.entity.*; + +import extend.mj.*; +import extend.mj.room.state.EXRoomSetpState; + +import java.util.ArrayList; +import java.util.Collections; + +/** + * �ȴ���ҳ���״̬ + * + */ +public class EXPlayerDiscardState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + if (owner.is_gang) + { + owner.louhu = false; + int discard = owner.drawCard; + if(owner.drawCard == 0) { + discard = owner.cardInhand.get(owner.cardInhand.size() - 1); + } + + EXMainServer.gameCtr.outCard(owner, discard); + owner.gangshangpao = false; + + if (owner.getRoom().tipMap.size() != 0) { + owner.stateMachine.changeState(Global.getState(PlayerPauseState.class)); + } else { + this.toNextState(owner); + } + } + else { + EXMainServer.gameCtr.discardTipEvent(owner); + owner.startActionTimer(); + } + } + + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + owner.room.stateMachine.changeState(Global.getState(EXRoomSetpState.class)); + } + + + + @Override + public void exit(EXPlayer owner) { + owner.stopActionTimer(); + } + + public void reload(EXPlayer owner) { + owner.startActionTimer(); + } + + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + switch (cmd) { + case EXActionEvent.EVENT_DISCARD: + ITObject netParam = (ITObject) param; + int discard = netParam.getInt("card"); + + if (!Util.checkCard(discard, owner.cardInhand)) { + ITObject reconParam = new TObject(); + owner.sendEvent(Router.GAME_EVT__UPDATE_RECONECT, reconParam); + return; + } + owner.louhu = false; + EXMainServer.gameCtr.outCard(owner, discard); + owner.gangshangpao = false; + + if (owner.getRoom().tipMap.size() != 0) { + owner.stateMachine.changeState(Global.getState(PlayerPauseState.class)); + } else { + this.toNextState(owner); + } + break; + case ActionEvent.EVENT_TIMER_AUTO: + owner.louhu = false; + discard = owner.drawCard; + if(owner.drawCard == 0) { + discard = owner.cardInhand.get(owner.cardInhand.size() - 1); + } + + EXMainServer.gameCtr.outCard(owner, discard); + owner.gangshangpao = false; + + if (owner.getRoom().tipMap.size() != 0) { + owner.stateMachine.changeState(Global.getState(PlayerPauseState.class)); + } else { + this.toNextState(owner); + } + break; + case ActionEvent.EVENT_ENTRUST: + owner.startActionTimer(); + break; + default: + break; + } + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawState.java new file mode 100644 index 0000000..7f29a50 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawState.java @@ -0,0 +1,199 @@ +package extend.mj.player.state; + +import com.game.Global; +import com.game.Util; +import com.game.state.StateBase; +import com.taurus.core.entity.ITObject; +import extend.mj.*; +import extend.mj.uitl.WinCard; + +import java.util.ArrayList; +import java.util.HashMap; + +/** + * ���ץ��״̬ + * + * + * 2017��8��30�� + * EXPlayerDrawState.java + */ +public class EXPlayerDrawState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + EXRoom room = owner.getRoom(); + if (room.isLiuJu()) { + room.endGameByLiuJu(); + return; + } + + ITObject config = room.config; + boolean hz_hu = config.getBoolean(Config.ROOM_CONFIG_HZ_HU); + boolean laizi = room.config.getInt(Config.ROOM_CONFIG_LAIZI) > 0 ? true : false; + + if(owner.seat == room.adminSeat) { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = room.card.pop(); + + if (!IsGoodCard(owner, drawCard, laizi)) { + if (room.card.cardList.size() != 0 && count++ <= 5) { + tempCardList.add(drawCard); + continue; + } + } + + owner.drawCard = drawCard; + break; + } while (true); + room.card.cardList.addAll(tempCardList); + } else { + double rand = Math.random() % 100 * 100; + if (room.while_list && owner.is_white && rand > room.white_value) { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = room.card.pop(); + + if (!IsGoodCard(owner, drawCard, laizi)) { + if (room.card.cardList.size() != 0 && count++ <= 5) { + tempCardList.add(drawCard); + continue; + } + } + + owner.drawCard = drawCard; + break; + } while (true); + room.card.cardList.addAll(tempCardList); + } else { + if (owner.black_white_status == 2) { + double rand1 = Math.random() % 100 * 100; + if (rand1 <= owner.black_white_rate) { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = room.card.pop(); + + boolean flag = false; + if (IsGoodCard(owner, drawCard, laizi)) { + flag = true; + } + + if (!flag) { + if (room.card.cardList.size() > 0 && count++ <= 5) { + tempCardList.add(drawCard); + continue; + } + } + + owner.drawCard = drawCard; + break; + } + while (true); + room.card.cardList.addAll(tempCardList); + } else { + owner.drawCard = room.card.pop(); + } + } else if (owner.black_white_status == 1) { + double rand1 = Math.random() % 100 * 100; + if (rand1 <= owner.black_white_rate) { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = room.card.pop(); + + boolean flag = false; + if (IsGoodCard(owner, drawCard, laizi)) { + flag = true; + } + + if (flag) { + if (room.card.cardList.size() > 0 && count++ <= 5) { + tempCardList.add(drawCard); + continue; + } + } + + owner.drawCard = drawCard; + break; + } + while (true); + room.card.cardList.addAll(tempCardList); + } else { + owner.drawCard = room.card.pop(); + } + } else { + owner.drawCard = room.card.pop(); + } + } + } + + int leftCount = room.card.getCount(); + ((EXGameController)Global.gameCtr).getCard(owner, leftCount); + + EXMainServer.playerRuleMgr.condition(PlayerRuleManager.DRAW_RULE, owner); + } + + private boolean IsGoodCard(EXPlayer player, int drawCard, boolean laizi) { + if (player.getRoom().isLaizi(drawCard)) + { + return true; + } + + if (Util.cardNum(drawCard, player.cardInhand) >= 2) + { + return true; + } + + for (int[] cardGroup : player.pongGroup) { + if (drawCard == cardGroup[0]) { + return true; + } + } + + HashMap map = new HashMap(); + WinCard win = new WinCard(player.cardInhand, drawCard, player.getRoom().card.laiziCard, player.getRoom().card.laiziCard2, laizi, true, true); + if (win.checkWin(map, player, player.getRoom(), true)) { + return true; + } + + if (drawCard < 400) + { + if (drawCard % 100 <= 7) + { + if (Util.cardNum(drawCard+1, player.cardInhand) >= 1 && Util.cardNum(drawCard+2, player.cardInhand) >= 1) + { + return true; + } + } + + if (drawCard % 100 >= 3) + { + if (Util.cardNum(drawCard-1, player.cardInhand) >= 1 && Util.cardNum(drawCard-2, player.cardInhand) >= 1) + { + return true; + } + } + + if (drawCard % 100 >= 2 && drawCard % 100 <= 8) + { + if (Util.cardNum(drawCard-1, player.cardInhand) >= 1 && Util.cardNum(drawCard+1, player.cardInhand) >= 1) + { + return true; + } + } + } + + return false; + } + + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class)); + + } + + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawTipState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawTipState.java new file mode 100644 index 0000000..f2b5baf --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerDrawTipState.java @@ -0,0 +1,43 @@ +package extend.mj.player.state; + +import java.util.Map.Entry; + +import com.game.ActionEvent; +import com.game.Global; +import com.taurus.core.entity.ITObject; + +import extend.mj.EXActionEvent; +import extend.mj.EXPlayer; +import extend.mj.RuleWeight; +import extend.mj.tip.Tip; + +/** + * ���ץ����ʾ״̬ + * + */ +public class EXPlayerDrawTipState extends EXPlayerTipState { + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + super.execute(owner, cmd, gid, param); + if (cmd.equals(EXActionEvent.EVENT_ACTION)) { + ITObject netParam = (ITObject) param; + int id = netParam.getInt("id"); + boolean win = (owner.tipMgr.weight &RuleWeight.SELF_WIN)!=0 ; + if(Global.gameId == 1 && win && id == 0)return; + owner.tipMgr.doAction(id); + }else if(cmd.equals(ActionEvent.EVENT_TIMER_AUTO)) { + int id = 0; + for (Entry entry : owner.tipMgr.tipMap.entrySet()) { + Tip tip = entry.getValue(); + if(tip.type == RuleWeight.TYPE_WIN) { + id = tip.id; + break; + } + } + owner.tipMgr.doAction(id); + } + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongDrawState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongDrawState.java new file mode 100644 index 0000000..c152b6d --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongDrawState.java @@ -0,0 +1,142 @@ +package extend.mj.player.state; + +import com.game.Global; +import com.game.player.state.PlayerPauseState; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; + +import com.taurus.core.entity.ITObject; +import com.taurus.permanent.TPServer; +import extend.mj.*; +import extend.mj.room.state.EXRoomSetpState; +import extend.mj.uitl.WinCard; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.concurrent.TimeUnit; + +/** + * ���ץ��״̬ + * + * + * 2017��8��30�� + * EXPlayerDrawState.java + */ +public class EXPlayerKongDrawState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + EXRoom room = owner.getRoom(); + if (room.isLiuJu()) { + room.endGameByLiuJu(); + return; + } + + ITObject config = room.config; + + boolean hz_hu = config.getBoolean(Config.ROOM_CONFIG_HZ_HU); + int laizi = room.config.getInt(Config.ROOM_CONFIG_LAIZI); + + if(owner.seat == room.adminSeat) { + double rand = Math.random() % 100; + if (room.while_list && !owner.is_white && rand > room.white_value) + { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = owner.drawCard = room.card.popsub(); + HashMap map = new HashMap(); + WinCard win = new WinCard(owner.cardInhand, drawCard, room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, true, true); + if(!(hz_hu && win.laizi_count >0)) { + if (win.checkWin(map, owner, room, true)) { + if (room.card.cardList.size() != 0 && count++ <= 5) { + tempCardList.add(drawCard); + continue; + } + } + } + + owner.drawCard = drawCard; + break; + } while(true); + + room.card.cardList.addAll(tempCardList); + } + else + { + owner.drawCard = room.card.popsub(); + } + }else { + double rand = Math.random() % 100 * 100; + if (room.while_list && !owner.is_white && rand > room.white_value) + { + ArrayList tempCardList = new ArrayList(); + int count = 0; + do { + int drawCard = room.card.pop(); + HashMap map = new HashMap(); + WinCard win = new WinCard(owner.cardInhand, drawCard, room.card.laiziCard, room.card.laiziCard2, laizi > 0 ? true : false, true, true); + if(!(hz_hu && win.laizi_count >0)) { + if (win.checkWin(map, owner, room, true)) { + if (room.card.cardList.size() != 0 && count++ <= 5) { + tempCardList.add(drawCard); + Global.logger.info("no white to hu:" + drawCard); + continue; + } + } + } + + owner.drawCard = drawCard; + break; + } while(true); + room.card.cardList.addAll(tempCardList); + } + else + { + owner.drawCard = room.card.pop(); + } + } + + int leftCount = room.card.getCount(); + ((EXGameController)Global.gameCtr).getCard(owner, leftCount); + + EXMainServer.playerRuleMgr.condition(PlayerRuleManager.KONG_DRAW_RULE, owner); + } + + @Override + public void toNextState(EXPlayer owner) { + if (owner.is_gang) + { + timer(owner); + } + else { + owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class)); + } + } + + public static void timer(EXPlayer owner) { + + TPServer.me().getTimerPool().schedule(new Runnable() { + + @Override + public void run() { + + if (owner == null || owner.getRoom() == null) { + Global.logger.error("room is null"); + return; + } + + if (owner.getRoom().isDestroy) + return; + + owner.getRoom().enqueueRunnable(new Runnable() { + + @Override + public void run() { + owner.stateMachine.changeState(Global.getState(EXPlayerDiscardState.class)); + } + }); + } + }, 1000, TimeUnit.MILLISECONDS); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongWinState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongWinState.java new file mode 100644 index 0000000..441c172 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerKongWinState.java @@ -0,0 +1,42 @@ +package extend.mj.player.state; + +import com.taurus.core.entity.ITObject; + +import extend.mj.EXActionEvent; +import extend.mj.EXPlayer; + +/** + * ���������ʾ�ȴ� + * + * + * 2017��8��30�� + * EXPlayerKongWinState.java + */ +public class EXPlayerKongWinState extends EXPlayerTipState{ + + @Override + public void enter(EXPlayer owner) { + // TODO Auto-generated method stub + super.enter(owner); + owner.getRoom().tipMap.put(owner.playerid, owner.tipMgr); + + } + + @Override + public void exit(EXPlayer owner) { + // TODO Auto-generated method stub + super.exit(owner); + owner.getRoom().tipMap.remove(owner.playerid); + + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + if (cmd.equals(EXActionEvent.EVENT_ACTION)) { + ITObject netParam = (ITObject) param; + int id = netParam.getInt("id"); + owner.tipMgr.choicAction(id); + } + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerPiaoNiaoTipState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerPiaoNiaoTipState.java new file mode 100644 index 0000000..4d6945a --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerPiaoNiaoTipState.java @@ -0,0 +1,63 @@ +package extend.mj.player.state; + +import com.game.ActionEvent; +import com.game.Global; +import com.game.player.state.PlayerWaitState; +import com.game.state.StateBase; +import com.taurus.core.entity.ITObject; +import extend.mj.EXActionEvent; +import extend.mj.EXMainServer; +import extend.mj.EXPlayer; + + +public class EXPlayerPiaoNiaoTipState extends StateBase{ + + @Override + public void enter(EXPlayer owner) { + if(!owner.isEntrust()) { + EXMainServer.gameCtr.piaoTipEvent(owner,0); + } + owner.startActionTimer(); + } + + /** + * 重连 + * @param owner + */ + @Override + public void reload(EXPlayer owner) { + EXMainServer.gameCtr.piaoTipEvent(owner,1); + owner.startActionTimer(); + } + + + @Override + public void exit(EXPlayer owner) { + owner.stopActionTimer(); + } + + private void _action(EXPlayer owner,int id,int gid) { + owner.piao = id; + owner.last_piao = id; + + owner.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + owner.getRoom().piaoCount --; + EXMainServer.gameCtr.piaoEvent(owner); + owner.getRoom().stateMachine.execute(EXActionEvent.EVENT_PIAO, gid, null); + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + super.execute(owner, cmd, gid, param); + if (cmd.equals(EXActionEvent.EVENT_PIAO)) { + ITObject netParam = (ITObject) param; + int id = netParam.getInt("id"); + _action(owner, id, gid); + }else if(cmd.equals(ActionEvent.EVENT_TIMER_AUTO) || cmd.equals(ActionEvent.EVENT_ENTRUST)) { + _action(owner,0,gid); + } + else if(cmd.equals(ActionEvent.EVENT_OFFLINE)) { + owner.startActionTimer(); + } + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerTipState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerTipState.java new file mode 100644 index 0000000..db227ac --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerTipState.java @@ -0,0 +1,61 @@ +package extend.mj.player.state; + +import com.game.ActionEvent; +import com.game.state.StateBase; +import extend.mj.Config; +import extend.mj.EXMainServer; +import extend.mj.EXPlayer; +import extend.mj.RuleWeight; +import extend.mj.tip.Tip; + +/** + * �����ʾ������� + * + * + * 2017��8��30�� + * EXPlayerTipState.java + */ +public abstract class EXPlayerTipState extends StateBase { + + @Override + public void enter(EXPlayer owner) { + if (owner.getRoom().config.getBoolean(Config.ROOM_CONFIG_ZI_DONG_HU)) + { + Tip tip = owner.tipMgr.getTip(RuleWeight.TYPE_WIN); + if (tip != null) + { + owner.startActionTimer(1000); + return; + } + } + + if(!owner.isEntrust()) { + EXMainServer.gameCtr.tipEvent(owner); + } + owner.startActionTimer(); + } + + @SuppressWarnings("unchecked") + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.lastState.toNextState(owner); + } + + @Override + public void exit(EXPlayer owner) { + owner.tipMgr.clean(); + owner.stopActionTimer(); + } + + public void reload(EXPlayer owner) { + super.reload(owner); + this.enter(owner); + } + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + if(cmd.equals(ActionEvent.EVENT_ENTRUST)) { + owner.startActionTimer(); + } + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitKongWinState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitKongWinState.java new file mode 100644 index 0000000..dff6a34 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitKongWinState.java @@ -0,0 +1,24 @@ +package extend.mj.player.state; + +import com.game.state.StateBase; + +import extend.mj.EXPlayer; + +/** + * ������ҵȴ��������ǹ�ܺ� + * + * + * 2017��8��30�� + * EXPlayerWaitKongWinState.java + */ +public class EXPlayerWaitKongWinState extends StateBase{ + + @SuppressWarnings("unchecked") + @Override + public void toNextState(EXPlayer owner) { + owner.stateMachine.lastState.toNextState(owner); + + } + + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitState.java new file mode 100644 index 0000000..858aee0 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/player/state/EXPlayerWaitState.java @@ -0,0 +1,39 @@ +package extend.mj.player.state; + + +import com.game.state.StateBase; + +import extend.mj.EXActionEvent; +import extend.mj.EXMainServer; +import extend.mj.EXPlayer; +import extend.mj.PlayerRuleManager; + +/** + * ��ҵȴ�״̬ + * + * + * 2017��8��30�� + * EXPlayerWaitState.java + */ +public class EXPlayerWaitState extends StateBase { + + + @Override + public void execute(EXPlayer owner, String cmd, int gid, Object param) { + // TODO Auto-generated method stub + switch (cmd) { + case EXActionEvent.EVENT_OTHER_DISCARD: + EXMainServer.playerRuleMgr.condition( PlayerRuleManager.OTHER_DISCARD_RULE , owner); + break; + case EXActionEvent.EVENT_KONG_WIN: + owner.forceCheckWin = true; + EXMainServer.playerRuleMgr.condition( PlayerRuleManager.KONG_HU_RULE , owner); + owner.forceCheckWin = false; + break; + default: + break; + } + + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomDealState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomDealState.java new file mode 100644 index 0000000..a9c6966 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomDealState.java @@ -0,0 +1,107 @@ +package extend.mj.room.state; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Map.Entry; +import java.util.Random; +import java.util.concurrent.TimeUnit; + +import com.game.Global; +import com.game.data.Player; +import com.game.state.StateBase; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; + +import com.taurus.permanent.TPServer; +import extend.mj.*; +import extend.mj.player.state.EXPlayerPiaoNiaoTipState; + +/** + * ���䷢��״̬ + * + * + * 2017��8��30�� + * EXRoomDealState.java + */ +public class EXRoomDealState extends StateBase { + + @Override + public void enter(EXRoom owner) { + boolean donghua = false; + for (Entry entry : owner.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + if (player.xi_pai) + { + donghua = true; + break; + } + } + + if (donghua) + { + owner.notifyXiPai(); + //启动定时器 + timer(owner); + } + else { + this.toNextState(owner); + } + } + + public static void timer(EXRoom owner) { + + TPServer.me().getTimerPool().schedule(new Runnable() { + + @Override + public void run() { + + if (owner == null) { + Global.logger.error("room is null"); + return; + } + + if (owner.isDestroy) + return; + + owner.enqueueRunnable(new Runnable() { + + @Override + public void run() { + owner.stateMachine.toNextState(); + } + }); + } + }, 4000, TimeUnit.MILLISECONDS); + } + + @Override + public void toNextState(EXRoom owner) { + owner.card.init(); + if (owner.bankerSeat == 0) { + owner.bankerSeat = 1; + ArrayList randPlayer = new ArrayList<>(); + for (Entry entry : owner.playerMapBySeat.entrySet()) { + Integer seat = entry.getKey(); + randPlayer.add(seat); + } + + Collections.shuffle(randPlayer); + if (randPlayer.size() > 0) + { + owner.bankerSeat = randPlayer.get(0); + } + } + else { + if (owner.config.getInt(Config.ROOM_CONFIG_XUAN_ZHUANG) == 0) + { + owner.bankerSeat = (owner.bankerSeat)%owner.maxPlayers+1; + } + } + + ITObject param = new TObject(); + param.putInt("bank_seat", owner.bankerSeat); + EXMainServer.gameCtr.dealCard(owner); + owner.playBackData = new EXPlayBack(owner); + owner.stateMachine.changeState(Global.getState(EXRoomSetpState.class)); + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomPiaoState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomPiaoState.java new file mode 100644 index 0000000..0a522d7 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomPiaoState.java @@ -0,0 +1,30 @@ +package extend.mj.room.state; + +import com.game.Global; +import com.game.data.Player; +import com.game.state.StateBase; +import extend.mj.EXActionEvent; +import extend.mj.EXRoom; +import extend.mj.player.state.EXPlayerPiaoNiaoTipState; + +import java.util.Map.Entry; + +public class EXRoomPiaoState extends StateBase{ + + @Override + public void enter(EXRoom owner) { + owner.piaoCount = owner.maxPlayers; + for (Entry entry : owner.playerMapById.entrySet()) { + Player player = entry.getValue(); + player.stateMachine.changeState(Global.getState(EXPlayerPiaoNiaoTipState.class)); + } + } + + public void execute(EXRoom owner, String cmd, int gid, Object param) { + if(cmd.equals(EXActionEvent.EVENT_PIAO)) { + if(owner.piaoCount==0) { + owner.stateMachine.changeState(Global.getState(EXRoomDealState.class)); + } + } + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomSetpState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomSetpState.java new file mode 100644 index 0000000..47fbd44 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomSetpState.java @@ -0,0 +1,42 @@ +package extend.mj.room.state; + + +import com.game.Global; +import com.game.data.Player; +import com.game.state.StateBase; + +import extend.mj.EXMainServer; +import extend.mj.EXRoom; +import extend.mj.player.state.EXPlayerDrawState; + +/** + * ����ת����λ + * + * + * 2017��8��30�� + * EXRoomSetpState.java + */ +public class EXRoomSetpState extends StateBase { + + @Override + public void enter(EXRoom owner) { + Player player; + // TODO Auto-generated method stub + if (owner.activeSeat == 0) { + player = owner.playerMapBySeat.get(owner.bankerSeat); + + } else { + player = owner.playerMapBySeat.get(owner.activeSeat); + int nextSeat = player.nextSeat; + player = owner.playerMapBySeat.get(nextSeat); + + } + + EXMainServer.gameCtr.changeActiveSeat(owner,player.seat); + + player.stateMachine.changeState(Global.getState(EXPlayerDrawState.class)); + + this.toNextState(owner); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomStartGameState.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomStartGameState.java new file mode 100644 index 0000000..1a2b807 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/room/state/EXRoomStartGameState.java @@ -0,0 +1,58 @@ +package extend.mj.room.state; + +import com.game.Global; +import com.game.data.Player; +import com.game.state.StateBase; + +import extend.mj.Config; +import extend.mj.EXMainServer; +import extend.mj.EXPlayer; +import extend.mj.EXRoom; + +import java.util.Map; + +/** + * ���俪ʼ״̬ + * + */ +public class EXRoomStartGameState extends StateBase { + + @Override + public void enter(EXRoom owner) { +// owner.readyCount = 0; +// for (Entry entry : owner.playerMapById.entrySet()) { +// Player player = entry.getValue(); +// player.ready = false; +// player.clear(); +// player.initSeat(); +// } + owner.startGame(); + + this.toNextState(owner); + } + + @Override + public void toNextState(EXRoom owner) { + if(owner.config.containsKey(Config.ROOM_CONFIG_PIAO) && owner.config.getInt(Config.ROOM_CONFIG_PIAO) != 0) { + if (owner.config.getInt(Config.ROOM_CONFIG_PIAO) == 3) + { + int piaofen = owner.config.getInt(Config.ROOM_CONFIG_PIAO_FEN); + + for (Map.Entry entry : owner.playerMapById.entrySet()) { + EXPlayer player = (EXPlayer) entry.getValue(); + player.piao = piaofen; + player.last_piao = piaofen; + EXMainServer.gameCtr.piaoEvent(player); + } + owner.stateMachine.changeState(Global.getState(EXRoomDealState.class)); + } + else { + owner.stateMachine.changeState(Global.getState(EXRoomPiaoState.class)); + } + } + else{ + owner.stateMachine.changeState(Global.getState(EXRoomDealState.class)); + } + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Action.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Action.java new file mode 100644 index 0000000..454d9ca --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Action.java @@ -0,0 +1,27 @@ +package extend.mj.tip; + + +import extend.mj.EXPlayer; + +/** + * + * + + */ +public class Action { + + public Tip tip; + public EXPlayer player; + + public Action(Tip tip, EXPlayer player) { + this.tip = tip; + this.player = player; + + } + + public void run() { + this.player.initOpCard(tip.opcard); + this.tip.rule.action(this.player,this.tip); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/IRuleBase.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/IRuleBase.java new file mode 100644 index 0000000..79f1ab8 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/IRuleBase.java @@ -0,0 +1,27 @@ +package extend.mj.tip; + +import extend.mj.EXPlayer; + +/** + * ����������� + * + * + * 2017��8��30�� + * RuleBase.java + */ +public interface IRuleBase { + + /** + * ������� + * @param player + * @return + */ + public abstract boolean condition(EXPlayer player ); + + /** + * ִ�иù��� + * @param player + */ + public abstract void action(EXPlayer player ,Tip tip); + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Tip.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Tip.java new file mode 100644 index 0000000..b4f6ce4 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/Tip.java @@ -0,0 +1,46 @@ +package extend.mj.tip; + +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TObject; +import extend.mj.WinCardType; + +import java.util.Map; + +/** + * tip������ + * + * + * + * 2017��8��30�� Tip.java + */ +public class Tip { + public int id; + public IRuleBase rule; + public int weight; + public int card; + public ITArray opcard; + public int winType; + public int type; + public boolean self; + public Map winMap; + + public Tip(int card, ITArray opcard, int weight, IRuleBase rule, int type) { + this.rule = rule; + this.weight = weight; + this.opcard = opcard; + this.card = card; + this.type = type; + this.self = false; + } + + public ITObject toMP() { + ITObject tipMp = new TObject(); + tipMp.putInt("id", id); + tipMp.putInt("weight", weight); + tipMp.putInt("type", type); + tipMp.putInt("card", card); + tipMp.putTArray("opcard", opcard); + return tipMp; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/TipManager.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/TipManager.java new file mode 100644 index 0000000..9f40ee2 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/tip/TipManager.java @@ -0,0 +1,142 @@ +package extend.mj.tip; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.game.Global; +import com.game.player.state.PlayerWaitState; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import com.taurus.core.entity.TObject; + +import extend.mj.Config; +import extend.mj.EXPlayer; +import extend.mj.RuleWeight; + +/** + * + * + * + * 2017��9��18�� TipManager.java + */ +public class TipManager { + + private int id = 0; + + public Map tipMap = null; + public Tip actionTip; + public int weight = 0; + public EXPlayer owner = null; + + public TipManager(EXPlayer owner) { + this.tipMap = new HashMap(); + this.owner = owner; + + } + + public void addTip(Tip tip) { + int id = this.getId(); + this.weight = this.weight | tip.weight; + tip.id = id; + this.tipMap.put(id, tip); + } + + public Tip getTip(int type) + { + for (Entry entry : this.tipMap.entrySet()) + { + Tip tip = entry.getValue(); + if (tip.type == type) + { + return tip; + } + } + return null; + } + + private void checkLouhu() { + if (owner.getRoom().config.getBoolean(Config.ROOM_CONFIG_LOUHU)) + { + for (Entry entry : this.tipMap.entrySet()) { + Tip tip = entry.getValue(); + if(tip.type == RuleWeight.TYPE_WIN) { + this.owner.louhu = true; + break; + } + } + } + } + + public void choicAction(int id) { + if (id == 0) { + this.checkLouhu(); + this.owner.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + this.owner.getRoom().checkAction(); + } else if (this.tipMap.containsKey(id)) { + Tip tip = this.tipMap.get(id); + owner.stateMachine.changeState(Global.getState(PlayerWaitState.class)); + owner.getRoom().addAction(new Action(tip, owner)); + } else { + throw new Error("tip map has no id" + id); + } + } + + @SuppressWarnings("unchecked") + public void doAction(int id) { + if (id == 0) { + this.checkLouhu(); + this.owner.stateMachine.lastState.toNextState(owner); + } else if (this.tipMap.containsKey(id)) { + Tip tip = this.tipMap.get(id); + owner.initOpCard(tip.opcard); + tip.rule.action(owner,tip); + + } else { + throw new Error("tip map has no id" + id); + } + + } + + public ITObject toMP() { + ITObject mp = new TObject(); + mp.putInt("weight", this.weight); + ITArray tipList = new TArray(); + for (Entry entry : this.tipMap.entrySet()) { + Tip tip = entry.getValue(); + ITObject tipMp = tip.toMP(); + tipList.addTObject(tipMp); + } + mp.putTArray("tip_list", tipList); + return mp; + + } + + private int getId() { + this.id += 1; + return this.id; + } + + public int getWeightest() { + int result = 0; + for (Entry entry : this.tipMap.entrySet()) { + Tip tip = entry.getValue(); + if (tip.weight > result) { + result = tip.weight; + } + } + return result; + } + + public void cleanTip() { + this.weight = 0; + this.id = 0; + this.tipMap = new HashMap(); + } + + public void clean() { + this.cleanTip(); + } + +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/CardUtil.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/CardUtil.java new file mode 100644 index 0000000..e8ed060 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/CardUtil.java @@ -0,0 +1,51 @@ +package extend.mj.uitl; + +import java.util.List; +import java.util.Map; + +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.TArray; +import extend.mj.OpCard; +import extend.mj.WinCardType; + +public class CardUtil { + + + static public void removeGroup(List group, int card) { + for (int i = 0; i < group.size(); i++) { + int[] cardArray = group.get(i); + if (cardArray[0] == card) { + group.remove(cardArray); + return; + } + + } + } + + static public void removeOpcard(List opcards, OpCard param) { + for (int i = 0; i < opcards.size(); i++) { + if (param.card == opcards.get(i).card) { + opcards.remove(i); + return; + } + + } + + } + + static public ITArray toMPData_WinMap(Map map) { + return toMPData_WinMap(map,false); + } + + static public ITArray toMPData_WinMap(Map map,boolean is_opcard) { + if (map != null && map.size() > 0) { + ITArray array = TArray.newInstance(); + for (Map.Entry entry : map.entrySet()) { + WinCardType wct = entry.getValue(); + array.addTObject(wct.toTObject(is_opcard)); + } + return array; + } + return null; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/WinCard.java b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/WinCard.java new file mode 100644 index 0000000..0f6b0ad --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/main/java/extend/mj/uitl/WinCard.java @@ -0,0 +1,1468 @@ +package extend.mj.uitl; + +import com.game.Global; +import com.game.Util; +import com.game.data.Player; +import com.taurus.core.entity.ITArray; +import com.taurus.core.entity.ITObject; +import com.taurus.core.entity.TArray; +import extend.mj.*; + +import java.util.*; + +public class WinCard { + + public List cardList; + public int laizi_count; + public int laizi1_count; + public int laizi2_count; + public int laizi1 = 0; + public int laizi2 = 0; + public boolean zi_mo = false; + public boolean ting_pai = false; + public Map cbCardMap; + public int addCard = 0; + public boolean selfCard = false; + + public WinCard(List cardInhand, int addCard, int laizi1, int laizi2, boolean islaizi, boolean selfCard, boolean ting_pai) { + this.cardList = new ArrayList(); + this.cardList.addAll(cardInhand); + this.cbCardMap = new HashMap(); + this.ting_pai = ting_pai; + this.selfCard = selfCard; + this.addCard = addCard; + if (selfCard) + { + this.cardList.add(addCard); + if (islaizi) { + this.laizi1 = laizi1; + this.laizi2 = laizi2; + this.laizi1_count = Util.cardNum(laizi1, this.cardList); + this.laizi2_count = Util.cardNum(laizi2, this.cardList); + this.laizi_count = this.laizi1_count + this.laizi2_count; + Util.removeCard(this.cardList, laizi1, this.laizi1_count); + Util.removeCard(this.cardList, laizi2, this.laizi2_count); + } + } + else { + if (islaizi) { + this.laizi1 = laizi1; + this.laizi2 = laizi2; + this.laizi1_count = Util.cardNum(laizi1, this.cardList); + this.laizi2_count = Util.cardNum(laizi2, this.cardList); + this.laizi_count = this.laizi1_count + this.laizi2_count; + Util.removeCard(this.cardList, laizi1, this.laizi1_count); + Util.removeCard(this.cardList, laizi2, this.laizi2_count); + } + this.cardList.add(addCard); + } + + Collections.sort(this.cardList); + for(int i = 0; i < this.cardList.size(); i++) + { + int card = this.cardList.get(i); + if (this.cbCardMap.containsKey(card)) + { + int num = this.cbCardMap.get(card); + this.cbCardMap.put(card, num+1); + } + else + { + this.cbCardMap.put(card, 1); + } + } + } + + public WinCard(List cardInhand, int laizi1, int laizi2, boolean islaizi, boolean ting_pai) { + this.cardList = new ArrayList(); + this.cardList.addAll(cardInhand); + this.cbCardMap = new HashMap(); + this.ting_pai = ting_pai; + this.selfCard = true; + this.addCard = 0; + if (islaizi) { + this.laizi1 = laizi1; + this.laizi2 = laizi2; + this.laizi1_count = Util.cardNum(laizi1, this.cardList); + this.laizi2_count = Util.cardNum(laizi2, this.cardList); + this.laizi_count = this.laizi1_count + this.laizi2_count; + Util.removeCard(this.cardList, laizi1, this.laizi1_count); + Util.removeCard(this.cardList, laizi2, this.laizi2_count); + } + Collections.sort(this.cardList); + for(int i = 0; i < this.cardList.size(); i++) + { + int card = this.cardList.get(i); + if (this.cbCardMap.containsKey(card)) + { + int num = this.cbCardMap.get(card); + this.cbCardMap.put(card, num+1); + } + else + { + this.cbCardMap.put(card, 1); + } + } + } + + public boolean checkWin(Map map, EXPlayer player, EXRoom room, boolean zimo) { + return checkWinOpList(map, player, player.opCardList, room, zimo); + } + + public boolean checkWinOpList(Map map, EXPlayer player, List opList, EXRoom room, boolean zimo) { + if (this.cardList.size() == 0) { + return false; + } + + this.zi_mo = zimo; + + boolean hu = AnalyseChiHuCard(map, opList, room.config); + if (hu) + { + if (zimo) + { + if (room.card.cardList.size() == 0 && room.config.getBoolean(Config.ROOM_CONFIG_HAI_DI_NAO_YUE)) + { + WinCard.putWinCardType(map, WinCardType.HAI_DI_NAO_YUE, 1,WinCardType.HAI_DI_NAO_YUE_SCORE, true, "海底捞月"); + } + } + else { + + } + } + + if (zimo) + { + if (room.config.getBoolean(Config.ROOM_CONFIG_MENG_QING)) + { + for (Map.Entry entry : map.entrySet()) { + WinCardType cardType = entry.getValue(); + if (cardType.type == WinCardType.JIHU || cardType.type == WinCardType.PINGHU) + { + boolean flag = true; + for(int i = 0; i < opList.size(); i++) + { + OpCard op_card = opList.get(i); + if (op_card.type != RuleWeight.TYPE_SELF_KONG && op_card.type != RuleWeight.TYPE_SELF_ZHAO) + { + flag = false; + } + } + if (flag) + { + WinCard.putWinCardType(map, WinCardType.ZIMO_MEN_QING, 1,WinCardType.ZIMO_MEN_QING_SCORE, true, "门清自摸"); + } + break; + } + } + } + } + else + { + if (room.config.getBoolean(Config.ROOM_CONFIG_MENG_QING)) + { + for (Map.Entry entry : map.entrySet()) { + WinCardType cardType = entry.getValue(); + if (cardType.type == WinCardType.JIHU || cardType.type == WinCardType.PINGHU) + { + boolean flag = true; + for(int i = 0; i < opList.size(); i++) + { + OpCard op_card = opList.get(i); + if (op_card.type != RuleWeight.TYPE_SELF_KONG && op_card.type != RuleWeight.TYPE_SELF_ZHAO) + { + flag = false; + } + } + if (flag) + { + WinCard.putWinCardType(map, WinCardType.MEN_QING, 1,WinCardType.MENGQING_SCORE, true, "门清捉炮"); + } + break; + } + } + } + + + if (room.config.getBoolean(Config.ROOM_CONFIG_JIHU_NOTCHIHU)) + { + WinCardType jihuType = map.get(WinCardType.JIHU); + if (jihuType != null) + { + //鸡胡不能吃胡 + return false; + } + } + + if (room.config.getBoolean(Config.ROOM_CONFIG_SPECAIL_ZIMO)) + { + int hu_score = 0; + if (room.config.getBoolean(Config.ROOM_CONFIG_USE_BASE_HU_SCORE)) + { + hu_score = WinCardType.BASE_HU_SCORE; + } + else + { + player.hu_score = room.maxPlayers - 1; + player.di_score = room.maxPlayers - 1; + } + + int dahu_score = 0; + if (room.config.getBoolean(Config.ROOM_CONFIG_DAHU_CHENG)) + { + dahu_score = 1; + } + int cheng_score = 1; + for (Map.Entry entry : map.entrySet()) { + WinCardType cardType = entry.getValue(); + { + if (room.config.getBoolean(Config.ROOM_CONFIG_DAHU_CHENG)) + { + if (cardType.IsDaHu()) + { + dahu_score *= cardType.score; + } + else + { + cheng_score *= cardType.score; + } + } + else + { + if (cardType.IsDaHu()) + { + dahu_score += cardType.score*WinCardType.DA_HU_BEI_SCORE; + } + else + { + cheng_score *= cardType.score; + } + } + } + } + + if (dahu_score > 0) + { + hu_score *= dahu_score; + } + + hu_score *= cheng_score; + + if (hu_score < 20) + { + return false; + } + } + } + + return hu; + } + + public final static WinCardType putWinCardType(Map map, int type, int value,int score, boolean isDaHu, String desc) { + if (map == null) + return null; + if (isDaHu) + { + map.remove(WinCardType.JIHU); + map.remove(WinCardType.PINGHU); + } + if (map.containsKey(type)) { + WinCardType wct = map.get(type); + wct.value += value; + //Global.logger.info("putWinCardType: " + wct.toString()); + return wct; + } else { + WinCardType wct = new WinCardType(type, value,score, isDaHu, desc); + map.put(type, wct); + //Global.logger.info("putWinCardType: " + wct.toString()); + return wct; + } + } + + public boolean AnalyseChiHuCard(Map map, List opCards, ITObject config) + { + Map tempCardList = new HashMap(); + tempCardList.putAll(this.cbCardMap); + + if (AnalyseChiHuCardEx(map, tempCardList, 0, opCards, config)) + { + return true; + } + + return false; + } + + boolean AnalyseChiHuCardEx(Map map, Map cardListParam, int curCard, List opCards, ITObject config) + { + Map tempCardList = new HashMap<>(); + tempCardList.putAll(cardListParam); + + if (curCard > 0) + { + tempCardList.put(curCard, tempCardList.getOrDefault(curCard, 0)+1); + } + + List clearCardList = new ArrayList<>(); + for (Map.Entry entry : tempCardList.entrySet()) { + if (entry.getValue() == 0) + { + clearCardList.add(entry.getKey()); + } + } + + for(int i = 0; i < clearCardList.size(); i++) + { + tempCardList.remove(clearCardList.get(i)); + } + + //变量定义 + List tagAnalyseItemList = new ArrayList(); + List wChiHuKind = new ArrayList(); + + //分析麻将 + AnalyseCard(tempCardList, opCards, tagAnalyseItemList, config); + + //胡牌分析 + if (tagAnalyseItemList.size() > 0) + { + //牌型分析 + for (int i = 0;i < tagAnalyseItemList.size();i++) + { + //变量定义 + boolean bLianCard=false,bPengCard=false,b258Card=false; + TagAnalyseItem pAnalyseItem= tagAnalyseItemList.get(i); + + if (pAnalyseItem.huxi < 11) + { + if (this.zi_mo || this.zi_mo == false && config.getInt(Config.ROOM_CONFIG_QING_ZUI_HU) > 0) + { + boolean erxiaosheng = false; + boolean bajiuzi = false; + boolean jiazuoren = false; + for (int j = 0;j < pAnalyseItem.cbOpCard.size(); j++) { + OpCard cbWeaveKind = pAnalyseItem.cbOpCard.get(j); + if (cbWeaveKind.type == RuleWeight.TYPE_CHOW) { + if (cbWeaveKind.card % 100 == 5) + { + erxiaosheng = true; + } + else if (cbWeaveKind.card % 100 == 6) + { + bajiuzi = true; + } + else if (cbWeaveKind.card % 100 == 7) + { + jiazuoren = true; + } + } + } + + if (erxiaosheng == false || bajiuzi == false || jiazuoren == false) + { + continue; + } + } + else { + continue; + } + } + + //牌型分析 + for (int j = 0;j < pAnalyseItem.cbOpCard.size(); j++) { + OpCard cbWeaveKind = pAnalyseItem.cbOpCard.get(j); + if (cbWeaveKind.type == RuleWeight.TYPE_PONG + || cbWeaveKind.type == RuleWeight.TYPE_KONG + || cbWeaveKind.type == RuleWeight.TYPE_SELF_KONG + || cbWeaveKind.type == RuleWeight.TYPE_ZHAO + || cbWeaveKind.type == RuleWeight.TYPE_SELF_ZHAO) { + bPengCard = true; + } + + if (cbWeaveKind.type == RuleWeight.TYPE_CHOW) { + bLianCard = true; + } + } + + //牌型判断 + if (bLianCard==false && bPengCard==false) + { + return false; + } + + if (bLianCard && bPengCard == false) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else if (bLianCard && bPengCard) + { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + + //特殊--碰碰胡 + if ((bLianCard==false)&&(bPengCard==true)) + { + if (config.getBoolean(Config.ROOM_CONFIG_PENGPENGHU)) + { + if (config.getBoolean(Config.ROOM_CONFIG_SPECIAL_PENG_PENG_HU)) + { + if (pAnalyseItem.cbCardEye > 0 && pAnalyseItem.cbCardEyeList.size() == 0) + { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + else if (pAnalyseItem.cbCardEyeList.size() > 0) + { + boolean flag = true; + for(int x = 0; x < pAnalyseItem.cbCardEyeList.size(); x++) + { + ITArray xCardList = pAnalyseItem.cbCardEyeList.get(x); + int card1 = xCardList.getInt(0); + int card2 = xCardList.getInt(1); + if (card1 != card2) + { + if (card1 % 100 != 4 && card2 % 100 != 4) + { + flag = false; + } + } + } + + if (flag) + { + wChiHuKind.add(WinCardType.PENGPENGHU); + putWinCardType(map, WinCardType.PENGPENGHU, 1,WinCardType.PENGPENGHU_SCORE, true, "碰碰胡"); + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + } + } + else { + if (pAnalyseItem.cbCardEyeList.size() > 0) + { + boolean flag = true; + for(int x = 0; x < pAnalyseItem.cbCardEyeList.size(); x++) + { + ITArray xCardList = pAnalyseItem.cbCardEyeList.get(x); + int card1 = xCardList.getInt(0); + int card2 = xCardList.getInt(1); + if (card1 != card2) + { + if (card1 % 100 != 4 && card2 % 100 != 4) + { + flag = false; + } + } + } + + if (flag) + { + wChiHuKind.add(WinCardType.PENGPENGHU); + putWinCardType(map, WinCardType.PENGPENGHU, 1,WinCardType.PENGPENGHU_SCORE, true, "碰碰胡"); + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + } + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_JIHU_SHI_PINGHU)) + { + wChiHuKind.add(WinCardType.PINGHU); + putWinCardType(map, WinCardType.PINGHU, 1,WinCardType.PINGHU_SCORE, false, "平胡"); + } + else + { + wChiHuKind.add(WinCardType.JIHU); + putWinCardType(map, WinCardType.JIHU, 1,WinCardType.JIHU_SCORE, false, "鸡胡"); + } + } + } + } + } + + //结果判断 + if (wChiHuKind.size() > 0) + { + return true; + } + + return false; + } + + public boolean IsShangFu(int card) + { + if (card == 101 || card == 801) + { + return true; + } + return false; + } + + public boolean IsDaRen(int card) + { + if (card == 102 || card == 103) + { + return true; + } + return false; + } + + boolean IsLuShou(int card) + { + if (card == 802 || card == 803) + { + return true; + } + return false; + } + + public boolean IsDaRenLuShou(int card) + { + if (card == 102 || card == 103 || card == 802 || card == 803) + { + return true; + } + return false; + } + + public boolean IsShangDaRen(int card) + { + if (card / 100 == 1) + { + return true; + } + return false; + } + + public boolean IsFuLuShou(int card) + { + if (card / 100 == 8) + { + return true; + } + return false; + } + + public boolean IsShangDaRenFuLuShou(int card) + { + if (card / 100 == 1 || card / 100 == 8) + { + return true; + } + return false; + } + + public boolean AnalyseCardFuLuShou(int cbLessKindItem, TagKindItem[] pKindItem, int eyeCard, List opCards, List tagAnalyseItemList, ITObject config) { + //变量定义 + TagAnalyseItem AnalyseItem = new TagAnalyseItem(); + + //设置结果 + for (int i = 0; i < opCards.size(); i++) { + OpCard src_card = opCards.get(i); + OpCard op_card = new OpCard(src_card.type, src_card.card); + AnalyseItem.cbOpCard.add(src_card); + if (src_card.type == RuleWeight.TYPE_CHOW) + { + if (IsShangDaRenFuLuShou(src_card.card)) + { + AnalyseItem.huxi += 4; + } + } + else if (src_card.type == RuleWeight.TYPE_PONG) + { + if (IsShangFu(src_card.card)) + { + AnalyseItem.huxi += 3 * 4; + } + else { + AnalyseItem.huxi += 2; + } + } + else + { + if (IsShangFu(src_card.card)) + { + AnalyseItem.huxi += 4 * 4; + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) + { + AnalyseItem.huxi += 6; + } + else { + AnalyseItem.huxi += 4; + } + } + } + } + + //设置牌型 + boolean useOther = false; + boolean usePong = false; + if (pKindItem != null) + { + for (int i = 0; i < cbLessKindItem; i++) { + OpCard op_card = new OpCard(pKindItem[i].type, pKindItem[i].card); + AnalyseItem.cbOpCard.add(op_card); + if (op_card.type == RuleWeight.TYPE_CHOW) + { + if (IsShangDaRenFuLuShou(op_card.card)) + { + AnalyseItem.huxi += 4; + } + if (!this.selfCard && (pKindItem[i].cbCardList[0] == this.addCard) || (pKindItem[i].cbCardList[1] == this.addCard) || (pKindItem[i].cbCardList[2] == this.addCard)) + { + useOther = true; + } + } + else if (op_card.type == RuleWeight.TYPE_PONG) + { + if (IsShangFu(op_card.card)) + { + AnalyseItem.huxi += 3 * 4; + } + else { + AnalyseItem.huxi += 3; + if (!this.selfCard && op_card.card == this.addCard) + { + usePong = true; + } + } + } + else + { + if (!this.selfCard && op_card.card == this.addCard) + { + useOther = true; + } + if (IsShangFu(op_card.card)) + { + AnalyseItem.huxi += 4 * 4; + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) + { + AnalyseItem.huxi += 6; + } + else { + AnalyseItem.huxi += 4; + } + } + } + } + } + + if (eyeCard > 0) { + AnalyseItem.cbCardEye = eyeCard; + if (!this.selfCard && eyeCard == this.addCard) + { + useOther = true; + } + if (IsShangFu(eyeCard)) + { + AnalyseItem.huxi += 8; + } + else if (IsDaRenLuShou(eyeCard)) { + AnalyseItem.huxi += 4; + } + else if (eyeCard == 104 || eyeCard == 804) + { + AnalyseItem.huxi += 8; + } + } + + if (useOther == false && usePong) + { + AnalyseItem.huxi -= 1; + } + + //插入结果 + tagAnalyseItemList.add(AnalyseItem); + if (AnalyseItem.huxi >= 11) + { + return true; + } + return false; + } + + public boolean AnalyseCardFuLuShouJiang(int cbLessKindItem, TagKindItem[] pKindItem, int card1, int card2, int card3, int card4, List opCards, List tagAnalyseItemList, ITObject config) { + //变量定义 + TagAnalyseItem AnalyseItem = new TagAnalyseItem(); + + //设置结果 + //设置结果 + boolean diJin = false; + boolean shangDaRenFuLuShou = false; + boolean ban_shangDaRenFuLuShou = false; + boolean hasKan = false; + for (int i = 0; i < opCards.size(); i++) { + OpCard src_card = opCards.get(i); + OpCard op_card = new OpCard(src_card.type, src_card.card); + AnalyseItem.cbOpCard.add(src_card); + if (src_card.type == RuleWeight.TYPE_CHOW) + { + if (IsShangDaRenFuLuShou(src_card.card)) + { + shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + } + else if (src_card.type == RuleWeight.TYPE_PONG) + { + hasKan = true; + if (IsShangFu(src_card.card)) + { + AnalyseItem.huxi += 3 * 4; + } + else { + AnalyseItem.huxi += 2; + } + } + else + { + hasKan = true; + if (IsShangFu(src_card.card)) + { + AnalyseItem.huxi += 4 * 4; + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) + { + AnalyseItem.huxi += 6; + } + else { + AnalyseItem.huxi += 4; + } + } + } + } + + //设置牌型 + boolean useOther = false; + boolean usePong = false; + if (pKindItem != null) + { + for (int i = 0; i < cbLessKindItem; i++) { + OpCard op_card = new OpCard(pKindItem[i].type, pKindItem[i].card); + AnalyseItem.cbOpCard.add(op_card); + if (op_card.type == RuleWeight.TYPE_CHOW) + { + if (IsShangDaRenFuLuShou(op_card.card)) + { + shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + if (!this.selfCard && (pKindItem[i].cbCardList[0] == this.addCard) || (pKindItem[i].cbCardList[1] == this.addCard) || (pKindItem[i].cbCardList[2] == this.addCard)) + { + useOther = true; + } + } + else if (op_card.type == RuleWeight.TYPE_PONG) + { + hasKan = true; + if (IsShangFu(op_card.card)) + { + AnalyseItem.huxi += 3 * 4; + } + else { + AnalyseItem.huxi += 3; + if (!this.selfCard && op_card.card == this.addCard) + { + usePong = true; + } + } + } + else + { + if (!this.selfCard && op_card.card == this.addCard) + { + useOther = true; + } + hasKan = true; + if (IsShangFu(op_card.card)) + { + AnalyseItem.huxi += 4 * 4; + } + else { + if (config.getBoolean(Config.ROOM_CONFIG_GANG_ZHAO_LIU_XI)) + { + AnalyseItem.huxi += 6; + } + else { + AnalyseItem.huxi += 4; + } + } + } + } + } + + ITArray eyeCard1 = new TArray(); + eyeCard1.addInt(card1); + eyeCard1.addInt(card2); + AnalyseItem.cbCardEyeList.add(eyeCard1); + + ITArray eyeCard2 = new TArray(); + eyeCard2.addInt(card3); + eyeCard2.addInt(card4); + AnalyseItem.cbCardEyeList.add(eyeCard2); + + if (!this.selfCard && (card1 == this.addCard || card2 == this.addCard || card3 == this.addCard || card4 == this.addCard)) + { + useOther = true; + } + + //一对上、福,就可以胡了 + if (card1 == card2 && IsShangFu(card1)) + { + AnalyseItem.huxi += 12; + } + else if (card1 == card2 && (card1 == 104 || card1 == 804)) + { + AnalyseItem.huxi += 12; + } + else if (card1 == 101 && card2 == 104 || card2 == 101 && card1 == 104) + { + AnalyseItem.huxi += 12; + } + else if (card1 == 801 && card2 == 804 || card2 == 801 && card1 == 804) + { + AnalyseItem.huxi += 12; + } + else if ((card1 == 101 || card2 == 101 ) && card1 != card2) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card1 == 104 || card2 == 104 ) && card1 != card2) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card1 == 801 || card2 == 801 ) && card1 != card2) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card1 == 804 || card2 == 804 ) && card1 != card2) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + + if (card3 == card4 && IsShangFu(card3)) + { + AnalyseItem.huxi += 12; + } + else if (card3 == card4 && (card3 == 104 || card3 == 804)) + { + AnalyseItem.huxi += 12; + } + else if (card3 == 101 && card4 == 104 || card4 == 101 && card3 == 104) + { + AnalyseItem.huxi += 12; + } + else if (card3 == 801 && card4 == 804 || card4 == 801 && card3 == 804) + { + AnalyseItem.huxi += 12; + } + else if ((card3 == 101 || card4 == 101) && card3 != card4) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card3 == 104 || card4 == 104) && card3 != card4) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card3 == 801 || card4 == 801) && card3 != card4) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + else if ((card3 == 804 || card4 == 804) && card3 != card4) + { + ban_shangDaRenFuLuShou = true; + AnalyseItem.huxi += 4; + } + + if (shangDaRenFuLuShou || ban_shangDaRenFuLuShou || hasKan) { + if (card1 != card2 && IsDaRen(card1) && IsDaRen(card2) || card3 != card4 && IsDaRen(card3) && IsDaRen(card4)) + { + if (!diJin) { + diJin = true; + AnalyseItem.huxi += 4; + } + } + if (card1 != card2 && IsLuShou(card1) && IsLuShou(card2) || card3 != card4 && IsLuShou(card3) && IsLuShou(card4)) + { + if (!diJin) { + diJin = true; + AnalyseItem.huxi += 4; + } + } + if ((card1 == card2 && !IsShangFu(card1) && card1 != 104 && card1 != 804) || + (card3 == card4 && !IsShangFu(card3) && card3 != 104 && card3 != 804)) + { + if (!diJin) { + diJin = true; + AnalyseItem.huxi += 3; + } + } + else if ((card1 != card2 && ((card1 / 100 != 1 && card1 / 100 != 8 && card1 % 100 == 4) || (card2 / 100 != 1 && card2 / 100 != 8 && card2 % 100 == 4)) && !IsShangFu(card1)) || + (card3 != card4 && ((card3 / 100 != 1 && card3 / 100 != 8 && card3 % 100 == 4) || (card4 / 100 != 1 && card4 / 100 != 8 && card4 % 100 == 4)) && !IsShangFu(card3))) + { + if (!diJin) { + diJin = true; + AnalyseItem.huxi += 3; + } + } + } + + if (useOther == false && usePong) + { + AnalyseItem.huxi -= 1; + } + + //插入结果 + tagAnalyseItemList.add(AnalyseItem); + if (AnalyseItem.huxi >= 11) + { + return true; + } + return false; + } + + boolean AnalyseCard(Map tempCardList, List opCards, List tagAnalyseItemList, ITObject config) { + //计算数目 + int cbCardCount = 0; + for (Map.Entry entry : tempCardList.entrySet()) { + cbCardCount += entry.getValue(); + } + + //效验数目 + if ((cbCardCount < 1) || (cbCardCount > 19)) { + return false; + } + + //变量定义 + List tagKindList = new ArrayList(); + + do { + int cbLessKindItem = (cbCardCount - 1) / 3; + if (cbLessKindItem + opCards.size() != 6) { + break; + } + + //单吊判断 + if (cbLessKindItem == 0) { + //效验参数 + if (!((cbCardCount == 1) && (opCards.size() == 6))) { + return false; + } + + //牌眼判断 + for (Map.Entry entry : tempCardList.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + if (num == 1) { + return AnalyseCardFuLuShou(cbLessKindItem, null, card, opCards, tagAnalyseItemList, config); + } + } + + return false; + } + + //拆分分析 + if (cbCardCount >= 3) { + for (Map.Entry entry : tempCardList.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + //同牌判断 + if (num >= 2 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) == 1) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_PONG; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card; + kindItem.cbCardList[2] = card / 100 * 100 + 4; + tagKindList.add(kindItem); + } + + if (num >= 3) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_PONG; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card; + kindItem.cbCardList[2] = card; + tagKindList.add(kindItem); + } + + //连牌判断 + if (card % 100 >= 1 && card % 100 <= 4 && num > 0) { + for (int i = 1; i <= num; i++) { + if (tempCardList.getOrDefault(card + 1, 0) >= i && tempCardList.getOrDefault(card + 2, 0) >= i && (card+1)%100 != 4 && (card+2)%100 != 4) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card + 1; + kindItem.cbCardList[2] = card + 2; + tagKindList.add(kindItem); + } + if (tempCardList.getOrDefault(card + 1, 0) >= i && (card+1)%100 != 4 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) >= i) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card + 1; + kindItem.cbCardList[2] = card / 100 * 100 + 4; + tagKindList.add(kindItem); + } + if (tempCardList.getOrDefault(card + 2, 0) >= i && (card+2)%100 != 4 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) >= i) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card / 100 * 100 + 4; + kindItem.cbCardList[2] = card + 2; + tagKindList.add(kindItem); + } + } + } + } + } + + //组合分析 + if (tagKindList.size() >= cbLessKindItem) { + //变量定义 + Integer[] cbIndex = new Integer[6]; //{0,1,2,3}; + cbIndex[0] = 0; + cbIndex[1] = 1; + cbIndex[2] = 2; + cbIndex[3] = 3; + cbIndex[4] = 4; + cbIndex[5] = 5; + + TagKindItem[] pKindItem = new TagKindItem[6]; + pKindItem[0] = null; + pKindItem[1] = null; + pKindItem[2] = null; + pKindItem[3] = null; + pKindItem[4] = null; + pKindItem[5] = null; + + int count = 0; + //开始组合 + do { + count++; + //设置变量 + Map cbCardMap_temp = new HashMap(); + cbCardMap_temp.putAll(tempCardList); + + for (int i = 0; i < cbLessKindItem; i++) { + pKindItem[i] = tagKindList.get(cbIndex[i]); + } + + //数量判断 + boolean bEnoughCard = true; + for (int i = 0; i < cbLessKindItem * 3; i++) { + //存在判断 + int cbCardIndex = pKindItem[i / 3].cbCardList[i % 3]; + if (cbCardMap_temp.getOrDefault(cbCardIndex, 0) <= 0) { + bEnoughCard = false; + break; + } else { + if (cbCardMap_temp.containsKey(cbCardIndex)) { + cbCardMap_temp.put(cbCardIndex, cbCardMap_temp.get(cbCardIndex) - 1); + } + } + } + + //胡牌判断 + if (bEnoughCard == true) { + //牌眼判断 + int cbCardEye = 0; + for (Map.Entry entry : cbCardMap_temp.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + if (num == 1) { + cbCardEye = card; + break; + } + } + + //组合类型 + if (cbCardEye != 0) { + boolean result = AnalyseCardFuLuShou(cbLessKindItem, pKindItem, cbCardEye, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + } + + //设置索引 + if (cbIndex[cbLessKindItem - 1] == (tagKindList.size() - 1)) { + int i = cbLessKindItem - 1; + for (; i > 0; i--) { + if ((cbIndex[i - 1] + 1) != cbIndex[i]) { + int cbNewIndex = cbIndex[i - 1]; + for (int j = (i - 1); j < cbLessKindItem; j++) { + cbIndex[j] = cbNewIndex + j - i + 2; + } + break; + } + } + if (i == 0) break; + } else { + cbIndex[cbLessKindItem - 1]++; + } + + } while (true); + //Global.logger.info("count:" + count); + } + + if (tagAnalyseItemList.size() > 0) { + break; + } + } + while (false); + tagKindList.clear(); + + do { + int cbLessKindItem = (cbCardCount - 4) / 3; + if (cbLessKindItem + opCards.size() != 5) { + break; + } + + //单吊判断 + if (cbLessKindItem == 0) { + //效验参数 + if (!((cbCardCount == 4) && (opCards.size() == 5))) { + return false; + } + + //牌眼判断 + ArrayList eyeList = new ArrayList(); + ArrayList eyeCardList = new ArrayList(); + for (Map.Entry entry : tempCardList.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + if (num > 0) { + for(int i = 0; i < num; i++) + { + eyeCardList.add(card); + } + } + } + + if (eyeCardList.size() != 4) + { + return false; + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(1) / 100 && eyeCardList.get(2) / 100 == eyeCardList.get(3) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(1); + int card3 = eyeCardList.get(2); + int card4 = eyeCardList.get(3); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, null, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(2) / 100 && eyeCardList.get(1) / 100 == eyeCardList.get(3) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(2); + int card3 = eyeCardList.get(1); + int card4 = eyeCardList.get(3); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, null, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(3) / 100 && eyeCardList.get(2) / 100 == eyeCardList.get(1) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(3); + int card3 = eyeCardList.get(2); + int card4 = eyeCardList.get(1); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, null, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + + if (tagAnalyseItemList.size() > 0) + { + return true; + } + else { + return false; + } + } + + //拆分分析 + if (cbCardCount >= 3) { + for (Map.Entry entry : tempCardList.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + //同牌判断 + if (num >= 2 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) == 1) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_PONG; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card; + kindItem.cbCardList[2] = card / 100 * 100 + 4; + tagKindList.add(kindItem); + } + + if (num >= 3) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_PONG; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card; + kindItem.cbCardList[2] = card; + tagKindList.add(kindItem); + } + + //连牌判断 + if (card % 100 >= 1 && card % 100 <= 4 && num > 0) { + for (int i = 1; i <= num; i++) { + if (tempCardList.getOrDefault(card + 1, 0) >= i && tempCardList.getOrDefault(card + 2, 0) >= i && (card+1)%100 != 4 && (card+2)%100 != 4) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card + 1; + kindItem.cbCardList[2] = card + 2; + tagKindList.add(kindItem); + } + if (tempCardList.getOrDefault(card + 1, 0) >= i && (card+1)%100 != 4 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) >= i) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card + 1; + kindItem.cbCardList[2] = card / 100 * 100 + 4; + tagKindList.add(kindItem); + } + if (tempCardList.getOrDefault(card + 2, 0) >= i && (card+2)%100 != 4 && tempCardList.getOrDefault(card / 100 * 100 + 4, 0) >= i) { + TagKindItem kindItem = new TagKindItem(); + kindItem.type = RuleWeight.TYPE_CHOW; + kindItem.card = card; + kindItem.cbCardList[0] = card; + kindItem.cbCardList[1] = card / 100 * 100 + 4; + kindItem.cbCardList[2] = card + 2; + tagKindList.add(kindItem); + } + } + } + } + } + + //组合分析 + if (tagKindList.size() >= cbLessKindItem) { + //变量定义 + Integer[] cbIndex = new Integer[5]; //{0,1,2,3}; + cbIndex[0] = 0; + cbIndex[1] = 1; + cbIndex[2] = 2; + cbIndex[3] = 3; + cbIndex[4] = 4; + + TagKindItem[] pKindItem = new TagKindItem[5]; + pKindItem[0] = null; + pKindItem[1] = null; + pKindItem[2] = null; + pKindItem[3] = null; + pKindItem[4] = null; + + //开始组合 + int count = 0; + do { + count++; + //设置变量 + Map cbCardMap_temp = new HashMap(); + cbCardMap_temp.putAll(tempCardList); + + for (int i = 0; i < cbLessKindItem; i++) { + pKindItem[i] = tagKindList.get(cbIndex[i]); + } + + //数量判断 + boolean bEnoughCard = true; + for (int i = 0; i < cbLessKindItem * 3; i++) { + //存在判断 + int cbCardIndex = pKindItem[i / 3].cbCardList[i % 3]; + if (cbCardMap_temp.getOrDefault(cbCardIndex, 0) <= 0) { + bEnoughCard = false; + break; + } else { + if (cbCardMap_temp.containsKey(cbCardIndex)) { + cbCardMap_temp.put(cbCardIndex, cbCardMap_temp.get(cbCardIndex) - 1); + } + } + } + + //胡牌判断 + if (bEnoughCard == true) { + //牌眼判断 + ArrayList eyeList = new ArrayList(); + ArrayList eyeCardList = new ArrayList(); + for (Map.Entry entry : cbCardMap_temp.entrySet()) { + int card = entry.getKey(); + int num = entry.getValue(); + if (num > 0) { + for(int i = 0; i < num; i++) + { + eyeCardList.add(card); + } + } + } + + if (eyeCardList.size() != 4) + { + return false; + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(1) / 100 && eyeCardList.get(2) / 100 == eyeCardList.get(3) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(1); + int card3 = eyeCardList.get(2); + int card4 = eyeCardList.get(3); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, pKindItem, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(2) / 100 && eyeCardList.get(1) / 100 == eyeCardList.get(3) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(2); + int card3 = eyeCardList.get(1); + int card4 = eyeCardList.get(3); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, pKindItem, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + + if (eyeCardList.get(0) / 100 == eyeCardList.get(3) / 100 && eyeCardList.get(2) / 100 == eyeCardList.get(1) / 100) + { + int card1 = eyeCardList.get(0); + int card2 = eyeCardList.get(3); + int card3 = eyeCardList.get(2); + int card4 = eyeCardList.get(1); + + boolean result = AnalyseCardFuLuShouJiang(cbLessKindItem, pKindItem, card1, card2, card3, card4, opCards, tagAnalyseItemList, config); + if (ting_pai && result) + { + return true; + } + } + } + + //设置索引 + if (cbIndex[cbLessKindItem - 1] == (tagKindList.size() - 1)) { + int i = cbLessKindItem - 1; + for (; i > 0; i--) { + if ((cbIndex[i - 1] + 1) != cbIndex[i]) { + int cbNewIndex = cbIndex[i - 1]; + for (int j = (i - 1); j < cbLessKindItem; j++) { + cbIndex[j] = cbNewIndex + j - i + 2; + } + break; + } + } + if (i == 0) break; + } else { + cbIndex[cbLessKindItem - 1]++; + } + + } while (true); + //Global.logger.info("count:" + count); + } + + if (tagAnalyseItemList.size() > 0) { + break; + } + } + while (false); + + if (tagAnalyseItemList.size() > 0) { + return true; + } + return false; + } +} diff --git a/robots/zhipai/game_mj_fulushou/src/test/java/game_mj_fulushou/Main.java b/robots/zhipai/game_mj_fulushou/src/test/java/game_mj_fulushou/Main.java new file mode 100644 index 0000000..3ff39ef --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/src/test/java/game_mj_fulushou/Main.java @@ -0,0 +1,9 @@ +package game_mj_fulushou; + +import com.taurus.permanent.TPServer; + +public class Main { + public static void main(String[] args) { + TPServer.me().start(); + } +} diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/CardNiao.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/CardNiao.class new file mode 100644 index 0000000..66fc356 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/CardNiao.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/Config.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/Config.class new file mode 100644 index 0000000..3e687bc Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/Config.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXActionEvent.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXActionEvent.class new file mode 100644 index 0000000..a65dfc8 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXActionEvent.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXGameController.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXGameController.class new file mode 100644 index 0000000..f394ec9 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXGameController.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXMainServer.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXMainServer.class new file mode 100644 index 0000000..35009f4 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXMainServer.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayBack.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayBack.class new file mode 100644 index 0000000..bf4b8c0 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayBack.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayer.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayer.class new file mode 100644 index 0000000..395d87e Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXPlayer.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXRoom.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXRoom.class new file mode 100644 index 0000000..603939d Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXRoom.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXScore.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXScore.class new file mode 100644 index 0000000..798f7d7 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/EXScore.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/OpCard.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/OpCard.class new file mode 100644 index 0000000..aa7f575 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/OpCard.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/PlayerRuleManager.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/PlayerRuleManager.class new file mode 100644 index 0000000..6519b90 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/PlayerRuleManager.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RoomCard.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RoomCard.class new file mode 100644 index 0000000..9d5b324 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RoomCard.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RuleWeight.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RuleWeight.class new file mode 100644 index 0000000..18b0c76 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/RuleWeight.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/SettleLog.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/SettleLog.class new file mode 100644 index 0000000..11e4154 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/SettleLog.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagAnalyseItem.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagAnalyseItem.class new file mode 100644 index 0000000..07efdfb Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagAnalyseItem.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagKindItem.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagKindItem.class new file mode 100644 index 0000000..9c8a8a1 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/TagKindItem.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/WinCardType.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/WinCardType.class new file mode 100644 index 0000000..e266670 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/WinCardType.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleChow.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleChow.class new file mode 100644 index 0000000..1af1932 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleChow.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKong.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKong.class new file mode 100644 index 0000000..afad551 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKong.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKongSelfWin.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKongSelfWin.class new file mode 100644 index 0000000..e5bce5f Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherKongSelfWin.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherWin.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherWin.class new file mode 100644 index 0000000..3eb7b2a Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleOtherWin.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RulePong.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RulePong.class new file mode 100644 index 0000000..5fe6cda Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RulePong.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfKong.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfKong.class new file mode 100644 index 0000000..4281fa9 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfKong.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfWin.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfWin.class new file mode 100644 index 0000000..22bd365 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rule/RuleSelfWin.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRChowState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRChowState.class new file mode 100644 index 0000000..ddb2c54 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRChowState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherGongSelfWinState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherGongSelfWinState.class new file mode 100644 index 0000000..b01aa04 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherGongSelfWinState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherKongState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherKongState.class new file mode 100644 index 0000000..4473c10 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherKongState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherWinState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherWinState.class new file mode 100644 index 0000000..9e1f286 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PROtherWinState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRPongState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRPongState.class new file mode 100644 index 0000000..fdadbfb Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRPongState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfKongState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfKongState.class new file mode 100644 index 0000000..5c59bc7 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfKongState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfWinState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfWinState.class new file mode 100644 index 0000000..945bc91 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/rulestate/PRSelfWinState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDisCardTipState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDisCardTipState.class new file mode 100644 index 0000000..4f155e7 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDisCardTipState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDiscardState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDiscardState.class new file mode 100644 index 0000000..710b926 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDiscardState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawState.class new file mode 100644 index 0000000..f077ab2 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawTipState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawTipState.class new file mode 100644 index 0000000..469dc98 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerDrawTipState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1$1.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1$1.class new file mode 100644 index 0000000..e073d7b Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1$1.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1.class new file mode 100644 index 0000000..0c5f32c Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState$1.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState.class new file mode 100644 index 0000000..602f2d2 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongDrawState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongWinState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongWinState.class new file mode 100644 index 0000000..d69181b Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerKongWinState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerPiaoNiaoTipState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerPiaoNiaoTipState.class new file mode 100644 index 0000000..5f3a0ad Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerPiaoNiaoTipState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerTipState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerTipState.class new file mode 100644 index 0000000..537be79 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerTipState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitKongWinState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitKongWinState.class new file mode 100644 index 0000000..1d99f7f Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitKongWinState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitState.class new file mode 100644 index 0000000..23d2a77 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/player/state/EXPlayerWaitState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1$1.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1$1.class new file mode 100644 index 0000000..896ea1b Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1$1.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1.class new file mode 100644 index 0000000..108766c Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState$1.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState.class new file mode 100644 index 0000000..b2740af Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomDealState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomPiaoState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomPiaoState.class new file mode 100644 index 0000000..c2a18be Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomPiaoState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomSetpState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomSetpState.class new file mode 100644 index 0000000..91b6417 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomSetpState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomStartGameState.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomStartGameState.class new file mode 100644 index 0000000..b2e693e Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/room/state/EXRoomStartGameState.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Action.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Action.class new file mode 100644 index 0000000..8b506c8 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Action.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/IRuleBase.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/IRuleBase.class new file mode 100644 index 0000000..e6136db Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/IRuleBase.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Tip.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Tip.class new file mode 100644 index 0000000..428e7c1 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/Tip.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/TipManager.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/TipManager.class new file mode 100644 index 0000000..401b2d9 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/tip/TipManager.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/CardUtil.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/CardUtil.class new file mode 100644 index 0000000..9fdf634 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/CardUtil.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/WinCard.class b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/WinCard.class new file mode 100644 index 0000000..4aafcbe Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/classes/extend/mj/uitl/WinCard.class differ diff --git a/robots/zhipai/game_mj_fulushou/target/game_mj_fulushou.jar b/robots/zhipai/game_mj_fulushou/target/game_mj_fulushou.jar new file mode 100644 index 0000000..b846adc Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/game_mj_fulushou.jar differ diff --git a/robots/zhipai/game_mj_fulushou/target/maven-archiver/pom.properties b/robots/zhipai/game_mj_fulushou/target/maven-archiver/pom.properties new file mode 100644 index 0000000..47cc103 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Sat Apr 13 13:11:30 GMT+08:00 2024 +version=1.0.0 +groupId=com.game +artifactId=game_mj_fulushou diff --git a/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..8e3953c --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,55 @@ +extend\mj\player\rule\RuleOtherKong.class +extend\mj\room\state\EXRoomSetpState.class +extend\mj\player\state\EXPlayerDrawTipState.class +extend\mj\EXRoom.class +extend\mj\PlayerRuleManager.class +extend\mj\room\state\EXRoomDealState.class +extend\mj\player\state\EXPlayerDiscardState.class +extend\mj\player\rulestate\PRSelfKongState.class +extend\mj\EXMainServer.class +extend\mj\tip\TipManager.class +extend\mj\TagAnalyseItem.class +extend\mj\EXPlayBack.class +extend\mj\RuleWeight.class +extend\mj\SettleLog.class +extend\mj\OpCard.class +extend\mj\EXActionEvent.class +extend\mj\player\rule\RuleOtherWin.class +extend\mj\player\state\EXPlayerDisCardTipState.class +extend\mj\EXGameController.class +extend\mj\player\rulestate\PRSelfWinState.class +extend\mj\player\rule\RuleSelfKong.class +extend\mj\room\state\EXRoomStartGameState.class +extend\mj\player\state\EXPlayerWaitState.class +extend\mj\EXPlayer.class +extend\mj\uitl\CardUtil.class +extend\mj\player\rulestate\PROtherWinState.class +extend\mj\EXScore.class +extend\mj\player\state\EXPlayerWaitKongWinState.class +extend\mj\player\state\EXPlayerKongDrawState$1.class +extend\mj\player\state\EXPlayerTipState.class +extend\mj\player\rulestate\PRChowState.class +extend\mj\TagKindItem.class +extend\mj\tip\Action.class +extend\mj\player\rule\RuleChow.class +extend\mj\player\state\EXPlayerKongWinState.class +extend\mj\room\state\EXRoomDealState$1.class +extend\mj\uitl\WinCard.class +extend\mj\player\rulestate\PROtherKongState.class +extend\mj\player\rule\RulePong.class +extend\mj\player\rulestate\PRPongState.class +extend\mj\room\state\EXRoomPiaoState.class +extend\mj\player\state\EXPlayerKongDrawState$1$1.class +extend\mj\Config.class +extend\mj\player\state\EXPlayerKongDrawState.class +extend\mj\CardNiao.class +extend\mj\tip\Tip.class +extend\mj\tip\IRuleBase.class +extend\mj\player\rule\RuleSelfWin.class +extend\mj\player\state\EXPlayerPiaoNiaoTipState.class +extend\mj\room\state\EXRoomDealState$1$1.class +extend\mj\player\rule\RuleOtherKongSelfWin.class +extend\mj\player\rulestate\PROtherGongSelfWinState.class +extend\mj\player\state\EXPlayerDrawState.class +extend\mj\WinCardType.class +extend\mj\RoomCard.class diff --git a/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..6feafc8 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,51 @@ +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXMainServer.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\RoomCard.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerKongDrawState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXActionEvent.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\tip\Tip.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\TagKindItem.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleOtherKongSelfWin.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\uitl\WinCard.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerWaitState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PROtherWinState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleChow.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerDisCardTipState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PRSelfKongState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerPiaoNiaoTipState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\OpCard.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PROtherGongSelfWinState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\RuleWeight.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\room\state\EXRoomDealState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\Config.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerDiscardState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RulePong.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PRPongState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerKongWinState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXPlayer.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\room\state\EXRoomPiaoState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PROtherKongState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleSelfWin.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PRSelfWinState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerDrawState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\room\state\EXRoomSetpState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rulestate\PRChowState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\tip\IRuleBase.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\tip\TipManager.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\CardNiao.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleOtherWin.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\TagAnalyseItem.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerWaitKongWinState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\PlayerRuleManager.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\room\state\EXRoomStartGameState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleSelfKong.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\uitl\CardUtil.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerTipState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\rule\RuleOtherKong.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\WinCardType.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXGameController.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXScore.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\SettleLog.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\player\state\EXPlayerDrawTipState.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\tip\Action.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXPlayBack.java +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\main\java\extend\mj\EXRoom.java diff --git a/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..8c06621 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +game_mj_fulushou\Main.class diff --git a/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..b814577 --- /dev/null +++ b/robots/zhipai/game_mj_fulushou/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +D:\project\javapro\javapro\xtserver_anchou\majiang\fulushou\game_mj_fulushou\src\test\java\game_mj_fulushou\Main.java diff --git a/robots/zhipai/game_mj_fulushou/target/test-classes/game_mj_fulushou/Main.class b/robots/zhipai/game_mj_fulushou/target/test-classes/game_mj_fulushou/Main.class new file mode 100644 index 0000000..c82ed03 Binary files /dev/null and b/robots/zhipai/game_mj_fulushou/target/test-classes/game_mj_fulushou/Main.class differ