커밋 취소

This commit is contained in:
2019-03-09 00:39:13 +09:00
parent 78da30f2ad
commit b7e432228b
+3 -9
View File
@@ -312,18 +312,9 @@ function process_29(&$general) {
$total_gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2');
$total_npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4');
$gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']);
$npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']);
$curr_cnt = Util::toInt($total_gen_cnt + $total_npc_cnt / 2);
$remain_slot = $max_gen_cnt - $curr_cnt;
if($npc_cnt < 2){
$found_prop = 1 / ($npc_cnt + 1);
}
else{
$found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt);
}
$found_prop = max(pow($remain_slot / $max_gen_cnt, 5), 1 / $max_gen_cnt);
$found_npc = Util::randBool($found_prop);
@@ -358,6 +349,9 @@ function process_29(&$general) {
$name = "{$name}{$count}";
}
$gen_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc <= 2 AND nation = %i', $general['nation']);
$npc_cnt = $db->queryFirstField('SELECT count(`no`) FROM general WHERE 3 <= npc AND npc <= 4 AND nation = %i', $general['nation']);
$join_prop = 0.3 + 0.7 * (($gen_cnt + $npc_cnt / 2) / $curr_cnt);
if($nation['scout'] != 0 || !Util::randBool($join_prop)) {