금쌀 구매 관련 임시 수정
This commit is contained in:
@@ -2049,22 +2049,28 @@ 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
|
||||||
|
$amount = Util::valueFit(Util::toInt($general->getVar('gold') - $avgAmount), 100, GameConst::$maxResourceActionAmount);
|
||||||
|
if($amount >= $this->nationPolicy->minimumResourceActionAmount){
|
||||||
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
||||||
[
|
[
|
||||||
'buyRice' => true,
|
'buyRice' => true,
|
||||||
'amount' => Util::valueFit(Util::toInt($general->getVar('gold') - $avgAmount), 100, GameConst::$maxResourceActionAmount)
|
'amount' => $amount
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
if($cmd->hasFullConditionMet()){
|
if($cmd->hasFullConditionMet()){
|
||||||
return $cmd;
|
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;
|
||||||
|
$amount = Util::valueFit(Util::toInt($general->getVar('rice') - $avgAmount), 100, GameConst::$maxResourceActionAmount);
|
||||||
|
if($amount >= $this->nationPolicy->minimumResourceActionAmount){
|
||||||
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
||||||
[
|
[
|
||||||
'buyRice' => false,
|
'buyRice' => false,
|
||||||
'amount' => Util::valueFit(Util::toInt($general->getVar('rice') - $avgAmount), 100, GameConst::$maxResourceActionAmount)
|
'amount' => $amount
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
if($cmd->hasFullConditionMet()){
|
if($cmd->hasFullConditionMet()){
|
||||||
@@ -2073,6 +2079,7 @@ class GeneralAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($general->getVar('rice') < $this->baseDevelCost && $general->getVar('gold') >= $this->baseDevelCost * 3) {
|
if ($general->getVar('rice') < $this->baseDevelCost && $general->getVar('gold') >= $this->baseDevelCost * 3) {
|
||||||
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env,
|
||||||
|
|||||||
Reference in New Issue
Block a user