From 8c21f208c625388e3a344c802e37d10997ffaa4f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 3 Jun 2022 16:03:37 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 4 ++++ webapp/controller/MissionController.class.php | 4 ++++ webapp/models/Gun.php | 11 +++++++++++ webapp/models/Hero.php | 16 +++++++++++++++- webapp/mt/Task.php | 18 ++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 799bc28b..7135d09b 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -145,6 +145,8 @@ CREATE TABLE `t_hero` ( `rand_attr` mediumblob COMMENT '随机属性', `today_get_gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `last_get_gold_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后获取金币的时间', + `today_pve_get_ceg` bigint NOT NULL DEFAULT '0' COMMENT 'pve金币', + `last_pve_get_ceg_time` bigint NOT NULL DEFAULT '0' COMMENT '最后pve获取金币的时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), @@ -223,6 +225,8 @@ CREATE TABLE `t_gun` ( `rand_attr` mediumblob COMMENT '随机属性', `today_get_gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `last_get_gold_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后获取金币的时间', + `today_pve_get_ceg` bigint NOT NULL DEFAULT '0' COMMENT 'pve金币', + `last_pve_get_ceg_time` bigint NOT NULL DEFAULT '0' COMMENT '最后pve获取金币的时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), diff --git a/webapp/controller/MissionController.class.php b/webapp/controller/MissionController.class.php index 1dca07e6..bd1953a0 100644 --- a/webapp/controller/MissionController.class.php +++ b/webapp/controller/MissionController.class.php @@ -156,6 +156,10 @@ class MissionController extends BaseAuthedController { return; } $this->_scatterDrop('mission:' . $missionId, $dropMeta, $this->awardService, $this->propertyChgService); + if ($missionMeta['type'] == mt\Task::DAILY_MISSON_TYPE) { + //(账号内所有PVE角色NFT每日获得极限总和(CEG)+账号内所有PVE武器NFT每日获得极限总和(CEG))*10%/每日任务数量 + $this->propertyChgService->addUserChg(); + } Mission::add($missionId); $missionDb = Mission::find($missionId); $missionDto = $this->missionService->getMissionDto( diff --git a/webapp/models/Gun.php b/webapp/models/Gun.php index b0a3d934..0ccb6a80 100644 --- a/webapp/models/Gun.php +++ b/webapp/models/Gun.php @@ -138,6 +138,12 @@ class Gun extends BaseModel { if (myself()->_getDaySeconds($lastGetGoldTime) < myself()->_getNowDaySeconds()) { $todayGetGold = 0; } + $todayPveGetGold = $row['today_pve_get_ceg']; + $lastPveGetCegTime = $row['last_pve_get_ceg_time']; + if (myself()->_getDaySeconds($lastPveGetCegTime) < + myself()->_getNowDaySeconds()) { + $todayPveGetCeg = 0; + } $dto = array( 'gun_uniid' => $row['idx'], 'gun_id' => $row['gun_id'], @@ -146,6 +152,8 @@ class Gun extends BaseModel { 'quality' => $row['quality'], 'durability' => $row['durability'], 'ceg_uplimit' => 0, + 'pve_ceg_uplimit' => 0, + 'raw_pve_ceg_uplimit' => 0, 'attr' => $attr, 'try_count' => $row['try_count'], 'lock_type' => $lockType, @@ -155,6 +163,9 @@ class Gun extends BaseModel { 'unlock_trade_time' => $row['unlock_trade_time'], ); $dto['ceg_uplimit'] = FormulaService::getWeaponPvpDailyCegUpLimit($dto); + $dto['raw_pve_ceg_uplimit'] = + FormulaService::getWeaponPveDailyCegUpLimit($dto); + $dto['pve_ceg_uplimit'] = round($dto['pve_ceg_uplimit'] * 0.9); return $dto; } diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index 4302d2f4..732d747c 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -123,9 +123,16 @@ class Hero extends BaseModel { } $todayGetGold = $row['today_get_gold']; $lastGetGoldTime = $row['last_get_gold_time']; - if (myself()->_getDaySeconds($lastGetGoldTime) < myself()->_getNowDaySeconds()) { + if (myself()->_getDaySeconds($lastGetGoldTime) < + myself()->_getNowDaySeconds()) { $todayGetGold = 0; } + $todayPveGetGold = $row['today_pve_get_ceg']; + $lastPveGetCegTime = $row['last_pve_get_ceg_time']; + if (myself()->_getDaySeconds($lastPveGetCegTime) < + myself()->_getNowDaySeconds()) { + $todayPveGetCeg = 0; + } $dto = array( 'token_id' => $row['token_id'], 'hero_uniid' => $row['idx'], @@ -138,15 +145,22 @@ class Hero extends BaseModel { 'skill_lv1' => $row['skill_lv1'], 'skill_lv2' => $row['skill_lv2'], 'ceg_uplimit' => 0, + 'pve_ceg_uplimit' => 0, + 'raw_pve_ceg_uplimit' => 0, 'attr' => $attr, 'try_count' => $row['try_count'], 'lock_type' => $lockType, 'today_get_gold' => $todayGetGold, 'last_get_gold_time' => $lastGetGoldTime, + 'today_pve_get_ceg' => $todayPveGetCeg, + 'last_pve_get_gold_ceg' => $lastPveGetCegTime, 'unlock_time' => $unlockTime, 'unlock_trade_time' => $row['unlock_trade_time'], ); $dto['ceg_uplimit'] = FormulaService::getHeroPvpDailyCegUpLimit($dto); + $dto['raw_pve_ceg_uplimit'] = + FormulaService::getHeroPveDailyCegUpLimit($dto); + $dto['pve_ceg_uplimit'] = round($dto['pve_ceg_uplimit'] * 0.9); return $dto; } diff --git a/webapp/mt/Task.php b/webapp/mt/Task.php index a747a01a..847ed2c3 100644 --- a/webapp/mt/Task.php +++ b/webapp/mt/Task.php @@ -135,6 +135,23 @@ class Task { return $metas; } + public static function getDaildyMissionCount() + { + if (is_null(self::$dailyMissionCount)) { + self::$dailyMissionCount = 0; + foreach (self::getMetaList() as $meta) { + if ($meta['type'] == self::DAILY_MISSON_TYPE) { + if ($meta['subtype'] != + self::WEAKLY_ACTIVE_VALUE_MISSON_SUBTYPE) { + ++self::$dailyMissionCount; + } + } + } + + } + return self::$dailyMissionCount; + } + protected static function getMetaList() { if (!self::$metaList) { @@ -144,5 +161,6 @@ class Task { } protected static $metaList; + protected static $dailyMissionCount = null; }