내정 상승량 공식 변경

- 성공/실패 수식 대폭 변경(무지장 너프)
  - 스탯이 낮을 수록 성공이 잘 뜸. (실패도 잘 뜸)
- 일반 무장/지장 평균 내정량 상승
- 민심이 필요한 내정도 '성공 확률'만 낮아지는 형태로 변경
This commit is contained in:
2018-03-11 21:54:36 +09:00
parent ae6ddd079b
commit 0a81754f7e
+64 -43
View File
@@ -108,27 +108,41 @@ function getGeneralIntel(&$general, $withInjury, $withItem, $withStatAdjust, $us
* @return array 계산된 실패, 성공 확률 ('succ' => 성공 확률, 'fail' => 실패 확률)
*/
function CriticalRatioDomestic(&$general, $type) {
$leader = getGeneralLeadership($general, false, true, false, false);
$power = getGeneralPower($general, false, true, false, false);
$intel = getGeneralIntel($general, false, true, false, false);
$leader = getGeneralLeadership($general, false, true, true, false);
$power = getGeneralPower($general, false, true, true, false);
$intel = getGeneralIntel($general, false, true, true, false);
$avg = ($leader+$power+$intel) / 3;
// 707010장수 18/21% 706515장수 16/27% 706020장수 14/33% xx50xx장수 10/50%
/*
* 능력치가 높아질 수록 성공 확률 감소. 실패 확률도 감소
* 무력 내정 기준(지력 내정 방식과 구조 동일)
756510(32%/30%), 707010(28%/25%), 657510(23%/20%)
106575(23%/20%), 107070(20%/17%), 107565(17%/15%)
506040(33%/30%), 505050(43%/40%), 504060(50%/50%)
* 통솔 내정 기준
756510(25%/22%), 707010(31%/28%), 657510(38%,35%),
505050(50%,50%), 107070(50%,50%)
*/
switch($type) {
case 0: $ratio = $avg / $leader; break;
case 1: $ratio = $avg / $power; break;
case 2: $ratio = $avg / $intel; break;
}
if($ratio > 1) $ratio = 1;
$ratio = min($ratio, 1.2);
$r[fail] = (0.2 / $ratio - 0.1) * 100;
$r[succ] = ($ratio - 0.5) * 100;
$fail = power($ratio / 1.2, 1.4) - 0.3;
$succ = power($ratio / 1.2, 1.5) - 0.25;
if($r[fail] < 0) { $r[fail] = 0; }
$r[succ] += $r[fail];
if($r[succ] > 100) { $r[succ] = 100; }
$fail = min(max($fail, 0), 0.5);
$succ = min(max($succ, 0), 0.5);
return $r;
return array(
'succ'=>$succ,
'fail'=>$fail
);
}
/**
@@ -154,10 +168,10 @@ function setLeadershipBonus(&$general, $nationLevel){
function CriticalScore($score, $type) {
switch($type) {
case 0:
$ratio = (rand()%9 + 20)/10; // 2.0~2.8
$ratio = randF()*0.8 + 2.2; // 2.2~3.0
break;
case 1:
$ratio = (rand()%3 + 2)/10; // 0.2~0.4
$ratio = randF()*0.2 + 0.2; // 0.2~0.4
break;
}
return round($score * $ratio);
@@ -214,20 +228,21 @@ function process_1($connect, &$general, $type) {
// 군사 보정
if($general[level] == 3 && $general[no] == $city[gen2]) { $score *= 1.05; }
$rd = rand() % 100;
$rd = randF();
$r = CriticalRatioDomestic($general, 2);
// 특기보정 : 경작, 상재
if($type == 1 && $general[special] == 1) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($type == 2 && $general[special] == 2) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($type == 1 && $general['special'] == 1) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 2) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}{$atype} <O>실패</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city[rate] >= 80 && $r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}{$atype} <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -302,18 +317,20 @@ function process_3($connect, &$general) {
// 군주, 참모, 모사 보정
if($general[level] == 12 || $general[level] == 11 || $general[level] == 9 || $general[level] == 7 || $general[level] == 5) { $score *= 1.05; }
$rd = rand() % 100;
$r = CriticalRatioDomestic($general, 0);
$rd = randF();
$r = CriticalRatioDomestic($general, 2);
// 특기보정 : 발명
if($general[special] == 3) { $score *= 1.1; $admin[develcost] *= 0.8; $r[succ] += 10; }
if($general['special'] == 3) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}를 <O>실패</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city[rate] >= 80 && $r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}를 <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -397,18 +414,18 @@ function process_4($connect, &$general) {
// 시중 보정
if($general[level] == 2 && $general[no] == $city[gen3]) { $score *= 1.05; }
$rd = rand() % 100;
$rd = randF();
$r = CriticalRatioDomestic($general, 0);
// 특기보정 : 인덕
if($general[special] == 20) { $r[succ] += 10; $admin[develcost] *= 0.8; $score *= 1.1; }
if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:선정을 <O>실패</>하여 민심이 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:선정을 <S>성공</>하여 민심이 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -492,19 +509,21 @@ function process_5($connect, &$general, $type) {
// 태수 보정
if($general[level] == 4 && $general[no] == $city[gen1]) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$r = CriticalRatioDomestic($general, 0);
$rd = randF();
$r = CriticalRatioDomestic($general, 1);
// 특기보정 : 수비, 축성
if($type == 1 && $general[special] == 11) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($type == 2 && $general[special] == 10) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($type == 1 && $general['special'] == 11) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
if($type == 2 && $general['special'] == 10) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}를 <O>실패</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} elseif($city[rate] >= 80 && $r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}를 <S>성공</>하여 <C>$score</> 상승했습니다. <1>$date</>";
} else {
@@ -581,18 +600,18 @@ function process_7($connect, &$general) {
// 시중 보정
if($general[level] == 2 && $general[no] == $city[gen3]) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$rd = randF();
$r = CriticalRatioDomestic($general, 0);
// 특기보정 : 인덕
if($general[special] == 20) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($general['special'] == 20) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:장려를 <O>실패</>하여 주민이 <C>{$score}0</>명 증가했습니다. <1>$date</>";
} elseif($r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:장려를 <S>성공</>하여 주민이 <C>{$score}0</>명 증가했습니다. <1>$date</>";
} else {
@@ -675,18 +694,20 @@ function process_8($connect, &$general) {
// 태수 보정
if($general[level] == 4 && $general[no] == $city[gen1]) { $score *= 1.05; }
$rd = rand() % 100; // 현재 20%
$r = CriticalRatioDomestic($general, 0);
$rd = randF();
$r = CriticalRatioDomestic($general, 1);
// 특기보정 : 통찰
if($general[special] == 12) { $r[succ] += 10; $score *= 1.1; $admin[develcost] *= 0.8; }
if($general['special'] == 12) { $r['succ'] += 0.1; $score *= 1.1; $admin['develcost'] *= 0.8; }
//민심 반영
if($city['rate'] < 80) { $r['succ'] *= $city['rate'] / 80; }
//버그방지
if($score < 1) $score = 1;
if($r[fail] > $rd) {
if($r['fail'] > $rd) {
$score = CriticalScore($score, 1);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}을 <O>실패</>하여 <C>$score</> 강화했습니다. <1>$date</>";
} elseif($city[rate] >= 80 && $r[succ] > $rd) {
} elseif($r['succ'] + $r['fail'] > $rd) {
$score = CriticalScore($score, 0);
$log[count($log)] = "<C>●</>{$admin[month]}월:{$dtype}을 <S>성공</>하여 <C>$score</> 강화했습니다. <1>$date</>";
} else {