맵 규격 재 정의
This commit is contained in:
1 parent
637dbbba0d
commit
742c3c7156
49 files changed
+245
-315
No files matched your search
+1
-1
@@ -91,7 +91,7 @@ if ($month <= 0) {
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -163,7 +163,7 @@ if($btn == "추방") {
|
||||
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] == 0 || rand()%100 == 0)) {
|
||||
if($general['npc'] >= 2 && ($admin['scenario'] < 100 || rand()%100 == 0)) {
|
||||
switch(rand()%5) {
|
||||
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
|
||||
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
|
||||
|
||||
+1
-1
@@ -2183,7 +2183,7 @@ function uniqueItem($general, $log, $vote=0) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen = MYDB_fetch_array($result);
|
||||
|
||||
if($admin['scenario'] == 0) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
if($admin['scenario'] < 100) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
|
||||
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
|
||||
|
||||
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||
|
||||
@@ -84,7 +84,7 @@ function process_25(&$general) {
|
||||
$joinedNations = Json::decode($general['nations']);
|
||||
|
||||
// 랜덤임관인 경우
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] == 0 || $admin['scenario'] >= 20 || !$admin['fiction'])){
|
||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] < 100 || $admin['scenario'] >= 2000 || !$admin['fiction'])){
|
||||
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
||||
$nations = $db->query(
|
||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
||||
@@ -339,7 +339,7 @@ function process_29(&$general) {
|
||||
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
||||
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
||||
$type = rand() % 10;
|
||||
if($admin['scenario'] == 0) {
|
||||
if($admin['scenario'] < 100) {
|
||||
switch($type) {
|
||||
case 0: case 1:
|
||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ $color = "cyan";
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/main.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<?=WebUtil::printJS('js/msg.js')?>
|
||||
<script>
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
|
||||
|
||||
function getCityPosition(){
|
||||
return {
|
||||
1: ["업", 345, 130],
|
||||
2: ["허창", 330, 215],
|
||||
3: ["낙양", 275, 180],
|
||||
4: ["장안", 145, 165],
|
||||
5: ["성도", 25, 290],
|
||||
6: ["양양", 255, 290],
|
||||
7: ["건업", 505, 305],
|
||||
8: ["북평", 465, 65],
|
||||
9: ["남피", 395, 95],
|
||||
10: ["완", 270, 235],
|
||||
11: ["수춘", 395, 270],
|
||||
12: ["서주", 440, 250],
|
||||
13: ["강릉", 245, 335],
|
||||
14: ["장사", 255, 375],
|
||||
15: ["시상", 360, 360],
|
||||
16: ["위례", 620, 145],
|
||||
17: ["계", 365, 35],
|
||||
18: ["복양", 410, 170],
|
||||
19: ["진류", 365, 185],
|
||||
20: ["여남", 330, 260],
|
||||
21: ["하비", 480, 235],
|
||||
22: ["서량", 25, 50],
|
||||
23: ["하내", 230, 150],
|
||||
24: ["한중", 135, 205],
|
||||
25: ["상용", 185, 225],
|
||||
26: ["덕양", 85, 275],
|
||||
27: ["강주", 70, 310],
|
||||
28: ["건녕", 80, 400],
|
||||
29: ["남해", 245, 480],
|
||||
30: ["계양", 230, 400],
|
||||
31: ["오", 510, 345],
|
||||
32: ["평양", 590, 100],
|
||||
33: ["사비", 605, 205],
|
||||
34: ["계림", 655, 200],
|
||||
35: ["진양", 295, 60],
|
||||
36: ["평원", 440, 115],
|
||||
37: ["북해", 470, 155],
|
||||
38: ["초", 365, 230],
|
||||
39: ["패", 430, 220],
|
||||
40: ["천수", 70, 105],
|
||||
41: ["안정", 95, 145],
|
||||
42: ["홍농", 210, 175],
|
||||
43: ["하변", 45, 190],
|
||||
44: ["자동", 75, 245],
|
||||
45: ["영안", 115, 295],
|
||||
46: ["귀양", 90, 360],
|
||||
47: ["주시", 30, 345],
|
||||
48: ["운남", 30, 415],
|
||||
49: ["남영", 135, 405],
|
||||
50: ["교지", 130, 480],
|
||||
51: ["신야", 250, 260],
|
||||
52: ["강하", 315, 295],
|
||||
53: ["무릉", 195, 355],
|
||||
54: ["영릉", 190, 395],
|
||||
55: ["상동", 210, 435],
|
||||
56: ["여강", 380, 315],
|
||||
57: ["회계", 480, 395],
|
||||
58: ["고창", 350, 405],
|
||||
59: ["대", 450, 480],
|
||||
60: ["안평", 530, 80],
|
||||
61: ["졸본", 570, 65],
|
||||
62: ["이도", 680, 260],
|
||||
63: ["강", 95, 35],
|
||||
64: ["저", 25, 120],
|
||||
65: ["흉노", 180, 95],
|
||||
66: ["남만", 80, 455],
|
||||
67: ["산월", 425, 430],
|
||||
68: ["오환", 610, 20],
|
||||
69: ["왜", 680, 320],
|
||||
70: ["호관", 285, 140],
|
||||
71: ["호로", 285, 205],
|
||||
72: ["사곡", 240, 175],
|
||||
73: ["함곡", 180, 175],
|
||||
74: ["사수", 310, 185],
|
||||
75: ["양평", 90, 220],
|
||||
76: ["가맹", 45, 225],
|
||||
77: ["역경", 410, 65],
|
||||
78: ["계교", 405, 135],
|
||||
79: ["동황", 515, 145],
|
||||
80: ["관도", 340, 165],
|
||||
81: ["정도", 400, 210],
|
||||
82: ["합비", 435, 285],
|
||||
83: ["광릉", 490, 275],
|
||||
84: ["적도", 130, 75],
|
||||
85: ["가정", 40, 160],
|
||||
86: ["기산", 110, 180],
|
||||
87: ["면죽", 35, 255],
|
||||
88: ["이릉", 215, 295],
|
||||
89: ["장판", 280, 315],
|
||||
90: ["백랑", 530, 30],
|
||||
91: ["적벽", 330, 325],
|
||||
92: ["파양", 430, 350],
|
||||
93: ["탐라", 605, 260],
|
||||
94: ["유구", 625, 435],
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -128,7 +128,7 @@ function starter($name, $type=0) {
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/base_map.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('js/map.js')?>
|
||||
<script>
|
||||
$(function(){
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class CityConst{
|
||||
private function __construct(){
|
||||
class CityConstBase{
|
||||
protected function __construct(){
|
||||
|
||||
}
|
||||
|
||||
private static $constID = null;
|
||||
private static $constName = null;
|
||||
private static $constRegion = null;
|
||||
protected static $constID = null;
|
||||
protected static $constName = null;
|
||||
protected static $constRegion = null;
|
||||
|
||||
|
||||
public static $regionMap = [
|
||||
@@ -55,7 +55,7 @@ class CityConst{
|
||||
return static::$constRegion[$region];
|
||||
}
|
||||
|
||||
private static $initCity = [
|
||||
protected static $initCity = [
|
||||
//id, 도시, 규모, 인구, 농, 상, 치, 성, 수,(x100)지역, x, y, 연결도시
|
||||
[ 1, '업', '특', 6205,125,113,100,117,122, '하북', 345, 130, ['남피', '복양', '호관', '계교', '관도']],
|
||||
[ 2, '허창', '특', 5876,121,124,100,117,125, '중원', 330, 215, ['완', '진류', '초', '호로', '사수', '관도']],
|
||||
@@ -153,7 +153,7 @@ class CityConst{
|
||||
[94, '유구', '수', 921, 17, 18, 20, 37, 37, '동이', 625, 435, ['대', '왜']]
|
||||
];
|
||||
|
||||
private static function _generate(){
|
||||
protected static function _generate(){
|
||||
if(static::$constID || static::$constName || static::$constRegion){
|
||||
return;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class CityConst{
|
||||
|
||||
}
|
||||
|
||||
private static $buildInitCommon = [
|
||||
protected static $buildInitCommon = [
|
||||
'rate'=>50,
|
||||
'trade'=>100,
|
||||
'gen1'=>0,
|
||||
@@ -247,7 +247,7 @@ class CityConst{
|
||||
'gen3'=>0
|
||||
];
|
||||
|
||||
private static $buildInit = [
|
||||
protected static $buildInit = [
|
||||
'수'=>[
|
||||
'pop' => 5000,
|
||||
'agri'=> 100,
|
||||
@@ -314,7 +314,7 @@ class CityConst{
|
||||
]
|
||||
];
|
||||
|
||||
private static function test(){
|
||||
protected static function test(){
|
||||
static::_generate();
|
||||
|
||||
foreach(static::all() as $id=>$city){
|
||||
@@ -330,20 +330,6 @@ class CityConst{
|
||||
public static function build(){
|
||||
static::_generate();
|
||||
static::test();
|
||||
|
||||
$cityPositions = [];
|
||||
foreach(static::$constID as $city){
|
||||
$cityPositions[$city->id] = [
|
||||
$city->name,
|
||||
$city->posX,
|
||||
$city->posY
|
||||
];
|
||||
}
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/base_map.orig.js',
|
||||
__dir__.'/d_shared/base_map.js',
|
||||
['cityPosition'=>Json::encode($cityPositions)]
|
||||
);
|
||||
|
||||
$queries = array_map(function(CityInitialDetail $city){
|
||||
$initValue = static::$buildInit[$city->level];
|
||||
@@ -364,5 +350,7 @@ class CityConst{
|
||||
}, array_values(static::$constID));
|
||||
|
||||
DB::db()->insert('city', $queries);
|
||||
|
||||
return $cityPositions;
|
||||
}
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitConst{
|
||||
private function __construct(){
|
||||
|
||||
}
|
||||
|
||||
private static $constID = null;
|
||||
private static $constName = null;
|
||||
private static $constCity = null;
|
||||
private static $constRegion = null;
|
||||
|
||||
/**
|
||||
* @return \sammo\GameUnitDetail[]
|
||||
*/
|
||||
public static function all(): array{
|
||||
static::_generate();
|
||||
return static::$constID;
|
||||
}
|
||||
|
||||
public static function byID(int $id): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constID[$id];
|
||||
}
|
||||
|
||||
public static function byName(string $name): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constName[$name];
|
||||
}
|
||||
|
||||
public static function byCity(int $city): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constCity[$city];
|
||||
}
|
||||
|
||||
public static function byRegion(int $region): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constRegion[$region];
|
||||
}
|
||||
|
||||
private static function _generate(){
|
||||
|
||||
if(static::$constID || static::$constName || static::$constCity || static::$constRegion){
|
||||
return;
|
||||
}
|
||||
|
||||
$list = [
|
||||
[ 0, '보병', 100, 150, 7, 10, 9, 9, 0, 0, true, ['표준적인 보병입니다.','보병은 방어특화입니다.']],
|
||||
[ 1, '청주병', 100, 200, 7, 10, 10, 11, 1, '중원', true, ['저렴하고 튼튼합니다.']],
|
||||
[ 2, '수병', 150, 150, 7, 10, 11, 10, 1, '오월', true, ['저렴하고 강력합니다.']],
|
||||
[ 3, '자객병', 100, 150, 7, 20, 10, 10, 2, '저', true, ['은밀하고 날쌥니다.']],
|
||||
[ 4, '근위병', 150, 200, 7, 10, 12, 12, 2, '낙양', true, ['최강의 보병입니다.']],
|
||||
[ 5, '등갑병', 100, 250, 7, 5, 13, 10, 1, '남중', true, ['등갑을 두른 보병입니다.']],
|
||||
|
||||
[10, '궁병', 100, 100, 7, 20, 10, 10, 0, 0, true, ['표준적인 궁병입니다.','궁병은 회피특화입니다.']],
|
||||
[11, '궁기병', 100, 100, 8, 30, 11, 12, 1, '동이', true, ['말을 타고 잘 피합니다.']],
|
||||
[12, '연노병', 150, 100, 8, 20, 12, 11, 1, '서촉', true, ['화살을 연사합니다.']],
|
||||
[13, '강궁병', 150, 150, 7, 20, 13, 13, 2, '양양', true, ['강건한 궁병입니다.']],
|
||||
[14, '석궁병', 200, 100, 7, 20, 13, 13, 2, '건업', true, ['강력한 화살을 쏩니다.']],
|
||||
|
||||
[20, '기병', 150, 100, 7, 5, 11, 11, 0, 0, true, ['표준적인 기병입니다.','기병은 공격특화입니다.']],
|
||||
[21, '백마병', 200, 100, 7, 5, 12, 13, 1, '하북', true, ['백마의 위용을 보여줍니다.']],
|
||||
[22, '중장기병', 150, 150, 7, 5, 13, 12, 1, '서북', true, ['갑주를 두른 기병입니다.']],
|
||||
[23, '돌격기병', 200, 100, 8, 5, 13, 11, 2,'흉노', true, ['저돌적으로 공격합니다.']],
|
||||
[24, '철기병', 100, 200, 7, 5, 11, 13, 2, '강', true, ['철갑을 두른 기병입니다.']],
|
||||
[25, '수렵기병', 150, 100, 8, 15, 12, 12, 2, '산월', true, ['날쎄고 빠른 기병입니다.']],
|
||||
[26, '맹수병', 250, 200, 6, 0, 16, 16, 2, '남만', true, ['어느 누구보다 강력합니다.']],
|
||||
[27, '호표기병', 200, 150, 7, 5, 14, 14, 2, '허창', true, ['정예 기병입니다.']],
|
||||
|
||||
[30, '귀병', 80, 80, 7, 5, 9, 9, 0, 0, true, ['계략을 사용하는 병종입니다.']],
|
||||
[31, '신귀병', 80, 80, 7, 20, 10, 10, 1,'초', true, ['신출귀몰한 귀병입니다.']],
|
||||
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true, ['저렴하고 튼튼합니다.']],
|
||||
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true, ['저렴하고 강력합니다.']],
|
||||
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true, ['백병전에도 능숙합니다.']],
|
||||
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 1000, false, ['전투를 포기하고 계략에 몰두합니다.']],
|
||||
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true, ['고도로 훈련된 귀병입니다.']],
|
||||
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true, ['갑주를 두른 귀병입니다.']],
|
||||
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true, ['날카로운 무기를 가진 귀병입니다.']],
|
||||
|
||||
[40, '정란', 100, 100, 6, 0, 15, 5, 0, 0, false, ['높은 구조물 위에서 공격합니다.']],
|
||||
[41, '충차', 150, 100, 6, 0, 20, 5, 0, 1000, false, ['엄청난 위력으로 성벽을 부수어버립니다.']],
|
||||
[42, '벽력거', 200, 100, 6, 0, 25, 5, 2, '업', true, ['상대에게 돌덩이를 날립니다.']],
|
||||
[43, '목우', 50, 200, 5, 0, 30, 5, 2, '성도', true, ['상대를 저지하는 특수병기입니다.']]
|
||||
];
|
||||
|
||||
$constID = [];
|
||||
$constName = [];
|
||||
$constCity = [];
|
||||
$constRegion = [];
|
||||
|
||||
foreach($list as $rawUnit){
|
||||
list(
|
||||
$id,
|
||||
$name,
|
||||
$attack,
|
||||
$defence,
|
||||
$speed,
|
||||
$avoid,
|
||||
$cost,
|
||||
$rice,
|
||||
$recruitType,
|
||||
$recruitCondition,
|
||||
$recruitFirst,
|
||||
$info
|
||||
) = $rawUnit;
|
||||
|
||||
//0인 경우는 기술치이다.
|
||||
if(!$recruitFirst){
|
||||
$info[] = "일정 시간이 지나야 사용 가능";
|
||||
}
|
||||
|
||||
if($recruitType == 1){
|
||||
$info[] = "{$recruitCondition}지역 소유시 가능";
|
||||
$recruitCondition = CityConst::$regionMap[$recruitCondition];
|
||||
}
|
||||
else if($recruitType == 2){
|
||||
$info[] = "{$recruitCondition} 소유시 가능";
|
||||
$recruitCondition = CityConst::byName($recruitCondition)->id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$unit = new GameUnitDetail(
|
||||
$id,
|
||||
$name,
|
||||
$attack,
|
||||
$defence,
|
||||
$speed,
|
||||
$avoid,
|
||||
$cost,
|
||||
$rice,
|
||||
$recruitType,
|
||||
$recruitCondition,
|
||||
$recruitFirst,
|
||||
$info
|
||||
);
|
||||
|
||||
$constID[$id] = $unit;
|
||||
$constName[$name] = $unit;
|
||||
if($recruitType == 1){
|
||||
if(!key_exists($recruitCondition, $constRegion)){
|
||||
$constRegion[$recruitCondition] = [];
|
||||
}
|
||||
$constRegion[$recruitCondition][] = $unit;
|
||||
}
|
||||
if($recruitType == 2){
|
||||
if(!key_exists($recruitCondition, $constCity)){
|
||||
$constCity[$recruitCondition] = [];
|
||||
}
|
||||
$constCity[$recruitCondition][] = $unit;
|
||||
}
|
||||
}
|
||||
|
||||
static::$constID = $constID;
|
||||
static::$constName = $constName;
|
||||
static::$constCity = $constCity;
|
||||
static::$constRegion = $constRegion;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitConstBase{
|
||||
protected function __construct(){
|
||||
|
||||
}
|
||||
|
||||
protected static $constID = null;
|
||||
protected static $constName = null;
|
||||
protected static $constCity = null;
|
||||
protected static $constRegion = null;
|
||||
|
||||
protected static $_buildData = [
|
||||
[ 0, '보병', 100, 150, 7, 10, 9, 9, 0, 0, true, ['표준적인 보병입니다.','보병은 방어특화입니다.']],
|
||||
[ 1, '청주병', 100, 200, 7, 10, 10, 11, 1, '중원', true, ['저렴하고 튼튼합니다.']],
|
||||
[ 2, '수병', 150, 150, 7, 10, 11, 10, 1, '오월', true, ['저렴하고 강력합니다.']],
|
||||
[ 3, '자객병', 100, 150, 7, 20, 10, 10, 2, '저', true, ['은밀하고 날쌥니다.']],
|
||||
[ 4, '근위병', 150, 200, 7, 10, 12, 12, 2, '낙양', true, ['최강의 보병입니다.']],
|
||||
[ 5, '등갑병', 100, 250, 7, 5, 13, 10, 1, '남중', true, ['등갑을 두른 보병입니다.']],
|
||||
|
||||
[10, '궁병', 100, 100, 7, 20, 10, 10, 0, 0, true, ['표준적인 궁병입니다.','궁병은 회피특화입니다.']],
|
||||
[11, '궁기병', 100, 100, 8, 30, 11, 12, 1, '동이', true, ['말을 타고 잘 피합니다.']],
|
||||
[12, '연노병', 150, 100, 8, 20, 12, 11, 1, '서촉', true, ['화살을 연사합니다.']],
|
||||
[13, '강궁병', 150, 150, 7, 20, 13, 13, 2, '양양', true, ['강건한 궁병입니다.']],
|
||||
[14, '석궁병', 200, 100, 7, 20, 13, 13, 2, '건업', true, ['강력한 화살을 쏩니다.']],
|
||||
|
||||
[20, '기병', 150, 100, 7, 5, 11, 11, 0, 0, true, ['표준적인 기병입니다.','기병은 공격특화입니다.']],
|
||||
[21, '백마병', 200, 100, 7, 5, 12, 13, 1, '하북', true, ['백마의 위용을 보여줍니다.']],
|
||||
[22, '중장기병', 150, 150, 7, 5, 13, 12, 1, '서북', true, ['갑주를 두른 기병입니다.']],
|
||||
[23, '돌격기병', 200, 100, 8, 5, 13, 11, 2,'흉노', true, ['저돌적으로 공격합니다.']],
|
||||
[24, '철기병', 100, 200, 7, 5, 11, 13, 2, '강', true, ['철갑을 두른 기병입니다.']],
|
||||
[25, '수렵기병', 150, 100, 8, 15, 12, 12, 2, '산월', true, ['날쎄고 빠른 기병입니다.']],
|
||||
[26, '맹수병', 250, 200, 6, 0, 16, 16, 2, '남만', true, ['어느 누구보다 강력합니다.']],
|
||||
[27, '호표기병', 200, 150, 7, 5, 14, 14, 2, '허창', true, ['정예 기병입니다.']],
|
||||
|
||||
[30, '귀병', 80, 80, 7, 5, 9, 9, 0, 0, true, ['계략을 사용하는 병종입니다.']],
|
||||
[31, '신귀병', 80, 80, 7, 20, 10, 10, 1,'초', true, ['신출귀몰한 귀병입니다.']],
|
||||
[32, '백귀병', 80, 130, 7, 5, 9, 11, 2, '오환', true, ['저렴하고 튼튼합니다.']],
|
||||
[33, '흑귀병', 130, 80, 7, 5, 11, 9, 2, '왜', true, ['저렴하고 강력합니다.']],
|
||||
[34, '악귀병', 130, 130, 7, 0, 12, 12, 2, '장안', true, ['백병전에도 능숙합니다.']],
|
||||
[35, '남귀병', 60, 60, 7, 10, 8, 8, 0, 1000, false, ['전투를 포기하고 계략에 몰두합니다.']],
|
||||
[36, '황귀병', 110, 110, 7, 0, 13, 10, 2, '낙양', true, ['고도로 훈련된 귀병입니다.']],
|
||||
[37, '천귀병', 80, 130, 7, 15, 11, 12, 2, '성도', true, ['갑주를 두른 귀병입니다.']],
|
||||
[38, '마귀병', 130, 80, 7, 15, 12, 11, 2, '업', true, ['날카로운 무기를 가진 귀병입니다.']],
|
||||
|
||||
[40, '정란', 100, 100, 6, 0, 15, 5, 0, 0, false, ['높은 구조물 위에서 공격합니다.']],
|
||||
[41, '충차', 150, 100, 6, 0, 20, 5, 0, 1000, false, ['엄청난 위력으로 성벽을 부수어버립니다.']],
|
||||
[42, '벽력거', 200, 100, 6, 0, 25, 5, 2, '업', true, ['상대에게 돌덩이를 날립니다.']],
|
||||
[43, '목우', 50, 200, 5, 0, 30, 5, 2, '성도', true, ['상대를 저지하는 특수병기입니다.']]
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \sammo\GameUnitDetail[]
|
||||
*/
|
||||
public static function all(): array{
|
||||
static::_generate();
|
||||
return static::$constID;
|
||||
}
|
||||
|
||||
public static function byID(int $id): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constID[$id];
|
||||
}
|
||||
|
||||
public static function byName(string $name): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constName[$name];
|
||||
}
|
||||
|
||||
public static function byCity(int $city): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constCity[$city];
|
||||
}
|
||||
|
||||
public static function byRegion(int $region): GameUnitDetail{
|
||||
static::_generate();
|
||||
return static::$constRegion[$region];
|
||||
}
|
||||
|
||||
protected static function _generate(){
|
||||
|
||||
if(static::$constID || static::$constName || static::$constCity || static::$constRegion){
|
||||
return;
|
||||
}
|
||||
|
||||
$constID = [];
|
||||
$constName = [];
|
||||
$constCity = [];
|
||||
$constRegion = [];
|
||||
|
||||
foreach(static::$_buildData as $rawUnit){
|
||||
list(
|
||||
$id,
|
||||
$name,
|
||||
$attack,
|
||||
$defence,
|
||||
$speed,
|
||||
$avoid,
|
||||
$cost,
|
||||
$rice,
|
||||
$recruitType,
|
||||
$recruitCondition,
|
||||
$recruitFirst,
|
||||
$info
|
||||
) = $rawUnit;
|
||||
|
||||
//0인 경우는 기술치이다.
|
||||
if(!$recruitFirst){
|
||||
$info[] = "일정 시간이 지나야 사용 가능";
|
||||
}
|
||||
|
||||
if($recruitType == 1){
|
||||
$info[] = "{$recruitCondition}지역 소유시 가능";
|
||||
$recruitCondition = CityConst::$regionMap[$recruitCondition];
|
||||
}
|
||||
else if($recruitType == 2){
|
||||
$info[] = "{$recruitCondition} 소유시 가능";
|
||||
$recruitCondition = CityConst::byName($recruitCondition)->id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$unit = new GameUnitDetail(
|
||||
$id,
|
||||
$name,
|
||||
$attack,
|
||||
$defence,
|
||||
$speed,
|
||||
$avoid,
|
||||
$cost,
|
||||
$rice,
|
||||
$recruitType,
|
||||
$recruitCondition,
|
||||
$recruitFirst,
|
||||
$info
|
||||
);
|
||||
|
||||
$constID[$id] = $unit;
|
||||
$constName[$name] = $unit;
|
||||
if($recruitType == 1){
|
||||
if(!key_exists($recruitCondition, $constRegion)){
|
||||
$constRegion[$recruitCondition] = [];
|
||||
}
|
||||
$constRegion[$recruitCondition][] = $unit;
|
||||
}
|
||||
if($recruitType == 2){
|
||||
if(!key_exists($recruitCondition, $constCity)){
|
||||
$constCity[$recruitCondition] = [];
|
||||
}
|
||||
$constCity[$recruitCondition][] = $unit;
|
||||
}
|
||||
}
|
||||
|
||||
static::$constID = $constID;
|
||||
static::$constName = $constName;
|
||||
static::$constCity = $constCity;
|
||||
static::$constRegion = $constRegion;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -143,6 +143,19 @@ class ResetHelper{
|
||||
]);
|
||||
|
||||
CityConst::build();
|
||||
$cityPositions = [];
|
||||
foreach(CityConst::all() as $city){
|
||||
$cityPositions[$city->id] = [
|
||||
$city->name,
|
||||
$city->posX,
|
||||
$city->posY
|
||||
];
|
||||
}
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/../templates/base_map.orig.js',
|
||||
__dir__.'/../d_shared/base_map.js',
|
||||
['cityPosition'=>Json::encode($cityPositions)]
|
||||
);
|
||||
|
||||
|
||||
$turntime = date('Y-m-d H:i:s');
|
||||
|
||||
+17
-1
@@ -189,7 +189,8 @@ class Scenario{
|
||||
'statChiefMin'=>$this->data['stat']['chiefMin']??$default['stat']['chiefMin'],
|
||||
];
|
||||
|
||||
$this->gameConf = array_merge($stat);
|
||||
$this->gameConf = array_merge($stat, $this->data['map']??[]);
|
||||
|
||||
$this->iconPath = $this->data['iconPath']??$default['iconPath'];
|
||||
return $this->gameConf;
|
||||
}
|
||||
@@ -363,6 +364,21 @@ class Scenario{
|
||||
$this->gameConf,
|
||||
true
|
||||
);
|
||||
|
||||
$mapPath = __dir__.'/../scenario/map';
|
||||
$unitPath = __dir__.'/../scenario/unit';
|
||||
$mapName = $this->gameConf['mapName']??'che';
|
||||
$unitSet = $this->gameConf['unitSet']??'che';
|
||||
|
||||
if(!file_exists("$mapPath/$mapName.php")){
|
||||
throw new \RuntimeException('맵 파일이 올바르게 지정되지 않음! : '.$mapName);
|
||||
}
|
||||
if(!file_exists("$unitPath/$unitSet.php")){
|
||||
throw new \RuntimeException('유닛 파일이 올바르게 지정되지 않음! : '.$unitSet);
|
||||
}
|
||||
|
||||
copy("$mapPath/$mapName.php", $path.'/CityConst.php');
|
||||
copy("$unitPath/$unitSet.php", $path.'/GameUnitConst.php');
|
||||
}
|
||||
|
||||
public function build($env=[]){
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
class CityConst extends CityConstBase{
|
||||
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드1】 영웅 난무",
|
||||
"title":"【가상모드1a】 영웅 난무",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드1.1】 영웅 난무",
|
||||
"title":"【가상모드1b】 영웅 난무 220",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드1】 영웅 집결",
|
||||
"title":"【가상모드2】 영웅 집결",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드2】 훼신 집결",
|
||||
"title":"【가상모드3】 훼신 집결",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드3】 영웅 시대",
|
||||
"title":"【가상모드4】 영웅 시대",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드4】 결사항전",
|
||||
"title":"【가상모드5】 결사항전",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드5】 영웅독존",
|
||||
"title":"【가상모드6】 영웅독존",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드6】 무풍지대",
|
||||
"title":"【가상모드7】 무풍지대",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드7】 가요대잔치",
|
||||
"title":"【가상모드8】 가요대잔치",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드8】 확산성 밀리언 아서",
|
||||
"title":"【가상모드9】 확산성 밀리언 아서",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드9-a】 천인 강림",
|
||||
"title":"【가상모드10-a】 천인 강림",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드9-b】 천인 강림·극",
|
||||
"title":"【가상모드10-b】 천인 강림·극",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드11】 삼국지11 영웅 난무",
|
||||
"title":"【가상모드12】 삼국지11 영웅 난무",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드12-a】 환상향 공",
|
||||
"title":"【가상모드13-a】 환상향 공",
|
||||
"life":0,
|
||||
"fiction":0,
|
||||
"stat":{
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드12-b】 환상향 춘",
|
||||
"title":"【가상모드13-b】 환상향 춘",
|
||||
"life":0,
|
||||
"fiction":0,
|
||||
"stat":{
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드13】 걸그룹대전",
|
||||
"title":"【가상모드14】 걸그룹대전",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드14】 소울소드",
|
||||
"title":"【가상모드15a】 소울소드",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title":"【가상모드14-1】 소울소드_리마스터",
|
||||
"title":"【가상모드15b】 소울소드_리마스터",
|
||||
"life":1,
|
||||
"fiction":1,
|
||||
"nation":[
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "【가상모드15】 애니집결",
|
||||
"title": "【가상모드16】 애니집결",
|
||||
"startYear": 180,
|
||||
"history": [
|
||||
"<C>●</>180년 1월:<L><b>【이벤트】</b></>제작자: 강서유서.",
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "【가상모드16】 루드라사움",
|
||||
"title": "【가상모드17】 루드라사움",
|
||||
"startYear": 180,
|
||||
"history": [
|
||||
"<C>●</>180년 1월:<L><b>【가상모드16】</> 루드라사움",
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
class GameUnitConst extends GameUnitConstBase
|
||||
{
|
||||
}
|
||||
Reference in new issue
Block a user