|
@@ -128,13 +128,18 @@ class FightProc {
|
|
$gateInfo = ctx()->gates->GateList->$gateId;
|
|
$gateInfo = ctx()->gates->GateList->$gateId;
|
|
my_Assert($gateInfo->pass, ErrCode::gate_GateNoUnlock); # 通关后解锁难度1
|
|
my_Assert($gateInfo->pass, ErrCode::gate_GateNoUnlock); # 通关后解锁难度1
|
|
my_Assert($gateInfo->tz_state + 1 >= $index, ErrCode::gate_GateNoUnlock); # 通关上一难度解锁当前难度
|
|
my_Assert($gateInfo->tz_state + 1 >= $index, ErrCode::gate_GateNoUnlock); # 通关上一难度解锁当前难度
|
|
|
|
+
|
|
|
|
+ FightProc::funUnlock_mainChallengeGate_State(true, $gateId, $index);
|
|
$gateInfo->tz_state = $index;
|
|
$gateInfo->tz_state = $index;
|
|
|
|
|
|
TaskProc::OnPassMainChallengeGate_X_Num($gateId, $index);
|
|
TaskProc::OnPassMainChallengeGate_X_Num($gateId, $index);
|
|
TaskProc::OnKillCommonNumMonster($killMonsterNum);
|
|
TaskProc::OnKillCommonNumMonster($killMonsterNum);
|
|
TaskProc::OnKillleaderNumMonster($killBossNum);
|
|
TaskProc::OnKillleaderNumMonster($killBossNum);
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
- return Resp::ok(array("task" => ctx()->task,));
|
|
|
|
|
|
+ return Resp::ok(array("task" => ctx()->task,
|
|
|
|
+ 'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
|
|
+ 'funUnlockRecord_2' => ctx()->privateState->funUnlockRecord_2,
|
|
|
|
+ ));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -579,6 +584,15 @@ class FightProc {
|
|
if ($tag) {
|
|
if ($tag) {
|
|
my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
|
|
my_Assert(!in_array($mask, $gateInfo->FirstReward), ErrCode::gate_GatePriceHasReceive);
|
|
$gateInfo->FirstReward[] = $mask;
|
|
$gateInfo->FirstReward[] = $mask;
|
|
|
|
+
|
|
|
|
+ $pStr = explode(';', $prize);
|
|
|
|
+ foreach ($pStr as $val) {
|
|
|
|
+ $arr = explode(',', $val);
|
|
|
|
+ if(GameConfig::item_getItem($arr[0]) == 201 || GameConfig::item_getItem($arr[0]) == 701){
|
|
|
|
+ FightProc::funUnlock_Gem();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
StoreProc::AddMultiItemInStore($prize);
|
|
StoreProc::AddMultiItemInStore($prize);
|
|
}
|
|
}
|
|
ctx()->gates->GateList->$gateId = $gateInfo;
|
|
ctx()->gates->GateList->$gateId = $gateInfo;
|
|
@@ -592,6 +606,8 @@ class FightProc {
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'reward' => StoreProc::$reward,
|
|
'reward' => StoreProc::$reward,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
|
+ 'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
|
|
+ 'funUnlockRecord_2' => ctx()->privateState->funUnlockRecord_2,
|
|
);
|
|
);
|
|
return Resp::ok($ret);
|
|
return Resp::ok($ret);
|
|
}
|
|
}
|
|
@@ -614,7 +630,7 @@ class FightProc {
|
|
$gateInfo->MaxSeconds = $curTs;
|
|
$gateInfo->MaxSeconds = $curTs;
|
|
}
|
|
}
|
|
|
|
|
|
- self::funUnlock($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
|
|
|
|
|
|
+ self::funUnlock_Gate($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
|
|
self::subFunUnlock($resultType, $gateId);
|
|
self::subFunUnlock($resultType, $gateId);
|
|
if ($resultType) { # 胜利
|
|
if ($resultType) { # 胜利
|
|
self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
|
|
self::skillUnlock_gate($resultType, $gateId); //备注 这个接口位置不能动
|
|
@@ -652,7 +668,7 @@ class FightProc {
|
|
$waveMo = GameConfig::waveItem_getItem($gateId, $finalLayer);
|
|
$waveMo = GameConfig::waveItem_getItem($gateId, $finalLayer);
|
|
my_Assert(null != $waveMo, ErrCode::err_const_no);
|
|
my_Assert(null != $waveMo, ErrCode::err_const_no);
|
|
$oldLevel = ctx()->baseInfo->level;
|
|
$oldLevel = ctx()->baseInfo->level;
|
|
- StoreProc::AddMultiItemInStore('4,' . $waveMo->rewardExp);
|
|
|
|
|
|
+ StoreProc::AddMultiItemInStore('4,' . $waveMo->rewardExp);
|
|
//ctx()->base()->Add_Exp($waveMo->rewardExp); # 指挥官经验
|
|
//ctx()->base()->Add_Exp($waveMo->rewardExp); # 指挥官经验
|
|
$newLevel = ctx()->baseInfo->level;
|
|
$newLevel = ctx()->baseInfo->level;
|
|
if ($oldLevel != $newLevel) {
|
|
if ($oldLevel != $newLevel) {
|
|
@@ -679,6 +695,8 @@ class FightProc {
|
|
}
|
|
}
|
|
# 宝石奖励: 数量min-max;品质:权重,品质:权重...
|
|
# 宝石奖励: 数量min-max;品质:权重,品质:权重...
|
|
if (strlen($waveMo->rewardGem) > 0) {
|
|
if (strlen($waveMo->rewardGem) > 0) {
|
|
|
|
+ self::funUnlock_Gem();
|
|
|
|
+
|
|
list($gs_num, $gs_props) = explode(';', $waveMo->rewardGem);
|
|
list($gs_num, $gs_props) = explode(';', $waveMo->rewardGem);
|
|
list($gem_min, $gem_max) = explode('-', $gs_num); # 宝石数量
|
|
list($gem_min, $gem_max) = explode('-', $gs_num); # 宝石数量
|
|
$gem_n = rand($gem_min, $gem_max);
|
|
$gem_n = rand($gem_min, $gem_max);
|
|
@@ -729,13 +747,16 @@ class FightProc {
|
|
'oldLevel' => $oldLevel,
|
|
'oldLevel' => $oldLevel,
|
|
'newLevel' => $newLevel,
|
|
'newLevel' => $newLevel,
|
|
'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
|
|
+ 'funUnlockRecord_2'=> ctx()->privateState->funUnlockRecord_2,
|
|
'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
|
|
'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
|
|
'heros' => ctx()->heros,
|
|
'heros' => ctx()->heros,
|
|
- 'subFunStartTs'=> ctx()->privateState->subFunStartTs,
|
|
|
|
|
|
+ 'subFunStartTs' => ctx()->privateState->subFunStartTs,
|
|
);
|
|
);
|
|
return Resp::ok($ret);
|
|
return Resp::ok($ret);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// <editor-fold defaultstate="collapsed" desc="功能解锁">
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 检测功能解锁的
|
|
* 检测功能解锁的
|
|
* @param type $resultType
|
|
* @param type $resultType
|
|
@@ -745,10 +766,10 @@ class FightProc {
|
|
static function funUnlock($resultType, $gateId) {
|
|
static function funUnlock($resultType, $gateId) {
|
|
$dic = GameConfig::fun_unlock();
|
|
$dic = GameConfig::fun_unlock();
|
|
foreach ($dic as $id => $mo) {
|
|
foreach ($dic as $id => $mo) {
|
|
- if ($mo->unlockTip == 1 && $mo->unlockGateId == $gateId) {
|
|
|
|
|
|
+ if ($mo->unlockTip == 1 && $mo->unlockParas1 == $gateId) {
|
|
$tag = false;
|
|
$tag = false;
|
|
//1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
//1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
- switch ($mo->unlockType) {
|
|
|
|
|
|
+ switch ($mo->unlockType1) {
|
|
case 1:
|
|
case 1:
|
|
if (ctx()->gates->GateList->$gateId->fightNum == 0) {
|
|
if (ctx()->gates->GateList->$gateId->fightNum == 0) {
|
|
$tag = true;
|
|
$tag = true;
|
|
@@ -765,12 +786,152 @@ class FightProc {
|
|
}
|
|
}
|
|
|
|
|
|
if ($tag) {
|
|
if ($tag) {
|
|
- ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
|
|
+ ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 检测功能解锁的 关卡
|
|
|
|
+ * @param type $resultType
|
|
|
|
+ * @param type $gateId
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ static function funUnlock_Gate($resultType, $gateId) {
|
|
|
|
+ $dic = GameConfig::fun_unlock();
|
|
|
|
+ foreach ($dic as $id => $mo) {
|
|
|
|
+ if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
|
|
|
|
+ $tag = false;
|
|
|
|
+ if ($mo->unlockType1 != null) {
|
|
|
|
+ //1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
|
|
+ switch ($mo->unlockType1) {
|
|
|
|
+ case Enum_FunUnlockType::battle_Gate:
|
|
|
|
+ if ($mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case Enum_FunUnlockType::passBattle_Gate:
|
|
|
|
+ if ($resultType == true && $mo->unlockParas1 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($mo->unlockType2 != null) {
|
|
|
|
+ //1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
|
|
+ switch ($mo->unlockType2) {
|
|
|
|
+ case Enum_FunUnlockType::battle_Gate:
|
|
|
|
+ if ($mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->fightNum == 0) {
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case Enum_FunUnlockType::passBattle_Gate:
|
|
|
|
+ if ($resultType == true && $mo->unlockParas2 == $gateId && ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
|
|
|
|
+ ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
+ ctx()->privateState->funUnlockRecord_2[] = $id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 初次得到宝石 功能解锁
|
|
|
|
+ */
|
|
|
|
+ static function funUnlock_Gem() {
|
|
|
|
+ $dic = GameConfig::fun_unlock();
|
|
|
|
+ foreach ($dic as $id => $mo) {
|
|
|
|
+ if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
|
|
|
|
+ $tag = false;
|
|
|
|
+ if($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::getGem && ctx()->store->gemStore == null){
|
|
|
|
+ $tag = true;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::getGem && ctx()->store->gemStore == null){
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
|
|
|
|
+ ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
+ ctx()->privateState->funUnlockRecord_2[] = $id;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 玩家等级要求 功能解锁
|
|
|
|
+ */
|
|
|
|
+ static function funUnlock_userLv($level) {
|
|
|
|
+ $dic = GameConfig::fun_unlock();
|
|
|
|
+ foreach ($dic as $id => $mo) {
|
|
|
|
+ if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
|
|
|
|
+ $tag = false;
|
|
|
|
+ if($mo->unlockType1 != null && $mo->unlockType1 == Enum_FunUnlockType::userLv && $mo->unlockParas1 == $level){
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($mo->unlockType2 != null && $mo->unlockType2 == Enum_FunUnlockType::userLv && $mo->unlockParas2 == $level){
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
|
|
|
|
+ ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
+ ctx()->privateState->funUnlockRecord_2[] = $id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 主线挑战 功能解锁
|
|
|
|
+ */
|
|
|
|
+ static function funUnlock_mainChallengeGate_State($result,$gateId,$state) {
|
|
|
|
+ $dic = GameConfig::fun_unlock();
|
|
|
|
+ foreach ($dic as $id => $mo) {
|
|
|
|
+ if ($mo->unlockTip == 1) {//$mo->unlockGateId == $gateId
|
|
|
|
+ $tag = false;
|
|
|
|
+ if($mo->unlockType1 != null && $result = true && $mo->unlockType1 == Enum_FunUnlockType::mainChallengeGate_State){
|
|
|
|
+ $str = explode(',', $mo->unlockParas1);
|
|
|
|
+ $uGateId = $str[0];
|
|
|
|
+ $gateState = $str[1];
|
|
|
|
+
|
|
|
|
+ if($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState-1){
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($mo->unlockType2 != null &&$result = true && $mo->unlockType2 == Enum_FunUnlockType::mainChallengeGate_State){
|
|
|
|
+ $str = explode(',', $mo->unlockParas2);
|
|
|
|
+ $uGateId = $str[0];
|
|
|
|
+ $gateState = $str[1];
|
|
|
|
+ if($uGateId == $gateId && StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId) && ctx()->gates->GateList->$gateId->tz_state == $gateState-1){
|
|
|
|
+ $tag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($tag && !in_array($id, ctx()->privateState->funUnlockRecord_2)) {
|
|
|
|
+ ctx()->privateState->funUnlockRecord[] = $id;
|
|
|
|
+ ctx()->privateState->funUnlockRecord_2[] = $id;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 检测次级功能解锁的
|
|
* 检测次级功能解锁的
|
|
* @param type $resultType
|
|
* @param type $resultType
|
|
@@ -812,6 +973,7 @@ class FightProc {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// </editor-fold>
|
|
// <editor-fold defaultstate="collapsed" desc="技能解锁">
|
|
// <editor-fold defaultstate="collapsed" desc="技能解锁">
|
|
|
|
|
|
/**
|
|
/**
|