1
This commit is contained in:
parent
b773e9c867
commit
cf60f4d878
@ -171,6 +171,7 @@ class UserInfo(object):
|
||||
['!ring_list', [0], '勋章(戒指)列表'],
|
||||
['!honor_info', [HonorInfo()], '荣誉信息'],
|
||||
['account_lucky', 0, '用户幸运值'],
|
||||
['chest_rate', 0, '宝箱概率'],
|
||||
]
|
||||
|
||||
class UserBattleInfo(object):
|
||||
|
@ -5,6 +5,7 @@ namespace models;
|
||||
require_once('mt/Item.php');
|
||||
require_once('mt/LevelUp.php');
|
||||
require_once('mt/StarLevel.php');
|
||||
require_once('mt/Parameter.php');
|
||||
require_once('models/UserSeasonRing.php');
|
||||
require_once('models/Parachute.php');
|
||||
require_once('models/Hero.php');
|
||||
@ -84,6 +85,11 @@ class User extends BaseModel {
|
||||
if ($row['address']){
|
||||
$honorInfo = UserHonor::info($row['address']);
|
||||
}
|
||||
$lucky = Hero::getAccountLuckyTemp();
|
||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||
|
||||
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||
return array(
|
||||
'activated' => $row['activated'],
|
||||
'rename_count' => $row['rename_count'],
|
||||
@ -122,7 +128,8 @@ class User extends BaseModel {
|
||||
'ring_id' => $row['ring_id'],
|
||||
'ring_list' => UserSeasonRing::ringList($row['account_id']),
|
||||
'honor_info' => $honorInfo,
|
||||
'account_lucky' => Hero::getAccountLuckyTemp()
|
||||
'account_lucky' => $lucky,
|
||||
'chest_rate' => $rate,
|
||||
);
|
||||
}
|
||||
|
||||
@ -141,6 +148,11 @@ class User extends BaseModel {
|
||||
if ($row['address']){
|
||||
$honorInfo = UserHonor::info($row['address']);
|
||||
}
|
||||
$lucky = Hero::getAccountLuckyTemp();
|
||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||
|
||||
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||
return array(
|
||||
'activated' => $row['activated'],
|
||||
'rename_count' => $row['rename_count'],
|
||||
@ -181,7 +193,8 @@ class User extends BaseModel {
|
||||
'parachute_list' => Parachute::getMyParachute(),
|
||||
'honor_info' => $honorInfo,
|
||||
'last_login_time' => $row['last_login_time'],
|
||||
'account_lucky' => Hero::getAccountLuckyTemp()
|
||||
'account_lucky' => $lucky,
|
||||
'chest_rate' => $rate,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -72,11 +72,11 @@ class HashRateService extends BaseService
|
||||
'task'.AchievementsPower::TYPE3 => array(),
|
||||
'task'.AchievementsPower::TYPE4 => array(),
|
||||
'currentPeriod' => 0,
|
||||
'initTime' => 0
|
||||
'modifytime' => 0
|
||||
);
|
||||
}
|
||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||
if ($currentPeriod && $currentPeriod['id'] != $this->hashRateTask['currentPeriod']){
|
||||
if ($currentPeriod && myself()->_getDaySeconds($this->hashRateTask['modifytime']) < myself()->_getNowDaySeconds()){
|
||||
$this->initHashRateTask($currentPeriod['id']);
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ class HashRateService extends BaseService
|
||||
$this->randHashRateTaskList(AchievementsPower::TYPE2);
|
||||
$this->randHashRateTaskList(AchievementsPower::TYPE3);
|
||||
$this->randHashRateTaskList(AchievementsPower::TYPE4);
|
||||
$this->hashRateTask['initTime'] = myself()->_getNowDaySeconds();
|
||||
$this->hashRateTask['modifytime'] = myself()->_getNowTime();
|
||||
$this->hashRateTask['currentPeriod'] = $currentId;
|
||||
$this->saveHashRateTask();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user