From 455d68d2b4eb3f2d750df9555023e4265ecf5451 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 30 Jan 2020 02:14:01 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=B4=ED=8A=B9,=20=EC=A0=84=ED=8A=B9=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 2 ++ hwe/func_command.php | 10 ++++++++++ hwe/func_process.php | 37 +++++++++++++++++++++++++++++++++++++ hwe/j_preprocessing.php | 3 +++ hwe/processing.php | 3 +++ 5 files changed, 55 insertions(+) diff --git a/hwe/func.php b/hwe/func.php index d8b8e5fc..2e06b94c 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -667,6 +667,8 @@ function commandTable() { } commandGroup("", 1); commandGroup("======= 개 인 ========"); + addCommand("내정 특기 초기화/3턴", 38); + addCommand("전투 특기 초기화/3턴", 39); if($me['level'] >= 1) { addCommand("단련(자금$develcost, 군량$develcost)", 41); addCommand("숙련전환(통솔경험, 자금$develcost, 군량$develcost)", 58); diff --git a/hwe/func_command.php b/hwe/func_command.php index f3725f9a..806db221 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -180,6 +180,13 @@ function getTurn(array $general, $type, $font=1) { $str[$i] = "【{$city['name']}】에 선동 실행"; break; + case 38: //내특 초기화 + $str[$i] = "내정 특기를 초기화"; + break; + case 39: //전특 초기화 + $str[$i] = "전투 특기를 초기화"; + break; + case 41: //단련 $str[$i] = "숙련도를 단련"; break; @@ -634,6 +641,9 @@ function processCommand($no, $reduceTurn) { case 34: process_34($general); break; //파괴 case 35: process_35($general); break; //선동 + case 38: process_38($general, '내정 특기', 'special', 'specage'); break; //내특 초기화 + case 39: process_38($general, '전투 특기', 'special2', 'specage2'); break; //내특 초기화 + case 41: process_41($general); break; //단련 case 42: process_42($general); break; //견문 case 43: process_43($general); break; //증여 diff --git a/hwe/func_process.php b/hwe/func_process.php index 7ac25889..de2e3476 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -2040,6 +2040,43 @@ function process_31(&$general) { pushGenLog($general, $log); } +function process_38(&$general, string $specName, string $specTypeKey, string $specAgeKey) { + $db = DB::db(); + $gameStor = KVStorage::getStorage($db, 'game_env'); + $connect=$db->get(); + + $log = []; + $date = substr($general['turntime'],11,5); + + $admin = $gameStor->getValues(['year', 'month']); + + if($general['term']%100 == 15) { + $term = intdiv($general['term'], 100) + 1; + $code = $term * 100 + 15; + } else { + $term = 1; + $code = 100 + 15; + } + + if(!$general[$specTypeKey]) { + $log[] = "●{$admin['month']}월:{$specName}를 갖고 있지 않습니다. {$specName} 초기화 실패. <1>$date"; + } elseif($term < 3) { + $log[] = "●{$admin['month']}월:새로운 적성을 찾는 중... ({$term}/3) <1>$date"; + + $query = "update general set resturn='ONGOING',term={$code} where no='{$general['no']}'"; + MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + } else { + + $general[$specAgeKey]=20; + $query = "update general set resturn='SUCCESS',term='0',$specTypeKey=0,$specAgeKey=age+1 where no='{$general['no']}'"; + MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + + $log[] = "●{$admin['month']}월:새로운 {$specName}를 가질 준비가 되었습니다. <1>$date"; + } + + pushGenLog($general, $log); +} + function process_41(&$general) { $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); diff --git a/hwe/j_preprocessing.php b/hwe/j_preprocessing.php index 31926d8f..246490b1 100644 --- a/hwe/j_preprocessing.php +++ b/hwe/j_preprocessing.php @@ -82,6 +82,9 @@ switch($commandtype) { // case 34: command_34($turn, 34); break; //파괴 // case 35: command_35($turn, 35); break; //선동 + case 38: command_Single($turn, 38); break; //내특 초기화 + case 39: command_Single($turn, 39); break; //전특 초기화 + case 41: command_Single($turn, 41); break; //단련 case 42: command_Single($turn, 42); break; //견문 // case 43: command_43( $turn, 43); break; //증여 diff --git a/hwe/processing.php b/hwe/processing.php index 8c2dd43d..a872bda0 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -80,6 +80,9 @@ switch($commandtype) { case 34: command_34($turn, 34); break; //파괴 case 35: command_35($turn, 35); break; //선동 + case 38: command_Single($turn, 38); break; //내특 초기화 + case 39: command_Single($turn, 39); break; //전특 초기화 + case 41: command_Single($turn, 41); break; //단련 case 42: command_Single($turn, 42); break; //견문 case 43: command_43( $turn, 43); break; //증여