diff --git a/server/game2006service/constant.js b/server/game2006service/constant.js index d6d9e9f5..49e025aa 100644 --- a/server/game2006service/constant.js +++ b/server/game2006service/constant.js @@ -1 +1,27 @@ exports.TIME_ZONE = 0; + +exports.NORMAL_HERO_FRAGMENT = [ + 110101, + 110111, + 110121, + 110131, + 110141, + 110151, + 110161, + 110171 +]; + +exports.SPEC_HERO_FRAGMENT = 110181; + +exports.NORMAL_GUN_FRAGMENT = [ + 110201, + 110211, + 110221, + 110231, + 110241, + 110251, + 110261, + 110271 +]; + +exports.SPEC_GUN_FRAGMENT = 110281; diff --git a/server/game2006service/tasks/fragment.js b/server/game2006service/tasks/fragment.js index b21865f9..d25870cf 100644 --- a/server/game2006service/tasks/fragment.js +++ b/server/game2006service/tasks/fragment.js @@ -89,6 +89,33 @@ class Fragment { } async realloc(conn, daySeconds, nowTime, hourSeconds, allocedFragments) { + const totalHeroNum = this.getYesterDayHeroNum(); + const totalGunNum = this.getYesterDayGunNum(); + const hour = Math.floor(hourSeconds / 3600); + + const normalHeroNum = Math.floor(totalHeroNum * 0.06 * 8); + const specHeroNum = Math.floor(totalHeroNum * 0.02); + const normalGunNum = Math.floor(totalGunNum * 0.06 * 8); + const specGunNum = Math.floor(totalGunNum * 0.02); + + const pvpNormalHeroNum = normalHeroNum * 0.6; + const pvpSpecHeroNum = specHeroNum * 0.6; + const pvpNormalGunNum = normalGunNum * 0.6; + const pvpSpecGunNum = specGunNum * 0.6; + + const pveNormalHeroNum = normalHeroNum * 0.4; + const pveSpecHeroNum = specHeroNum * 0.4; + const pveNormalGunNum = normalGunNum * 0.4; + const pveSpecGunNum = specGunNum * 0.4; + + } + + getYesterDayHeroNum() { + return YESTERDAY_HERO_NUM; + } + + getYesterDayGunNum() { + return YESTERDAY_GUN_NUM; } }