|
@@ -736,53 +736,53 @@ class HeroProc {
|
|
|
* @return resp
|
|
|
*/
|
|
|
static function StrengthenStar_old() {
|
|
|
- list($yanlingUid, $uidList) = req()->paras;
|
|
|
- $store = req()->userInfo->game->store;
|
|
|
- my_Assert(StlUtil::dictHasProperty($store->yanling, $yanlingUid), ErrCode::hero_yanling_notfound);
|
|
|
- my_Assert(!in_array($yanlingUid, $uidList), ErrCode::hero_yanling_repeat);
|
|
|
- my_Assert($store->yanling->$yanlingUid->starLv < 5, ErrCode::hero_yanling_repeat);
|
|
|
-
|
|
|
- $tag = true;
|
|
|
- foreach ($uidList as $costUid) {
|
|
|
- if (StlUtil::dictHasProperty($store->yanling, $costUid)) { # 校验是否是同类型
|
|
|
- $confDic = GameConfig::item_yanling_getItem($store->yanling->$costUid->typeId);
|
|
|
- my_Assert(null != $confDic, ErrCode::hero_const_no_err);
|
|
|
- if ($confDic->type != GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId)->type) {
|
|
|
- $tag = false;
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if ($store->yanling->$costUid->herouid != 0) {
|
|
|
- $tag = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- } else {
|
|
|
- $tag = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- my_Assert($tag, ErrCode::hero_yanling_errorYanling);
|
|
|
- $exp = 0;
|
|
|
- foreach ($uidList as $costuid) {
|
|
|
- $confDic = GameConfig::item_yanling_getItem($store->yanling->$costuid->typeId);
|
|
|
- my_Assert(null != $confDic, ErrCode::hero_const_no_err);
|
|
|
- $exp += $confDic->addStarExp;
|
|
|
- StlUtil::dictRemove($store->yanling, $costuid);
|
|
|
- }
|
|
|
-
|
|
|
- $store->yanling->$yanlingUid->curStarExp += $exp;
|
|
|
- $dic = GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId);
|
|
|
-
|
|
|
- if ($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp) {
|
|
|
- $store->yanling->$yanlingUid->curStarExp = 0;
|
|
|
- $store->yanling->$yanlingUid->starLv += 1;
|
|
|
- $store->yanling->$yanlingUid->typeId = $dic->nextId;
|
|
|
- }
|
|
|
-
|
|
|
- req()->userInfo->game->store = $store;
|
|
|
- UserProc::updateUserInfo();
|
|
|
- return Resp::ok(array('store' => req()->userInfo->game->store,));
|
|
|
+// list($yanlingUid, $uidList) = req()->paras;
|
|
|
+// $store = req()->userInfo->game->store;
|
|
|
+// my_Assert(StlUtil::dictHasProperty($store->yanling, $yanlingUid), ErrCode::hero_yanling_notfound);
|
|
|
+// my_Assert(!in_array($yanlingUid, $uidList), ErrCode::hero_yanling_repeat);
|
|
|
+// my_Assert($store->yanling->$yanlingUid->starLv < 5, ErrCode::hero_yanling_repeat);
|
|
|
+//
|
|
|
+// $tag = true;
|
|
|
+// foreach ($uidList as $costUid) {
|
|
|
+// if (StlUtil::dictHasProperty($store->yanling, $costUid)) { # 校验是否是同类型
|
|
|
+// $confDic = GameConfig::item_yanling_getItem($store->yanling->$costUid->typeId);
|
|
|
+// my_Assert(null != $confDic, ErrCode::hero_const_no_err);
|
|
|
+// if ($confDic->type != GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId)->type) {
|
|
|
+// $tag = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if ($store->yanling->$costUid->herouid != 0) {
|
|
|
+// $tag = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// $tag = false;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// my_Assert($tag, ErrCode::hero_yanling_errorYanling);
|
|
|
+// $exp = 0;
|
|
|
+// foreach ($uidList as $costuid) {
|
|
|
+// $confDic = GameConfig::item_yanling_getItem($store->yanling->$costuid->typeId);
|
|
|
+// my_Assert(null != $confDic, ErrCode::hero_const_no_err);
|
|
|
+// $exp += $confDic->addStarExp;
|
|
|
+// StlUtil::dictRemove($store->yanling, $costuid);
|
|
|
+// }
|
|
|
+//
|
|
|
+// $store->yanling->$yanlingUid->curStarExp += $exp;
|
|
|
+// $dic = GameConfig::item_yanling_getItem($store->yanling->$yanlingUid->typeId);
|
|
|
+//
|
|
|
+// if ($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp) {
|
|
|
+// $store->yanling->$yanlingUid->curStarExp = 0;
|
|
|
+// $store->yanling->$yanlingUid->starLv += 1;
|
|
|
+// $store->yanling->$yanlingUid->typeId = $dic->nextId;
|
|
|
+// }
|
|
|
+//
|
|
|
+// req()->userInfo->game->store = $store;
|
|
|
+// UserProc::updateUserInfo();
|
|
|
+// return Resp::ok(array('store' => req()->userInfo->game->store,));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -902,40 +902,40 @@ class HeroProc {
|
|
|
* 言灵升级 2021.4(cyzhao)
|
|
|
*/
|
|
|
static function YanlinUpLevel_old() {
|
|
|
- list($yanlingUid, $type) = req()->paras; # 参数: 言灵uid,升级类型:1/5级.
|
|
|
- $store = ctx()->store();
|
|
|
- my_Assert(StlUtil::dictHasProperty($store->yanling, $yanlingUid), ErrCode::hero_yanling_notfound);
|
|
|
- $allDic = GameConfig::yanlingLeve();
|
|
|
- $maxLevel = count((array) $allDic);
|
|
|
- $curlv = $store->yanling->$yanlingUid->level;
|
|
|
- my_Assert($curlv <= ctx()->base()->level, "请提升指挥官等级."); # 言灵等级不能超过指挥官等级.-gwang 2021.4.20
|
|
|
- my_Assert($curlv < $maxLevel, ErrCode::hero_yanling_levelMax);
|
|
|
-
|
|
|
- $maxLv = $curlv + $type;
|
|
|
- if ($maxLv > $maxLevel) {
|
|
|
- $maxLv = $maxLevel;
|
|
|
- }
|
|
|
- $goldNum = 0;
|
|
|
- $pointNum = 0;
|
|
|
- for ($index = $curlv; $index < $maxLv; $index++) {
|
|
|
- my_Assert(StlUtil::dictHasProperty($allDic, $index), ErrCode::hero_yanling_levelconst_no);
|
|
|
- $mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
- $goldNum += $mo->goldCost;
|
|
|
- $pointNum += $mo->pointCost;
|
|
|
- }
|
|
|
- my_Assert(req()->userInfo->game->base()->Consume_Gold($goldNum), ErrCode::notenough_gold_msg);
|
|
|
-// my_Assert(Data_UserGame::Consume_ResPoint(req()->userInfo->game->baseInfo, $pointNum), ErrCode::notenough_resPoint);
|
|
|
- my_Assert(req()->userInfo->game->base()->Consume_ResPoint($pointNum), ErrCode::notenough_resPoint);
|
|
|
- $store->yanling->$yanlingUid->level += $type; # 增加等级
|
|
|
- if ($store->yanling->$yanlingUid->level > $maxLevel) {
|
|
|
- $store->yanling->$yanlingUid->level = $maxLevel;
|
|
|
- }
|
|
|
- TaskProc::OnYanlingLevelUp($store->yanling->$yanlingUid->typeId, $store->yanling->$yanlingUid->level); # 言灵升级
|
|
|
-// req()->userInfo->game->store = $store;
|
|
|
- UserProc::updateUserInfo(); # 回写玩家数据
|
|
|
- return Resp::ok(array('store' => req()->userInfo->game->store, #
|
|
|
- 'gold' => ctx()->base()->gold, #
|
|
|
- 'resPoint' => ctx()->base()->resPoint));
|
|
|
+// list($yanlingUid, $type) = req()->paras; # 参数: 言灵uid,升级类型:1/5级.
|
|
|
+// $store = ctx()->store();
|
|
|
+// my_Assert(StlUtil::dictHasProperty($store->yanling, $yanlingUid), ErrCode::hero_yanling_notfound);
|
|
|
+// $allDic = GameConfig::yanlingLeve();
|
|
|
+// $maxLevel = count((array) $allDic);
|
|
|
+// $curlv = $store->yanling->$yanlingUid->level;
|
|
|
+// my_Assert($curlv <= ctx()->base()->level, "请提升指挥官等级."); # 言灵等级不能超过指挥官等级.-gwang 2021.4.20
|
|
|
+// my_Assert($curlv < $maxLevel, ErrCode::hero_yanling_levelMax);
|
|
|
+//
|
|
|
+// $maxLv = $curlv + $type;
|
|
|
+// if ($maxLv > $maxLevel) {
|
|
|
+// $maxLv = $maxLevel;
|
|
|
+// }
|
|
|
+// $goldNum = 0;
|
|
|
+// $pointNum = 0;
|
|
|
+// for ($index = $curlv; $index < $maxLv; $index++) {
|
|
|
+// my_Assert(StlUtil::dictHasProperty($allDic, $index), ErrCode::hero_yanling_levelconst_no);
|
|
|
+// $mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
+// $goldNum += $mo->goldCost;
|
|
|
+// $pointNum += $mo->pointCost;
|
|
|
+// }
|
|
|
+// my_Assert(req()->userInfo->game->base()->Consume_Gold($goldNum), ErrCode::notenough_gold_msg);
|
|
|
+//// my_Assert(Data_UserGame::Consume_ResPoint(req()->userInfo->game->baseInfo, $pointNum), ErrCode::notenough_resPoint);
|
|
|
+// my_Assert(req()->userInfo->game->base()->Consume_ResPoint($pointNum), ErrCode::notenough_resPoint);
|
|
|
+// $store->yanling->$yanlingUid->level += $type; # 增加等级
|
|
|
+// if ($store->yanling->$yanlingUid->level > $maxLevel) {
|
|
|
+// $store->yanling->$yanlingUid->level = $maxLevel;
|
|
|
+// }
|
|
|
+// TaskProc::OnYanlingLevelUp($store->yanling->$yanlingUid->typeId, $store->yanling->$yanlingUid->level); # 言灵升级
|
|
|
+//// req()->userInfo->game->store = $store;
|
|
|
+// UserProc::updateUserInfo(); # 回写玩家数据
|
|
|
+// return Resp::ok(array('store' => req()->userInfo->game->store, #
|
|
|
+// 'gold' => ctx()->base()->gold, #
|
|
|
+// 'resPoint' => ctx()->base()->resPoint));
|
|
|
}
|
|
|
|
|
|
//
|