|
@@ -285,15 +285,14 @@ class Ins_UserHero extends Object_ext {
|
|
|
/**
|
|
|
* 获得角色装备的 物品提供的属性加成
|
|
|
* @param type $attribute
|
|
|
+ * @param Data_UserGame $user
|
|
|
* @return type
|
|
|
*/
|
|
|
- public function getEquipExtraProperty($attribute) {
|
|
|
+ public function getEquipExtraProperty($attribute, $user) {
|
|
|
$result = 0;
|
|
|
- $player = req()->userInfo->game;
|
|
|
$equipUID = $this->equip->weapon->itemuid;
|
|
|
-
|
|
|
- if (CommUtil::isPropertyExists($player->store->equipment, $equipUID)) {
|
|
|
- $equip = $player->store->equipment->$equipUID;
|
|
|
+ if (CommUtil::isPropertyExists($user->store->equipment, $equipUID)) {
|
|
|
+ $equip = $user->store->equipment->$equipUID;
|
|
|
$itemId = my_null_default($equip->typeId, 0);
|
|
|
$wp = GameConfig::item_weapon_getItem($itemId);
|
|
|
my_Assert(null != $wp, ErrCode::err_const_no);
|
|
@@ -321,13 +320,9 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
public function getYanlingExtraProperty($attribute, $user) {
|
|
|
$result = 0;
|
|
|
- var_dump($this);
|
|
|
foreach ($this->yanling as $item) {
|
|
|
$itemUID = $item->itemuid;
|
|
|
if ($itemUID > 0) {
|
|
|
- foreach (debug_backtrace()as $x) {
|
|
|
- echoLine(json_encode($x));
|
|
|
- }
|
|
|
$itemId = $user->store->yanling->$itemUID->typeId;
|
|
|
$mo = GameConfig::item_yanling_getItem($itemId);
|
|
|
my_Assert(null != $mo, ErrCode::err_const_no); # 言灵常量找不到
|
|
@@ -512,7 +507,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
public function getHpForBattle($user) {
|
|
|
return (int) ($this->getHp() // 英雄数据
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties ::HP) // 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties ::HP, $user) // 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties :: HP, $user) // 言灵加成
|
|
|
);
|
|
|
}
|
|
@@ -524,7 +519,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
public function getNengLiangZhiJiForBattle($user) {
|
|
|
return (int) ($this->getNengLiangZhi() // 英雄本身
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties :: NENGLIANGZHI) // + 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties :: NENGLIANGZHI, $user) // + 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties::NENGLIANGZHI, $user) // + 言灵加成
|
|
|
);
|
|
|
}
|
|
@@ -535,7 +530,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
public function getWuLiGongJiForBattle($user) {
|
|
|
return (int) ($this->getWuLiGongJi() // 英雄数据
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties ::WULIGONGJI) // 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties ::WULIGONGJI, $user) // 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties :: WULIGONGJI, $user) // 言灵加成
|
|
|
);
|
|
|
}
|
|
@@ -546,7 +541,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
function getFaShuQiangDuForBattle($user) {
|
|
|
return (int) ($this->getFaShuQiangDu() // 英雄数据
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties ::FASHUQIANGDU) // 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties ::FASHUQIANGDU, $user) // 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties :: FASHUQIANGDU, $user) // 言灵加成
|
|
|
);
|
|
|
}
|
|
@@ -557,7 +552,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
function getFangYuHuJiaForBattle($user) {
|
|
|
return (int) ($this->getFangYuHuJia() // 英雄数据
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties ::FANGYUHUJIA) // 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties ::FANGYUHUJIA, $user) // 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties :: FANGYUHUJIA, $user) // 言灵加成
|
|
|
);
|
|
|
}
|
|
@@ -568,7 +563,7 @@ class Ins_UserHero extends Object_ext {
|
|
|
*/
|
|
|
function getMoFaKangXingForBattle($user) {
|
|
|
return (int) ($this->getMoFaKangXing() // 英雄数据
|
|
|
- + $this->getEquipExtraProperty(EHeroProperties ::MOFAKANGXING) // 武器加成
|
|
|
+ + $this->getEquipExtraProperty(EHeroProperties ::MOFAKANGXING, $user) // 武器加成
|
|
|
+ $this->getYanlingExtraProperty(EHeroProperties :: MOFAKANGXING, $user) // 言灵加成
|
|
|
);
|
|
|
}
|