Explorar o código

战力里话宝石

cyzhao hai 11 meses
pai
achega
411012ce40
Modificáronse 1 ficheiros con 54 adicións e 15 borrados
  1. 54 15
      Gameserver/App/process/FightProc.php

+ 54 - 15
Gameserver/App/process/FightProc.php

@@ -78,17 +78,17 @@ class FightProc {
 
         ctx()->gates->fightSweepNum += 1;
         ctx()->baseInfo->Consume_tili($costTili);
-      
+
         $wavesArr = GameConfig::waves_getItemArray($passGateId);
         $count = count($wavesArr);
         $wavesMo = $wavesArr[$count - 1];
 
-        $gold = $wavesMo->rewardGold;     
-        StoreProc::AddMultiItemInStore("1," . $gold);     
-               
-        $exp = $wavesMo->rewardExp; 
+        $gold = $wavesMo->rewardGold;
+        StoreProc::AddMultiItemInStore("1," . $gold);
+
+        $exp = $wavesMo->rewardExp;
         StoreProc::AddMultiItemInStore("4," . $exp);
-    
+
         if ($wavesMo->rewardTuZhi != null) {
             $tuzhi = explode('-', $wavesMo->rewardTuZhi);
             $n = rand($tuzhi[0], $tuzhi[1]);
@@ -132,7 +132,7 @@ class FightProc {
         UserProc::updateUserInfo();
         $ret = array(
             'tili' => ctx()->baseInfo->tili,
-            'tili_ts'=> ctx()->baseInfo->tili_ts,
+            'tili_ts' => ctx()->baseInfo->tili_ts,
             'fightSweepNum' => ctx()->gates->fightSweepNum,
             //'prizeArr' => $prizeArr,
             'store' => ctx()->store,
@@ -321,9 +321,9 @@ class FightProc {
                     StoreProc::AddMultiItemInStore($layerMo->rewards);              # 发放奖励
                 }
             }
-            
+
             ctx()->gates()->TowerGateInfo()->CurLayer = $finalLayer;
-            
+
             TaskProc::OnPassLayer_ChallengeGate($finalLayer - 1);
             UserProc::updateUserInfo();
             $ret = array(
@@ -691,24 +691,24 @@ class FightProc {
         $isExistFinishReward_other = 0;
         if ($type == 1) {
             $list = gMem()->zrevrange(MemKey_GameRun::Rank_MainGateIndex_Zone_zset(req()->zoneid), 0, glc()->Rank_MainGateIndex_OnListRank, true);
-            $selfExtraInfo = ctx()->gates->maxPassGateNumId();        
-            
+            $selfExtraInfo = ctx()->gates->maxPassGateNumId();
+
             $isExistFinishReward = self::isExistNoDrawed_MainGate();
             $isExistFinishReward_other = self::isExistNoDrawed_FightPower();
         } else {
             $list = gMem()->zrevrange(MemKey_GameRun::Rank_FightPower_Zone_zset(req()->zoneid), 0, glc()->Rank_FightPower_OnListRank, true);
-            $selfExtraInfo = self::countUserFightPower();   
-            
+            $selfExtraInfo = self::countUserFightPower();
+
             $isExistFinishReward = self::isExistNoDrawed_FightPower();
             $isExistFinishReward_other = self::isExistNoDrawed_MainGate();
         }
-              
+
         if ($isExistFinishReward == 1) {
             $isExistFinishReward = true;
         } else {
             $isExistFinishReward = false;
         }
-        
+
         if ($isExistFinishReward_other == 1) {
             $isExistFinishReward_other = true;
         } else {
@@ -1071,6 +1071,45 @@ class FightProc {
         $heroAttck = $heroBashAttack + $attck;
         $heroHp = $heroBashHp + $hp;
 
+        $pag = ctx()->store->equipPag;
+        $gemDic = ctx()->store->gemEquip->$pag; //Dictionary<E_EquipPosition, Dictionary<int, Ins_Gem>>
+        $per = 0;
+        $parasVal = 0;
+
+        $per_hp = 0;
+        $parasVal_hp = 0;
+        foreach ($equipDic as $index => $ins_equip) {
+            if (StlUtil::dictHasProperty($gemDic, $index)) {
+                $dic = $gemDic->$index;
+                foreach ($dic as $k => $gem) {
+                    $ins_Gem = new Ins_Gem($gem);
+                    if ($ins_Gem->predicateMo()->actionType == "mulDamage") {
+                        $per += g . predicateMo . actionParam1;
+                    } elseif ($ins_Gem->predicateMo()->actionType == "addDamage") {
+                        $parasVal += g . predicateMo . actionParam1;
+                    } elseif ($ins_Gem->predicateMo()->actionType == "mulHp") {
+                        $per_hp += g . predicateMo . actionParam1;
+                    } elseif ($ins_Gem->predicateMo()->actionType == "addHp") {
+                        $parasVal_hp += g . predicateMo . actionParam1;
+                    }
+                }
+            }
+        }
+
+        if ($per != 0) {
+            $heroAttck = round($heroAttck + $heroAttck * $per);
+        }
+        if ($parasVal != 0) {
+            $heroAttck += $parasVal;
+        }
+        
+        if ($per_hp != 0) {
+            $heroHp = round($heroHp + $heroHp * $per_hp);
+        }
+        if ($parasVal_hp != 0) {
+            $heroHp += $parasVal_hp;
+        }
+
         $dec_demage = $mo->dec_demage;
         $bigHit_Val = $mo->bigHit_Val / 100;
         $bigHit_rate = $mo->bigHit_rate / 100;