|
@@ -22,7 +22,7 @@ class FightProc {
|
|
|
case CmdCode::fight_selectGate: # 6803 主线剧情关卡选择
|
|
|
return FightProc::SelectGate();
|
|
|
case CmdCode::fight_gateChallengePriceReviced: # 6804 挑战关卡: 领取奖励
|
|
|
- return FightProc::GateChallengePriceReviced();
|
|
|
+ return FightProc::GateChallengeRewards();
|
|
|
case CmdCode::fihgt_towerStart: # 6805 挑战关卡: 开始挑战
|
|
|
return FightProc::ChallengeGateStartFight();
|
|
|
case CmdCode::fight_plotSav: # 6806 主线剧情(已播放)回存
|
|
@@ -111,9 +111,9 @@ class FightProc {
|
|
|
$itemArr = explode(',', $ctxArr[1]);
|
|
|
foreach ($itemArr as $str) {
|
|
|
$arr = explode(':', $str);
|
|
|
- $itemId = $arr[0];
|
|
|
+ $itemId = $arr[0];
|
|
|
$per = $arr[1];
|
|
|
-
|
|
|
+
|
|
|
$end += $per;
|
|
|
if ($randNum >= $start && $randNum < $end) {
|
|
|
$res = $itemId;
|
|
@@ -360,29 +360,20 @@ class FightProc {
|
|
|
* 6804 挑战关卡: 奖励领取
|
|
|
* @return type
|
|
|
*/
|
|
|
- public static function GateChallengePriceReviced() {
|
|
|
-// list($zhangjieId, $gateId) = req()->paras;
|
|
|
-//
|
|
|
-// $gateMo = GameConfig::gate_getItem($gateId);
|
|
|
-// my_Assert($gateMo != null, ErrCode::err_const_no);
|
|
|
-//
|
|
|
-// if (!StlUtil::dictHasProperty(ctx()->gates->GatesChallengeRecord, $zhangjieId)) {
|
|
|
-// ctx()->gates->GatesChallengeRecord->$zhangjieId = array();
|
|
|
-// }
|
|
|
-//
|
|
|
-// my_Assert(!in_array($gateId, ctx()->gates->GatesChallengeRecord->$zhangjieId), ErrCode::gate_GatePriceHasReceive);
|
|
|
-// my_Assert(in_array($gateMo->challengeUnlockId, ctx()->gates->GatesChallengeRecord->$zhangjieId), ErrCode::gate_GateNoUnlock);
|
|
|
-//
|
|
|
-// ctx()->gates->GatesChallengeRecord->$zhangjieId[] = $gateId;
|
|
|
-//
|
|
|
-// StoreProc::AddMultiItemInStore($gateMo->reward_win);
|
|
|
-//
|
|
|
-// ctx()->gates->CurrentGateId = $gateId;
|
|
|
+ public static function GateChallengeRewards() {
|
|
|
+ $arr = req()->paras; # 关卡列表
|
|
|
+
|
|
|
+ foreach ($arr as $layerId) {
|
|
|
+ $layerMo = GameConfig::tower_gate_getItem($layerId);
|
|
|
+ my_Assert($layerMo != null, ErrCode::err_const_no);
|
|
|
+ StoreProc::AddMultiItemInStore($layerMo->rewards); # 发放奖励
|
|
|
+ }
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
|
$ret = array(
|
|
|
'store' => ctx()->store,
|
|
|
- 'gates' => ctx()->gates,
|
|
|
+ 'gold' => ctx()->base()->gold,
|
|
|
+ 'cash' => ctx()->base()->cash
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
}
|