버그 수정
This commit is contained in:
@@ -49,7 +49,7 @@ abstract class BaseCommand{
|
||||
|
||||
protected $alternative = null;
|
||||
|
||||
static protected $isInitStatic = false;
|
||||
static protected $isInitStatic = true;
|
||||
protected static function initStatic(){
|
||||
|
||||
}
|
||||
|
||||
@@ -255,9 +255,9 @@ class che_랜덤임관 extends Command\GeneralCommand{
|
||||
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
if($general->getVar('npc') == 1 || $relYear >= 3){
|
||||
$joinedNations = Join::decode($general->getVar('nations'));
|
||||
$joinedNations = Json::decode($general->getVar('nations'));
|
||||
$joinedNations[] = $destNationID;
|
||||
$general->setVar('nations', Join::encode($joinedNations));
|
||||
$general->setVar('nations', Json::encode($joinedNations));
|
||||
}
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
|
||||
@@ -15,6 +15,7 @@ class che_모병 extends che_징병{
|
||||
static protected $actionName = '모병';
|
||||
static protected $costOffset = 2;
|
||||
|
||||
static protected $isInitStatic = false;
|
||||
protected static function initStatic()
|
||||
{
|
||||
static::$defaultTrain = GameConst::$defaultTrainHigh;
|
||||
|
||||
@@ -162,9 +162,9 @@ class che_임관 extends Command\GeneralCommand{
|
||||
|
||||
$relYear = $env['year'] - $env['startyear'];
|
||||
if($general->getVar('npc') == 1 || $relYear >= 3){
|
||||
$joinedNations = Join::decode($general->getVar('nations'));
|
||||
$joinedNations = Json::decode($general->getVar('nations'));
|
||||
$joinedNations[] = $destNationID;
|
||||
$general->setVar('nations', Join::encode($joinedNations));
|
||||
$general->setVar('nations', Json::encode($joinedNations));
|
||||
}
|
||||
|
||||
$general->increaseVar('experience', $exp);
|
||||
|
||||
@@ -35,6 +35,7 @@ class che_징병 extends Command\GeneralCommand{
|
||||
protected $reqCrewType;
|
||||
protected $currCrewType;
|
||||
|
||||
static protected $isInitStatic = false;
|
||||
protected static function initStatic()
|
||||
{
|
||||
static::$defaultTrain = GameConst::$defaultTrainLow;
|
||||
|
||||
+28
-4
@@ -1253,18 +1253,42 @@ class GeneralAI{
|
||||
}
|
||||
|
||||
if($general->getVar('rice') < $baseArmRice && $general->getVar('gold') >= $baseArmGold * 3){
|
||||
return ['che_군량매매', ['buyRice'=>true, 'amount'=> $general->getVar('gold') - $baseArmGold]];
|
||||
return [
|
||||
'che_군량매매',
|
||||
[
|
||||
'buyRice'=>true,
|
||||
'amount'=> Util::toInt($general->getVar('gold') - $baseArmGold)
|
||||
]
|
||||
];
|
||||
}
|
||||
if($general->getVar('gold') < $baseArmGold && $general->getVar('gold') >= $baseArmRice * 3){
|
||||
return ['che_군량매매', ['buyRice'=>false, 'amount'=> $general->getVar('rice') - $baseArmRice]];
|
||||
return [
|
||||
'che_군량매매',
|
||||
[
|
||||
'buyRice'=>false,
|
||||
'amount'=> Util::toInt($general->getVar('rice') - $baseArmRice)
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
else{
|
||||
if($general->getVar('rice') < $this->baseDevelCost && $general->getVar('gold') >= $this->baseDevelCost * 3){
|
||||
return ['che_군량매매', ['buyRice'=>true, 'amount'=> $general->getVar('gold') - $this->baseDevelCost]];
|
||||
return [
|
||||
'che_군량매매',
|
||||
[
|
||||
'buyRice'=>true,
|
||||
'amount'=> Util::toInt($general->getVar('gold') - $this->baseDevelCost)
|
||||
]
|
||||
];
|
||||
}
|
||||
if($general->getVar('gold') < $this->baseDevelCost && $general->getVar('gold') >= $this->baseDevelCost * 3){
|
||||
return ['che_군량매매', ['buyRice'=>false, 'amount'=> $general->getVar('rice') - $this->baseDevelCost]];
|
||||
return [
|
||||
'che_군량매매',
|
||||
[
|
||||
'buyRice'=>false,
|
||||
'amount'=> Util::toInt($general->getVar('rice') - $this->baseDevelCost)
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ class NPC{
|
||||
$duplicateCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE name LIKE %s', $name.'%') + 1;
|
||||
|
||||
if($duplicateCnt > 1){
|
||||
$name = "{$name}($duplicateCnt}";
|
||||
$name = "{$name}{$duplicateCnt}";
|
||||
}
|
||||
|
||||
$this->realName = $name;
|
||||
|
||||
Reference in New Issue
Block a user