버그 수정
This commit is contained in:
@@ -27,14 +27,14 @@ class AutorunNationPolicy {
|
||||
static $NPC몰수 = 'NPC몰수';
|
||||
|
||||
// 군주 행동
|
||||
static $선포 = '선포';
|
||||
static $선전포고 = '선전포고';
|
||||
static $천도 = '천도';
|
||||
|
||||
|
||||
|
||||
//실제 행동
|
||||
static public $defaultPriority = [
|
||||
'선포',
|
||||
'선전포고',
|
||||
'천도',
|
||||
|
||||
'유저장긴급포상',
|
||||
@@ -103,8 +103,8 @@ class AutorunNationPolicy {
|
||||
public $canNPC포상 = true;
|
||||
public $canNPC몰수 = true;
|
||||
|
||||
public $can선포 = false;
|
||||
public $can천도 = false;
|
||||
public $can선전포고 = true;
|
||||
public $can천도 = true;
|
||||
|
||||
//Policy Variables
|
||||
public $reqNationGold = 10000;
|
||||
|
||||
@@ -47,7 +47,7 @@ class che_출병 extends Command\GeneralCommand{
|
||||
$general = $this->generalObj;
|
||||
|
||||
$this->setCity();
|
||||
$this->setNation(['war', 'gennum', 'tech', 'gold', 'rice']);
|
||||
$this->setNation(['war', 'gennum', 'tech', 'gold', 'rice', 'color', 'type', 'level', 'capital']);
|
||||
$this->setDestCity($this->arg['destCityID'], null);
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
@@ -196,9 +196,7 @@ class che_출병 extends Command\GeneralCommand{
|
||||
$general->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
$general->applyDB($db);
|
||||
|
||||
//TODO: 장기적으로 통합해야함
|
||||
$attackerNation = $db->queryFirstRow('SELECT nation, name, color, type, level, capital, tech, gennum from nation WHERE nation = %i', $attackerNationID);
|
||||
processWar($general, $attackerNation, $this->destCity);
|
||||
processWar($general, $this->nation, $this->destCity);
|
||||
|
||||
tryUniqueItemLottery($general);
|
||||
$general->applyDB($db);
|
||||
|
||||
@@ -1068,9 +1068,6 @@ class GeneralAI
|
||||
}
|
||||
//국고와 '충분한 금액'의 기하평균
|
||||
$payAmount = sqrt(($enoughMoney - $targetUserGeneral->getVar($resName)) * $resVal);
|
||||
if($payAmount < $this->nationPolicy->minimumResourceActionAmount){
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($resVal < $payAmount / 2) {
|
||||
continue;
|
||||
@@ -1513,7 +1510,7 @@ class GeneralAI
|
||||
|
||||
|
||||
// 군주 행동
|
||||
protected function do선포(LastTurn $lastTurn): ?NationCommand
|
||||
protected function do선전포고(LastTurn $lastTurn): ?NationCommand
|
||||
{
|
||||
$general = $this->general;
|
||||
|
||||
@@ -2843,6 +2840,7 @@ class GeneralAI
|
||||
}
|
||||
|
||||
$nationCities[$cityID] = &$nationCity;
|
||||
unset($nationCity);
|
||||
}
|
||||
|
||||
$this->nationCities = $nationCities;
|
||||
|
||||
@@ -369,4 +369,9 @@ class WarUnit{
|
||||
//전특, 병종에 따라 필살 데미지가 달라질지도 모르므로 static 함수는 아닌 것으로
|
||||
return Util::randRange(1.3, 2.0);
|
||||
}
|
||||
|
||||
function applyDB(\MeekroDB $db):bool{
|
||||
throw new MustNotBeReachedException('Must be WarUnitCity or WarUnitGeneral');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class WarUnitCity extends WarUnit{
|
||||
$this->logger = $general->getLogger();
|
||||
$this->crewType = GameUnitConst::byID(GameUnitConst::CREWTYPE_CASTLE);
|
||||
|
||||
$this->hp = $this->getVar('def') * 10;
|
||||
$this->hp = $this->getCityVar('def') * 10;
|
||||
|
||||
//수비자 보정
|
||||
if($this->getCityVar('level') == 1){
|
||||
|
||||
Reference in New Issue
Block a user