This commit is contained in:
aozhiwei 2022-06-03 16:03:37 +08:00
parent 852c9b3f78
commit 8c21f208c6
5 changed files with 52 additions and 1 deletions

View File

@ -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`),

View File

@ -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(

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}