버그 수정
This commit is contained in:
@@ -40,8 +40,8 @@ class che_단련 extends Command\GeneralCommand{
|
|||||||
$this->runnableConstraints=[
|
$this->runnableConstraints=[
|
||||||
ConstraintHelper::NotBeNeutral(),
|
ConstraintHelper::NotBeNeutral(),
|
||||||
ConstraintHelper::ReqGeneralCrew(),
|
ConstraintHelper::ReqGeneralCrew(),
|
||||||
ConstraintHelper::ReqGeneralValue('train', '훈련', '<', GameConst::$defaultTrainHigh),
|
ConstraintHelper::ReqGeneralValue('train', '훈련', '>=', GameConst::$defaultTrainLow),
|
||||||
ConstraintHelper::ReqGeneralValue('atmos', '사기', '<', GameConst::$defaultAtmosHigh),
|
ConstraintHelper::ReqGeneralValue('atmos', '사기', '>=', GameConst::$defaultAtmosLow),
|
||||||
ConstraintHelper::ReqGeneralGold($reqGold),
|
ConstraintHelper::ReqGeneralGold($reqGold),
|
||||||
ConstraintHelper::ReqGeneralRice($reqRice),
|
ConstraintHelper::ReqGeneralRice($reqRice),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class che_화계 extends Command\GeneralCommand{
|
|||||||
$genScore = $general->getIntel();
|
$genScore = $general->getIntel();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
throw new MustNotBeReachedException();
|
throw new \sammo\MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$prob = $genScore / GameConst::$sabotageProbCoefByStat;
|
$prob = $genScore / GameConst::$sabotageProbCoefByStat;
|
||||||
@@ -91,7 +91,7 @@ class che_화계 extends Command\GeneralCommand{
|
|||||||
$genScore = $destGeneral->getIntel();
|
$genScore = $destGeneral->getIntel();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
throw new MustNotBeReachedException();
|
throw new \sammo\MustNotBeReachedException();
|
||||||
}
|
}
|
||||||
$maxGenScore = max($maxGenScore, $genScore);
|
$maxGenScore = max($maxGenScore, $genScore);
|
||||||
}
|
}
|
||||||
@@ -243,20 +243,17 @@ class che_화계 extends Command\GeneralCommand{
|
|||||||
|
|
||||||
$destCityGeneralList = [];
|
$destCityGeneralList = [];
|
||||||
|
|
||||||
[$year, $month] = [$env['year'], $env['month']];
|
$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($db->query(
|
foreach($destCityGeneralList as &$destCityGeneral){
|
||||||
'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',
|
$destCityGeneral->setRawCity($this->destCity);
|
||||||
$destCityID,
|
unset($destCityGeneral);
|
||||||
$destNationID
|
}
|
||||||
) as $rawDestCityGeneral){
|
|
||||||
$destCityGeneralList[] = new General($rawDestCityGeneral, null, $destCity, $year, $month, true);
|
|
||||||
//계략에 성공할 경우 logger를 사용해야 하므로 해야하므로, 미리 초기화한다.
|
//계략에 성공할 경우 logger를 사용해야 하므로 해야하므로, 미리 초기화한다.
|
||||||
//실패하면 날리는거지 뭐~
|
//실패하면 날리는거지 뭐~
|
||||||
};
|
|
||||||
|
|
||||||
$prob = GameConst::$sabotageDefaultProb + $this->calcSabotageAttackProb() - $this->calcSabotageDefenceProb($destCityGeneralList);
|
$prob = GameConst::$sabotageDefaultProb + $this->calcSabotageAttackProb() - $this->calcSabotageDefenceProb($destCityGeneralList);
|
||||||
$prob /= $dist[$destCityID];
|
$prob /= $dist;
|
||||||
|
|
||||||
if(!Util::randBool($prob)){
|
if(!Util::randBool($prob)){
|
||||||
$josaYi = JosaUtil::pick($commandName, '이');
|
$josaYi = JosaUtil::pick($commandName, '이');
|
||||||
|
|||||||
@@ -3161,6 +3161,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($npcType < 2 && $nationID === 0 && !$this->generalPolicy->can국가선택){
|
if($npcType < 2 && $nationID === 0 && !$this->generalPolicy->can국가선택){
|
||||||
|
$reservedCommand->reason = '재야유저';
|
||||||
return $reservedCommand;
|
return $reservedCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user