|
@@ -632,71 +632,70 @@ class FightProc {
|
|
|
return Resp::ok($ret);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * [6801]关卡战斗结算
|
|
|
- * @return type
|
|
|
- */
|
|
|
- public static function Settle_bak() {
|
|
|
- list($resultType, $gateId, $gold, $curTs, $pickups) = req()->paras;
|
|
|
- # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
|
|
|
- $gateMo = GameConfig::gate_getItem($gateId);
|
|
|
- my_Assert($gateMo != null, ErrCode::err_const_no);
|
|
|
- my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::gate_NoUserGateInfo);
|
|
|
- $gateInfo = ctx()->gates->GateList->$gateId;
|
|
|
- $ts = $gateInfo->MaxSeconds;
|
|
|
- if ($curTs >= $ts) {
|
|
|
- $gateInfo->MaxSeconds = $curTs;
|
|
|
- }
|
|
|
- if ($resultType) { # 胜利
|
|
|
- if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
- ctx()->gates->GateList->$gateId->pass = 1;
|
|
|
- TaskProc::Day7TaskReset($gateId);
|
|
|
- }
|
|
|
- TaskProc::OnPassGate_X($gateId);
|
|
|
- StoreProc::AddMultiItemInStore($gateMo->reward_win);
|
|
|
- if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
|
|
|
- ctx()->gates->UnlockNextPlotGate();
|
|
|
- $dic = GameConfig::gate();
|
|
|
- $index = 0; # 挑战关卡解锁逻辑. -gwang 2024年4月15日
|
|
|
- foreach ($dic as $id => $item) {
|
|
|
- if (Ins_GateInfo::GateTypeFromId($id) == Enum_GateType::MainChallengeGate && $item->challengeGateId == $gateId) {
|
|
|
- $index += 1;
|
|
|
- $gate = new Ins_GateInfo();
|
|
|
- $gate->GateId = $id;
|
|
|
- ctx()->gates->GateList->$id = $gate;
|
|
|
- }
|
|
|
- if ($index >= 3) {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
-
|
|
|
- }
|
|
|
- } else { # 失败
|
|
|
- StoreProc::AddMultiItemInStore($gateMo->reward_fail);
|
|
|
- }
|
|
|
-
|
|
|
- StoreProc::AddMultiItemInStore($pickups); # 战场拾取道具
|
|
|
- ctx()->baseInfo->Add_Gold($gold);
|
|
|
- //ctx()->baseInfo->Add_Exp($exp);
|
|
|
-
|
|
|
- if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
|
|
|
- TaskProc::OnFightNumMainGate();
|
|
|
- } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) {
|
|
|
- TaskProc::OnFightNumChallengeGate();
|
|
|
- }
|
|
|
- TaskProc::OnKillCommonNumMonster(1000);
|
|
|
- TaskProc::OnKillleaderNumMonster(500);
|
|
|
-
|
|
|
- UserProc::updateUserInfo();
|
|
|
- $ret = array(
|
|
|
- 'gates' => ctx()->gates,
|
|
|
- 'store' => ctx()->store,
|
|
|
- 'task' => ctx()->task,
|
|
|
- );
|
|
|
- return Resp::ok($ret);
|
|
|
- }
|
|
|
-
|
|
|
+// /**
|
|
|
+// * [6801]关卡战斗结算
|
|
|
+// * @return type
|
|
|
+// */
|
|
|
+// public static function Settle_bak() {
|
|
|
+// list($resultType, $gateId, $gold, $curTs, $pickups) = req()->paras;
|
|
|
+// # 客户端需要增加参数: killmonserNum,killBosssNum, finalHpPercent(最终血量百分比)
|
|
|
+// $gateMo = GameConfig::gate_getItem($gateId);
|
|
|
+// my_Assert($gateMo != null, ErrCode::err_const_no);
|
|
|
+// my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList, $gateId), ErrCode::gate_NoUserGateInfo);
|
|
|
+// $gateInfo = ctx()->gates->GateList->$gateId;
|
|
|
+// $ts = $gateInfo->MaxSeconds;
|
|
|
+// if ($curTs >= $ts) {
|
|
|
+// $gateInfo->MaxSeconds = $curTs;
|
|
|
+// }
|
|
|
+// if ($resultType) { # 胜利
|
|
|
+// if (ctx()->gates->GateList->$gateId->pass == 0) {
|
|
|
+// ctx()->gates->GateList->$gateId->pass = 1;
|
|
|
+// TaskProc::Day7TaskReset($gateId);
|
|
|
+// }
|
|
|
+// TaskProc::OnPassGate_X($gateId);
|
|
|
+// StoreProc::AddMultiItemInStore($gateMo->reward_win);
|
|
|
+// if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
|
|
|
+// ctx()->gates->UnlockNextPlotGate();
|
|
|
+// $dic = GameConfig::gate();
|
|
|
+// $index = 0; # 挑战关卡解锁逻辑. -gwang 2024年4月15日
|
|
|
+// foreach ($dic as $id => $item) {
|
|
|
+// if (Ins_GateInfo::GateTypeFromId($id) == Enum_GateType::MainChallengeGate && $item->challengeGateId == $gateId) {
|
|
|
+// $index += 1;
|
|
|
+// $gate = new Ins_GateInfo();
|
|
|
+// $gate->GateId = $id;
|
|
|
+// ctx()->gates->GateList->$id = $gate;
|
|
|
+// }
|
|
|
+// if ($index >= 3) {
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+//
|
|
|
+// }
|
|
|
+// } else { # 失败
|
|
|
+// StoreProc::AddMultiItemInStore($gateMo->reward_fail);
|
|
|
+// }
|
|
|
+//
|
|
|
+// StoreProc::AddMultiItemInStore($pickups); # 战场拾取道具
|
|
|
+// ctx()->baseInfo->Add_Gold($gold);
|
|
|
+// //ctx()->baseInfo->Add_Exp($exp);
|
|
|
+//
|
|
|
+// if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainStoryGate) {
|
|
|
+// TaskProc::OnFightNumMainGate();
|
|
|
+// } else if (Ins_GateInfo::GateTypeFromId($gateId) == Enum_GateType::MainChallengeGate) {
|
|
|
+// TaskProc::OnFightNumChallengeGate();
|
|
|
+// }
|
|
|
+// TaskProc::OnKillCommonNumMonster(1000);
|
|
|
+// TaskProc::OnKillleaderNumMonster(500);
|
|
|
+//
|
|
|
+// UserProc::updateUserInfo();
|
|
|
+// $ret = array(
|
|
|
+// 'gates' => ctx()->gates,
|
|
|
+// 'store' => ctx()->store,
|
|
|
+// 'task' => ctx()->task,
|
|
|
+// );
|
|
|
+// return Resp::ok($ret);
|
|
|
+// }
|
|
|
// <editor-fold defaultstate="collapsed" desc="排行榜">
|
|
|
|
|
|
/**
|
|
@@ -1032,37 +1031,38 @@ class FightProc {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/*
|
|
|
* 统计战力 战斗力=0.75*攻击+0.12*生命+1*伤害减免+1*攻击速度+2*暴击伤害倍率
|
|
|
*/
|
|
|
+
|
|
|
public static function countUserFightPower() {
|
|
|
$CurrentHeroId = ctx()->heros->CurrentHeroId;
|
|
|
//$hero = ctx()->heros->Dic->$CurrentHeroId;
|
|
|
-
|
|
|
+
|
|
|
$mo = GameConfig::hero_getItem($CurrentHeroId);
|
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
-
|
|
|
+
|
|
|
$heroBashAttack = $mo->attack;
|
|
|
$heroBashHp = $mo->hp;
|
|
|
-
|
|
|
+
|
|
|
$equipDic = ctx()->store->equip;
|
|
|
$attck = 0;
|
|
|
$hp = 0;
|
|
|
foreach ($equipDic as $index => $ins_equip) {
|
|
|
- $attck += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->attckNum;
|
|
|
+ $attck += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->attckNum;
|
|
|
$hp += GameConfig::equip_levelupgrade_getItem($ins_equip->level)->hpNum;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$heroAttck = $heroBashAttack + $attck;
|
|
|
$heroHp = $heroBashHp + $hp;
|
|
|
-
|
|
|
+
|
|
|
$dec_demage = $mo->dec_demage;
|
|
|
$bigHit_Val = $mo->bigHit_Val;
|
|
|
$mul_bullet_speed = $mo->mul_bullet_speed;
|
|
|
-
|
|
|
- $val = 0.75*$heroAttck+0.12*$heroHp+1*$dec_demage+1*$mul_bullet_speed+2*$$bigHit_Val;
|
|
|
-
|
|
|
+
|
|
|
+ $val = 0.75 * $heroAttck + 0.12 * $heroHp + 1 * $dec_demage + 1 * $mul_bullet_speed + 2 * $$bigHit_Val;
|
|
|
+
|
|
|
return intval($val);
|
|
|
}
|
|
|
|