From 4b73763e27df029a7418e701d4b8750e1b5e448b Mon Sep 17 00:00:00 2001 From: luying Date: Sat, 18 Feb 2023 20:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(gvg):=20=E4=BA=91=E5=8F=B0?= =?UTF-8?q?=E8=B4=A1=E7=8C=AE=E6=AF=94=E4=BE=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/gvg/gvgPrepareService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/game-server/app/services/gvg/gvgPrepareService.ts b/game-server/app/services/gvg/gvgPrepareService.ts index 8a8a6f7ae..fd472775c 100644 --- a/game-server/app/services/gvg/gvgPrepareService.ts +++ b/game-server/app/services/gvg/gvgPrepareService.ts @@ -10,7 +10,7 @@ import { calLeagueLv, gameData, getFieldMaxAddType } from "../../pubUtils/data"; import { GVG } from "../../pubUtils/dicParam"; import { RewardInter } from "../../pubUtils/interface"; import { nowSeconds } from "../../pubUtils/timeUtil"; -import { arrToMap, getArrayOfNumber, getRandEelm, getRandValueByMinMax, parseGoodStr, sortArrRandom } from "../../pubUtils/util"; +import { arrToMap, getArrayOfNumber, getRandEelm, decodeIdCntArrayStr, parseGoodStr, sortArrRandom } from "../../pubUtils/util"; import { addGVGReward } from "./gvgItemService"; import { getGVGConfig } from "./gvgService"; import { getProduceCoinCnt } from "./gvgItemService"; @@ -40,7 +40,11 @@ export function checkTechIsIng(techId: number, activeQueue: number[], techQueue: export function calProducerContribute(obj: { food: number, mineral: number, wood: number }) { let { food = 0, mineral = 0, wood = 0 } = obj||{}; - return food + mineral + wood; + let ratio = decodeIdCntArrayStr(GVG.GVG_PRODUCE_GAME_RATIO, 1); + let foodRatio = ratio.get(GVG_RESOURCE_TYPE.FOOD.toString())||0; + let mineralRatio = ratio.get(GVG_RESOURCE_TYPE.MINERAL.toString())||0; + let woodRatio = ratio.get(GVG_RESOURCE_TYPE.WOOD.toString())||0; + return food * foodRatio + mineral * mineralRatio + wood * woodRatio; } export function calFighterContribute(obj: { score: number }) {