|
@@ -51,10 +51,57 @@ class FightProc {
|
|
return self::ReceiveRankReward_FightPower();
|
|
return self::ReceiveRankReward_FightPower();
|
|
case CmdCode::fight_rank_IsExistRankReward: # 6817 是否存在未领取的荣誉榜奖励
|
|
case CmdCode::fight_rank_IsExistRankReward: # 6817 是否存在未领取的荣誉榜奖励
|
|
return self::IsExistRankReward();
|
|
return self::IsExistRankReward();
|
|
|
|
+ case CmdCode::fight_evolveUnlock: # 6818 启灵解锁
|
|
|
|
+ return self::EvolveUnlock();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6805 进化解锁
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function EvolveUnlock() {
|
|
|
|
+ list($type, $id) = req()->paras;
|
|
|
|
+
|
|
|
|
+ if ($type == 1) {
|
|
|
|
+ $mo = GameConfig::evolve_getItem($id);
|
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
+ my_Assert(ctx()->baseInfo->level >= $mo->level, ErrCode::evolve_canotUnlock_levelLimit);
|
|
|
|
+ my_Assert(ctx()->baseInfo->gold >= $mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
|
|
+ ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);
|
|
|
|
+ ctx()->gates->evolveMaxId_left = $id;
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ $dic = GameConfig::evolve();
|
|
|
|
+ foreach ($dic as $key => $value) {
|
|
|
|
+ if ($value->specificEvolveId == $id) {
|
|
|
|
+ $mo = $value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ my_Assert(ctx()->baseInfo->level >= $mo->level, ErrCode::evolve_canotUnlock_levelLimit);
|
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
+ if ($mo->specificEvolveCost != null) {
|
|
|
|
+ $cost = explode(',', $mo->specificEvolveCost);
|
|
|
|
+ $costId = $cost[0];
|
|
|
|
+ $costNum = $cost[1];
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty(ctx()->store->items, $costId) && ctx()->store->items->$costId >= $costNum, ErrCode::notenough_item);
|
|
|
|
+ ctx()->store->removeItem($costId, $costNum);
|
|
|
|
+ }
|
|
|
|
+ ctx()->gates->evolveMaxId_right = $id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ $ret = array(
|
|
|
|
+ 'gold'=> ctx()->baseInfo->gold,
|
|
|
|
+ 'items' => ctx()->store->items,
|
|
|
|
+ 'evolveMaxId_right' => ctx()->gates->evolveMaxId_right,
|
|
|
|
+ 'evolveMaxId_left' => ctx()->gates->evolveMaxId_left,
|
|
|
|
+ );
|
|
|
|
+ return Resp::ok($ret);
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 6807 扫荡
|
|
* 6807 扫荡
|