|
@@ -16,7 +16,7 @@ class HeroProc {
|
|
|
switch (req()->cmd) {
|
|
|
case CmdCode::cmd_hero_levelup: # [6301] 英雄升级
|
|
|
return HeroProc::HeroLevelUpCostExpItem();
|
|
|
- case CmdCode::cmd_hero_tupo: # [6301] 英雄升级
|
|
|
+ case CmdCode::cmd_hero_tupo: # [6328] 英雄突破
|
|
|
return HeroProc::tupo();
|
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="过时 接口">
|
|
@@ -67,6 +67,8 @@ class HeroProc {
|
|
|
return HeroProc::StrengthenStar();
|
|
|
case CmdCode::cmd_hero_YanlinUpLevel: # [6327] 升级
|
|
|
return HeroProc::YanlinUpLevel();
|
|
|
+ case CmdCode::cmd_hero_YanLingReplace: # [6329] 言灵替换
|
|
|
+ return HeroProc::YanLingReplace();
|
|
|
// </editor-fold>
|
|
|
default: # err: 未知的命令码
|
|
|
return Resp::err(ErrCode::cmd_err);
|
|
@@ -304,6 +306,31 @@ class HeroProc {
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 武器替换
|
|
|
+ * @return type
|
|
|
+ */
|
|
|
+ static function YanLingReplace() {
|
|
|
+ list($uid ,$replaceId) = req()->paras; # 参数 言灵uid(指定进阶的言灵实例id)
|
|
|
+ $user = req()->userInfo->game;
|
|
|
+ $yanling = $user->store->yanling;
|
|
|
+ my_Assert(property_exists($yanling, $uid), "找不到这个言灵");
|
|
|
+ my_Assert(property_exists($yanling, $replaceId), "找不到这个言灵");
|
|
|
+
|
|
|
+
|
|
|
+ $herouid = $yanling->$uid->herouid;
|
|
|
+ $herouid_replace = $yanling->$replaceId->herouid;
|
|
|
+ $yanling->$replaceId->herouid = $herouid;
|
|
|
+ $yanling->$uid->herouid = $herouid_replace;
|
|
|
+ $user->store->equipment = $yanling;
|
|
|
+ req()->userInfo->game = $user;
|
|
|
+
|
|
|
+ UserProc::updateUserInfo(); # 回写玩家数据
|
|
|
+ return Resp::ok(array(
|
|
|
+ "store" => $user->store, # # 目前来看只涉及到items变化
|
|
|
+ ));
|
|
|
+ }
|
|
|
|
|
|
// </editor-fold>
|
|
|
//
|