버그 수정

This commit is contained in:
2020-04-24 01:51:15 +09:00
parent 6667d85623
commit 089bb027ae
3 changed files with 14 additions and 16 deletions
+2 -2
View File
@@ -40,8 +40,8 @@ class che_단련 extends Command\GeneralCommand{
$this->runnableConstraints=[
ConstraintHelper::NotBeNeutral(),
ConstraintHelper::ReqGeneralCrew(),
ConstraintHelper::ReqGeneralValue('train', '훈련', '<', GameConst::$defaultTrainHigh),
ConstraintHelper::ReqGeneralValue('atmos', '사기', '<', GameConst::$defaultAtmosHigh),
ConstraintHelper::ReqGeneralValue('train', '훈련', '>=', GameConst::$defaultTrainLow),
ConstraintHelper::ReqGeneralValue('atmos', '사기', '>=', GameConst::$defaultAtmosLow),
ConstraintHelper::ReqGeneralGold($reqGold),
ConstraintHelper::ReqGeneralRice($reqRice),
];
+11 -14
View File
@@ -60,7 +60,7 @@ class che_화계 extends Command\GeneralCommand{
$genScore = $general->getIntel();
}
else{
throw new MustNotBeReachedException();
throw new \sammo\MustNotBeReachedException();
}
$prob = $genScore / GameConst::$sabotageProbCoefByStat;
@@ -91,7 +91,7 @@ class che_화계 extends Command\GeneralCommand{
$genScore = $destGeneral->getIntel();
}
else{
throw new MustNotBeReachedException();
throw new \sammo\MustNotBeReachedException();
}
$maxGenScore = max($maxGenScore, $genScore);
}
@@ -243,20 +243,17 @@ class che_화계 extends Command\GeneralCommand{
$destCityGeneralList = [];
[$year, $month] = [$env['year'], $env['month']];
foreach($db->query(
'SELECT `no`,name,city,nation,officer_level,leadership,horse,strength,weapon,intel,book,item,last_turn,injury,special,special2,injury,crew,atmos,train FROM general WHERE city = %i',
$destCityID,
$destNationID
) as $rawDestCityGeneral){
$destCityGeneralList[] = new General($rawDestCityGeneral, null, $destCity, $year, $month, true);
//계략에 성공할 경우 logger를 사용해야 하므로 해야하므로, 미리 초기화한다.
//실패하면 날리는거지 뭐~
};
$cityGeneralID = $db->queryFirstColumn('SELECT no FROM general WHERE city = %i AND nation = %i', $destCityID, $destNationID);
$destCityGeneralList = General::createGeneralObjListFromDB($cityGeneralID, ['name', 'city', 'nation', 'officer_level', 'leadership', 'horse', 'strength', 'weapon', 'intel', 'book', 'item', 'last_turn', 'injury', 'special', 'special2', 'injury', 'crew', 'atmos', 'train'], 2);
foreach($destCityGeneralList as &$destCityGeneral){
$destCityGeneral->setRawCity($this->destCity);
unset($destCityGeneral);
}
//계략에 성공할 경우 logger를 사용해야 하므로 해야하므로, 미리 초기화한다.
//실패하면 날리는거지 뭐~
$prob = GameConst::$sabotageDefaultProb + $this->calcSabotageAttackProb() - $this->calcSabotageDefenceProb($destCityGeneralList);
$prob /= $dist[$destCityID];
$prob /= $dist;
if(!Util::randBool($prob)){
$josaYi = JosaUtil::pick($commandName, '이');
+1
View File
@@ -3161,6 +3161,7 @@ class GeneralAI
}
if($npcType < 2 && $nationID === 0 && !$this->generalPolicy->can국가선택){
$reservedCommand->reason = '재야유저';
return $reservedCommand;
}