전쟁/선포 중인 국가에 선포 확률 대폭 감소
This commit is contained in:
+26
-2
@@ -1723,7 +1723,15 @@ class GeneralAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$lowTargetNations = Util::convertArrayToSetLike($db->queryFirstColumn(
|
||||||
|
'SELECT DISTINCT(me) FROM diplomacy WHERE me != %i AND state IN %li',
|
||||||
|
$nationID,
|
||||||
|
[0, 1]
|
||||||
|
));
|
||||||
|
|
||||||
$nations = [];
|
$nations = [];
|
||||||
|
$warNations = [];
|
||||||
foreach(getAllNationStaticInfo() as $destNation){
|
foreach(getAllNationStaticInfo() as $destNation){
|
||||||
if($destNation['level'] == 0){
|
if($destNation['level'] == 0){
|
||||||
continue;
|
continue;
|
||||||
@@ -1733,10 +1741,26 @@ class GeneralAI
|
|||||||
if (!isNeighbor($nationID, $destNationID)) {
|
if (!isNeighbor($nationID, $destNationID)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$nations[$destNationID] = 1 / sqrt($destNationPower + 1);
|
|
||||||
|
if(!key_exists($destNationID, $lowTargetNations)){
|
||||||
|
$nations[$destNationID] = 1 / sqrt($destNationPower + 1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$warNations[$destNationID] = 1 / sqrt($destNationPower + 1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!$nations) {
|
if (!$nations) {
|
||||||
return null;
|
if(!$warNations){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if(!$lowTargetNations){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if(Util::randBool(1/count($lowTargetNations))){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$nations = $warNations;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = buildNationCommandClass('che_선전포고', $this->general, $this->env, $lastTurn, [
|
$cmd = buildNationCommandClass('che_선전포고', $this->general, $this->env, $lastTurn, [
|
||||||
|
|||||||
Reference in New Issue
Block a user