버그 수정...

This commit is contained in:
2019-10-06 14:49:41 +09:00
parent 46acfe9470
commit 617ca22f2d
28 changed files with 115 additions and 102 deletions
+2 -2
View File
@@ -252,7 +252,7 @@ abstract class BaseCommand{
'destNation'=>$this->destNation,
];
$this->reasonNotReservable = Constraint::testAll($this->reservableConstraints??[], $constraintInput);
$this->reasonNotReservable = Constraint::testAll($this->reservableConstraints??[], $constraintInput, $this->env);
$this->reservable = $this->reasonNotReservable === null;
return $this->reasonNotReservable;
}
@@ -288,7 +288,7 @@ abstract class BaseCommand{
'destNation'=>$this->destNation,
];
$this->reasonNotRunnable = Constraint::testAll($this->runnableConstraints??[], $constraintInput);
$this->reasonNotRunnable = Constraint::testAll($this->runnableConstraints??[], $constraintInput, $this->env);
$this->runnable = $this->reasonNotRunnable === null;
return $this->reasonNotRunnable;
+1 -1
View File
@@ -71,7 +71,7 @@ class che_귀환 extends Command\GeneralCommand{
$generalLevel = $general->getVar('level');
$target = null;
if(2 <= $generalLevel && 4 <= $generalLevel){
if(2 <= $generalLevel && $generalLevel <= 4){
$target = $db->queryFirstList(
'SELECT city, name FROM city WHERE %b=%i AND nation = %i',
'officer'.$general->getVar('level'), $generalID, $general->getNationID()
@@ -34,7 +34,7 @@ class che_인재탐색 extends Command\GeneralCommand{
$general = $this->generalObj;
$this->setNation(['gennum']);
$this->setNation(['gennum', 'scout']);
$env = $this->env;
[$reqGold, $reqRice] = $this->getCost();
+1
View File
@@ -160,6 +160,7 @@ class che_임관 extends Command\GeneralCommand{
$db->update('nation', [
'gennum'=>$db->sqleval('gennum + 1')
], 'nation=%i', $destNationID);
\sammo\refreshNationStaticInfo();
$relYear = $env['year'] - $env['startyear'];
if($general->getVar('npc') == 1 || $relYear >= 3){
+1 -1
View File
@@ -128,7 +128,7 @@ class che_출병 extends Command\GeneralCommand{
$general->applyDB($db);
//TODO: 장기적으로 통합해야함
$attackerNation = $db->queryFirstRow('SELECT nation, name, color, type, level, capital, tech from nation WHERE nation = %i', $attackerNationID);
$attackerNation = $db->queryFirstRow('SELECT nation, name, color, type, level, capital, tech, gennum from nation WHERE nation = %i', $attackerNationID);
processWar($general, $attackerNation, $this->destCity);
tryUniqueItemLottery($general);
+1
View File
@@ -112,6 +112,7 @@ class che_하야 extends Command\GeneralCommand{
'rice'=>$db->sqleval('rice + %i', $lostRice),
'gennum'=>$db->sqleval('gennum - 1')
], 'nation=%i', $nationID);
\sammo\refreshNationStaticInfo();
$general->setVar('nation', 0);
$general->setVar('level', 0);
+7 -4
View File
@@ -8,13 +8,16 @@ use \sammo\{
GameConst,
LastTurn,
GameUnitConst,
Command
Command,
MessageTarget,
Message
};
use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx
CriticalScoreEx,
GetImageURL
};
use \sammo\Constraint\Constraint;
@@ -70,7 +73,7 @@ class che_몰수 extends Command\NationCommand{
$this->setCity();
$this->setNation(['gold', 'rice']);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'nation'], 1);
$destGeneral = General::createGeneralObjFromDB($this->arg['destGeneralID'], ['gold', 'rice', 'npc', 'nation'], 1);
$this->setDestGeneral($destGeneral);
$relYear = $env['year'] - $env['startyear'];
@@ -118,7 +121,7 @@ class che_몰수 extends Command\NationCommand{
$resName = $isGold?'금':'쌀';
$destGeneral = $this->destGeneralObj;
$amount = Util::valueFit($amount, 0, ($general->getVar[$resKey]- $isGold?GameConst::$generalMinimumGold:GameConst::$generalMinimumRice));
$amount = Util::valueFit($amount, 0, ($general->getVar($resKey)- $isGold?GameConst::$generalMinimumGold:GameConst::$generalMinimumRice));
$amountText = number_format($amount, 0);
if($destGeneral->getVar('npc') >= 2 && Util::randBool(0.01)){