금쌀 구매 관련 임시 수정

This commit is contained in:
2020-05-11 01:16:27 +09:00
parent db00b65e3c
commit 1029acab75
+23 -16
View File
@@ -2049,26 +2049,33 @@ class GeneralAI
if($avgAmount * 2 > $goldCost + $riceCost){ if($avgAmount * 2 > $goldCost + $riceCost){
if ($general->getVar('rice') < $riceCost * 2 && $general->getVar('gold') >= $goldCost * 4) { if ($general->getVar('rice') < $riceCost * 2 && $general->getVar('gold') >= $goldCost * 4) {
//1:1 //1:1
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env, $amount = Util::valueFit(Util::toInt($general->getVar('gold') - $avgAmount), 100, GameConst::$maxResourceActionAmount);
[ if($amount >= $this->nationPolicy->minimumResourceActionAmount){
'buyRice' => true, $cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
'amount' => Util::valueFit(Util::toInt($general->getVar('gold') - $avgAmount), 100, GameConst::$maxResourceActionAmount) [
] 'buyRice' => true,
); 'amount' => $amount
if($cmd->hasFullConditionMet()){ ]
return $cmd; );
if($cmd->hasFullConditionMet()){
return $cmd;
}
} }
} }
if ($general->getVar('gold') < $goldCost && $general->getVar('rice') >= $riceCost * 2) { if ($general->getVar('gold') < $goldCost && $general->getVar('rice') >= $riceCost * 2) {
$avgAmount = ($general->getVar('gold') + $general->getVar('rice'))/2; $avgAmount = ($general->getVar('gold') + $general->getVar('rice'))/2;
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env, $amount = Util::valueFit(Util::toInt($general->getVar('rice') - $avgAmount), 100, GameConst::$maxResourceActionAmount);
[ if($amount >= $this->nationPolicy->minimumResourceActionAmount){
'buyRice' => false, $cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
'amount' => Util::valueFit(Util::toInt($general->getVar('rice') - $avgAmount), 100, GameConst::$maxResourceActionAmount) [
] 'buyRice' => false,
); 'amount' => $amount
if($cmd->hasFullConditionMet()){ ]
return $cmd; );
if($cmd->hasFullConditionMet()){
return $cmd;
}
} }
} }
} }