|
@@ -63,23 +63,23 @@ class FightProc {
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function EvolveUnlock() {
|
|
public static function EvolveUnlock() {
|
|
- list($type, $id) = req()->paras;//$id废弃 因为玩家可能不安顺序点
|
|
|
|
|
|
+ list($type, $id) = req()->paras; //$id废弃 因为玩家可能不安顺序点
|
|
|
|
|
|
if ($type == 1) {
|
|
if ($type == 1) {
|
|
- $nextId = ctx()->gates->evolveMaxId_left+1;
|
|
|
|
|
|
+ $nextId = ctx()->gates->evolveMaxId_left + 1;
|
|
my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
-
|
|
|
|
- $mo = GameConfig::evolve_getItem($nextId);
|
|
|
|
- my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
|
|
+
|
|
|
|
+ $mo = GameConfig::evolve_getItem($nextId);
|
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
my_Assert(ctx()->baseInfo->level >= $mo->level, ErrCode::evolve_canotUnlock_levelLimit);
|
|
my_Assert(ctx()->baseInfo->level >= $mo->level, ErrCode::evolve_canotUnlock_levelLimit);
|
|
my_Assert(ctx()->baseInfo->gold >= $mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
my_Assert(ctx()->baseInfo->gold >= $mo->needGold_unlock, ErrCode::notenough_gold_msg);
|
|
-
|
|
|
|
|
|
+
|
|
ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);
|
|
ctx()->baseInfo->Consume_Gold($mo->needGold_unlock);
|
|
ctx()->gates->evolveMaxId_left = $nextId;
|
|
ctx()->gates->evolveMaxId_left = $nextId;
|
|
} else {
|
|
} else {
|
|
$nextId = ctx()->gates->evolveMaxId_right + 1;
|
|
$nextId = ctx()->gates->evolveMaxId_right + 1;
|
|
my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
my_Assert($id == $nextId, ErrCode::err_const_no);
|
|
-
|
|
|
|
|
|
+
|
|
$dic = GameConfig::evolve();
|
|
$dic = GameConfig::evolve();
|
|
foreach ($dic as $key => $value) {
|
|
foreach ($dic as $key => $value) {
|
|
if ($value->specificEvolveId == $nextId) {
|
|
if ($value->specificEvolveId == $nextId) {
|
|
@@ -185,8 +185,8 @@ class FightProc {
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
$ret = array(
|
|
$ret = array(
|
|
- 'gold'=> ctx()->baseInfo->gold,
|
|
|
|
- 'cash'=> ctx()->baseInfo->cash,
|
|
|
|
|
|
+ 'gold' => ctx()->baseInfo->gold,
|
|
|
|
+ 'cash' => ctx()->baseInfo->cash,
|
|
'tili' => ctx()->baseInfo->tili,
|
|
'tili' => ctx()->baseInfo->tili,
|
|
'tili_ts' => ctx()->baseInfo->tili_ts,
|
|
'tili_ts' => ctx()->baseInfo->tili_ts,
|
|
'xp' => ctx()->baseInfo->xp,
|
|
'xp' => ctx()->baseInfo->xp,
|
|
@@ -271,7 +271,7 @@ class FightProc {
|
|
ctx()->gates()->TowerGateInfo()->TodayChanNum--; # 增加次数
|
|
ctx()->gates()->TowerGateInfo()->TodayChanNum--; # 增加次数
|
|
} else { # 主线剧情
|
|
} else { # 主线剧情
|
|
my_Assert(ctx()->base()->Consume_tili($mo->cost_tili), ErrCode::notenough_tili);
|
|
my_Assert(ctx()->base()->Consume_tili($mo->cost_tili), ErrCode::notenough_tili);
|
|
- }
|
|
|
|
|
|
+ }
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array("tili" => ctx()->baseInfo->tili, "tili_ts" => ctx()->baseInfo->tili_ts));
|
|
return Resp::ok(array("tili" => ctx()->baseInfo->tili, "tili_ts" => ctx()->baseInfo->tili_ts));
|
|
}
|
|
}
|
|
@@ -507,9 +507,11 @@ class FightProc {
|
|
if ($curTs >= $ts) {
|
|
if ($curTs >= $ts) {
|
|
$gateInfo->MaxSeconds = $curTs;
|
|
$gateInfo->MaxSeconds = $curTs;
|
|
}
|
|
}
|
|
-
|
|
|
|
- self::funUnlock($resultType, $gateId);//备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
|
|
|
|
|
|
+
|
|
|
|
+ self::funUnlock($resultType, $gateId); //备注:这个接口的位置不能动 里面有关卡第一次胜利解锁的功能提示校验
|
|
if ($resultType) { # 胜利
|
|
if ($resultType) { # 胜利
|
|
|
|
+ self::skillUnlock_gate($resultType, $gateId);//备注 这个接口位置不能动
|
|
|
|
+
|
|
if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
ctx()->gates->GateList->$gateId->pass = 1;
|
|
ctx()->gates->GateList->$gateId->pass = 1;
|
|
TaskProc::Day7TaskReset($gateId); # 刷新七日任务
|
|
TaskProc::Day7TaskReset($gateId); # 刷新七日任务
|
|
@@ -531,6 +533,7 @@ class FightProc {
|
|
// StoreProc::AddMultiItemInStore($gateMo->reward_win); # 发放胜利奖励(2024.5.30 过期)
|
|
// StoreProc::AddMultiItemInStore($gateMo->reward_win); # 发放胜利奖励(2024.5.30 过期)
|
|
} else {
|
|
} else {
|
|
ctx()->gates->GateList->$gateId->fightNum_fail += 1;
|
|
ctx()->gates->GateList->$gateId->fightNum_fail += 1;
|
|
|
|
+ self::skillUnlock_fightNum($resultType);//这个接口位置不能动
|
|
}
|
|
}
|
|
// else { # 失败
|
|
// else { # 失败
|
|
//// StoreProc::AddMultiItemInStore($gateMo->reward_fail); # 发放失败奖励(2024.5.30 过期)
|
|
//// StoreProc::AddMultiItemInStore($gateMo->reward_fail); # 发放失败奖励(2024.5.30 过期)
|
|
@@ -593,7 +596,7 @@ class FightProc {
|
|
}
|
|
}
|
|
|
|
|
|
ctx()->gates->GateList->$gateId->fightNum += 1;
|
|
ctx()->gates->GateList->$gateId->fightNum += 1;
|
|
-
|
|
|
|
|
|
+
|
|
TaskProc::OnFightNumMainGate();
|
|
TaskProc::OnFightNumMainGate();
|
|
TaskProc::OnKillCommonNumMonster($killMonsterNum);
|
|
TaskProc::OnKillCommonNumMonster($killMonsterNum);
|
|
TaskProc::OnKillleaderNumMonster($killBossNum);
|
|
TaskProc::OnKillleaderNumMonster($killBossNum);
|
|
@@ -611,46 +614,135 @@ class FightProc {
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'oldLevel' => $oldLevel,
|
|
'oldLevel' => $oldLevel,
|
|
'newLevel' => $newLevel,
|
|
'newLevel' => $newLevel,
|
|
- 'funUnlockRecord'=> ctx()->privateState->funUnlockRecord,
|
|
|
|
- 'skillUnlockRecord'=> ctx()->privateState->skillUnlockRecord,
|
|
|
|
|
|
+ 'funUnlockRecord' => ctx()->privateState->funUnlockRecord,
|
|
|
|
+ 'skillUnlockRecord' => ctx()->privateState->skillUnlockRecord,
|
|
);
|
|
);
|
|
return Resp::ok($ret);
|
|
return Resp::ok($ret);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 检测功能解锁的
|
|
* 检测功能解锁的
|
|
* @param type $resultType
|
|
* @param type $resultType
|
|
* @param type $gateId
|
|
* @param type $gateId
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
- static function funUnlock($resultType,$gateId) {
|
|
|
|
- $dic = GameConfig::fun_unlock();
|
|
|
|
|
|
+ static function funUnlock($resultType, $gateId) {
|
|
|
|
+ $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->unlockGateId == $gateId) {
|
|
$tag = false;
|
|
$tag = false;
|
|
//1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
//1:参与战斗结束即可 2战斗胜利 3某场战斗参加N次数才行
|
|
switch ($mo->unlockType) {
|
|
switch ($mo->unlockType) {
|
|
case 1:
|
|
case 1:
|
|
- if(ctx()->gates->GateList->$gateId->fightNum == 0){
|
|
|
|
|
|
+ if (ctx()->gates->GateList->$gateId->fightNum == 0) {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
- if($resultType == true && ctx()->gates->GateList->$gateId->pass == 0){
|
|
|
|
|
|
+ if ($resultType == true && ctx()->gates->GateList->$gateId->pass == 0) {
|
|
$tag = true;
|
|
$tag = true;
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
- }
|
|
|
|
-
|
|
|
|
- if($tag){
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ($tag) {
|
|
ctx()->privateState->funUnlockRecord[] = $id;
|
|
ctx()->privateState->funUnlockRecord[] = $id;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 检测技能解锁的 1 关卡解锁,游玩到一定关卡解锁技能
|
|
|
|
+ * @param type $resultType
|
|
|
|
+ * @param type $gateId
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ static function skillUnlock_gate($resultType, $gateId) {
|
|
|
|
+ $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 == 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
|
|
|
|
+ * @param type $gateId
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ static function skillUnlock_heroUnlock($heroId) {
|
|
|
|
+ $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 != 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)){
|
|
|
|
+ ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 检测技能解锁的 3://玩家失败X次后解锁
|
|
|
|
+ * @param type $resultType
|
|
|
|
+ * @param type $gateId
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ static function skillUnlock_fightNum($resultType) {
|
|
|
|
+ if(!$resultType){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $GateList = ctx()->gates->GateList;
|
|
|
|
+ $num = 0;
|
|
|
|
+ foreach ($GateList as $gateId => $Ins_GateInfo) {
|
|
|
|
+ $num += $Ins_GateInfo->fightNum_fail;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $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){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($num == $unlockId && !in_array($mo->typeId, ctx()->privateState->skillUnlockRecord)){
|
|
|
|
+ ctx()->privateState->skillUnlockRecord[] = $mo->typeId;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="排行榜">
|
|
// <editor-fold defaultstate="collapsed" desc="排行榜">
|