From 403d91419399cb924cd7ca8220c7958ffe5547db Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 18 Jul 2018 03:32:47 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- f_install/templates/common.orig.css | 16 +++++------ hwe/sammo/CityConstBase.php | 2 -- hwe/sammo/GameUnitConstBase.php | 43 ++++++++++++++++++----------- hwe/sammo/ResetHelper.php | 3 +- src/sammo/Util.php | 3 -- 5 files changed, 37 insertions(+), 30 deletions(-) diff --git a/f_install/templates/common.orig.css b/f_install/templates/common.orig.css index c2425d47..bd5b249c 100644 --- a/f_install/templates/common.orig.css +++ b/f_install/templates/common.orig.css @@ -43,19 +43,19 @@ /*체 지도*/ .map_theme_che.map_spring .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat; } .map_theme_che.map_summer .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat; } .map_theme_che.map_fall .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat; } .map_theme_che.map_winter .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat; } .map_theme_che .map_bgroad{ @@ -64,19 +64,19 @@ /*미니체 지도*/ .map_theme_miniche.map_spring .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_spring.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat; } .map_theme_miniche.map_summer .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_summer.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat; } .map_theme_miniche.map_fall .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_fall.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat; } .map_theme_miniche.map_winter .map_bglayer1{ - background: url('_tK_gameImagePath_/map/che/map_winter.jpg') no-repeat; + background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat; } .map_theme_miniche .map_bgroad{ diff --git a/hwe/sammo/CityConstBase.php b/hwe/sammo/CityConstBase.php index 05579e88..742f5a19 100644 --- a/hwe/sammo/CityConstBase.php +++ b/hwe/sammo/CityConstBase.php @@ -350,7 +350,5 @@ class CityConstBase{ }, array_values(static::$constID)); DB::db()->insert('city', $queries); - - return $cityPositions; } } diff --git a/hwe/sammo/GameUnitConstBase.php b/hwe/sammo/GameUnitConstBase.php index 99e769ea..3b2e1937 100644 --- a/hwe/sammo/GameUnitConstBase.php +++ b/hwe/sammo/GameUnitConstBase.php @@ -365,6 +365,7 @@ class GameUnitConstBase{ $defence, $speed, $avoid, + $magicCoef, $cost, $rice, $reqTech, @@ -384,15 +385,19 @@ class GameUnitConstBase{ $info[] = "기술력 {$reqTech} 이상 필요"; } - $reqCities = array_map(function($reqCity) use (&$info){ - $info[] = "{$reqCity} 소유시 가능"; - return CityConst::byName($reqCity)->id; - }, $reqCities); + if($reqCities !== null){ + $reqCities = array_map(function($reqCity) use (&$info){ + $info[] = "{$reqCity} 소유시 가능"; + return CityConst::byName($reqCity)->id; + }, $reqCities); + } - $reqRegions = array_map(function($reqRegion) use (&$info){ - $info[] = "{$reqRegion} 지역 소유시 가능"; - return CityConst::$regionMap[$reqRegion]; - }, $reqRegions); + if($reqRegions !== null){ + $reqRegions = array_map(function($reqRegion) use (&$info){ + $info[] = "{$reqRegion} 지역 소유시 가능"; + return CityConst::$regionMap[$reqRegion]; + }, $reqRegions); + } $unit = new GameUnitDetail( $id, @@ -402,6 +407,7 @@ class GameUnitConstBase{ $defence, $speed, $avoid, + $magicCoef, $cost, $rice, $reqTech, @@ -420,18 +426,23 @@ class GameUnitConstBase{ } $constType[$armType][] = $unit; - foreach($unit->reqCities as $reqCity){ - if(!key_exists($reqCity, $constCity)){ - $constCity[$reqCity] = []; + if($unit->reqCities){ + foreach($unit->reqCities as $reqCity){ + if(!key_exists($reqCity, $constCity)){ + $constCity[$reqCity] = []; + } + $constCity[$reqCity][] = $unit; } - $constCity[$reqCity][] = $unit; } + - foreach($unit->reqRegions as $reqRegion){ - if(!key_exists($reqRegion, $constRegion)){ - $constRegion[$reqRegion] = []; + if($unit->reqRegions){ + foreach($unit->reqRegions as $reqRegion){ + if(!key_exists($reqRegion, $constRegion)){ + $constRegion[$reqRegion] = []; + } + $constRegion[$reqRegion][] = $unit; } - $constRegion[$reqRegion][] = $unit; } } diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index d6a1f163..0fae7445 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -154,7 +154,8 @@ class ResetHelper{ Util::generateFileUsingSimpleTemplate( __dir__.'/../templates/base_map.orig.js', __dir__.'/../d_shared/base_map.js', - ['cityPosition'=>Json::encode($cityPositions)] + ['cityPosition'=>Json::encode($cityPositions)], + true ); diff --git a/src/sammo/Util.php b/src/sammo/Util.php index ee8ea87b..5461d533 100644 --- a/src/sammo/Util.php +++ b/src/sammo/Util.php @@ -132,9 +132,6 @@ class Util extends \utilphp\util * params에 맞도록 class를 생성해주는 함수 */ public static function generatePHPClassFile(string $destFilePath, array $params, ?string $srcClassName=null, string $namespace='sammo'){ - if ($destFilePath === $srcFilePath) { - return 'invalid destFilePath'; - } if (!is_writable(dirname($destFilePath))) { return 'destFilePath is not writable'; }