|
@@ -53,11 +53,45 @@ class FightProc {
|
|
|
return self::IsExistRankReward();
|
|
|
case CmdCode::fight_evolveUnlock: # 6818 启灵解锁
|
|
|
return self::EvolveUnlock();
|
|
|
+
|
|
|
+ case CmdCode::fight_MainTZPass: # 6819 主线挑战--通关
|
|
|
+ return self::MainTZPass();
|
|
|
+ case CmdCode::fight_MainTZGetReward: # 6820 主线挑战--领取奖励
|
|
|
+ return self::MainTZGetReward();
|
|
|
default:
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 6819 主线挑战 -- 通关
|
|
|
+ */
|
|
|
+ static function MainTZPass() {
|
|
|
+ list($gateId, $index) = req()->paras; # 关卡id, 通关难度索引(1/2/3)
|
|
|
+ my_Assert(ctx()->gates()->maxPassGateId >= $gateId, ErrCode::gate_GateNoUnlock); # 通关后解锁难度1
|
|
|
+// isEditor() && $gateInfo = new Ins_GateInfo();
|
|
|
+ $gateInfo = ctx()->gates()->GateList->$gateId;
|
|
|
+ my_Assert($gateInfo->tz_state + 1 >= $index, ErrCode::gate_GateNoUnlock); # 通关上一难度解锁当前难度
|
|
|
+ $gateInfo->tz_state = $index;
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 6820 主线挑战 -- 领取奖励
|
|
|
+ */
|
|
|
+ static function MainTZGetReward() {
|
|
|
+ list($gateId, $index) = req()->paras; # 关卡id, 通关难度索引(1/2/3)
|
|
|
+ my_Assert(ctx()->gates()->maxPassGateId >= $gateId, ErrCode::gate_GateNoUnlock); # 通关后解锁难度1
|
|
|
+// isEditor() && $gateInfo = new Ins_GateInfo();
|
|
|
+ $gateInfo = ctx()->gates()->GateList->$gateId;
|
|
|
+ my_Assert($gateInfo->tz_state >= $index, ErrCode::gate_GateNoUnlock); # 已解锁当前难度
|
|
|
+ my_Assert(Bits::GetBitValue($gateInfo->tz_rewards, $index) == false, ErrCode::gate_GatePriceHasReceive);
|
|
|
+ $gateInfo->tz_rewards = Bits::SetBitValue($gateInfo->tz_rewards, $index, true); # 更新领取记录
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 6805 进化解锁
|
|
|
* @return type
|
|
@@ -269,7 +303,7 @@ class FightProc {
|
|
|
Err(ErrCode::tower_timeNo);
|
|
|
}
|
|
|
ctx()->gates()->TowerGateInfo()->TodayChanNum--; # 增加次数
|
|
|
- } else { # 主线剧情
|
|
|
+ } else { # 主线剧情
|
|
|
my_Assert(ctx()->base()->Consume_tili($mo->cost_tili), ErrCode::notenough_tili);
|
|
|
}
|
|
|
UserProc::updateUserInfo();
|
|
@@ -510,8 +544,8 @@ class FightProc {
|
|
|
|
|
|
self::funUnlock($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
|
|
|
if ($resultType) { # 胜利
|
|
|
- self::skillUnlock_gate($resultType, $gateId);//备注 这个接口位置不能动
|
|
|
-
|
|
|
+ self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
|
|
|
+
|
|
|
if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
ctx()->gates->GateList->$gateId->pass = 1;
|
|
|
TaskProc::Day7TaskReset($gateId); # 刷新七日任务
|
|
@@ -533,7 +567,7 @@ class FightProc {
|
|
|
// StoreProc::AddMultiItemInStore($gateMo->reward_win); # 发放胜利奖励(2024.5.30 过期)
|
|
|
} else {
|
|
|
ctx()->gates->GateList->$gateId->fightNum_fail += 1;
|
|
|
- self::skillUnlock_fightNum($resultType);//这个接口位置不能动
|
|
|
+ self::skillUnlock_fightNum($resultType); //这个接口位置不能动
|
|
|
}
|
|
|
// else { # 失败
|
|
|
//// StoreProc::AddMultiItemInStore($gateMo->reward_fail); # 发放失败奖励(2024.5.30 过期)
|
|
@@ -545,14 +579,14 @@ class FightProc {
|
|
|
$waveMo = GameConfig::waveItem_getItem($gateId, $finalLayer);
|
|
|
my_Assert(null != $waveMo, ErrCode::err_const_no);
|
|
|
$oldLevel = ctx()->baseInfo->level;
|
|
|
- StoreProc::AddMultiItemInStore('4,'.$waveMo->rewardExp);
|
|
|
+ StoreProc::AddMultiItemInStore('4,' . $waveMo->rewardExp);
|
|
|
//ctx()->base()->Add_Exp($waveMo->rewardExp); # 指挥官经验
|
|
|
$newLevel = ctx()->baseInfo->level;
|
|
|
- if($oldLevel != $newLevel){
|
|
|
+ if ($oldLevel != $newLevel) {
|
|
|
ctx()->privateState->oldLevel = $oldLevel;
|
|
|
ctx()->privateState->upLevel = $newLevel;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//ctx()->base()->Add_Gold($waveMo->rewardGold); # 金币奖励
|
|
|
//$pickups .= ";1," . $gold + $waveMo->rewardGold;
|
|
|
|
|
@@ -672,17 +706,17 @@ class FightProc {
|
|
|
foreach ($dic as $id => $mo) {
|
|
|
if ($mo->unlock_acc_id_new == null) {
|
|
|
continue;
|
|
|
- }
|
|
|
+ }
|
|
|
$strList = explode(':', $mo->unlock_acc_id_new);
|
|
|
$unlockType = $strList[0];
|
|
|
$unlockId = $strList[1];
|
|
|
-
|
|
|
- if($unlockType == 1 && $unlockId == $gateId && $resultType == true && ctx()->gates->GateList->$gateId->pass == 0 && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)){
|
|
|
+
|
|
|
+ if ($unlockType == 1 && $unlockId == $gateId && $resultType == true && ctx()->gates->GateList->$gateId->pass == 0 && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)) {
|
|
|
ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 检测技能解锁的 2://皮肤解锁,获取到人物解锁后对应皮肤技能
|
|
|
* @param type $resultType
|
|
@@ -694,58 +728,58 @@ class FightProc {
|
|
|
foreach ($dic as $id => $mo) {
|
|
|
if ($mo->unlock_acc_id_new == null) {
|
|
|
continue;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
$strList = explode(':', $mo->unlock_acc_id_new);
|
|
|
$unlockType = $strList[0];
|
|
|
- $unlockId = $strList[1];
|
|
|
-
|
|
|
- if($unlockType != 2){
|
|
|
+ $unlockId = $strList[1];
|
|
|
+
|
|
|
+ if ($unlockType != 2) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$heroMo = GameConfig::hero_getItem($heroId);
|
|
|
$heroTypeId = $heroMo->typeID;
|
|
|
- $isUnlock = ctx()->heros->Dic->$heroId->isUnlock;
|
|
|
-
|
|
|
- if($unlockId == $heroTypeId && $isUnlock == 0 && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)){
|
|
|
+ $isUnlock = ctx()->heros->Dic->$heroId->isUnlock;
|
|
|
+
|
|
|
+ if ($unlockId == $heroTypeId && $isUnlock == 0 && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)) {
|
|
|
ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
- * 检测技能解锁的 3://玩家失败X次后解锁
|
|
|
+ * 检测技能解锁的 3://玩家失败X次后解锁
|
|
|
* @param type $resultType
|
|
|
* @param type $gateId
|
|
|
* @return type
|
|
|
*/
|
|
|
static function skillUnlock_fightNum($resultType) {
|
|
|
- if(!$resultType){
|
|
|
+ if (!$resultType) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$GateList = ctx()->gates->GateList;
|
|
|
$num = 0;
|
|
|
foreach ($GateList as $gateId => $Ins_GateInfo) {
|
|
|
$num += $Ins_GateInfo->fightNum_fail;
|
|
|
}
|
|
|
-
|
|
|
- $dic = GameConfig::skills();
|
|
|
+
|
|
|
+ $dic = GameConfig::skills();
|
|
|
foreach ($dic as $id => $mo) {
|
|
|
if ($mo->unlock_acc_id_new == null) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$strList = explode(':', $mo->unlock_acc_id_new);
|
|
|
$unlockType = $strList[0];
|
|
|
$unlockId = $strList[1];
|
|
|
-
|
|
|
- if($unlockType != 3){
|
|
|
+
|
|
|
+ if ($unlockType != 3) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
- if($num == $unlockId && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)){
|
|
|
+
|
|
|
+ if ($num == $unlockId && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)) {
|
|
|
ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
|
|
|
}
|
|
|
}
|