유저장은 자동 사령턴 켬끔 가능
This commit is contained in:
+9
-2
@@ -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>
|
||||||
|
|||||||
@@ -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){
|
||||||
|
|||||||
+88
-87
@@ -1,166 +1,167 @@
|
|||||||
jQuery(function($){
|
jQuery(function($) {
|
||||||
|
|
||||||
|
|
||||||
var initCustomCSSForm = function(){
|
var initCustomCSSForm = function() {
|
||||||
var lastTimeOut = null;
|
var lastTimeOut = null;
|
||||||
var $obj = $('#custom_css');
|
var $obj = $('#custom_css');
|
||||||
var key = 'sam_customCSS';
|
var key = 'sam_customCSS';
|
||||||
|
|
||||||
var text = localStorage.getItem(key);
|
var text = localStorage.getItem(key);
|
||||||
if(text){
|
if (text) {
|
||||||
$obj.val(text);
|
$obj.val(text);
|
||||||
console.log(text);
|
console.log(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($obj.on('change keyup paste', function(){
|
if ($obj.on('change keyup paste', function() {
|
||||||
var newText = $obj.val();
|
var newText = $obj.val();
|
||||||
if(text == newText){
|
if (text == newText) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(lastTimeOut){
|
if (lastTimeOut) {
|
||||||
clearTimeout(lastTimeOut);
|
clearTimeout(lastTimeOut);
|
||||||
}
|
}
|
||||||
$obj.css('background-color', '#222222');
|
$obj.css('background-color', '#222222');
|
||||||
lastTimeOut = setTimeout(function(){
|
lastTimeOut = setTimeout(function() {
|
||||||
text = $obj.val();
|
text = $obj.val();
|
||||||
localStorage.setItem(key, text);
|
localStorage.setItem(key, text);
|
||||||
$obj.css('background-color', 'black');
|
$obj.css('background-color', 'black');
|
||||||
}, 500);
|
}, 500);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.load_old_log').click(function(){
|
$('.load_old_log').click(function() {
|
||||||
var $thisBtn = $(this);
|
var $thisBtn = $(this);
|
||||||
var logType = $thisBtn.data('log_type');
|
var logType = $thisBtn.data('log_type');
|
||||||
var $last = $('.log_{0}:last'.format(logType));
|
var $last = $('.log_{0}:last'.format(logType));
|
||||||
var reqTo = null;
|
var reqTo = null;
|
||||||
if($last.length){
|
if ($last.length) {
|
||||||
reqTo = $last.data('seq');
|
reqTo = $last.data('seq');
|
||||||
}
|
}
|
||||||
|
|
||||||
$.post({
|
$.post({
|
||||||
url:'j_general_log_old.php',
|
url: 'j_general_log_old.php',
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
data:{
|
data: {
|
||||||
to:reqTo,
|
to: reqTo,
|
||||||
type:logType
|
type: logType
|
||||||
}
|
}
|
||||||
}).then(function(data){
|
}).then(function(data) {
|
||||||
if(!data){
|
if (!data) {
|
||||||
return quickReject('로그를 받아오지 못했습니다.');
|
return quickReject('로그를 받아오지 못했습니다.');
|
||||||
}
|
}
|
||||||
if(!data.result){
|
if (!data.result) {
|
||||||
return quickReject('로그를 받아오지 못했습니다. : '+data.reason);
|
return quickReject('로그를 받아오지 못했습니다. : ' + data.reason);
|
||||||
}
|
|
||||||
|
|
||||||
var keys = Object.keys(data.log);
|
|
||||||
if(keys.length > 1 && keys[0] < keys[1]){
|
|
||||||
keys.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(keys == 0){
|
|
||||||
$thisBtn.hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var html = [];
|
|
||||||
$.each(keys, function(_, key){
|
|
||||||
if($('#log_{0}_{1}'.format(logType, key)).length){
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
var item = data.log[key];
|
|
||||||
html.push("<div class='log_{0}' id='log_{0}_{1}' data-seq='{1}'>{2}</div>".format(logType, key, item));
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#{0}Plate'.format(logType)).append(html);
|
var keys = Object.keys(data.log);
|
||||||
}, errUnknown)
|
if (keys.length > 1 && keys[0] < keys[1]) {
|
||||||
.fail(function(reason){
|
keys.reverse();
|
||||||
alert(reason);
|
}
|
||||||
location.reload();
|
|
||||||
});
|
if (keys == 0) {
|
||||||
|
$thisBtn.hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var html = [];
|
||||||
|
$.each(keys, function(_, key) {
|
||||||
|
if ($('#log_{0}_{1}'.format(logType, key)).length) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
var item = data.log[key];
|
||||||
|
html.push("<div class='log_{0}' id='log_{0}_{1}' data-seq='{1}'>{2}</div>".format(logType, key, item));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#{0}Plate'.format(logType)).append(html);
|
||||||
|
}, errUnknown)
|
||||||
|
.fail(function(reason) {
|
||||||
|
alert(reason);
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
initCustomCSSForm();
|
initCustomCSSForm();
|
||||||
|
|
||||||
|
|
||||||
$('#die_immediately').click(function(){
|
$('#die_immediately').click(function() {
|
||||||
if(!confirm('정말로 삭제하시겠습니까?')){
|
if (!confirm('정말로 삭제하시겠습니까?')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$.post({
|
$.post({
|
||||||
url:'j_die_immediately.php',
|
url: 'j_die_immediately.php',
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
}).then(function(data){
|
}).then(function(data) {
|
||||||
if(!data){
|
if (!data) {
|
||||||
return quickReject('실패했습니다.');
|
return quickReject('실패했습니다.');
|
||||||
}
|
}
|
||||||
if(!data.result){
|
if (!data.result) {
|
||||||
return quickReject(data.reason);
|
return quickReject(data.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
location.replace('..');
|
location.replace('..');
|
||||||
|
|
||||||
}, errUnknown)
|
}, errUnknown)
|
||||||
.fail(function(reason){
|
.fail(function(reason) {
|
||||||
alert(reason);
|
alert(reason);
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#vacation').click(function(){
|
$('#vacation').click(function() {
|
||||||
if(!confirm('휴가 기능을 신청할까요?')){
|
if (!confirm('휴가 기능을 신청할까요?')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$.post({
|
$.post({
|
||||||
url:'j_vacation.php',
|
url: 'j_vacation.php',
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
}).then(function(data){
|
}).then(function(data) {
|
||||||
if(!data){
|
if (!data) {
|
||||||
return quickReject('실패했습니다.');
|
return quickReject('실패했습니다.');
|
||||||
}
|
}
|
||||||
if(!data.result){
|
if (!data.result) {
|
||||||
return quickReject(data.reason);
|
return quickReject(data.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
}, errUnknown)
|
}, errUnknown)
|
||||||
.fail(function(reason){
|
.fail(function(reason) {
|
||||||
alert(reason);
|
alert(reason);
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#set_my_setting').click(function(){
|
$('#set_my_setting').click(function() {
|
||||||
$.post({
|
$.post({
|
||||||
url:'j_set_my_setting.php',
|
url: 'j_set_my_setting.php',
|
||||||
dataType:'json',
|
dataType: 'json',
|
||||||
data:{
|
data: {
|
||||||
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) {
|
||||||
return quickReject('실패했습니다.');
|
return quickReject('실패했습니다.');
|
||||||
}
|
}
|
||||||
if(!data.result){
|
if (!data.result) {
|
||||||
return quickReject(data.reason);
|
return quickReject(data.reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
location.reload();
|
location.reload();
|
||||||
|
|
||||||
}, errUnknown)
|
}, errUnknown)
|
||||||
.fail(function(reason){
|
.fail(function(reason) {
|
||||||
alert(reason);
|
alert(reason);
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -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();
|
||||||
|
|||||||
@@ -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}, ");
|
||||||
|
|||||||
Reference in New Issue
Block a user