버그 수정
This commit is contained in:
+3
-6
@@ -23,9 +23,7 @@ $query = "select no,nation,level,con,turntime,belong,permission,penalty from gen
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
$query = "select level from nation where nation='{$me['nation']}'";
|
$nationLevel = $db->queryFirstField('SELECT level FROM nation WHERE nation=%i', $me['nation']);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$nation = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
@@ -47,7 +45,6 @@ $sel = [];
|
|||||||
$sel[$type] = "selected";
|
$sel[$type] = "selected";
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine('templates');
|
$templates = new \League\Plates\Engine('templates');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -130,7 +127,7 @@ foreach ($generals as &$general) {
|
|||||||
$genCntEff += 1;
|
$genCntEff += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$lbonus = calcLeadershipBonus($general['level'], $nationlevel[$general['nation']]);
|
$lbonus = calcLeadershipBonus($general['level'], $nationLevel);
|
||||||
if ($lbonus > 0) {
|
if ($lbonus > 0) {
|
||||||
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||||
} else {
|
} else {
|
||||||
@@ -165,7 +162,7 @@ foreach ($generals as &$general) {
|
|||||||
|
|
||||||
|
|
||||||
if ($general['npc'] < 2) {
|
if ($general['npc'] < 2) {
|
||||||
foreach($generalTurnList[$generalObj->getID()] as $turnRawIdx=>$turn){
|
foreach($generalTurnList[$general['no']] as $turnRawIdx=>$turn){
|
||||||
$turn = StringUtil::subStringForWidth($turn, 0, 41);
|
$turn = StringUtil::subStringForWidth($turn, 0, 41);
|
||||||
$turnIdx = $turnRawIdx+1;
|
$turnIdx = $turnRawIdx+1;
|
||||||
$turntext[] = " $turnIdx : $turn";
|
$turntext[] = " $turnIdx : $turn";
|
||||||
|
|||||||
@@ -119,7 +119,11 @@ class che_포상 extends Command\NationCommand{
|
|||||||
$resName = $isGold?'금':'쌀';
|
$resName = $isGold?'금':'쌀';
|
||||||
$destGeneral = $this->destGeneralObj;
|
$destGeneral = $this->destGeneralObj;
|
||||||
|
|
||||||
$amount = Util::valueFit($amount, 0, $nation[$resKey] - ($isGold?GameConst::$basegold:GameConst::$baserice));
|
$amount = Util::valueFit(
|
||||||
|
$amount,
|
||||||
|
0,
|
||||||
|
$nation[$resKey] - ($isGold?GameConst::$basegold:GameConst::$baserice)
|
||||||
|
);
|
||||||
$amountText = number_format($amount, 0);
|
$amountText = number_format($amount, 0);
|
||||||
|
|
||||||
$logger = $general->getLogger();
|
$logger = $general->getLogger();
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ class GeneralAI{
|
|||||||
['che_포상', [
|
['che_포상', [
|
||||||
'destGeneralID' => $this->npcCivilGenerals[0]->id,
|
'destGeneralID' => $this->npcCivilGenerals[0]->id,
|
||||||
'isGold'=>$resName=='gold',
|
'isGold'=>$resName=='gold',
|
||||||
'amount'=>$this->baseDevelCost
|
'amount'=>round($this->baseDevelCost,-2)
|
||||||
]],
|
]],
|
||||||
1
|
1
|
||||||
];
|
];
|
||||||
@@ -430,7 +430,7 @@ class GeneralAI{
|
|||||||
|
|
||||||
if($targetNpcWarGeneral->$resName < $reqMoney){
|
if($targetNpcWarGeneral->$resName < $reqMoney){
|
||||||
//국고 1/5과 '충분한 금액'의 기하평균
|
//국고 1/5과 '충분한 금액'의 기하평균
|
||||||
$payAmount = sqrt(($enoughMoney - $reqMoney) * ($remainResource[$resName] / 5));
|
$payAmount = sqrt(($enoughMoney - $targetNpcWarGeneral->$resName) * ($remainResource[$resName] / 5));
|
||||||
if ($remainResource[$resName] >= $payAmount / 2) {
|
if ($remainResource[$resName] >= $payAmount / 2) {
|
||||||
$candidateCommand[] = [
|
$candidateCommand[] = [
|
||||||
['che_포상', [
|
['che_포상', [
|
||||||
@@ -454,7 +454,7 @@ class GeneralAI{
|
|||||||
|
|
||||||
if($targetNpcWarGeneral->$resName < $reqMoney){
|
if($targetNpcWarGeneral->$resName < $reqMoney){
|
||||||
//국고와 '충분한 금액'의 기하평균
|
//국고와 '충분한 금액'의 기하평균
|
||||||
$payAmount = sqrt(($enoughMoney - $reqMoney) * $remainResource[$resName]);
|
$payAmount = sqrt(($enoughMoney - $targetNpcWarGeneral->$resName) * $remainResource[$resName]);
|
||||||
|
|
||||||
if($remainResource[$resName] >= $payAmount / 2){
|
if($remainResource[$resName] >= $payAmount / 2){
|
||||||
$candidateCommand[] = [
|
$candidateCommand[] = [
|
||||||
@@ -476,7 +476,7 @@ class GeneralAI{
|
|||||||
$enoughMoney = $this->baseDevelCost * 1.5;
|
$enoughMoney = $this->baseDevelCost * 1.5;
|
||||||
|
|
||||||
if($targetNpcCivilGeneral->$resName >= $tooMuchMoney){
|
if($targetNpcCivilGeneral->$resName >= $tooMuchMoney){
|
||||||
$returnAmount = $this->npcCivilGenerals - $enoughMoney;
|
$returnAmount = $targetNpcCivilGeneral->$resName - $enoughMoney;
|
||||||
$candidateCommand[] = [
|
$candidateCommand[] = [
|
||||||
['che_몰수', [
|
['che_몰수', [
|
||||||
'destGeneralID' => $targetNpcCivilGeneral->id,
|
'destGeneralID' => $targetNpcCivilGeneral->id,
|
||||||
@@ -699,7 +699,8 @@ class GeneralAI{
|
|||||||
|
|
||||||
if((($isWarUser || $resName == 'gold') && $compUser->$resName < 21000) || ($compUser->$resName < 5000)){
|
if((($isWarUser || $resName == 'gold') && $compUser->$resName < 21000) || ($compUser->$resName < 5000)){
|
||||||
if($work){
|
if($work){
|
||||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 3000)*10 + 10);
|
//TODO: 새로 구현한 코드로 이전
|
||||||
|
$amount = min(10000, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 3000)*1000 + 1000);
|
||||||
$commandList[] = [['che_포상', [
|
$commandList[] = [['che_포상', [
|
||||||
'destGeneralID'=>$userGenerals[0]->no,
|
'destGeneralID'=>$userGenerals[0]->no,
|
||||||
'isGold'=>$resName=='gold',
|
'isGold'=>$resName=='gold',
|
||||||
@@ -707,7 +708,7 @@ class GeneralAI{
|
|||||||
]], 10]; // 금,쌀 1000단위 포상
|
]], 10]; // 금,쌀 1000단위 포상
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
$amount = min(10000, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*1000 + 1000);
|
||||||
$commandList[] = [['che_포상', [
|
$commandList[] = [['che_포상', [
|
||||||
'destGeneralID'=>$userGenerals[0]->no,
|
'destGeneralID'=>$userGenerals[0]->no,
|
||||||
'isGold'=>$resName=='gold',
|
'isGold'=>$resName=='gold',
|
||||||
@@ -739,10 +740,10 @@ class GeneralAI{
|
|||||||
|
|
||||||
if($targetGeneral){
|
if($targetGeneral){
|
||||||
if($targetGeneral === $compNpcCivil){
|
if($targetGeneral === $compNpcCivil){
|
||||||
$amount = intdiv($targetGeneral->$resName - $minRes * 3, 100);
|
$amount = round($targetGeneral->$resName - $minRes * 3, -2);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$amount = min(100, intdiv($targetGeneral->$resName, 5000)*10 + 10);
|
$amount = min(10000, intdiv($targetGeneral->$resName, 5000)*1000 + 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($amount > 0){
|
if($amount > 0){
|
||||||
|
|||||||
Reference in New Issue
Block a user