|
@@ -237,7 +237,11 @@ class HeroProc {
|
|
|
}
|
|
|
// var_dump($user->task->taskListDaily);
|
|
|
self::CalcUserFightPower($req->zoneid, $req->uid, $req->userInfo->game); # 跟新战力统计
|
|
|
- return Resp::ok($targetHero);
|
|
|
+ $ret = array(
|
|
|
+ 'hero' => $targetHero,
|
|
|
+ 'store' => $user->store
|
|
|
+ );
|
|
|
+ return Resp::ok($ret);
|
|
|
}
|
|
|
|
|
|
// </editor-fold>
|
|
@@ -964,88 +968,87 @@ class HeroProc {
|
|
|
* @return type
|
|
|
*/
|
|
|
static function StrengthenStar($req) {
|
|
|
- list($yanlingUid,$uidList) = $req->paras;
|
|
|
-
|
|
|
+ list($yanlingUid, $uidList) = $req->paras;
|
|
|
+
|
|
|
$store = $req->userInfo->game->store;
|
|
|
- if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
|
|
|
+ if (!StlUtil::dictHasProperty($store->yanling, $yanlingUid)) {
|
|
|
return Resp::err(ErrCode::hero_yanling_notfound);
|
|
|
}
|
|
|
$tag = true;
|
|
|
foreach ($uidList as $costUid) {
|
|
|
- if(StlUtil::dictHasProperty($store->yanling,$costUid)){//校验是否是同类型
|
|
|
+ if (StlUtil::dictHasProperty($store->yanling, $costUid)) {//校验是否是同类型
|
|
|
$confDic = GameConfig::item_yanling_getItem($costUid);
|
|
|
- if($confDic->type != GameConfig::item_yanling_getItem($yanlingUid)->type){
|
|
|
+ if ($confDic->type != GameConfig::item_yanling_getItem($yanlingUid)->type) {
|
|
|
$tag = false;
|
|
|
break;
|
|
|
- }
|
|
|
+ }
|
|
|
} else {
|
|
|
$tag = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(!$tag){
|
|
|
+
|
|
|
+ if (!$tag) {
|
|
|
return Resp::err(ErrCode::hero_yanling_notfound);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$exp = 0;
|
|
|
foreach ($uidList as $costuid) {
|
|
|
$confDic = GameConfig::item_yanling_getItem($costuid);
|
|
|
$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){
|
|
|
+
|
|
|
+ if ($store->yanling->$yanlingUid->curStarExp >= $dic->maxStarExp) {
|
|
|
$store->yanling->$yanlingUid->curStarExp = 0;
|
|
|
$store->yanling->$yanlingUid->starLv += 1;
|
|
|
- if($dic->nextId = 0){
|
|
|
+ if ($dic->nextId = 0) {
|
|
|
$store->yanling->$yanlingUid->starLv = 5;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- $req->userInfo->game->store = $store;
|
|
|
- UserProc::updateUserInfo();
|
|
|
- return Resp::ok(array('store' => $req->userInfo->game->store,));
|
|
|
- }
|
|
|
|
|
|
+ $req->userInfo->game->store = $store;
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array('store' => $req->userInfo->game->store,));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 言灵升级
|
|
|
* @param req $req
|
|
|
*/
|
|
|
static function YanlinUpLevel($req) {
|
|
|
- list($yanlingUid,$type) = $req->paras;
|
|
|
+ list($yanlingUid, $type) = $req->paras;
|
|
|
$store = $req->userInfo->game->store;
|
|
|
- if(!StlUtil::dictHasProperty($store->yanling,$yanlingUid)){
|
|
|
+ if (!StlUtil::dictHasProperty($store->yanling, $yanlingUid)) {
|
|
|
return Resp::err(ErrCode::hero_yanling_notfound);
|
|
|
}
|
|
|
$curlv = $store->yanling->$yanlingUid->level;
|
|
|
$maxLv = $curlv + $type;
|
|
|
-
|
|
|
+
|
|
|
for ($index = $curlv; $index < $maxLv; $index++) {
|
|
|
- $mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
- $costList = explode(';', $mo->cost);
|
|
|
+ $mo = GameConfig::yanlingLeve_getItem($index);
|
|
|
+ $costList = explode(';', $mo->cost);
|
|
|
foreach ($costList as $item) {
|
|
|
$list = explode(',', $item);
|
|
|
- if($list[0] == META_GOLD_ITEMID){//扣金币
|
|
|
+ if ($list[0] == META_GOLD_ITEMID) {//扣金币
|
|
|
Data_UserGame::Consume_Gold($req->userInfo->game->baseInfo, $list[1]);
|
|
|
} elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
|
|
|
- Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $list[1]);
|
|
|
+ Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $list[1]);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$store->yanling->$yanlingUid->level += $type;
|
|
|
- $req->userInfo->game->store = $store;
|
|
|
-
|
|
|
- UserProc::updateUserInfo();
|
|
|
- return Resp::ok(array('store' => $req->userInfo->game->store,'gold'=>$req->userInfo->game->baseInfo->gold,'resPoint'=>$req->userInfo->game->baseInfo->resPoint));
|
|
|
+ $req->userInfo->game->store = $store;
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array('store' => $req->userInfo->game->store, 'gold' => $req->userInfo->game->baseInfo->gold, 'resPoint' => $req->userInfo->game->baseInfo->resPoint));
|
|
|
}
|
|
|
+
|
|
|
//
|
|
|
// <editor-fold defaultstate="collapsed" desc="计算战队战斗力, for pvp back matchers, -wg 2017.07.13">
|
|
|
|