This commit is contained in:
hujiabin 2022-10-14 19:09:20 +08:00
parent cad0ae2477
commit 3a02badc59
3 changed files with 16 additions and 10 deletions

View File

@ -184,9 +184,6 @@ class Hero extends BaseModel {
}
$heroLucky = \services\FormulaService::Hero_Advanced_Lucky_Value($row['quality']);
$dto = array(
'rand_attr' => $row['rand_attr'],
'attr_pro1' => $attrPro1,
'attr_pro2' => $attrPro2,
'idx' => $row['idx'],
'token_id' => $row['token_id'],
'hero_uniid' => $row['idx'],
@ -519,9 +516,10 @@ class Hero extends BaseModel {
private static function getAttrProByLevel($row,$baseAttr,$attr){
$attrPro1 = [];
$coefficient_level = mt\HeroLevelAttr::getCoefficientByLevel($row['hero_lv'],$row['hero_id']);
foreach ($baseAttr as $val){
$coef_level = mt\HeroLevelAttr::getByCoefficient($coefficient_level,$val['attr_id']);
foreach ($attr as $v){
$coef_level = mt\HeroLevelAttr::getByCoefficient($coefficient_level,$val['attr_id']);
// if ($val['attr_id'] == $v['attr_id'] && $val['attr_id'] == kHAT_Atk){ //18 //18.941564456287 //20.847692307692
// array_push($attrPro1,[
// 'attr_id' => $val['attr_id'],

View File

@ -24,8 +24,11 @@ class HeroLevelAttr {
public static function getByCoefficient($data,$index)
{
self::mustBeCoefficientHash($data);
return getXVal(self::$coefficientHash, $index, null);
foreach ($data as $val){
if ($val['attr_id'] == $index){
return $val;
}
}
}
public static function getCoefficientByLevel($level,$hero_id){
@ -198,7 +201,7 @@ class HeroLevelAttr {
}
}
protected static function mustBeCoefficientHash($list)
protected static function mustBeCoefficientHash($list)
{
if (!self::$coefficientHash) {
self::$coefficientHash = array();
@ -211,6 +214,6 @@ class HeroLevelAttr {
protected static $metaList;
protected static $levelHash;
protected static $coefficientHash;
protected static $coefficientHash;
}

View File

@ -19,8 +19,13 @@ class HeroQuality {
public static function getByCoefficient($data,$index)
{
self::mustBeCoefficientHash($data);
return getXVal(self::$coefficientHash, $index, null);
foreach ($data as $val){
if ($val['attr_id'] == $index){
return $val;
}
}
// self::mustBeCoefficientHash($data);
// return getXVal(self::$coefficientHash, $index, null);
}
public static function getCoefficientByQuality($quality,$hero_id){