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 }) {