Browse Source

武器升级

cyzhao 4 years ago
parent
commit
4119532549

+ 4 - 4
Gameserver/Amfphp/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-04 11:22:29
+ // 日期: 2021-06-07 14:12:15
 ////////////////////
 namespace loyalsoft;
 /**
@@ -118,7 +118,7 @@ class GameConfig {
         return self::get_hash_item('heroextra_level', $heroId)->$quality;
     }
     /**
-    * 武器等级
+    * 武器等级,品质,等级双索引
     * @return \weapon_levelexp
     */
     public static function weapon_levelexp()
@@ -129,9 +129,9 @@ class GameConfig {
     /**
     * @return \sm_weapon_levelexp weapon_levelexp item数据 
     */
-    public static function weapon_levelexp_getItem($itemid)
+    public static function weapon_levelexp_getItem($type, $level)
     { 
-        return self::get_hash_item('weapon_levelexp', $itemid);
+        return self::get_hash_item('weapon_levelexp', $type)->$level;
     }
     /**
     * [废弃]

+ 4 - 4
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-04 11:22:29
+ // 日期: 2021-06-07 14:12:15
 ////////////////////
 
 /**
@@ -118,7 +118,7 @@ class GameConfig {
         return self::get_hash_item('heroextra_level', $heroId)->$quality;
     }
     /**
-    * 武器等级
+    * 武器等级,品质,等级双索引
     * @return \weapon_levelexp
     */
     public static function weapon_levelexp()
@@ -129,9 +129,9 @@ class GameConfig {
     /**
     * @return \sm_weapon_levelexp weapon_levelexp item数据 
     */
-    public static function weapon_levelexp_getItem($itemid)
+    public static function weapon_levelexp_getItem($type, $level)
     { 
-        return self::get_hash_item('weapon_levelexp', $itemid);
+        return self::get_hash_item('weapon_levelexp', $type)->$level;
     }
     /**
     * [废弃]

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-25 15:48:59
+ // 日期: 2021-06-04 18:11:35
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/Const/sm_item_stones.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-01 16:11:40
+ // 日期: 2021-06-04 16:53:45
 ////////////////////
 
 
@@ -19,7 +19,7 @@ class sm_item_stones
     public $typeId;
 
     /**
-    * @var Int32 类型 default(0) 
+    * @var Int32 类型 1 唤灵师 2 言灵 3 武器 4 天赋 default(0) 
     */
     public $type;
 

+ 2 - 7
Gameserver/Amfphp/model/Const/sm_item_stones_type.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-01 16:11:40
+ // 日期: 2021-06-04 16:53:45
 ////////////////////
 
 
@@ -24,7 +24,7 @@ class sm_item_stones_type
     public $typeId;
 
     /**
-    * @var Int32 类型 default(0) 
+    * @var Int32 类型 1 唤灵师 2 言灵 3 武器 4 天赋 default(0) 
     */
     public $type;
 
@@ -53,10 +53,5 @@ class sm_item_stones_type
     */
     public $costGold;
 
-    /**
-    * @var DateTime 上次修改 default(CURRENT_TIMESTAMP) 
-    */
-    public $lastupdate;
-
 }
 

+ 7 - 47
Gameserver/Amfphp/model/Const/sm_item_weapon.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-03 16:13:09
+ // 日期: 2021-06-07 11:39:39
 ////////////////////
 
 
@@ -24,10 +24,15 @@ class sm_item_weapon
     public $hero_id;
 
     /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    * @var Int32 1 刀/剑 2 魔法书 3 法杖 default(0) 
     */
     public $weaponType;
 
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    */
+    public $baseExp;
+
     /**
     * @var Int32 武器初始星级  
     */
@@ -43,91 +48,46 @@ class sm_item_weapon
     */
     public $hp;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $hpRate;
-
     /**
     * @var Int32 【不改】攻击 default(0) 
     */
     public $atk;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $atkRate;
-
     /**
     * @var Int32 【不改】防御 default(0) 
     */
     public $def;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $defRate;
-
     /**
     * @var Int32 暴击 default(0) 
     */
     public $crit;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $critRate;
-
     /**
     * @var Int32 物理攻击 default(0) 
     */
     public $phyAtk;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $phyAtkRate;
-
     /**
     * @var Int32 【不改】防御护甲 default(0) 
     */
     public $phyDef;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $phyDefRate;
-
     /**
     * @var Int32 【不改】攻击速度 default(0) 
     */
     public $atkSpeed;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
-    */
-    public $atkSpeedRate;
-
     /**
     * @var Int32 法术强度 default(0) 
     */
     public $fashuqiangdu;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。  
-    */
-    public $fashuqiangduRate;
-
     /**
     * @var Int32 【不改】魔法抗性 default(0) 
     */
     public $mofakangxing;
 
-    /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。  
-    */
-    public $mofakangxingRate;
-
     /**
     * @var Int32 装备时要求唤灵师的等级  
     */

+ 7 - 2
Gameserver/Amfphp/model/Const/sm_weapon_levelexp.php

@@ -3,12 +3,12 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-01 15:58:44
+ // 日期: 2021-06-04 17:31:06
 ////////////////////
 
 
 /**
- * Static Model weapon_levelexp 武器等级
+ * Static Model weapon_levelexp 武器等级,品质,等级双索引
  */
 class sm_weapon_levelexp
 {
@@ -18,6 +18,11 @@ class sm_weapon_levelexp
     */
     public $id;
 
+    /**
+    * @var Int32 武器品质 1 N 2 R 3 SR 4 SSR 5 UR default(0) 
+    */
+    public $type;
+
     /**
     * @var Int32 当前等级  
     */

+ 37 - 0
Gameserver/Amfphp/model/Const/sm_weapon_levelexp_type.php

@@ -0,0 +1,37 @@
+<?php
+////////////////////
+ // 由CodeGenerator创建。
+ // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
+ // author: gwang 
+ // 日期: 2021-06-04 17:31:06
+////////////////////
+
+
+/**
+ * Static Model weapon_levelexp_type 武器等级,品质,等级双索引
+ */
+class sm_weapon_levelexp_type
+{
+
+    /**
+    * @var Int32 用途未知!!请到数据库中添加字段注释。  
+    */
+    public $id;
+
+    /**
+    * @var Int32 武器品质 1 N 2 R 3 SR 4 SSR 5 UR default(0) 
+    */
+    public $type;
+
+    /**
+    * @var Int32 当前等级  
+    */
+    public $level;
+
+    /**
+    * @var Int32 达到当前等级所需经验 default(100) 
+    */
+    public $needExp;
+
+}
+

+ 1 - 11
Gameserver/Amfphp/model/Const/sm_weaponextra_level.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-06-04 11:12:13
+ // 日期: 2021-06-07 11:38:23
 ////////////////////
 
 
@@ -23,16 +23,6 @@ class sm_weaponextra_level
     */
     public $weaponId;
 
-    /**
-    * @var Int32 碎片ID  
-    */
-    public $segID;
-
-    /**
-    * @var Int32 升阶所需碎片数量  
-    */
-    public $segNum;
-
     /**
     * @var Int32 星级 default(0) 
     */

+ 17 - 14
Gameserver/Amfphp/process/StoreProc.php

@@ -71,18 +71,15 @@ class StoreProc {
      * 武器升级
      */
     static function weaponUpgrade() {
-        list($uid,$prizeCtx) = req()->paras;                                        # 参数 言灵uid(指定进阶的言灵实例id)
+        list($uid,$wuqiList, $items) = req()->paras;                                        # 参数 言灵uid(指定进阶的言灵实例id)
         $user = req()->userInfo->game;
         $equipment =  $user->store->equipment;
           
         my_Assert(CommUtil::isPropertyExists($equipment, $uid), ErrCode::store_weapon_err); # 玩家拥有此英雄
         $myPacketItems = $user->store->items;
-        $list = explode(';', $prizeCtx);
+        //消耗材料道具
         $total = 0;
-        foreach ($list as $key => $val) {
-            $ctxList = explode(',', $val);
-            $costItemId = $ctxList[0];
-            $costNumber = $ctxList[1];
+        foreach ($items as $costItemId => $costNumber) {       
             my_Assert(CommUtil::isPropertyExists($myPacketItems,$costItemId), ErrCode::store_itemnotenough); # 
             my_Assert($myPacketItems->$costItemId >= $costNumber, ErrCode::store_itemnotenough);# 检查道具的数量,在背包中是否充足
             $mo = GameConfig::item_stones_getItem($costItemId);
@@ -91,10 +88,16 @@ class StoreProc {
             StoreProc::removeItemFromStore($user->store, $costItemId, $costNumber);                      
             $total += $mo->baseExp*$costNumber;
         }
+        //消耗武器
+        foreach ($wuqiList as $wuqiId) {
+            my_Assert(CommUtil::isPropertyExists($equipment, $wuqiId), ErrCode::store_weapon_err); # 玩家拥有此英雄 
+            StlUtil::dictRemove($user->store->equipment, $wuqiId);         
+            $total += GameConfig::item_weapon_getItem($equipment->$wuqiId->typeId)->baseExp;
+        }
         
         $equipVo = new Ins_Weapon($equipment->$uid);
         $equipVo->exp += $total;
-        $curlevel = self::Upgrade($equipVo->exp);
+        $curlevel = self::Upgrade($equipVo->exp, GameConfig::item_base_getItem($equipVo->typeId)->quality);
         $equipVo->level = $curlevel;     
         $user->store->equipment->$uid = $equipVo;
          
@@ -112,9 +115,9 @@ class StoreProc {
      * @param type $type
      * @return type
      */
-    static function Upgrade($xp,$type = 3) {
+    static function Upgrade($xp,$qual) {
         $curLv = 0;
-        $heroLvDic = GameConfig::weapon_levelexp();
+        $heroLvDic = GameConfig::weapon_levelexp()->$qual;          
         $f = (array) $heroLvDic;     
         ksort($f); 
         foreach ($f as $lv => $mo) {
@@ -151,16 +154,16 @@ class StoreProc {
         my_Assert($equipment->$uid->level >= $mo->starlimitLv, ErrCode::hero_yanling_canotTupo);
         my_Assert($user->baseInfo->level >= $mo->userlvLimit, ErrCode::hero_yanling_canotTupo);
         my_Assert($user->baseInfo->gold >= $mo->gold , ErrCode::notenough_gold_msg); 
-        $segID = $mo->segID;
-        my_Assert(StlUtil::dictHasProperty($user->store->items,$segID) , ErrCode::store_itemnotenough); 
-        my_Assert($user->store->items->$segID>=$mo->segNum , ErrCode::store_itemnotenough); 
+//        $segID = $mo->segID;
+//        my_Assert(StlUtil::dictHasProperty($user->store->items,$segID) , ErrCode::store_itemnotenough); 
+//        my_Assert($user->store->items->$segID>=$mo->segNum , ErrCode::store_itemnotenough); 
         
         $costItemsList = explode(';',$mo->costItems);   
         foreach ($costItemsList as $value) {
             $list = explode(',', $value);
-            StoreProc::removeItemFromStore($user->store, $list[0], $list[1]);          
+            StoreProc::removeItemFromStore($user->store, $list[0], $list[1]);             
         }
-        $user->store->items->$segID -= $mo->segNum;
+      
         $user->baseInfo->gold -= $mo->gold;
         $equipment->$uid->starLevel += 1;