|
@@ -266,10 +266,11 @@ class Ins_UserHero extends Object_ext {
|
|
/**
|
|
/**
|
|
* 获取该角色战斗力数值
|
|
* 获取该角色战斗力数值
|
|
* 生命值+物理攻击*4+魔法强度*4+护甲*5+魔抗*5
|
|
* 生命值+物理攻击*4+魔法强度*4+护甲*5+魔抗*5
|
|
|
|
+ * @param Data_UserGame $user
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
- public function GetPower() {
|
|
|
|
- return (int) ($this->getHpForBattle() * 1.0 //
|
|
|
|
|
|
+ public function GetPower($user) {
|
|
|
|
+ return (int) ($this->getHpForBattle($user) * 1.0 //
|
|
+ $this->getNengLiangZhiJiForBattle() * 0 //
|
|
+ $this->getNengLiangZhiJiForBattle() * 0 //
|
|
+ $this->getWuLiGongJiForBattle() * 4 //
|
|
+ $this->getWuLiGongJiForBattle() * 4 //
|
|
+ $this->getFaShuQiangDuForBattle() * 4 //
|
|
+ $this->getFaShuQiangDuForBattle() * 4 //
|
|
@@ -315,11 +316,11 @@ class Ins_UserHero extends Object_ext {
|
|
/**
|
|
/**
|
|
* 获得角色装备的言灵提供的属性加成
|
|
* 获得角色装备的言灵提供的属性加成
|
|
* @param type $attribute
|
|
* @param type $attribute
|
|
|
|
+ * @param Data_UserGame $user
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
- public function getYanlingExtraProperty($attribute) {
|
|
|
|
|
|
+ public function getYanlingExtraProperty($attribute, $user) {
|
|
$result = 0;
|
|
$result = 0;
|
|
- $player = req()->userInfo->game;
|
|
|
|
var_dump($this);
|
|
var_dump($this);
|
|
foreach ($this->yanling as $item) {
|
|
foreach ($this->yanling as $item) {
|
|
$itemUID = $item->itemuid;
|
|
$itemUID = $item->itemuid;
|
|
@@ -327,7 +328,7 @@ class Ins_UserHero extends Object_ext {
|
|
foreach (debug_backtrace()as $x) {
|
|
foreach (debug_backtrace()as $x) {
|
|
echoLine(json_encode($x));
|
|
echoLine(json_encode($x));
|
|
}
|
|
}
|
|
- $itemId = $player->store->yanling->$itemUID->typeId;
|
|
|
|
|
|
+ $itemId = $user->store->yanling->$itemUID->typeId;
|
|
$mo = GameConfig::item_yanling_getItem($itemId);
|
|
$mo = GameConfig::item_yanling_getItem($itemId);
|
|
my_Assert(null != $mo, ErrCode::err_const_no); # 言灵常量找不到
|
|
my_Assert(null != $mo, ErrCode::err_const_no); # 言灵常量找不到
|
|
switch ($attribute) {
|
|
switch ($attribute) {
|
|
@@ -506,51 +507,69 @@ class Ins_UserHero extends Object_ext {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 战场血量 = 基础血量 + 武器和言灵加成
|
|
* 战场血量 = 基础血量 + 武器和言灵加成
|
|
|
|
+ * @param Data_UserGame $user
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
- public function getHpForBattle() {
|
|
|
|
|
|
+ public function getHpForBattle($user) {
|
|
return (int) ($this->getHp() // 英雄数据
|
|
return (int) ($this->getHp() // 英雄数据
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::HP) // 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::HP) // 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties :: HP) // 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties :: HP, $user) // 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 战场能量值 = 基础能量值 + 武器和言灵加成
|
|
* 战场能量值 = 基础能量值 + 武器和言灵加成
|
|
|
|
+ * @param Data_UserGame $user
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
- public function getNengLiangZhiJiForBattle() {
|
|
|
|
|
|
+ public function getNengLiangZhiJiForBattle($user) {
|
|
return (int) ($this->getNengLiangZhi() // 英雄本身
|
|
return (int) ($this->getNengLiangZhi() // 英雄本身
|
|
+ $this->getEquipExtraProperty(EHeroProperties :: NENGLIANGZHI) // + 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties :: NENGLIANGZHI) // + 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties::NENGLIANGZHI) // + 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties::NENGLIANGZHI, $user) // + 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- public function getWuLiGongJiForBattle() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param Data_UserGame $user
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public function getWuLiGongJiForBattle($user) {
|
|
return (int) ($this->getWuLiGongJi() // 英雄数据
|
|
return (int) ($this->getWuLiGongJi() // 英雄数据
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::WULIGONGJI) // 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::WULIGONGJI) // 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties :: WULIGONGJI) // 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties :: WULIGONGJI, $user) // 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- function getFaShuQiangDuForBattle() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param Data_UserGame $user
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ function getFaShuQiangDuForBattle($user) {
|
|
return (int) ($this->getFaShuQiangDu() // 英雄数据
|
|
return (int) ($this->getFaShuQiangDu() // 英雄数据
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::FASHUQIANGDU) // 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::FASHUQIANGDU) // 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties :: FASHUQIANGDU) // 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties :: FASHUQIANGDU, $user) // 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- function getFangYuHuJiaForBattle() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param Data_UserGame $user
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ function getFangYuHuJiaForBattle($user) {
|
|
return (int) ($this->getFangYuHuJia() // 英雄数据
|
|
return (int) ($this->getFangYuHuJia() // 英雄数据
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::FANGYUHUJIA) // 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::FANGYUHUJIA) // 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties :: FANGYUHUJIA) // 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties :: FANGYUHUJIA, $user) // 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- function getMoFaKangXingForBattle() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @param Data_UserGame $user
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ function getMoFaKangXingForBattle($user) {
|
|
return (int) ($this->getMoFaKangXing() // 英雄数据
|
|
return (int) ($this->getMoFaKangXing() // 英雄数据
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::MOFAKANGXING) // 武器加成
|
|
+ $this->getEquipExtraProperty(EHeroProperties ::MOFAKANGXING) // 武器加成
|
|
- + $this->getYanlingExtraProperty(EHeroProperties :: MOFAKANGXING) // 言灵加成
|
|
|
|
|
|
+ + $this->getYanlingExtraProperty(EHeroProperties :: MOFAKANGXING, $user) // 言灵加成
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|