From 0813f48fce0d1c0604454fffd142a9405dd91154 Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 26 Nov 2018 00:03:11 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=201=EC=B0=A8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_119_b.php | 9 +++++++-- hwe/func.old.php | 5 ++++- hwe/sammo/ActionItem/che_의술_청낭서.php | 1 + hwe/sammo/ActionItem/che_의술_태평청령.php | 2 ++ hwe/sammo/ActionItem/che_치료_도소연명.php | 1 + hwe/sammo/ActionItem/che_치료_무후행군.php | 1 + hwe/sammo/ActionItem/che_치료_오석산.php | 1 + hwe/sammo/ActionItem/che_치료_정력견혈.php | 1 + hwe/sammo/ActionItem/che_치료_칠엽청점.php | 1 + hwe/sammo/ActionItem/che_치료_환약.php | 1 + hwe/sammo/ActionSpecialDomestic/che_거상.php | 18 ++++++++++++++++++ hwe/sammo/ActionSpecialDomestic/che_인덕.php | 2 +- hwe/sammo/ActionSpecialWar/che_반계.php | 2 +- hwe/sammo/ActionSpecialWar/che_의술.php | 6 ++++-- hwe/sammo/General.php | 9 +++++++-- hwe/sammo/ResetHelper.php | 3 ++- hwe/sammo/Scenario/NPC.php | 12 +++--------- hwe/scenario/scenario_2160.json | 6 +++--- hwe/sql/reset.sql | 10 +++++----- hwe/sql/schema.sql | 4 ++-- src/sammo/TimeUtil.php | 10 +++++----- 21 files changed, 71 insertions(+), 34 deletions(-) create mode 100644 hwe/sammo/ActionSpecialDomestic/che_거상.php diff --git a/hwe/_119_b.php b/hwe/_119_b.php index 5a55fbbe..c3297b61 100644 --- a/hwe/_119_b.php +++ b/hwe/_119_b.php @@ -80,10 +80,15 @@ case "쌀지급": processRiceIncome(); break; case "락걸기": - $db->update('plock', ['plock'=>1], true); + $db->update('plock', [ + 'plock'=>1, + 'locktime'=>TimeUtil::now(true) + ], true); break; case "락풀기": - $db->update('plock', ['plock'=>0], true); + $db->update('plock', [ + 'plock'=>0 + ], true); break; } diff --git a/hwe/func.old.php b/hwe/func.old.php index 2c43abc9..277fc986 100644 --- a/hwe/func.old.php +++ b/hwe/func.old.php @@ -1548,7 +1548,10 @@ function checkTurn() { if($gameStor->isunited == 2) { - $db->update('plock', ['plock'=>1], true); + $db->update('plock', [ + 'plock'=>1, + 'locktime'=>TimeUtil::now(true) + ], true); return; } $gameStor->cacheAll(); diff --git a/hwe/sammo/ActionItem/che_의술_청낭서.php b/hwe/sammo/ActionItem/che_의술_청낭서.php index b5473e82..66683d35 100644 --- a/hwe/sammo/ActionItem/che_의술_청낭서.php +++ b/hwe/sammo/ActionItem/che_의술_청낭서.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_의술_청낭서 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_의술_태평청령.php b/hwe/sammo/ActionItem/che_의술_태평청령.php index 3c5b0222..5827946a 100644 --- a/hwe/sammo/ActionItem/che_의술_태평청령.php +++ b/hwe/sammo/ActionItem/che_의술_태평청령.php @@ -2,6 +2,8 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; +use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_의술_태평청령 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_도소연명.php b/hwe/sammo/ActionItem/che_치료_도소연명.php index 15784da8..a70e01de 100644 --- a/hwe/sammo/ActionItem/che_치료_도소연명.php +++ b/hwe/sammo/ActionItem/che_치료_도소연명.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_도소연명 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_무후행군.php b/hwe/sammo/ActionItem/che_치료_무후행군.php index f4ca04d1..5fc27641 100644 --- a/hwe/sammo/ActionItem/che_치료_무후행군.php +++ b/hwe/sammo/ActionItem/che_치료_무후행군.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_무후행군 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_오석산.php b/hwe/sammo/ActionItem/che_치료_오석산.php index 2d3ad3fa..4140cd55 100644 --- a/hwe/sammo/ActionItem/che_치료_오석산.php +++ b/hwe/sammo/ActionItem/che_치료_오석산.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_오석산 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_정력견혈.php b/hwe/sammo/ActionItem/che_치료_정력견혈.php index a229ebcd..26e257ba 100644 --- a/hwe/sammo/ActionItem/che_치료_정력견혈.php +++ b/hwe/sammo/ActionItem/che_치료_정력견혈.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_정력견혈 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_칠엽청점.php b/hwe/sammo/ActionItem/che_치료_칠엽청점.php index cdd0be39..01029ff6 100644 --- a/hwe/sammo/ActionItem/che_치료_칠엽청점.php +++ b/hwe/sammo/ActionItem/che_치료_칠엽청점.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_칠엽청점 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionItem/che_치료_환약.php b/hwe/sammo/ActionItem/che_치료_환약.php index 3b2f509d..9b6c59ac 100644 --- a/hwe/sammo/ActionItem/che_치료_환약.php +++ b/hwe/sammo/ActionItem/che_치료_환약.php @@ -3,6 +3,7 @@ namespace sammo\ActionNationType; use \sammo\iAction; use \sammo\General; use \sammo\GeneralTrigger; +use \sammo\GeneralTriggerCaller; class che_치료_환약 extends \sammo\BaseItem{ diff --git a/hwe/sammo/ActionSpecialDomestic/che_거상.php b/hwe/sammo/ActionSpecialDomestic/che_거상.php new file mode 100644 index 00000000..9778a0a0 --- /dev/null +++ b/hwe/sammo/ActionSpecialDomestic/che_거상.php @@ -0,0 +1,18 @@ +'; + + static $selectWeightType = SpecialityConst::WEIGHT_NORM; + static $selectWeight = 0; + static $type = []; + +} \ No newline at end of file diff --git a/hwe/sammo/ActionSpecialDomestic/che_인덕.php b/hwe/sammo/ActionSpecialDomestic/che_인덕.php index 04ad166b..81eeb1d9 100644 --- a/hwe/sammo/ActionSpecialDomestic/che_인덕.php +++ b/hwe/sammo/ActionSpecialDomestic/che_인덕.php @@ -4,7 +4,7 @@ use \sammo\iAction; use \sammo\General; use \sammo\SpecialityConst; -class che_통찰 implements iAction{ +class che_인덕 implements iAction{ use \sammo\DefaultAction; static $id = 20; diff --git a/hwe/sammo/ActionSpecialWar/che_반계.php b/hwe/sammo/ActionSpecialWar/che_반계.php index eaf6adf0..8e35fa06 100644 --- a/hwe/sammo/ActionSpecialWar/che_반계.php +++ b/hwe/sammo/ActionSpecialWar/che_반계.php @@ -4,7 +4,7 @@ use \sammo\iAction; use \sammo\General; use \sammo\SpecialityConst; -class che_신중 implements iAction{ +class che_반계 implements iAction{ use \sammo\DefaultAction; static $id = 45; diff --git a/hwe/sammo/ActionSpecialWar/che_의술.php b/hwe/sammo/ActionSpecialWar/che_의술.php index d7861634..4e5025fb 100644 --- a/hwe/sammo/ActionSpecialWar/che_의술.php +++ b/hwe/sammo/ActionSpecialWar/che_의술.php @@ -1,9 +1,11 @@ nationType, @@ -477,7 +482,7 @@ class General implements iAction{ } return [$att, $def]; } - public function getBattleInitSkillTriggerList(WarUnit $unit):array{ + public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ $caller = new WarUnitTriggerCaller(); foreach(array_merge([ $this->nationType, @@ -498,7 +503,7 @@ class General implements iAction{ } return $caller; } - public function getBattlePhaseSkillTriggerList(WarUnit $unit):array{ + public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ $caller = new WarUnitTriggerCaller(); foreach(array_merge([ $this->nationType, diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 2bf3aa01..b246c1e5 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -161,7 +161,8 @@ class ResetHelper{ $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); $db->insert('plock', [ - 'plock'=>1 + 'plock'=>1, + 'locktime'=>TimeUtil::now(true) ]); CityConst::build(); diff --git a/hwe/sammo/Scenario/NPC.php b/hwe/sammo/Scenario/NPC.php index 02ca3f42..34141dee 100644 --- a/hwe/sammo/Scenario/NPC.php +++ b/hwe/sammo/Scenario/NPC.php @@ -112,7 +112,7 @@ class NPC{ $this->charDomestic = SpecialityConst::pickSpecialDomestic($general); } } - else if($char !== null){ + else if($char === null){ } else{ //TODO: 내특, 전특 구분 필요 @@ -121,9 +121,9 @@ class NPC{ $domesticClass = \sammo\getGeneralSpecialDomesticClass($char); $this->charDomestic = Util::getClassName($domesticClass); } - catch (Exception $e) { + catch (\Exception $e) { $warClass = \sammo\getGeneralSpecialWarClass($char); - $this->charWar = Util::getClassName($domesticClass); + $this->charWar = Util::getClassName($warClass); } } } @@ -230,12 +230,6 @@ class NPC{ if($duplicateCnt > 1){ $name = "{$name}($duplicateCnt}"; } - $this->realName = $name; - - $query = "select no from general where name like '{$name}%'"; - $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $count = MYDB_num_rows($result); - $count++; $this->realName = $name; diff --git a/hwe/scenario/scenario_2160.json b/hwe/scenario/scenario_2160.json index b6c45ee1..6f9b8a7f 100644 --- a/hwe/scenario/scenario_2160.json +++ b/hwe/scenario/scenario_2160.json @@ -380,7 +380,7 @@ [0, "큐어 하트", null, 0, null, 93, 90, 95, 0, 160, 300, null, "위압"], [0, "큐어 다이아몬드", null, 0, null, 86, 88, 90, 0, 160, 300, null, null], [0, "큐어 로제타", null, 0, null, 80, 80, 85, 0, 160, 300, null, "상재"], - [0, "큐어소드", null, 0, null, 79, 87, 82, 0, 160, 300, null, "착사"], + [0, "큐어소드", null, 0, null, 79, 87, 82, 0, 160, 300, null, "척사"], [0, "큐어에이스", null, 0, null, 75, 83, 77, 0, 160, 300, null, null], [0, "하세가와스바루", null, 0, null, 86, 77, 80, 0, 160, 300, null, null, "정말 초등학생은 최고야!!"], [0, "토모카", null, 0, null, 70, 64, 82, 0, 160, 300, null, null, "잘부탁 드려요 하세가와 코치님!"], @@ -425,14 +425,14 @@ [0, "노기소노코", null, 0, null, 81, 81, 78, 0, 160, 300, null, null], [0, "미노와긴", null, 0, null, 83, 87, 67, 0, 160, 300, null, null], [0, "아키선생님", null, 0, null, 85, 39, 88, 0, 160, 300, null, "귀모"], - [0, "신수", null, 0, null, 97, 69, 99, 0, 160, 300, null, "집증"], + [0, "신수", null, 0, null, 97, 69, 99, 0, 160, 300, null, "집중"], [0, "노기와카바", null, 0, null, 87, 85, 79, 0, 160, 300, null, null], [0, "우에사토히나타", null, 0, null, 80, 19, 85, 0, 160, 300, null, "귀모"], [0, "이요지마안즈", null, 0, null, 76, 88, 86, 0, 160, 295, null, "저격"], [0, "도이타마코", null, 0, null, 72, 89, 37, 0, 160, 300, null, "견고"], [0, "코오리치카게", null, 0, null, 67, 90, 83, 0, 160, 300, null, null], [0, "타카시마유우나", null, 0, null, 72, 88, 75, 0, 160, 300, null, null, "군짱, 그러면 안되."], - [0, "우타노", null, 0, null, 71, 83, 67, 0, 160, 300, null, "농업"], + [0, "우타노", null, 0, null, 71, 83, 67, 0, 160, 300, null, "경작"], [0, "후지모리미토", null, 0, null, 70, 15, 81, 0, 160, 300, null, null], [0, "키리토", null, 0, null, 85, 91, 80, 0, 160, 300, null, "무쌍", "스타…버스트!!!...스트림!!!!!"], [0, "아스나", null, 0, null, 94, 89, 87, 0, 160, 300, null, "무쌍", "내…이름…어떻게 안거야??"], diff --git a/hwe/sql/reset.sql b/hwe/sql/reset.sql index 6214e70c..d8af5ec4 100644 --- a/hwe/sql/reset.sql +++ b/hwe/sql/reset.sql @@ -1,9 +1,9 @@ # 장수 테이블 삭제 DROP TABLE IF EXISTS general; - +DROP TABLE IF EXISTS `general_turn`; # 국가 테이블 삭제 DROP TABLE IF EXISTS nation; - +DROP TABLE IF EXISTS `nation_turn`; # 도시 테이블 삭제 DROP TABLE IF EXISTS city; @@ -41,6 +41,8 @@ DROP TABLE IF EXISTS world_history; # 전체 이벤트 테이블 삭제(연감 대체?) DROP TABLE IF EXISTS general_public_record; +DROP TABLE IF EXISTS select_npc_token; + DROP TABLE IF EXISTS reserved_open; CREATE TABLE `reserved_open` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -50,6 +52,4 @@ CREATE TABLE `reserved_open` ( INDEX `date` (`date`) ) DEFAULT CHARSET=utf8mb4 -ENGINE=MyISAM; - -DROP TABLE IF EXISTS select_npc_token; \ No newline at end of file +ENGINE=MyISAM; \ No newline at end of file diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index e2ebe7a2..25f60482 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -74,7 +74,7 @@ CREATE TABLE `general` ( `personal` INT(2) NULL DEFAULT '0', `special` VARCHAR(20) NOT NULL DEFAULT 'None', `specage` INT(2) NULL DEFAULT '0', - `special2` INT(2) NULL DEFAULT '0', + `special2` VARCHAR(20) NOT NULL DEFAULT 'None', `specage2` INT(2) NULL DEFAULT '0', `mode` INT(1) NULL DEFAULT '2', `tnmt` INT(1) NULL DEFAULT '1', @@ -146,7 +146,7 @@ CREATE TABLE `general_turn` ( UNIQUE INDEX `general_id` (`general_id`, `turn_idx`), INDEX `action` (`action`, `turn_idx`, `general_id`) ) -COLLATE=utf8mb4 +DEFAULT CHARSET=utf8mb4 ENGINE=MyISAM ; diff --git a/src/sammo/TimeUtil.php b/src/sammo/TimeUtil.php index 4e6ec94a..24c3e17d 100644 --- a/src/sammo/TimeUtil.php +++ b/src/sammo/TimeUtil.php @@ -58,7 +58,7 @@ class TimeUtil return $obj->format('Y-m-d H:i:s.u'); } - public static function secondsToDateTime(float $fullSeconds, bool $isDateTimeImmutable=false): \DateTime{ + public static function secondsToDateTime(float $fullSeconds, bool $isDateTimeImmutable=false): \DateTimeInterface{ $seconds = floor($fullSeconds); $fraction = $fullSeconds - $seconds; @@ -77,15 +77,15 @@ class TimeUtil } public static function secondsToDateInterval(float $fullSeconds): \DateInterval{ - $dateBase = new \DateTime("@0"); + $d0 = new \DateTime("@0"); - return static::secondsToDateTime($fullSeconds)->diff($d0); + return static::secondsToDateTime($fullSeconds, true)->diff($d0); } public static function DateTimeToSeconds(\DateTimeInterface $dateTime): float{ - $dateBase = new \DateTimeImmutable("@0"); + $d0 = new \DateTimeImmutable("@0"); - return static::DateIntervalToSeconds($dateTime->diff($dateBase)); + return static::DateIntervalToSeconds($dateTime->diff($d0)); } public static function DateIntervalToSeconds(\DateInterval $interval): float{