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 $maximumResourceActionAmount = 10000; public $minNPCWarLeadership = 40; public $minWarCrew = 1500; public $minNPCRecruitCityPopulation = 50000; public $safeRecruitCityPopulationRatio = 0.5; public $properWarTrainAtmos = 90; public $cureThreshold = 10; ///이쪽의 값이 실제 초기화 값임 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, 'maximumResourceActionAmount'=>10000, 'minNPCWarLeadership'=>40, 'minWarCrew'=>1500, 'minNPCRecruitCityPopulation'=>50000, 'safeRecruitCityPopulationRatio'=>0.5, 'properWarTrainAtmos'=>90, 'cureThreshold'=>10, ]; function __construct(GeneralBase $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; } } }