- 유산 포인트 - 기수 뒤로도 누적되는 포인트 - 생존, 최대 임관년 수, 최대 연속 내정 성공, 병종 상성 우위 횟수, 전투 횟수, 계략 성공 횟수, 천통 기여(규모 상승, 천통 수뇌, 천통 군주), 숙련도, 토너먼트, 베팅 당첨 - 유산 관리 페이지 제공 - 태수국 - 181년 1월에 자동 생성되는 u장수국 - 시간이 지나면 사실상 자동 소멸 - 유저국과는 4칸 거리, 서로는 2칸 거리 - 이 시스템으로 인해 m장 거병 차단 - NPC 원조시 불가침 - 1년 세수만큼 받은 경우 24개월 불가침 제안 - 최소 6개월 - 불가침을 받지 않고 추가 원조한 경우 계속해서 기간 상승 - 단, 불가침 수락 전에 선포를 할 수 있음 Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/187 Co-authored-by: hide_d <hided62@gmail.com> Co-committed-by: hide_d <hided62@gmail.com>
287 lines
9.0 KiB
PHP
287 lines
9.0 KiB
PHP
<?php
|
|
namespace sammo;
|
|
|
|
class AutorunNationPolicy {
|
|
|
|
// 수뇌 행동
|
|
static $부대전방발령 = '부대전방발령';
|
|
static $부대후방발령 = '부대후방발령';
|
|
static $부대구출발령 = '부대구출발령';
|
|
|
|
static $부대유저장후방발령 = '부대유저장후방발령';
|
|
static $유저장후방발령 = '유저장후방발령';
|
|
static $유저장전방발령 = '유저장전방발령';
|
|
static $유저장구출발령 = '유저장구출발령';
|
|
static $유저장내정발령 = '유저장내정발령';
|
|
|
|
static $NPC후방발령 = 'NPC후방발령';
|
|
static $NPC전방발령 = 'NPC전방발령';
|
|
static $NPC구출발령 = 'NPC구출발령';
|
|
static $NPC내정발령 = 'NPC내정발령';
|
|
|
|
static $유저장긴급포상 = '유저장긴급포상';
|
|
static $유저장포상 = '유저장포상';
|
|
//static $유저장몰수 = '유저장몰수';
|
|
|
|
static $NPC긴급포상 = 'NPC긴급포상';
|
|
static $NPC포상 = 'NPC포상';
|
|
static $NPC몰수 = 'NPC몰수';
|
|
|
|
// 군주 행동
|
|
static $불가침제의 = '불가침제의';
|
|
static $선전포고 = '선전포고';
|
|
static $천도 = '천도';
|
|
|
|
|
|
|
|
//실제 행동
|
|
static public $defaultPriority = [
|
|
'불가침제의',
|
|
'선전포고',
|
|
'천도',
|
|
|
|
'유저장긴급포상',
|
|
'부대전방발령',
|
|
'유저장구출발령',
|
|
|
|
'유저장후방발령',
|
|
'부대유저장후방발령',
|
|
|
|
'유저장전방발령',
|
|
'유저장포상',
|
|
|
|
//'유저장몰수',
|
|
'부대구출발령',
|
|
'부대후방발령',
|
|
|
|
'NPC긴급포상',
|
|
'NPC구출발령',
|
|
'NPC후방발령',
|
|
|
|
'NPC포상',
|
|
|
|
'NPC전방발령',
|
|
|
|
'유저장내정발령',
|
|
'NPC내정발령',
|
|
'NPC몰수',
|
|
];
|
|
|
|
//순서는 중요하지 않음
|
|
static public $availableInstantTurn = [
|
|
'유저장긴급포상'=>true,
|
|
'유저장구출발령'=>true,
|
|
'유저장후방발령'=>true,
|
|
'유저장전방발령'=>true,
|
|
'유저장내정발령'=>true,
|
|
'유저장포상'=>true,
|
|
'NPC긴급포상'=>true,
|
|
'NPC구출발령'=>true,
|
|
'NPC후방발령'=>true,
|
|
'NPC내정발령'=>true,
|
|
'NPC포상'=>true,
|
|
'NPC전방발령'=>true,
|
|
];
|
|
|
|
public $priority = [];
|
|
|
|
public $can부대전방발령 = true;
|
|
public $can부대후방발령 = true;
|
|
public $can부대구출발령 = true;
|
|
|
|
public $can부대유저장후방발령 = true;
|
|
public $can유저장후방발령 = true;
|
|
public $can유저장전방발령 = true;
|
|
public $can유저장구출발령 = true;
|
|
public $can유저장내정발령 = true;
|
|
|
|
public $canNPC후방발령 = true;
|
|
public $canNPC전방발령 = true;
|
|
public $canNPC구출발령 = true;
|
|
public $canNPC내정발령 = true;
|
|
|
|
public $can유저장긴급포상 = true;
|
|
public $can유저장포상 = true;
|
|
//public $can유저장몰수 = true;
|
|
|
|
public $canNPC긴급포상 = true;
|
|
public $canNPC포상 = true;
|
|
public $canNPC몰수 = true;
|
|
|
|
public $can불가침제의 = true;
|
|
public $can선전포고 = true;
|
|
public $can천도 = true;
|
|
|
|
//Policy Variables
|
|
public $reqNationGold = 10000;
|
|
public $reqNationRice = 12000;
|
|
public $CombatForce = [
|
|
//200 => [10, 24],//troopLeader, fromCity, toCity
|
|
//242 => [10, 24]
|
|
];
|
|
public $SupportForce = [
|
|
//211=>true
|
|
];
|
|
public $DevelopForce = [
|
|
//123=>true
|
|
];
|
|
public $reqHumanWarUrgentGold = 0;
|
|
public $reqHumanWarUrgentRice = 0;
|
|
public $reqHumanWarRecommandGold = 0;
|
|
public $reqHumanWarRecommandRice = 0;
|
|
public $reqHumanDevelGold = 10000;
|
|
public $reqHumanDevelRice = 10000;
|
|
public $reqNPCWarGold = 0;
|
|
public $reqNPCWarRice = 0;
|
|
public $reqNPCDevelGold = 0;
|
|
public $reqNPCDevelRice = 500;
|
|
|
|
public $minimumResourceActionAmount = 1000;
|
|
|
|
public $minNPCWarLeadership = 40;
|
|
public $minWarCrew = 1500;
|
|
|
|
public $allowNpcAttackCity = true;
|
|
public $minNPCRecruitCityPopulation = 50000;
|
|
public $safeRecruitCityPopulationRatio = 0.5;
|
|
public $properWarTrainAtmos = 90;
|
|
|
|
///이쪽의 값이 실제 초기화 값임
|
|
public static $defaultPolicy = [
|
|
'reqNationGold'=>10000,
|
|
'reqNationRice'=>12000,
|
|
'CombatForce'=>[],
|
|
'SupportForce'=>[],
|
|
'DevelopForce'=>[],
|
|
'reqHumanWarUrgentGold'=>0,
|
|
'reqHumanWarUrgentRice'=>0,
|
|
'reqHumanWarRecommandGold'=>0,
|
|
'reqHumanWarRecommandRice'=>0,
|
|
'reqHumanDevelGold'=>10000,
|
|
'reqHumanDevelRice'=>10000,
|
|
'reqNPCWarGold'=>0,
|
|
'reqNPCWarRice'=>0,
|
|
'reqNPCDevelGold'=>0,
|
|
'reqNPCDevelRice'=>500,
|
|
|
|
'minimumResourceActionAmount'=>1000,
|
|
|
|
'minNPCWarLeadership'=>40,
|
|
'minWarCrew'=>1500,
|
|
|
|
'allowNpcAttackCity'=>true,
|
|
'minNPCRecruitCityPopulation'=>50000,
|
|
'safeRecruitCityPopulationRatio'=>0.5,
|
|
'properWarTrainAtmos'=>90,
|
|
];
|
|
|
|
function __construct(General $general, $aiOptions, ?array $nationPolicy, ?array $serverPolicy, array $nation, array $env)
|
|
{
|
|
foreach(static::$defaultPolicy as $policy=>$value){
|
|
$this->{$policy} = $value;
|
|
}
|
|
|
|
if($serverPolicy){
|
|
foreach($serverPolicy['values']??[] as $policy=>$value){
|
|
if(!property_exists($this, $policy)){
|
|
trigger_error ("{$policy}이 없음", E_USER_NOTICE );
|
|
continue;
|
|
}
|
|
$this->{$policy} = $value;
|
|
}
|
|
|
|
if(key_exists('priority', $serverPolicy)){
|
|
$this->priority = $serverPolicy['priority'];
|
|
}
|
|
}
|
|
|
|
|
|
if($nationPolicy){
|
|
foreach($nationPolicy['values']??[] as $policy=>$value){
|
|
if(!property_exists($this, $policy)){
|
|
trigger_error ("{$policy}이 없음", E_USER_NOTICE );
|
|
continue;
|
|
}
|
|
$this->{$policy} = $value;
|
|
}
|
|
|
|
if(key_exists('priority', $nationPolicy)){
|
|
$this->priority = $nationPolicy['priority'];
|
|
}
|
|
}
|
|
|
|
|
|
if(!$this->priority){
|
|
$this->priority = $this::$defaultPriority;
|
|
}
|
|
|
|
|
|
if($this->reqNPCDevelGold === 0){
|
|
$this->reqNPCDevelGold = $env['develcost'] * 30;
|
|
}
|
|
|
|
|
|
if($this->reqNPCWarGold === 0 || $this->reqNPCWarRice === 0){
|
|
$defaultCrewType = GameUnitConst::byID(GameUnitConst::DEFAULT_CREWTYPE);
|
|
$reqGold = $defaultCrewType->costWithTech($nation['tech'], GameConst::$defaultStatNPCMax * 100);
|
|
$reqRice = $defaultCrewType->riceWithTech($nation['tech'], GameConst::$defaultStatNPCMax * 100);
|
|
if($this->reqNPCWarGold === 0){
|
|
$this->reqNPCWarGold = Util::round($reqGold * 4, -2);
|
|
}
|
|
if($this->reqNPCWarRice === 0){
|
|
$this->reqNPCWarRice = Util::round($reqRice * 4, -2);
|
|
}
|
|
}
|
|
|
|
if($this->reqHumanWarUrgentGold === 0 || $this->reqHumanWarUrgentRice === 0){
|
|
$defaultCrewType = GameUnitConst::byID(GameUnitConst::DEFAULT_CREWTYPE);
|
|
$reqGold = $defaultCrewType->costWithTech($nation['tech'], GameConst::$defaultStatMax * 100);
|
|
$reqRice = $defaultCrewType->riceWithTech($nation['tech'], GameConst::$defaultStatMax * 100);
|
|
if($this->reqHumanWarUrgentGold === 0){
|
|
$this->reqHumanWarUrgentGold = Util::round($reqGold * 3 * 2, -2);
|
|
}
|
|
if($this->reqHumanWarUrgentRice === 0){
|
|
$this->reqHumanWarUrgentRice = Util::round($reqRice * 3 * 2, -2);
|
|
}
|
|
}
|
|
|
|
if($this->reqHumanWarRecommandGold === 0){
|
|
$this->reqHumanWarRecommandGold = Util::round($this->reqHumanWarUrgentGold * 2, -2);
|
|
}
|
|
if($this->reqHumanWarRecommandRice === 0){
|
|
$this->reqHumanWarRecommandRice = Util::round($this->reqHumanWarUrgentRice * 2, -2);
|
|
}
|
|
|
|
if($general->getNPCType() >= 2){
|
|
return;
|
|
}
|
|
|
|
if(!key_exists('chief', $aiOptions)){
|
|
$this->can부대전방발령 = false;
|
|
$this->can부대후방발령 = false;
|
|
|
|
$this->can부대유저장후방발령 = false;
|
|
$this->can유저장후방발령 = false;
|
|
$this->can유저장전방발령 = false;
|
|
$this->can유저장구출발령 = false;
|
|
$this->can유저장내정발령 = false;
|
|
|
|
$this->canNPC후방발령 = false;
|
|
$this->canNPC전방발령 = false;
|
|
$this->canNPC구출발령 = false;
|
|
$this->canNPC내정발령 = false;
|
|
|
|
$this->can유저장긴급포상 = false;
|
|
$this->can유저장포상 = false;
|
|
//$this->can유저장몰수 = false;
|
|
|
|
$this->canNPC긴급포상 = false;
|
|
$this->canNPC포상 = false;
|
|
$this->canNPC몰수 = false;
|
|
|
|
$this->can선전포고 = false;
|
|
$this->can천도 = false;
|
|
}
|
|
}
|
|
}
|