diff --git a/common/constant.go b/common/constant.go index 4b5b5c3..8293072 100644 --- a/common/constant.go +++ b/common/constant.go @@ -613,6 +613,10 @@ const ( ItemIDWeekScore = 100004 // 周活跃积分 ItemIDGiftBox = 50001 // 碎片礼盒 ItemIDCollectBox = 50002 // 集卡礼盒 + ItemIDLike = 100007 // 点赞 + ItemIDCoffee = 100008 // 咖啡 + ItemIDBucket = 100009 // 水桶 + ItemIDSlippers = 100010 // 拖鞋 ) func ToItemId(id int32) int32 { diff --git a/data/DB_GameItem.dat b/data/DB_GameItem.dat index 0719886..a4a78db 100644 Binary files a/data/DB_GameItem.dat and b/data/DB_GameItem.dat differ diff --git a/data/DB_GameItem.json b/data/DB_GameItem.json index 0f1d7ab..55de895 100644 --- a/data/DB_GameItem.json +++ b/data/DB_GameItem.json @@ -437,7 +437,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "作用:获取金币或道具奖励\n产出途径:集字活动" + "Describe": "集卡礼盒:开启后可获得奖励\n产出途径:集字活动" }, { "Id": 50004, @@ -467,7 +467,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50005, @@ -497,7 +497,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50006, @@ -527,7 +527,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50007, @@ -557,7 +557,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50008, @@ -587,7 +587,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50009, @@ -617,7 +617,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50010, @@ -647,7 +647,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50011, @@ -677,7 +677,7 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" }, { "Id": 50012, @@ -707,7 +707,35 @@ "Composition": 1, "CompositionMax": 9999, "Location": "0", - "Describe": "集字活动兑换奖励" + "Describe": "可在集字活动中兑换物品" + }, + { + "Id": 60001, + "Name": "tienlen记牌器", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 15, + "Effect0": [ + 0, + 0, + 0 + ], + "Effect": [ + 0, + 0, + 0 + ], + "CompositionMax": 1, + "Time": 1, + "Location": "0", + "Describe": "tienlen游戏记录打出过的牌" }, { "Id": 100001, @@ -1145,6 +1173,1153 @@ "Location": "0", "Describe": "测试描述雷动九天" }, - {} + { + "Id": 71001, + "Name": "电饭煲", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 71002, + "Name": "电热水壶", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 71003, + "Name": "便携式风扇", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 72001, + "Name": "厨房炊具套装", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 72002, + "Name": "床上用品套件", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 72003, + "Name": "洗衣液", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 72004, + "Name": "水杯", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 72005, + "Name": "咖啡杯", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 73001, + "Name": "啤酒", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 73002, + "Name": "矿泉水", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 73003, + "Name": "果汁", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 73004, + "Name": "可乐", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 74001, + "Name": "护肤品套装", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 74002, + "Name": "洗发水和护发素", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 74003, + "Name": "电动牙刷", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 74004, + "Name": "香水", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 74005, + "Name": "按摩器", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75001, + "Name": "瑜伽垫", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75002, + "Name": "跳绳", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75003, + "Name": "篮球", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75004, + "Name": "足球", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75005, + "Name": "健身手环", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 75006, + "Name": "山地车", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 76001, + "Name": "智能手机", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 76002, + "Name": "平板电脑", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 76003, + "Name": "耳机", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 76004, + "Name": "智能手表", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 76005, + "Name": "便携式音箱", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 77001, + "Name": "超市购物卡", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 77002, + "Name": "餐厅用餐券", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 77003, + "Name": "电影票", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 77004, + "Name": "在线购物优惠券", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 77005, + "Name": "按摩和美容服务", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 78001, + "Name": "本地景点门票", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 78002, + "Name": "酒店住宿", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 78003, + "Name": "游乐场门票", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 79001, + "Name": "大米", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 79002, + "Name": "食用油", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 79003, + "Name": "盐", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 79004, + "Name": "酱油", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + }, + { + "Id": 79005, + "Name": "鸡蛋", + "ShowLocation": [ + 1, + 1 + ], + "Classify": [ + 1, + 1, + 0 + ], + "Type": 4, + "Effect0": [ + 0, + 1, + 0 + ], + "Effect": [ + 0, + 1, + 0 + ], + "Composition": 1, + "CompositionMax": 9999, + "Location": "0", + "Describe": "可联系客服兑换实物奖励" + } ] } \ No newline at end of file diff --git a/data/DB_GiftCard.dat b/data/DB_GiftCard.dat index 1560036..96640b0 100644 Binary files a/data/DB_GiftCard.dat and b/data/DB_GiftCard.dat differ diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index 32773be..1b90e94 100644 --- a/data/DB_PropExchange.dat +++ b/data/DB_PropExchange.dat @@ -1,5 +1,5 @@ -6ԆՆֆ׆ӆ"= +6Նֆ׆ӆԆ"= .؆نچۆ"= -WنچۆՆֆ׆ӆԆ؆"  -]܆ӆֆچۆنԆՆ׆؆" \ No newline at end of file +WۆՆ׆؆چӆԆֆن"  +]ۆӆԆՆ؆܆ֆ׆نچ" \ No newline at end of file diff --git a/data/DB_Task.dat b/data/DB_Task.dat index bb902ad..8fdc406 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/gamerule/tienlen/card.go b/gamerule/tienlen/card.go index 36cb2cc..fc8d63c 100644 --- a/gamerule/tienlen/card.go +++ b/gamerule/tienlen/card.go @@ -2987,3 +2987,32 @@ func GetASliceInt32NotInB(a []int32, b []int32) []int32 { return c } + +func IsTwo(a []int32) bool { + if len(a) != 1 { + return false + } + return Value(a[0]) == 12 // 2 +} + +// IsBomb 是否炸弹 +// isClass 是否经典版 +func IsBomb(a []int32, isClass bool) bool { + var n int + var has bool + if isClass { + has, n = RulePopEnable(a) + } else { + has, n = RulePopEnable_yl(a) + } + if !has { + return false + } + + switch n { + case Straight_Twin, Four_Bomb: + return true + } + + return false +} diff --git a/public b/public index 85842fa..a7fc5af 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit 85842faf03f62e89cc711b3d150bc73ca68b64b7 +Subproject commit a7fc5af077865e1daf27c8e04ff3247aa643a815 diff --git a/robot/base/interaction.go b/robot/base/interaction.go new file mode 100644 index 0000000..985f7e3 --- /dev/null +++ b/robot/base/interaction.go @@ -0,0 +1,58 @@ +package base + +import ( + "math/rand" + "mongo.games.com/game/protocol/gamehall" + "mongo.games.com/goserver/core/netlib" +) + +// 机器人互动操作 + +const ( + none = -1 + weixiao_01 = iota - 1 + kaixin_02 + kuqi_03 + nanweiren_04 + aini_05 + dengyan_06 + ganga_07 + dahan_08 + fahuo_09 + maren_10 + mihu_11 + wulianxiao_12 + shuashuai_13 + haixiu_14 + aixin_15 + buai_16 + zan_17 + daozan_18 + woshou_19 + ok_20 + fo_21 +) + +var ( + Emote1 = []int{fahuo_09, dahan_08, nanweiren_04, dengyan_06, mihu_11, none} + Emote2 = []int{weixiao_01, dengyan_06, mihu_11, mihu_11, none} + Emote3 = []int{dengyan_06, fahuo_09, ganga_07, none} + Emote4 = []int{aini_05, wulianxiao_12, shuashuai_13, none} + Emote5 = []int{shuashuai_13, wulianxiao_12, none} +) + +// SendEmote 随机表情 +func SendEmote(s *netlib.Session, p IPlayer, arr []int) { + e := arr[rand.Intn(len(arr))] // 随机一个表情 + if e == -1 { + return + } + + pack := &gamehall.CSRoomEvent{ + Tp: 2, + Content: "", + Param: []int32{int32(e)}, + } + + DelaySendSecond(s, int(gamehall.GameHallPacketID_PACKET_CSRoomEvent), pack, 2, 3) +} diff --git a/robot/tienlen/sctienlen.go b/robot/tienlen/sctienlen.go index e52c3b6..929839d 100644 --- a/robot/tienlen/sctienlen.go +++ b/robot/tienlen/sctienlen.go @@ -8,6 +8,7 @@ import ( "mongo.games.com/game/common" "mongo.games.com/game/gamerule/tienlen" "mongo.games.com/game/proto" + "mongo.games.com/game/protocol/gamehall" proto_tienlen "mongo.games.com/game/protocol/tienlen" "mongo.games.com/game/robot/base" "mongo.games.com/goserver/core/basic" @@ -79,16 +80,35 @@ func (this *SCTienLenPlayerOpHandler) Process(s *netlib.Session, packid int, pac if int(scTienLenOp.GetOpRetCode()) == 0 { switch scTienLenOp.GetOpCode() { case tienlen.TienLenPlayerOpPlay: + delC := []int32{} delCards := scTienLenOp.GetOpParam() for _, delcard := range delCards { for i, card := range me.Cards { if card != tienlen.InvalideCard && card == int32(delcard) { me.Cards[i] = tienlen.InvalideCard + delC = append(delC, card) } } } + + lastPlayer := scene.GetPlayerBySnid(scene.LastOpSnid) + if lastPlayer != nil && lastPlayer.IsRobot() && me.SnId != lastPlayer.GetSnId() && + (tienlen.IsTwo(scene.LastCards) || tienlen.IsBomb(scene.LastCards, !common.IsTienLenYuLe(int(scene.GetGameId())))) { + // 机器人出2/炸弹被压制 + base.SendEmote(base.PlayerMgrSingleton.GetPlayerSession(scene.LastOpSnid), lastPlayer, base.Emote1) + } + scene.LastCards = delC + scene.LastOpSnid = me.SnId + me.PassTimes = 0 case tienlen.TienLenPlayerOpPass: + me.PassTimes++ + if me.PassTimes >= 2 { + me.PassTimes = 0 + // 机器人过牌两次 + base.SendEmote(s, me, base.Emote2) + } } + } else { //操作失败 switch scTienLenOp.GetOpCode() { case tienlen.TienLenPlayerOpPlay: //出牌操作失败,改为过 @@ -440,6 +460,10 @@ func (this *SCTienLenCurOpPosHandler) Process(s *netlib.Session, packid int, pac exDelayTs = notExDelayTs minS = notExDelayminS maxS = notExDelaymaxS + if scene.FirstWinSnid == 0 { + base.SendEmote(s, p, base.Emote5) + scene.FirstWinSnid = me.SnId + } } base.DelaySendMillisecond(s, int(proto_tienlen.TienLenPacketID_PACKET_CSTienLenPlayerOp), packOp, []int{exDelayTs + minS, exDelayTs + maxS}...) } @@ -573,6 +597,45 @@ func (this *SCTienLenAIHandler) Process(s *netlib.Session, packid int, pack inte return nil } +func SCRoomEvent(s *netlib.Session, packid int, pack interface{}) error { + logger.Logger.Tracef("SCRoomEvent %v", pack) + msg, ok := pack.(*gamehall.SCRoomEvent) + if !ok { + return nil + } + + if msg.Content == "" || len(msg.Param) == 0 { + return nil + } + + scene, ok := base.GetScene(s).(*TienLenScene) + if !ok { + return nil + } + + p := scene.GetMe(s) + if p == nil { + return nil + } + + pos, err := strconv.Atoi(msg.GetContent()) + if err != nil { + return nil + } + if p.GetPos() != int32(pos) { + return nil + } + + switch msg.Param[0] { + case common.ItemIDBucket, common.ItemIDSlippers: + base.SendEmote(s, p, base.Emote3) + case common.ItemIDLike, common.ItemIDCoffee: + base.SendEmote(s, p, base.Emote4) + } + + return nil +} + func init() { //SCTienLenRoomInfo netlib.RegisterHandler(int(proto_tienlen.TienLenPacketID_PACKET_SCTienLenRoomInfo), &SCTienLenRoomInfoHandler{}) @@ -598,4 +661,6 @@ func init() { //SCTienLenAIData netlib.RegisterHandler(int(proto_tienlen.TienLenPacketID_PACKET_SCTienLenAI), &SCTienLenAIHandler{}) netlib.RegisterFactory(int(proto_tienlen.TienLenPacketID_PACKET_SCTienLenAI), &SCTienLenAIPacketFactory{}) + // SCRoomEvent + netlib.Register(int(gamehall.GameHallPacketID_PACKET_SCRoomEvent), gamehall.SCRoomEvent{}, SCRoomEvent) } diff --git a/robot/tienlen/tienlenplayer.go b/robot/tienlen/tienlenplayer.go index 81045d4..a05257a 100644 --- a/robot/tienlen/tienlenplayer.go +++ b/robot/tienlen/tienlenplayer.go @@ -12,7 +12,8 @@ var TienLenNilPlayer *TienLenPlayer = nil type TienLenPlayer struct { base.BasePlayer *proto_tienlen.TienLenPlayerData - data *tienlenApi.PredictRequest + data *tienlenApi.PredictRequest + PassTimes int } func NewTienLenPlayer(data *proto_tienlen.TienLenPlayerData) *TienLenPlayer { @@ -26,7 +27,7 @@ func (p *TienLenPlayer) Init() { } func (p *TienLenPlayer) Clear() { - + p.PassTimes = 0 } func (p *TienLenPlayer) MarkFlag(flag int32) { diff --git a/robot/tienlen/tienlenscene.go b/robot/tienlen/tienlenscene.go index 201aefd..824e68c 100644 --- a/robot/tienlen/tienlenscene.go +++ b/robot/tienlen/tienlenscene.go @@ -13,7 +13,10 @@ import ( type TienLenScene struct { base.BaseScene *proto_tienlen.SCTienLenRoomInfo - players map[int32]*TienLenPlayer + players map[int32]*TienLenPlayer + LastCards []int32 // 上一个机器人出的牌 + LastOpSnid int32 // 上一个出牌的机器人 + FirstWinSnid int32 // 第一个出完牌的玩家id } type filterFunc func(*TienLenScene, *TienLenPlayer, []int32, []int32, []int32, bool) (bool, []int32) @@ -47,6 +50,7 @@ func (s *TienLenScene) GetIsAllAi() bool { return i == 4 } func (s *TienLenScene) Clear() { + s.FirstWinSnid = 0 for _, p := range s.players { p.Clear() } diff --git a/xlsx/DB_GameItem.xlsx b/xlsx/DB_GameItem.xlsx index 7f504b8..be76101 100644 Binary files a/xlsx/DB_GameItem.xlsx and b/xlsx/DB_GameItem.xlsx differ