|
@@ -255,19 +255,21 @@ class FightProc {
|
|
*/
|
|
*/
|
|
public static function FightSweep() {
|
|
public static function FightSweep() {
|
|
//list($gateId) = req()->paras;
|
|
//list($gateId) = req()->paras;
|
|
|
|
+// 2024.12.17 扫荡修改: 前3次免费, 后面可以一直看广告免费.
|
|
|
|
|
|
- $passGateId = ctx()->gates->maxPassGateId();
|
|
|
|
- my_Assert($passGateId != 0, ErrCode::gate_NoSweep);
|
|
|
|
- $mo = GameConfig::gate_getItem($passGateId);
|
|
|
|
|
|
+ $passGateId = ctx()->gates->maxPassGateId(); # 最高通关关卡id
|
|
|
|
+ my_Assert($passGateId != 0, ErrCode::gate_NoSweep); # 还没有通关关卡
|
|
|
|
+ $mo = GameConfig::gate_getItem($passGateId); # 关卡配置数据
|
|
|
|
+ my_Assert(null != $mo, ErrCode::err_const_no); # 防御: 关卡配置找不到
|
|
$gateName = $mo->gateName;
|
|
$gateName = $mo->gateName;
|
|
$costTili = glc()->sweep_cost_tili;
|
|
$costTili = glc()->sweep_cost_tili;
|
|
$curTili = ctx()->baseInfo->CurTili();
|
|
$curTili = ctx()->baseInfo->CurTili();
|
|
- my_Assert($curTili >= $costTili, ErrCode::notenough_tili);
|
|
|
|
-
|
|
|
|
- if (ctx()->privateState->honourCardShop_ts == 0) {
|
|
|
|
- $max = glc()->sweepMaxNum;
|
|
|
|
- my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
|
|
|
|
- }
|
|
|
|
|
|
+ my_Assert($curTili >= $costTili, ErrCode::notenough_tili); # 检查: 体力不足
|
|
|
|
+ # 2024.12.17 去掉了次数限制, 故这段废弃
|
|
|
|
+// if (ctx()->privateState->honourCardShop_ts == 0) {
|
|
|
|
+// $max = glc()->sweepMaxNum;
|
|
|
|
+// my_Assert(ctx()->gates->fightSweepNum < $max, ErrCode::gate_SweepMaxNum_limit);
|
|
|
|
+// }
|
|
|
|
|
|
ctx()->gates->fightSweepNum += 1;
|
|
ctx()->gates->fightSweepNum += 1;
|
|
ctx()->baseInfo->Consume_tili($costTili);
|
|
ctx()->baseInfo->Consume_tili($costTili);
|
|
@@ -304,9 +306,9 @@ class FightProc {
|
|
|
|
|
|
if ($wavesMo->rewardItem != null) {
|
|
if ($wavesMo->rewardItem != null) {
|
|
$reward = StoreProc::Distribute_Rewards($wavesMo->rewardItem);
|
|
$reward = StoreProc::Distribute_Rewards($wavesMo->rewardItem);
|
|
- StoreProc::AddMultiItemInStore($reward);
|
|
|
|
|
|
+ StoreProc::AddMultiItemInStore($reward);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if ($wavesMo->rewardGem != null) {
|
|
if ($wavesMo->rewardGem != null) {
|
|
$goodsStr = self::sweepRandReward($wavesMo->rewardGem);
|
|
$goodsStr = self::sweepRandReward($wavesMo->rewardGem);
|
|
$str = explode(';', $goodsStr);
|
|
$str = explode(';', $goodsStr);
|
|
@@ -426,6 +428,9 @@ class FightProc {
|
|
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));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 战斗模块 - 每日清理变量
|
|
|
|
+ */
|
|
public static function FightDailyClear() {
|
|
public static function FightDailyClear() {
|
|
//ctx()->gates->xunluo_quick_buyRecord = 0;
|
|
//ctx()->gates->xunluo_quick_buyRecord = 0;
|
|
ctx()->gates->fightSweepNum = 0;
|
|
ctx()->gates->fightSweepNum = 0;
|
|
@@ -625,9 +630,8 @@ 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;
|
|
StoreProc::AddMultiItemInStore($prize);
|
|
StoreProc::AddMultiItemInStore($prize);
|
|
-
|
|
|
|
}
|
|
}
|
|
ctx()->gates->GateList->$gateId = $gateInfo;
|
|
ctx()->gates->GateList->$gateId = $gateInfo;
|
|
TaskProc::OnReceiveGateBoxReward();
|
|
TaskProc::OnReceiveGateBoxReward();
|
|
@@ -721,7 +725,7 @@ class FightProc {
|
|
if ($waveMo->rewardItem != null) {
|
|
if ($waveMo->rewardItem != null) {
|
|
$reward = StoreProc::Distribute_Rewards($waveMo->rewardItem);
|
|
$reward = StoreProc::Distribute_Rewards($waveMo->rewardItem);
|
|
StoreProc::AddMultiItemInStore($reward);
|
|
StoreProc::AddMultiItemInStore($reward);
|
|
-
|
|
|
|
|
|
+
|
|
// if(count(StoreProc::$reward_equip) > 0){
|
|
// if(count(StoreProc::$reward_equip) > 0){
|
|
// self::funUnlock_equip_firstTime();
|
|
// self::funUnlock_equip_firstTime();
|
|
// }
|
|
// }
|
|
@@ -1043,7 +1047,7 @@ class FightProc {
|
|
if ($mo->funTypeId == 5 && $mo->id == Enum_SubFunType::Day7_Sign) {
|
|
if ($mo->funTypeId == 5 && $mo->id == Enum_SubFunType::Day7_Sign) {
|
|
ActiveProc::DailyResetDay7Task(true);
|
|
ActiveProc::DailyResetDay7Task(true);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if ($mo->funTypeId == 21 && $mo->id == Enum_SubFunType::Day7_Sign_NewPlayer) {
|
|
if ($mo->funTypeId == 21 && $mo->id == Enum_SubFunType::Day7_Sign_NewPlayer) {
|
|
ActiveProc::InitDay7_Sign_NewPlayer(true);
|
|
ActiveProc::InitDay7_Sign_NewPlayer(true);
|
|
ctx()->privateState->day7_drawed_newPlayer_startTs = now();
|
|
ctx()->privateState->day7_drawed_newPlayer_startTs = now();
|