fix: 도시 주둔 장수 중 해당 국가 소속만 계략 확률 감소에 영향을 주도록 수정 (#254)

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/254
This commit was merged in pull request #254.
This commit is contained in:
2024-07-08 17:01:17 +09:00
+4 -1
View File
@@ -74,12 +74,15 @@ class che_화계 extends Command\GeneralCommand
$maxGenScore = 0;
$probCorrection = 0;
$affectGeneralCount = 0;
foreach ($destCityGeneralList as $destGeneral) {
/** @var General $destGeneral */
if ($destGeneral->getNationID() != $destNationID) {
continue;
}
$affectGeneralCount++;
if ($statType === 'leadership') {
$genScore = $destGeneral->getLeadership();
} else if ($statType === 'strength') {
@@ -95,7 +98,7 @@ class che_화계 extends Command\GeneralCommand
$prob = $maxGenScore / GameConst::$sabotageProbCoefByStat;
$prob += $probCorrection;
$prob += (log(count($destCityGeneralList) + 1, 2) - 1.25) * GameConst::$sabotageDefenceCoefByGeneralCnt;
$prob += (log($affectGeneralCount + 1, 2) - 1.25) * GameConst::$sabotageDefenceCoefByGeneralCnt;
$prob += $destCity['secu'] / $destCity['secu_max'] / 5; //최대 20%p
$prob += $destCity['supply'] ? 0.1 : 0;