유저장은 자동 사령턴 켬끔 가능

This commit is contained in:
2020-06-06 13:20:01 +09:00
parent ac5d2268e5
commit 522f5c8a86
5 changed files with 855 additions and 839 deletions
+9 -2
View File
@@ -14,6 +14,7 @@ $generalID = $session->generalID;
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['turntime', 'opentime', 'autorun_user']);
increaseRefresh("내정보", 1); increaseRefresh("내정보", 1);
@@ -38,7 +39,7 @@ if($gameStor->turntime <= $gameStor->opentime){
} }
$use_treatment = $me->getAuxVar('use_treatment')??10; $use_treatment = $me->getAuxVar('use_treatment')??10;
$use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn')??1;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@@ -84,7 +85,13 @@ var availableDieImmediately = <?=$availableDieImmediately?'true':'false'?>;
<option value=100 <?=$use_treatment==100?"selected":""; ?>>사용안함</option> <option value=100 <?=$use_treatment==100?"selected":""; ?>>사용안함</option>
</select>】<br> </select>】<br>
∞<span style='color:orange'>부상을 입었을 때 환약을 사용하는 기준입니다.</span><br><br> ∞<span style='color:orange'>부상을 입었을 때 환약을 사용하는 기준입니다.</span><br><br>
<?php if(($gameStor->autorun_user['options']['chief'])??false) : ?>
자동 사령턴 허용 【<select id='use_auto_nation_turn' name='use_auto_nation_turn'>
<option value=1 <?=$use_auto_nation_turn?"selected":""; ?>>허용</option>
<option value=0 <?=(!$use_auto_nation_turn)?"selected":""; ?>>허용 안함</option>
</select>】<br>
∞<span style='color:orange'>수뇌가 되었을 때 휴식 턴이어도 적당한 턴을 알아서 넣는 것을 허용합니다.</span><br><br>
<?php endif; ?>
수비 【<select id='defence_train' name='defence_train'> 수비 【<select id='defence_train' name='defence_train'>
<option value=90 <?=$me->getVar('defence_train')==90?"selected":""; ?>>☆(훈사90)</option> <option value=90 <?=$me->getVar('defence_train')==90?"selected":""; ?>>☆(훈사90)</option>
<option value=80 <?=$me->getVar('defence_train')==80?"selected":""; ?>>◎(훈사80)</option> <option value=80 <?=$me->getVar('defence_train')==80?"selected":""; ?>>◎(훈사80)</option>
+5
View File
@@ -16,6 +16,7 @@ $action = Util::getPost('action');
$tnmt = Util::getPost('tnmt', 'int', 1); $tnmt = Util::getPost('tnmt', 'int', 1);
$defence_train = Util::getPost('defence_train', 'int', 80); $defence_train = Util::getPost('defence_train', 'int', 80);
$use_treatment = Util::getPost('use_treatment', 'int', 10); $use_treatment = Util::getPost('use_treatment', 'int', 10);
$use_auto_nation_turn = Util::getPost('use_auto_nation_turn', 'int', 1);
//$detachNPC = Util::getPost('detachNPC', 'bool'); //$detachNPC = Util::getPost('detachNPC', 'bool');
$detachNPC = false; $detachNPC = false;
@@ -51,6 +52,10 @@ if($defence_train != $me->getVar('defence_train')){
} }
} }
if($use_auto_nation_turn != $me->getAuxVar('use_auto_nation_turn')){
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
}
$me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100)); $me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100));
if($me->getVar('tnmt') != $tnmt){ if($me->getVar('tnmt') != $tnmt){
+1
View File
@@ -144,6 +144,7 @@ jQuery(function($){
tnmt: $('.tnmt:checked').val(), tnmt: $('.tnmt:checked').val(),
defence_train: $('#defence_train').val(), defence_train: $('#defence_train').val(),
use_treatment: $('#use_treatment').val(), use_treatment: $('#use_treatment').val(),
use_auto_nation_turn: $('#use_auto_nation_turn').val(),
} }
}).then(function(data) { }).then(function(data) {
if (!data) { if (!data) {
+3
View File
@@ -3251,6 +3251,9 @@ class GeneralAI
$month = $this->env['month']; $month = $this->env['month'];
if($npcType >= 2){ if($npcType >= 2){
if(!($general->getAuxVar('use_auto_nation_turn')??1)){
$general->setAuxVar('use_auto_nation_turn', 1);
}
if($general->getVar('officer_level') == 12){ if($general->getVar('officer_level') == 12){
if (in_array($month, [3, 6, 9, 12])) { if (in_array($month, [3, 6, 9, 12])) {
$this->choosePromotion(); $this->choosePromotion();
+1 -1
View File
@@ -265,7 +265,7 @@ class TurnExecutionHelper
if(!$turnObj->processBlocked()){ if(!$turnObj->processBlocked()){
if($hasNationTurn){ if($hasNationTurn){
if($ai){ if($ai && ($general->getAuxVar('use_auto_nation_turn')??1)){
$nationCommandObj = $ai->chooseNationTurn($nationCommandObj); $nationCommandObj = $ai->chooseNationTurn($nationCommandObj);
$cityName = CityConst::byID($general->getCityID())->name; $cityName = CityConst::byID($general->getCityID())->name;
LogText("NationTurn", "General, {$general->getName()}, {$general->getID()}, {$cityName}, {$general->getStaticNation()['name']}, {$nationCommandObj->getBrief()}, {$nationCommandObj->reason}, "); LogText("NationTurn", "General, {$general->getName()}, {$general->getID()}, {$cityName}, {$general->getStaticNation()['name']}, {$nationCommandObj->getBrief()}, {$nationCommandObj->reason}, ");