1
This commit is contained in:
parent
0882a8eacf
commit
d7e36b2fa6
@ -272,6 +272,7 @@ class Hero(object):
|
||||
['hero_tili', 0, '英雄体力'],
|
||||
['state', 0, '0:已购买 1:免费(GIFT标签)'],
|
||||
['skin_id', 0, '英雄皮肤id'],
|
||||
['skin_uniid', 0, '英雄皮肤uniid'],
|
||||
['quality', 0, '品阶'],
|
||||
['skill_lv1', 0, '主动技能等级'],
|
||||
['skill_lv2', 0, '被动技能等级'],
|
||||
@ -289,8 +290,10 @@ class Hero(object):
|
||||
['tags', '', '1:Gen状态'],
|
||||
['!avatarInfo', [AvatarInfo()], '装饰信息'],
|
||||
['ability', Ability(), '属性'],
|
||||
['lucky', 0, '幸运值'],
|
||||
['wealth', 0, '财富值'],
|
||||
['lucky', 0, '英雄自身幸运值'],
|
||||
['wealth', 0, '英雄自身财富值'],
|
||||
['luckyMax', 0, '英雄最大幸运值'],
|
||||
['wealthMax', 0, '英雄最大财富值'],
|
||||
['seal_type', 0, '0:未封存 1:已封存'],
|
||||
['unseal_time', 0, '解封时间'],
|
||||
['valid_time', 0, '最大有效时间'],
|
||||
|
@ -289,6 +289,7 @@ class Hero extends BaseModel {
|
||||
'hero_tili' => $row['hero_tili'],
|
||||
'state' => $row['state'],
|
||||
'skin_id' => $skinDb?$skinDb['skin_id']:0,
|
||||
'skin_uniid' => $skinDb?$skinDb['idx']:0,
|
||||
'quality' => $row['quality'],
|
||||
'skill_lv1' => $row['skill_lv1'],
|
||||
'skill_lv2' => $row['skill_lv2'],
|
||||
@ -306,8 +307,10 @@ class Hero extends BaseModel {
|
||||
'offer_reward_state' => 0,
|
||||
'tags' => isset($row['tags'])?$row['tags']:'',
|
||||
'is_select' => $isSelect,
|
||||
'lucky' => self::getHeroLucky($row),
|
||||
'wealth' => self::getHeroWealth($row),
|
||||
'luckyMax' => self::getHeroLucky($row),
|
||||
'lucky' => self::getHeroLuckyBase($row),
|
||||
'wealthMax' => self::getHeroWealth($row),
|
||||
'wealth' => self::getHeroWealthBase($row),
|
||||
'ability' => self::abilityInfo($row),
|
||||
'seal_type' => $row['seal_type'],
|
||||
'unseal_time' => $row['unseal_time'],
|
||||
@ -356,8 +359,8 @@ class Hero extends BaseModel {
|
||||
'skill_lv1' => $row['skill_lv1'],
|
||||
'skill_lv2' => $row['skill_lv2'],
|
||||
'rand_attr' => $attr,
|
||||
'lucky' => self::getHeroLucky($row),
|
||||
'wealth' => self::getHeroWealth($row),
|
||||
'lucky' => self::getHeroLuckyBase($row),
|
||||
'wealth' => self::getHeroWealthBase($row),
|
||||
'ability' => self::abilityInfo($row),
|
||||
'valid_time' => max(0,
|
||||
86400 * $heroAtteMeta['validTime']),
|
||||
@ -365,6 +368,32 @@ class Hero extends BaseModel {
|
||||
"total_times" => $heroAtteMeta['roundPerDay'],
|
||||
);
|
||||
}
|
||||
private static function celHeroWealthBase($row){
|
||||
|
||||
//最大财富值和幸运值计算
|
||||
$wealth = 0;
|
||||
$wealth_rate = 0;
|
||||
$lucky = 0;
|
||||
$lucky_rate = 0;
|
||||
$heroAttrs = emptyReplace(json_decode($row['wealth_attr'], true), array());
|
||||
$heroResult = \mt\EconomyAttribute::getAttrValue($heroAttrs);
|
||||
$wealth += $heroResult['wealth'];
|
||||
$wealth_rate += $heroResult['wealth_rate'];
|
||||
$lucky += $heroResult['lucky'];
|
||||
$lucky_rate += $heroResult['lucky_rate'];
|
||||
|
||||
return array(
|
||||
"wealth" => floor($wealth * (1+$wealth_rate)),
|
||||
"lucky" => floor($lucky * (1+$lucky_rate)),
|
||||
);
|
||||
}
|
||||
public static function getHeroWealthBase($row){
|
||||
return self::celHeroWealthUpLimit($row)["wealth"];
|
||||
}
|
||||
|
||||
public static function getHeroLuckyBase($row){
|
||||
return self::celHeroWealthUpLimit($row)["lucky"];
|
||||
}
|
||||
|
||||
private static function celHeroWealthUpLimit($row){
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user