寻宝:点击头像接口设置机器人

This commit is contained in:
luying
2021-08-25 16:57:11 +08:00
parent 14eac59d43
commit fe78c998b2
13 changed files with 98 additions and 31 deletions
+1 -16
View File
@@ -4,7 +4,7 @@ import { RoleType } from '../db/Role';
import { PVP_HERO_POS, REDIS_KEY, PVP_CONST, COUNTER } from '../consts';
import { setPvpDefResult } from '../services/timeTaskService';
import { dicPvpOpponent, DicPvpOpponent } from "../pubUtils/dictionary/DicPvpOpponent";
import { getRandSingleIndex, genCode, shouldRefresh, getChineseName } from '../pubUtils/util';
import { getRandSingleIndex, genCode, shouldRefresh, getChineseName, makeRobotId, robotIdComBack } from '../pubUtils/util';
import { oppPlayersInter, pvpEndParamInter } from '../pubUtils/interface';
import { gameData, getPLvByScore } from "../pubUtils/data";
import { PVP } from '../pubUtils/dicParam';
@@ -313,21 +313,6 @@ function generateRobotRoleId() {
return `${genCode(10)}_r`;
}
// 根据roleId判断是不是机器人
export function checkRoleIsRobot(roleId: string) {
return !!roleId.match(/_r/);
}
// 将一般的roleId转为带_r的
export function makeRobotId(roleId: string) {
return `${roleId}_r`;
}
// 将一般的roleId去掉_r
export function robotIdComBack(robotRoleId: string) {
return robotRoleId.replace(/_r/, '')
}
// 根据连胜次数,获得加成的积分
export function getPlusScore(win: number) {
let result = win - 1;