From f83f57e11815d76e047d1d64ccbb16879a5f96d3 Mon Sep 17 00:00:00 2001 From: mamengke01 <794347210@qq.com> Date: Fri, 11 Dec 2020 16:08:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A6=E5=B0=86=E5=85=BB=E6=88=90=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/playerCeService.ts | 14 +++++++------- shared/consts/consts.ts | 6 +++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/game-server/app/services/playerCeService.ts b/game-server/app/services/playerCeService.ts index b16c9b8b5..9c345306d 100644 --- a/game-server/app/services/playerCeService.ts +++ b/game-server/app/services/playerCeService.ts @@ -3,7 +3,7 @@ */ import { ActionPointModel } from '../db/ActionPoint'; -import { ACTION_POIN } from '../consts/consts'; +import { HERO_SYSTEM_TYPE } from '../consts/consts'; import { pinus } from 'pinus'; import { STATUS } from '../consts/statusCode'; import {resResult } from '../pubUtils/util'; @@ -11,17 +11,17 @@ import {HeroModel} from '../db/Hero'; import {RoleModel} from '../db/Role'; //战力计算TODO -export function calPlayerCe(hero:any, type: number, args: Array<{id: number}>) { +export function calPlayerCe(hero:any, type: number, args: Array) { let ce = 0; let incAttr; - if (type == 1) { + if (HERO_SYSTEM_TYPE.STAR == 1) { incAttr = calHeroStarIncAttr(hero, args); - } + } return ce; } //修改并下发战力 -export async function calPlayerCeAndSave(sid: string, roleId: string, heros:Array, type?: number, args?: Array<{id: number}>) { +export async function calPlayerCeAndSave(sid: string, roleId: string, heros:Array, type?: number, args?: Array) { let playerCe = 0; let pushHeros = []; for (let hero of heros) { @@ -42,7 +42,7 @@ export async function calPlayerCeAndSave(sid: string, roleId: string, heros:Arra return heros; } -export function calHeroStarIncAttr (hero:any, args: Array<{id: number}>) { +export function calHeroStarIncAttr (hero:any, args: Array) { let incHp = 0; return {incHp};//属性增量可以是多个 -} \ No newline at end of file +} diff --git a/shared/consts/consts.ts b/shared/consts/consts.ts index 6d5e84b01..f7258d4b0 100644 --- a/shared/consts/consts.ts +++ b/shared/consts/consts.ts @@ -21,7 +21,11 @@ export const ACTION_POIN = { MAX: 100000, PER: 6 * 60 * 1000 }; - +//武将养成系统分类 +export const HERO_SYSTEM_TYPE = { + STAR:1, +}; + export const BATTLE_REWARD_TYPE = { FIX_REWARD: 1, CONDITION_REWARD: 2,