🐞 fix(抽卡): 添加ur武将专用保底

This commit is contained in:
luying
2022-11-22 17:10:10 +08:00
parent 4e8d785bea
commit b94c64cd1a
7 changed files with 54 additions and 75 deletions
@@ -184,7 +184,7 @@ export class GachaResults {
public getRandomResultOfTarget(floor: GachaFloor, cnt: number) { public getRandomResultOfTarget(floor: GachaFloor, cnt: number) {
let target = this.list.filter(cur => cur.heroQuality == floor.heroQuality); let target = this.list.filter(cur => cur.heroQuality == floor.heroQuality);
let targetRemoveLast = target.slice(0, target.length - 2); let targetRemoveLast = target.slice(0, cnt + 1);
return getRandEelm(targetRemoveLast, cnt); return getRandEelm(targetRemoveLast, cnt);
} }
@@ -326,6 +326,7 @@ class GachaFloor {
floorType: GACHA_FLOOR_TYPE; floorType: GACHA_FLOOR_TYPE;
heroQuality: number; heroQuality: number;
param: number; param: number;
param2: number = 0;
constructor(id: number) { constructor(id: number) {
let dicGachaFloor = gameData.gachaFloor.get(id); let dicGachaFloor = gameData.gachaFloor.get(id);
@@ -334,6 +335,12 @@ class GachaFloor {
this.floorType = dicGachaFloor.floorType; this.floorType = dicGachaFloor.floorType;
this.heroQuality = dicGachaFloor.heroQuality; this.heroQuality = dicGachaFloor.heroQuality;
this.param = dicGachaFloor.param; this.param = dicGachaFloor.param;
if(dicGachaFloor.floorType == GACHA_FLOOR_TYPE.TEN_MOST_HIGHER || dicGachaFloor.floorType == GACHA_FLOOR_TYPE.TEN_MOST_LOWER) {
this.param2 = 10;
} else if(dicGachaFloor.floorType == GACHA_FLOOR_TYPE.FIVE_MOST_LOWER) {
this.param2 = 5;
}
} }
} }
@@ -342,6 +349,7 @@ class GachaFloor {
GACHA_FLOOR_TYPE.MAIN_FLOOR, GACHA_FLOOR_TYPE.MAIN_FLOOR,
GACHA_FLOOR_TYPE.ONLY_ONE, GACHA_FLOOR_TYPE.ONLY_ONE,
GACHA_FLOOR_TYPE.TEN_MOST_LOWER, GACHA_FLOOR_TYPE.TEN_MOST_LOWER,
GACHA_FLOOR_TYPE.FIVE_MOST_LOWER,
].indexOf(this.floorType) != -1 ].indexOf(this.floorType) != -1
} }
} }
@@ -399,6 +407,7 @@ export class GachaPull {
break; break;
case GACHA_FLOOR_TYPE.TEN_MOST_HIGHER: case GACHA_FLOOR_TYPE.TEN_MOST_HIGHER:
case GACHA_FLOOR_TYPE.TEN_MOST_LOWER: case GACHA_FLOOR_TYPE.TEN_MOST_LOWER:
case GACHA_FLOOR_TYPE.FIVE_MOST_LOWER:
this.setTenMostFloor(floor); this.setTenMostFloor(floor);
break; break;
} }
@@ -445,7 +454,7 @@ export class GachaPull {
// 10连最多多少个武将 // 10连最多多少个武将
private setTenMostFloor(floor: GachaFloor) { private setTenMostFloor(floor: GachaFloor) {
let targetCnt = this.result.getTargetCnt(floor); let targetCnt = this.result.getTargetCnt(floor);
if(this.result.count == 10 && targetCnt > floor.param) { if(this.result.count == floor.param2 && targetCnt > floor.param) {
let gachaResults = this.result.getRandomResultOfTarget(floor, targetCnt - floor.param); let gachaResults = this.result.getRandomResultOfTarget(floor, targetCnt - floor.param);
for(let gachaResult of gachaResults) { for(let gachaResult of gachaResults) {
let replacePlan = this.percent.getReplacePlan(gachaResult.heroQuality, floor.isReplaceLower()); let replacePlan = this.percent.getReplacePlan(gachaResult.heroQuality, floor.isReplaceLower());
+1
View File
@@ -808,6 +808,7 @@ export enum GACHA_FLOOR_TYPE {
ONLY_ONE = 2, // 每 param 次有且仅有1次目标物(如当前的求贤若渴) ONLY_ONE = 2, // 每 param 次有且仅有1次目标物(如当前的求贤若渴)
TEN_MOST_HIGHER = 3, // 每次10连最多获得 param 个目标物(不计单抽)向上替换(如:蓝色不超过9个=紫色保底) TEN_MOST_HIGHER = 3, // 每次10连最多获得 param 个目标物(不计单抽)向上替换(如:蓝色不超过9个=紫色保底)
TEN_MOST_LOWER = 4, // 每次10连最多获得 param 个目标物(不计单抽)向下替换 (如:橙色不超过3个) TEN_MOST_LOWER = 4, // 每次10连最多获得 param 个目标物(不计单抽)向下替换 (如:橙色不超过3个)
FIVE_MOST_LOWER = 5, // 每次5连最多获得 param 个目标物(不计单抽)向下替换 (如:橙色不超过3个)
} }
// 跑马灯显示类型 // 跑马灯显示类型
+8 -4
View File
@@ -42,7 +42,7 @@ export const PVP = {
PVP_SEASON_FORBID_BATTLE_TIME_BEFORE: 3600, // pvp赛季结束前几秒钟禁止挑战队伍 PVP_SEASON_FORBID_BATTLE_TIME_BEFORE: 3600, // pvp赛季结束前几秒钟禁止挑战队伍
PVP_MATCH_ROBOT: 1500, // 巅峰演武多少分以下匹配的全是机器人(该分以上及其该分优先匹配真人) PVP_MATCH_ROBOT: 1500, // 巅峰演武多少分以下匹配的全是机器人(该分以上及其该分优先匹配真人)
PVP_RECORD_SOCRE: 1500, // 巅峰演武达到多少分可以查看战报 PVP_RECORD_SOCRE: 1500, // 巅峰演武达到多少分可以查看战报
PVP_NEWSEASON_SHOWTIME: 3, // 巅峰演武新赛季开启动画显示的天数 PVP_NEWSEASON_SHOWTIME: 259200, // 巅峰演武新赛季开启动画显示的秒数
}; };
export const ARMY = { export const ARMY = {
ARMY_CREAT_COST: 500, // 创建军团需要的元宝 ARMY_CREAT_COST: 500, // 创建军团需要的元宝
@@ -93,7 +93,7 @@ export const EXTERIOR = {
EXTERIOR_APPEARANCE: 11419, // 默认形象id EXTERIOR_APPEARANCE: 11419, // 默认形象id
}; };
export const HTTPMANAGE = { export const HTTPMANAGE = {
ADDRESSTYPE: 3, // 1:开发服(dev),2:云测服(stable),3:测试服(alpha),4:版号服(isbn) 5: 37测试服(sq1) 6: 对外测试(sq3) 7: 渠道二测(sq4) 8:渠道公测(sq4) ADDRESSTYPE: 3, // 1:开发服(dev),2:云测服(stable),3:测试服(alpha),4:版号服(isbn) 5: 37测试服(sq1) 6: 对外测试(sq3) 8:二测先行(sq4) 9:二测精英(sq7)
SERVERTYPE: 3, // ADDRESSTYPE下服务器的筛选:1:正式服(official),2:开发服(develop) 3. 测试服(alpha) SERVERTYPE: 3, // ADDRESSTYPE下服务器的筛选:1:正式服(official),2:开发服(develop) 3. 测试服(alpha)
}; };
export const CHAT_SYSTEM = { export const CHAT_SYSTEM = {
@@ -139,7 +139,7 @@ export const SHOP = {
HERO_SOUL_BULE: '40011&1', // 蓝将回收货币 HERO_SOUL_BULE: '40011&1', // 蓝将回收货币
HERO_SOUL_PURPLE: '40011&2', // 紫将回收货币 HERO_SOUL_PURPLE: '40011&2', // 紫将回收货币
HERO_SOUL_GOLDEN: '40011&4', // 金将回收货币 HERO_SOUL_GOLDEN: '40011&4', // 金将回收货币
HERO_SOUL_UR: '40011&8', // UR将回收货币 HERO_SOUL_UR: '40011&16', // UR将回收货币
}; };
export const TASK = { export const TASK = {
MAINTASK_OPEN: '1&6', // 主线任务开启条件(1:主公等级,2:关卡限制) MAINTASK_OPEN: '1&6', // 主线任务开启条件(1:主公等级,2:关卡限制)
@@ -154,7 +154,7 @@ export const RECRUIT = {
RECRUIT_MUST: '1&10|2&30|3&20', // 元宝招募保底 RECRUIT_MUST: '1&10|2&30|3&20', // 元宝招募保底
RECRUIT_BONUS_HERO_QUANTITY: '1&4&1|2&2&2|3&1&3', // 元宝招募转盘里各品质武将的数量 RECRUIT_BONUS_HERO_QUANTITY: '1&4&1|2&2&2|3&1&3', // 元宝招募转盘里各品质武将的数量
RECRUIT_WISH_LIST: '1&35|2&35|0&30', // 元宝招募心愿单概率 RECRUIT_WISH_LIST: '1&35|2&35|0&30', // 元宝招募心愿单概率
RECRUIT_CHANGE_SHARD: '1&20|2&40|3&80|4&80', // 重复的武将转换碎片 RECRUIT_CHANGE_SHARD: '1&20|2&40|3&80|4&100', // 重复的武将转换碎片
RECRUIT_LEVEL_WISH_LIST: 100, // 心愿单多少次招募开启 RECRUIT_LEVEL_WISH_LIST: 100, // 心愿单多少次招募开启
RECRUIT_LEVEL_HIGH_RECRUIT: 50, // 求贤若渴多少级开启 RECRUIT_LEVEL_HIGH_RECRUIT: 50, // 求贤若渴多少级开启
RECRUIT_DAILY_RECRUIT_SHARD: 3, // 每日武将拜访数量 RECRUIT_DAILY_RECRUIT_SHARD: 3, // 每日武将拜访数量
@@ -354,3 +354,7 @@ export const RECHARGE = {
RECHARGE_RMB_RETURN_RATIO: '31002&30', // 充值金额和返还元宝的比例(1RMB=30元宝) RECHARGE_RMB_RETURN_RATIO: '31002&30', // 充值金额和返还元宝的比例(1RMB=30元宝)
RECHARGE_RMB_RETURN_LEVEL_LIMITED: 6, // 角色到达x级后可以收到充值返还邮件 RECHARGE_RMB_RETURN_LEVEL_LIMITED: 6, // 角色到达x级后可以收到充值返还邮件
}; };
export const MINIGAME = {
MINIGAME_ARCHER_RANGE: '0&100|29&80|69&60|104&40|143&20|177&0', // 射箭小游戏圈数积分
MINIGAME_FLIPCARD_TYPE: 'baihe|guyuan|hongdou|huasheng|lianzi|nuomi|yimi|zao', // 翻牌游戏资源
};
+3 -3
View File
@@ -107,13 +107,13 @@
{ {
"id": 8, "id": 8,
"gachaType": 5, "gachaType": 5,
"floor": "5&", "floor": "5&6",
"name": "UR武将马超招募", "name": "UR武将马超招募",
"count": "1&5", "count": "1&5",
"free": "&", "free": "&",
"cost": "22003&1", "cost": "22003&1",
"percent": "36&0.1|37&0.4|38&1.5|39&3|40&95", "percent": "36&2|37&3|38&5|39&10|21&10|19&15|18&20|40&35",
"percentShow": "1&0.1|3&0.4&20&21066|3&1.5&10&21066|3&3&5&21066|3&95&1&21066", "percentShow": "1&2|3&3&20&21066|3&5&10&21066|3&10&5&21066|3&10&20&71002|3&15&10&71002|3&20&5&71002|3&35&10&17053",
"isTask": 1, "isTask": 1,
"gachaCnt": "1&-1", "gachaCnt": "1&-1",
"indirectId": 0, "indirectId": 0,
@@ -25,8 +25,14 @@
}, },
{ {
"id": 5, "id": 5,
"floorType": 1,
"heroQuality": 4,
"param": 80
},
{
"id": 6,
"floorType": 5, "floorType": 5,
"heroQuality": 4, "heroQuality": 4,
"param": 20 "param": 1
} }
] ]
+3 -3
View File
@@ -883,10 +883,10 @@
"id": 31004, "id": 31004,
"planId": 40, "planId": 40,
"type": 4, "type": 4,
"content": 21066, "content": 17053,
"count": 1, "count": 10,
"weight": 1, "weight": 1,
"heroQuality": 0, "heroQuality": 0,
"备注": "马超将魂*1" "备注": "玉髓*10"
} }
] ]
+21 -62
View File
@@ -1511,7 +1511,7 @@
"show_animation": "&", "show_animation": "&",
"isdeath": 1, "isdeath": 1,
"talentId": 1004, "talentId": 1004,
"recommendId": "4101&4102", "recommendId": "4201&",
"aiPlan": 1, "aiPlan": 1,
"heroChainId": 42, "heroChainId": 42,
"__EMPTY": 0 "__EMPTY": 0
@@ -2387,7 +2387,7 @@
"urType": 1, "urType": 1,
"quality": 4, "quality": 4,
"initialStars": 7, "initialStars": 7,
"pieceCount": 80, "pieceCount": 100,
"camp": 4, "camp": 4,
"area": 0, "area": 0,
"jobid": 300, "jobid": 300,
@@ -10825,11 +10825,11 @@
}, },
{ {
"heroId": 1168, "heroId": 1168,
"spineName": "zhaoyun_yinqiangbaima", "spineName": "machao",
"rSpineName": "LH_zhaoyun_yinqiangbaima", "rSpineName": "LH_machao1",
"name": "马超", "name": "马超",
"actorId": 1168, "actorId": 1168,
"face_id": "zhaoyun_yinqiangbaima", "face_id": "machao",
"urType": 0, "urType": 0,
"quality": 4, "quality": 4,
"initialStars": 6, "initialStars": 6,
@@ -11155,7 +11155,7 @@
"heroId": 1176, "heroId": 1176,
"spineName": "chendao", "spineName": "chendao",
"rSpineName": "LH_chendao", "rSpineName": "LH_chendao",
"name": "侯选", "name": "成宜",
"actorId": 1176, "actorId": 1176,
"face_id": "chendao", "face_id": "chendao",
"urType": 0, "urType": 0,
@@ -11237,7 +11237,7 @@
"heroId": 1178, "heroId": 1178,
"spineName": "lingtong", "spineName": "lingtong",
"rSpineName": "LH_lingtong", "rSpineName": "LH_lingtong",
"name": "马玩", "name": "马玩(暂去",
"actorId": 1178, "actorId": 1178,
"face_id": "lingtong", "face_id": "lingtong",
"urType": 0, "urType": 0,
@@ -11278,7 +11278,7 @@
"heroId": 1179, "heroId": 1179,
"spineName": "panzhang", "spineName": "panzhang",
"rSpineName": "LH_panzhang", "rSpineName": "LH_panzhang",
"name": "成宜", "name": "侯选(暂去",
"actorId": 1179, "actorId": 1179,
"face_id": "panzhang", "face_id": "panzhang",
"urType": 0, "urType": 0,
@@ -11400,7 +11400,7 @@
{ {
"heroId": 1182, "heroId": 1182,
"spineName": "SL_qibing", "spineName": "SL_qibing",
"rSpineName": "LH_limeng", "rSpineName": "LH_xiliangjiangling",
"name": "李蒙", "name": "李蒙",
"actorId": 1182, "actorId": 1182,
"face_id": "SL_qibing", "face_id": "SL_qibing",
@@ -11441,7 +11441,7 @@
{ {
"heroId": 1183, "heroId": 1183,
"spineName": "xiliangzhoushushi", "spineName": "xiliangzhoushushi",
"rSpineName": "LH_wangfang", "rSpineName": "LH_xiliangzhoushushi",
"name": "王方", "name": "王方",
"actorId": 1183, "actorId": 1183,
"face_id": "xiliangzhoushushi", "face_id": "xiliangzhoushushi",
@@ -11482,7 +11482,7 @@
{ {
"heroId": 1184, "heroId": 1184,
"spineName": "SL_qibing", "spineName": "SL_qibing",
"rSpineName": "LH_fanchou", "rSpineName": "LH_SL_daobing",
"name": "樊稠", "name": "樊稠",
"actorId": 1184, "actorId": 1184,
"face_id": "SL_qibing", "face_id": "SL_qibing",
@@ -11523,7 +11523,7 @@
{ {
"heroId": 1185, "heroId": 1185,
"spineName": "SL_qibing", "spineName": "SL_qibing",
"rSpineName": "LH_zhangji", "rSpineName": "LH_SL_daobing",
"name": "张济", "name": "张济",
"actorId": 1185, "actorId": 1185,
"face_id": "SL_qibing", "face_id": "SL_qibing",
@@ -11564,7 +11564,7 @@
{ {
"heroId": 1186, "heroId": 1186,
"spineName": "zhugexuan", "spineName": "zhugexuan",
"rSpineName": "LH_zhongyao", "rSpineName": "LH_zhugexuan",
"name": "钟繇", "name": "钟繇",
"actorId": 1186, "actorId": 1186,
"face_id": "zhugexuan", "face_id": "zhugexuan",
@@ -11605,7 +11605,7 @@
{ {
"heroId": 1187, "heroId": 1187,
"spineName": "SL_daobing", "spineName": "SL_daobing",
"rSpineName": "LH_zhongjin", "rSpineName": "LH_SL_daobing",
"name": "钟进", "name": "钟进",
"actorId": 1187, "actorId": 1187,
"face_id": "SL_daobing", "face_id": "SL_daobing",
@@ -11646,7 +11646,7 @@
{ {
"heroId": 1188, "heroId": 1188,
"spineName": "xiahoujie", "spineName": "xiahoujie",
"rSpineName": "LH_caohong", "rSpineName": "LH_xiahoujie",
"name": "曹洪", "name": "曹洪",
"actorId": 1188, "actorId": 1188,
"face_id": "xiahoujie", "face_id": "xiahoujie",
@@ -11850,11 +11850,11 @@
}, },
{ {
"heroId": 1193, "heroId": 1193,
"spineName": "qibing", "spineName": "shanzeiqi",
"rSpineName": "LH_mazei", "rSpineName": "LH_shanzei",
"name": "马贼", "name": "马贼",
"actorId": 1193, "actorId": 1193,
"face_id": "qibing", "face_id": "shanzei",
"urType": 0, "urType": 0,
"quality": 1, "quality": 1,
"initialStars": 6, "initialStars": 6,
@@ -12012,54 +12012,13 @@
"heroChainId": 0, "heroChainId": 0,
"__EMPTY": 0 "__EMPTY": 0
}, },
{
"heroId": 1197,
"spineName": "gongbing",
"rSpineName": "LH_xiliangbing",
"name": "西凉弓骑",
"actorId": 1197,
"face_id": "gongbing",
"urType": 0,
"quality": 1,
"initialStars": 6,
"pieceCount": 0,
"camp": 4,
"area": 0,
"jobid": 401,
"jobClass": 4,
"skill": 1024,
"pieceId": 0,
"hp": 1030,
"atk": 20,
"def": 20,
"mdef": 20,
"hp_up": 5,
"atk_up": 1,
"def_up": 1,
"mdef_up": 1,
"info": "&",
"actorinfo": "&",
"skillScroll": "&",
"initialSkin": 0,
"gender": 1,
"atkSpineEffect": "liqi",
"probation": 0,
"center_y": 0,
"show_animation": "&",
"isdeath": 1,
"talentId": 1001,
"recommendId": 0,
"aiPlan": 1,
"heroChainId": 0,
"__EMPTY": 0
},
{ {
"heroId": 1198, "heroId": 1198,
"spineName": "mache", "spineName": "chuanzhi_caocao",
"rSpineName": "LH_xiliangbing", "rSpineName": "LH_caocao",
"name": "大船", "name": "大船",
"actorId": 1198, "actorId": 1198,
"face_id": "gongbing", "face_id": "caocao",
"urType": 0, "urType": 0,
"quality": 1, "quality": 1,
"initialStars": 6, "initialStars": 6,