|
@@ -36,192 +36,51 @@ class FightProc {
|
|
|
return FightProc::PlotSav();
|
|
|
case CmdCode::cmd_fight_xunluoPrizeReceived: #6807 巡逻奖励领取
|
|
|
return FightProc::XunluoPrizeReceived();
|
|
|
+ case CmdCode::fight_startFight: # 6808 开始挑战
|
|
|
+ return self::StartFight();
|
|
|
default:
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6808 开始挑战 (扣除体力)
|
|
|
+ */
|
|
|
+ private static function StartFight() {
|
|
|
+ list($gateId) = req()->paras;
|
|
|
+ my_Assert($gateId > 0, ErrCode::paras_err);
|
|
|
+ $mo = GameConfig::gate_getItem($gateId);
|
|
|
+ my_Assert(null != $mo, ErrCode::err_const_no);
|
|
|
+ my_Assert(ctx()->base()->Consume_tili($mo->cost_tili), ErrCode::notenough_tili);
|
|
|
+ return Resp::ok(array("tili" => ctx()->baseInfo->tili, "tili_ts" => ctx()->baseInfo->tili_ts));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 6807 巡逻奖励领取
|
|
|
* @return type
|
|
|
*/
|
|
|
public static function XunluoPrizeReceived() {
|
|
|
list($type) = req()->paras;
|
|
|
-
|
|
|
+
|
|
|
$gateId = ctx()->gates->UnlockedGatesMaxId;
|
|
|
$gateMo = GameConfig::gate_getItem($gateId);
|
|
|
- my_Assert($gateMo!=null, ErrCode::err_const_no);
|
|
|
-
|
|
|
- if($type == 1){//巡逻
|
|
|
- $curTs = now();
|
|
|
- $startTs = ctx()->gates->xunluo_StartTs;
|
|
|
- $ts = $curTs - $startTs;
|
|
|
- $ts2 = intval($ts/60);//总的分钟数
|
|
|
-
|
|
|
- $fenzhong = intval($ts2/10);//有几个10分钟
|
|
|
- $gold = 0;
|
|
|
- $exp = 0;
|
|
|
- $price = "";
|
|
|
- if ($fenzhong > 0)
|
|
|
- {
|
|
|
- $gold = intval($gateMo->gold_xunluo / 6 * $fenzhong);
|
|
|
- $exp = intval($gateMo->exp_xunluo / 6 * $fenzhong);
|
|
|
- $price = "1,".$gold.';'."4,".$exp;
|
|
|
- }
|
|
|
-
|
|
|
- $itemStr = explode(';', $gateMo->xunluo_item_ts);
|
|
|
- $itemId = 0;
|
|
|
- $itemNum = 0;
|
|
|
-
|
|
|
- $tempTs = 0;
|
|
|
- foreach ($itemStr as $s) {
|
|
|
- $arr = explode('-', $s);
|
|
|
- $tsItemArr = explode(',', $arr[0]);
|
|
|
- $sTs = $tsItemArr[0];//开始时间
|
|
|
- $eTs = $tsItemArr[1]; //终止时间
|
|
|
- $produceTs = $tsItemArr[2];//间隔
|
|
|
- while (true)
|
|
|
- {
|
|
|
- $tempTs += $produceTs;
|
|
|
- if ($tempTs <= $eTs && $tempTs <= $ts2)
|
|
|
- {
|
|
|
- $sList = explode(',', $arr[1]);
|
|
|
- $itemId = $sList[0];
|
|
|
- $itemNum += $sList[1];
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs >= $eTs)
|
|
|
- {
|
|
|
- $tempTs = $eTs;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if($itemNum > 0){
|
|
|
- $price = $price.";".$itemId.','.$itemNum;
|
|
|
- }
|
|
|
-
|
|
|
- //---------------------------
|
|
|
- $tuzhiStr = explode(';',$gateMo->xunluo_tuzhi_ts);
|
|
|
- $tuzhiId = 0;
|
|
|
- $tuzhiNum = 0;
|
|
|
-
|
|
|
- $tempTs2 = 0;
|
|
|
- foreach ($tuzhiStr as $s)
|
|
|
- {
|
|
|
- $arr = explode('-', $s);
|
|
|
- $tsItemArr = explode(',', $arr[0]);
|
|
|
- $sTs = $tsItemArr[0];//开始时间
|
|
|
- $eTs = $tsItemArr[1]; //终止时间
|
|
|
- $produceTs = $tsItemArr[2];//间隔
|
|
|
-
|
|
|
- while (true)
|
|
|
- {
|
|
|
- $tempTs2 += $produceTs;
|
|
|
- if ($tempTs2 <= $eTs && $tempTs2 <= $ts2)
|
|
|
- {
|
|
|
- $sList = explode(',', $arr[1]);
|
|
|
- $tuzhiId = $sList[0];
|
|
|
- $tuzhiNum += $sList[1];
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs2 >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs2 >= $eTs)
|
|
|
- {
|
|
|
- $tempTs2 = $eTs;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs2 >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if($tuzhiNum > 0){
|
|
|
- $price = $price.";".$tuzhiId.','.$tuzhiNum;
|
|
|
- }
|
|
|
-
|
|
|
- //---------------------
|
|
|
- $equipStr = explode(';', $gateMo->xunluo_equip_ts);
|
|
|
- $equipId = 0;
|
|
|
- $equipNum = 0;
|
|
|
-
|
|
|
- $tempTs3 = 0;
|
|
|
- foreach ($equipStr as $s)
|
|
|
- {
|
|
|
- $arr = explode('-', $s);
|
|
|
- $tsItemArr = explode(',', $arr[0]);
|
|
|
- $sTs = $tsItemArr[0];//开始时间
|
|
|
- $eTs = $tsItemArr[1]; //终止时间
|
|
|
- $produceTs = $tsItemArr[2];//间隔
|
|
|
-
|
|
|
- while (true)
|
|
|
- {
|
|
|
- $tempTs3 += $produceTs;
|
|
|
- if ($tempTs3 <= $eTs && $tempTs3 <= $ts2)
|
|
|
- {
|
|
|
- $sList = explode(',', $arr[1]);
|
|
|
- $equipId = $sList[0];
|
|
|
- $equipNum += $sList[1];
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs3 >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs3 >= $eTs)
|
|
|
- {
|
|
|
- $tempTs3 = $eTs;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($tempTs3 >= $ts2)
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if($equipNum > 0){
|
|
|
- $price = $price.";".$equipId.','.$equipNum;
|
|
|
- }
|
|
|
- StoreProc::AddMultiItemInStore($price);
|
|
|
+ my_Assert($gateMo != null, ErrCode::err_const_no);
|
|
|
+
|
|
|
+ if ($type == 1) {//巡逻
|
|
|
ctx()->gates->xunluo_StartTs = now();
|
|
|
-
|
|
|
- } else {//快速巡逻
|
|
|
- my_Assert(ctx()->gates->xunluo_quick_buyRecord < $gateMo->xueluo_quick_num, ErrCode::err_const_no);
|
|
|
+ } else {//快速巡逻
|
|
|
ctx()->gates->xunluo_quick_buyRecord += 1;
|
|
|
- ctx()->baseInfo->Consume_tili(15);
|
|
|
- StoreProc::AddMultiItemInStore($gateMo->xueluo_quick_reward);
|
|
|
- }
|
|
|
-
|
|
|
+ ctx()->baseInfo->Consume_tili(15);
|
|
|
+ }
|
|
|
+
|
|
|
UserProc::updateUserInfo();
|
|
|
- $ret = array(
|
|
|
- 'gates' => ctx()->gates,
|
|
|
- );
|
|
|
+ $ret = array(
|
|
|
+ 'ok' => 1,
|
|
|
+ );
|
|
|
return Resp::ok($ret);
|
|
|
}
|
|
|
-
|
|
|
- public static function FightDailyClear() {
|
|
|
- ctx()->gates->xunluo_quick_buyRecord = 0;
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* 剧情回存
|
|
|
* @return type
|
|
|
*/
|
|
@@ -308,7 +167,6 @@ class FightProc {
|
|
|
return Resp::ok($ret);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 关卡选择
|
|
|
* @return type
|
|
@@ -369,10 +227,8 @@ class FightProc {
|
|
|
'store' => ctx()->store,
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 章节宝箱的领取
|
|
|
* @return type
|
|
@@ -430,5 +286,4 @@ class FightProc {
|
|
|
);
|
|
|
return Resp::ok($ret);
|
|
|
}
|
|
|
-
|
|
|
}
|