Browse Source

攻击力计算添加启灵部分

wanggangzero 10 months ago
parent
commit
f1c91446b3
2 changed files with 36 additions and 3 deletions
  1. 31 0
      Gameserver/App/model/User/Info_Gates.php
  2. 5 3
      Gameserver/App/process/FightProc.php

+ 31 - 0
Gameserver/App/model/User/Info_Gates.php

@@ -136,6 +136,37 @@ class Info_Gates extends Object_ext {
         }
         }
     }
     }
 
 
+    /**
+     * 计算启灵进化的buff加成
+     */
+    public function GetEnvovleBuffs() {
+        $addHp = $addAtk = $addDecDamage = $addEatFood = 0;                     # 初始化加成值
+        $arr = GameConfig::evolve();
+        foreach ($arr as $key => $value) {
+            isEditor() and $value = new \sm_evolve();
+            if ($key <= $this->evolveMaxId_left) {
+                isEditor() and $p = new \sm_predicate();
+                $p = GameConfig::predicate_getItem($value->predicateId);
+                my_Assert(null != $p, ErrCode::err_const_no);
+                switch ($p->actionType) {
+                    case 'addHp':                                               # + 血量上限
+                        $addHp += $p->actionParam1;
+                        break;
+                    case 'addDamge':                                            # + 攻击力
+                        $addAtk += $p->actionParam1;
+                        break;
+                    case 'addDecDamage':                                        # + 减伤
+                        $addDecDamage += $p->actionParam1;
+                        break;
+                    case 'addEatFood':                                          # + 肉食恢复
+                        $addEatFood += $p->actionParam1;
+                        break;
+                }
+            }
+        }
+        return array($addHp, $addAtk, $addDecDamage, $addEatFood);              # 返回元组
+    }
+
     /**
     /**
      * 挑战关卡数据结构
      * 挑战关卡数据结构
      * @return Ins_TowerGateInfo
      * @return Ins_TowerGateInfo

+ 5 - 3
Gameserver/App/process/FightProc.php

@@ -1042,6 +1042,8 @@ class FightProc {
         $CurrentHeroId = ctx()->heros->CurrentHeroId;
         $CurrentHeroId = ctx()->heros->CurrentHeroId;
         //$hero = ctx()->heros->Dic->$CurrentHeroId;
         //$hero = ctx()->heros->Dic->$CurrentHeroId;
 
 
+        list($addHp, $addAtk, $addDecDamage, $addEatFood) = ctx()->gates()->GetEnvovleBuffs(); // 启灵加成
+
         $mo = GameConfig::hero_getItem($CurrentHeroId);
         $mo = GameConfig::hero_getItem($CurrentHeroId);
         my_Assert($mo != null, ErrCode::err_const_no);
         my_Assert($mo != null, ErrCode::err_const_no);
 
 
@@ -1063,8 +1065,8 @@ class FightProc {
             }
             }
         }
         }
 
 
-        $heroAttck = $heroBashAttack + $attck;
-        $heroHp = $heroBashHp + $hp;
+        $heroAttck = $heroBashAttack + $attck + $addAtk;                        # 英雄基础攻击力+装备宝石词条攻击力+启灵攻击力
+        $heroHp = $heroBashHp + $hp + $addHp;                                   # 英雄基础hp + 装备宝石词条hp + 启灵hp
 
 
         $pag = ctx()->store->equipPag;
         $pag = ctx()->store->equipPag;
         $gemDic = ctx()->store->gemEquip->$pag; //Dictionary<E_EquipPosition, Dictionary<int, Ins_Gem>>
         $gemDic = ctx()->store->gemEquip->$pag; //Dictionary<E_EquipPosition, Dictionary<int, Ins_Gem>>
@@ -1105,7 +1107,7 @@ class FightProc {
             $heroHp += $parasVal_hp;
             $heroHp += $parasVal_hp;
         }
         }
 
 
-        $dec_demage = $mo->dec_demage;
+        $dec_demage = $mo->dec_demage + $addDecDamage;                          # 英雄基础减伤 + 启灵减伤
         $bigHit_Val = $mo->bigHit_Val / 100;
         $bigHit_Val = $mo->bigHit_Val / 100;
         $bigHit_rate = $mo->bigHit_rate / 100;
         $bigHit_rate = $mo->bigHit_rate / 100;