Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e0fca124 | ||
|
|
5c6537fd7a | ||
|
|
764a82df00 | ||
|
|
e904911fd9 | ||
|
|
a7494f72f6 | ||
|
|
b6b53b028d | ||
|
|
1743ce714a | ||
|
|
656f0c5d11 | ||
|
|
d80aebe1f4 | ||
|
|
ad48bc1962 | ||
|
|
d72fbb7098 | ||
|
|
95d5eaa09b | ||
|
|
b997a6159e | ||
|
|
1cd8b7a450 | ||
|
|
c5a8eb4261 | ||
|
|
8891c29cbd | ||
|
|
2facdfa1dd | ||
|
|
65c9fa0c21 | ||
|
|
e53c85dbaf | ||
|
|
3a231e8e61 | ||
|
|
4dc7776387 | ||
|
|
5ca043e0f1 | ||
|
|
9ef052c814 | ||
|
|
6d1690beaa | ||
|
|
171656e5be | ||
|
|
385e7f4871 | ||
|
|
89c5485784 | ||
|
|
02d191ec28 | ||
|
|
47c3090f3a | ||
|
|
476dac1ac1 | ||
|
|
8ca0d0ced4 | ||
|
|
ab197489d7 | ||
|
|
99736d187b | ||
|
|
197c09bd0d | ||
|
|
6cc634ba1f | ||
|
|
4c89ad91d2 | ||
|
|
d66233bce0 | ||
|
|
b485e6927e | ||
|
|
74b9e8bd7b | ||
|
|
545742ecc0 | ||
|
|
d9f1f65352 | ||
|
|
0904d17a5f | ||
|
|
87171b4246 | ||
|
|
78f8b56203 | ||
|
|
c160c5a555 | ||
|
|
31c7bf5348 | ||
|
|
6eadf718fc | ||
|
|
effced24d1 | ||
|
|
09f399db9a | ||
|
|
2b73f6faea | ||
|
|
943662605e | ||
|
|
9a04962bd6 | ||
|
|
c371f6bbb5 | ||
|
|
8324e2e454 | ||
|
|
30307c1b56 | ||
|
|
f139d0d2a8 | ||
|
|
33843764a7 | ||
|
|
aca7d7c571 | ||
|
|
bff72f609c | ||
|
|
adb03b7420 | ||
|
|
2094e18b60 | ||
|
|
541d8ddd40 | ||
|
|
f996172218 | ||
|
|
f9ffc1c1f3 | ||
|
|
05085ad504 | ||
|
|
64aecaf28b | ||
|
|
7b3ef45300 | ||
|
|
bd25de930b | ||
|
|
15d43c9653 | ||
|
|
5b7eba61cc | ||
|
|
2445c79805 | ||
|
|
63be2dee47 | ||
|
|
5bfef1be32 | ||
|
|
8253526f23 | ||
|
|
db19548e2c | ||
|
|
10af31f042 | ||
|
|
e7c6e17590 | ||
|
|
a277ac182b | ||
|
|
0eee613a95 | ||
|
|
b76fa38e09 | ||
|
|
c0f5c8a358 | ||
|
|
71dd82afe8 | ||
|
|
ea5425a528 | ||
|
|
d4ba13eee3 | ||
|
|
16831880dd | ||
|
|
f79fc98ba6 | ||
|
|
0483c75dd7 | ||
|
|
3a4dcacd56 | ||
|
|
5f6f09674e | ||
|
|
c785027c5c | ||
|
|
d2659cea5f | ||
|
|
a9b966b159 | ||
|
|
f2c23e21c5 | ||
|
|
53b973e2d3 | ||
|
|
b7a570cba2 | ||
|
|
c77b79f0d2 | ||
|
|
ef6678d8b0 | ||
|
|
21609fa9c4 | ||
|
|
accc083702 | ||
|
|
9e677f3871 | ||
|
|
55290eac30 | ||
|
|
d480502d33 | ||
|
|
c1cda16be0 | ||
|
|
8ca9df9f34 | ||
|
|
406b67b081 | ||
|
|
2c9fecf3ef | ||
|
|
6bc78b67bd | ||
|
|
5bbc46e070 | ||
|
|
6a9ceda361 | ||
|
|
ab2d5fd58f | ||
|
|
7018413777 | ||
|
|
77385616a4 | ||
|
|
c809f27bf5 | ||
|
|
493e778124 | ||
|
|
7373af50b9 | ||
|
|
309f053510 | ||
|
|
d976cf8a27 | ||
|
|
5d60a62a38 | ||
|
|
a3f7dbccea | ||
|
|
0c4cce3339 | ||
|
|
58ccbc4d3d | ||
|
|
c6cabc2087 | ||
|
|
ef1f2722fc | ||
|
|
6b4a7ee03b | ||
|
|
7745a2051d | ||
|
|
eabd5e9acc | ||
|
|
d7dcbf98ff | ||
|
|
ff4c73f3d3 | ||
|
|
dbf044b418 | ||
|
|
7a514e2492 | ||
|
|
a73e533287 | ||
|
|
0f175ac4c6 | ||
|
|
be15f1c698 | ||
|
|
a315da6041 | ||
|
|
3f43f218ac | ||
|
|
5c8ad646af | ||
|
|
77f5fddd90 | ||
|
|
eab8b1ede5 | ||
|
|
2ab0896523 | ||
|
|
639fe920df | ||
|
|
7577c84eca | ||
|
|
22c4ec2d4a | ||
|
|
8ac85881a9 | ||
|
|
724804efc6 | ||
|
|
ca57ef17fc | ||
|
|
480f015fb0 | ||
|
|
d90e087f20 | ||
|
|
3916cc0562 | ||
|
|
cb54e56417 | ||
|
|
6aa606f2fa | ||
|
|
53d13a11ce | ||
|
|
9ba2b4142d | ||
|
|
f5161a5b99 | ||
|
|
f9d5d190d5 | ||
|
|
eead9639a2 | ||
|
|
5044d5d3b4 | ||
|
|
44eed2c1df | ||
|
|
e83b182e4d | ||
|
|
888a76eda0 | ||
|
|
668364e583 | ||
|
|
35c7a2d1b6 | ||
|
|
79803178cd | ||
|
|
419ee8d8ff | ||
|
|
328b3c9409 | ||
|
|
f097508e87 | ||
|
|
e6791ee8ec | ||
|
|
cfbeba3de1 | ||
|
|
bbc7f5a734 | ||
|
|
e8726f03f3 | ||
|
|
de95c6d698 | ||
|
|
86b57447d8 | ||
|
|
c9d1efc6e7 | ||
|
|
dd1eeaddfa | ||
|
|
7f098db3de | ||
|
|
6468cbbfbd | ||
|
|
a30d61e842 | ||
|
|
e0029fdc87 | ||
|
|
712e2c32a0 | ||
|
|
f28e15b567 | ||
|
|
128e33661f | ||
|
|
3916561c62 | ||
|
|
00638d074a | ||
|
|
ca51b2d83a | ||
|
|
1a879f97a2 | ||
|
|
89d18cb7c5 | ||
|
|
4e14249707 | ||
|
|
41f2c08da8 | ||
|
|
4fca7bcfcf | ||
|
|
232725329a | ||
|
|
88247851f4 | ||
|
|
6efaec6642 | ||
|
|
b9e31e39e2 | ||
|
|
e2cd8ed391 | ||
|
|
8a1641fbfa | ||
|
|
936f069ac3 | ||
|
|
89faad730e | ||
|
|
798ab3e183 | ||
|
|
5508aa4533 | ||
|
|
81b7ebbab6 | ||
|
|
2d06e33e10 | ||
|
|
d8cc820572 | ||
|
|
d0ca46cfde | ||
|
|
513124161e | ||
|
|
7cfd8c7f79 | ||
|
|
c32ce5e795 | ||
|
|
d9c1530651 | ||
|
|
305eb071a9 | ||
|
|
10dab69c63 | ||
|
|
60ed594996 | ||
|
|
e60ddb3ee1 | ||
|
|
26b0992285 | ||
|
|
63f3ac807c | ||
|
|
ed1c33eac0 | ||
|
|
e7b7fd0bcc | ||
|
|
79d2b04721 | ||
|
|
5a8ab2d29c | ||
|
|
ed527ac394 | ||
|
|
bf09f48196 | ||
|
|
2a5af15aef | ||
|
|
1f8fe35e25 | ||
|
|
5979273a64 | ||
|
|
ef8c9e3968 | ||
|
|
baa9fdb660 | ||
|
|
35a860bb38 | ||
|
|
286939dc2c | ||
|
|
dd5b1dbdd8 | ||
|
|
fb8d3a038d | ||
|
|
ea5a25a671 | ||
|
|
d21fc4ab1d | ||
|
|
3ae3974866 | ||
|
|
71ffc3087e | ||
|
|
8f406489d4 | ||
|
|
a08d270968 | ||
|
|
48f13e4b82 | ||
|
|
51060f0e4b | ||
|
|
c583109046 | ||
|
|
cf05b693f1 | ||
|
|
d248c1ab0d | ||
|
|
34623fca94 | ||
|
|
975bdd5897 | ||
|
|
1b3380c2ca | ||
|
|
bb707b4a03 | ||
|
|
acb3b6ac85 | ||
|
|
80f6985f5f | ||
|
|
5e3a9c0579 | ||
|
|
b30d62d483 | ||
|
|
0ea1fdbd19 | ||
|
|
f068586f74 | ||
|
|
463f462e24 | ||
|
|
e0c4e3c58e | ||
|
|
5aa3ef38ba | ||
|
|
827277f6a3 | ||
|
|
46389341db | ||
|
|
a58f05a295 | ||
|
|
c0b0a0fe92 | ||
|
|
e9f471dd6f | ||
|
|
7917c5dddb | ||
|
|
de4541a3d9 | ||
|
|
77a496baa7 | ||
|
|
86e863de09 | ||
|
|
c2cfd217c2 | ||
|
|
f2366a61b0 | ||
|
|
9959393dee | ||
|
|
16facf98f1 | ||
|
|
bc8ce8832a | ||
|
|
20bcf960ef | ||
|
|
5cecd3e995 | ||
|
|
d7ead25ea4 | ||
|
|
75c0c375d1 | ||
|
|
5db4913292 | ||
|
|
a6a53b1d0d | ||
|
|
81a0c0e120 | ||
|
|
0dae71a644 | ||
|
|
f8eedaa3ea | ||
|
|
ce2d97a7e7 | ||
|
|
2cb570eaca | ||
|
|
c8c4352957 | ||
|
|
a311db4555 | ||
|
|
05c515b2da | ||
|
|
c1acf2b0fe | ||
|
|
803a2407eb | ||
|
|
a87945d1fb | ||
|
|
30793e68df | ||
|
|
9c666bf7a9 | ||
|
|
eff1dd7c34 | ||
|
|
e79a33ebb0 | ||
|
|
cb0adfdeaf | ||
|
|
6b135c343c | ||
|
|
6c92db524b | ||
|
|
b8dfd1c041 | ||
|
|
54d6347c1d | ||
|
|
4ea6e90600 | ||
|
|
4c7628a247 | ||
|
|
6c7334155a | ||
|
|
480e3ea974 | ||
|
|
1f639a5bc6 | ||
|
|
ccf3b07c3a | ||
|
|
d8508f2b72 | ||
|
|
5e13961ec8 | ||
|
|
80b1139371 | ||
|
|
635b41765c | ||
|
|
4b03686aa2 | ||
|
|
bfb0d8d639 | ||
|
|
93d4a0211d | ||
|
|
cd31bc69ef | ||
|
|
4a7b84d6de | ||
|
|
3142714c11 | ||
|
|
7ea10416a9 | ||
|
|
3e427db0f1 | ||
|
|
9f7b18d294 | ||
|
|
9af0e351b8 | ||
|
|
5c6aa2340d | ||
|
|
4424ec48cf | ||
|
|
61be34581e | ||
|
|
731978356d | ||
|
|
d5223ad1ab | ||
|
|
7cfdfab198 | ||
|
|
eb70e51ac1 | ||
|
|
1d48e7c7ae | ||
|
|
d6fc9fc8c3 | ||
|
|
8ada0976fe | ||
|
|
389ff5e9a4 | ||
|
|
5179e0228c | ||
|
|
2268526314 | ||
|
|
db4bc0eafe | ||
|
|
6edaf79df1 | ||
|
|
79cead3b59 | ||
|
|
db1b12b85c | ||
|
|
9360b7675a | ||
|
|
9c82fd17fe | ||
|
|
3a4665e473 | ||
|
|
b34f4648ee | ||
|
|
0de786d2ea | ||
|
|
ec7aafa1ff | ||
|
|
30c219716d | ||
|
|
5dd47cb89b | ||
|
|
abe856bd3f | ||
|
|
6ecb009466 | ||
|
|
3b4b2383a8 | ||
|
|
4ddd46c4a2 | ||
|
|
69ec2469b4 | ||
|
|
5789af801a | ||
|
|
7171b6302b | ||
|
|
51d4818b1e | ||
|
|
1c2875e7fc | ||
|
|
5048a88310 | ||
|
|
aef37f4362 | ||
|
|
d04641041b | ||
|
|
67b2ccea86 | ||
|
|
5ff9ca3c99 | ||
|
|
fe55df8b2f | ||
|
|
457f605898 | ||
|
|
0f2625133f | ||
|
|
fa34dbdf6f | ||
|
|
050913b0b4 | ||
|
|
a47e47d42c | ||
|
|
43d994b59a | ||
|
|
e8204d46ce | ||
|
|
fece659cfb | ||
|
|
695265b299 | ||
|
|
b652ed0b33 | ||
|
|
9a641552e4 | ||
|
|
3d18aeb5bc | ||
|
|
b545afce50 | ||
|
|
8fca98c0c9 | ||
|
|
0a98c71dfe | ||
|
|
ed75f39094 | ||
|
|
456245f23a | ||
|
|
b4529c9338 | ||
|
|
0ca7a8ab8a | ||
|
|
02f2209e8f | ||
|
|
fb72d02912 | ||
|
|
665fb25fc1 | ||
|
|
742c3c7156 | ||
|
|
637dbbba0d |
@@ -45,3 +45,4 @@ test.php
|
|||||||
|
|
||||||
phpinfo.php
|
phpinfo.php
|
||||||
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
|
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
|
||||||
|
*.sqlite3
|
||||||
|
|||||||
+2
-1
@@ -19,7 +19,8 @@
|
|||||||
"pguardiario/phpuri": "^1.0",
|
"pguardiario/phpuri": "^1.0",
|
||||||
"symfony/lock": "^4.1",
|
"symfony/lock": "^4.1",
|
||||||
"ezyang/htmlpurifier": "^4.10",
|
"ezyang/htmlpurifier": "^4.10",
|
||||||
"xemlock/htmlpurifier-html5": "^0.1.7"
|
"xemlock/htmlpurifier-html5": "^0.1.7",
|
||||||
|
"catfan/medoo": "^1.5"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
Generated
+70
-11
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "43da7d5e9d8441faa4311f32b16ee1c0",
|
"content-hash": "3fceaf3c2925068c7e757ab12036e29e",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "brandonwamboldt/utilphp",
|
"name": "brandonwamboldt/utilphp",
|
||||||
@@ -52,6 +52,65 @@
|
|||||||
],
|
],
|
||||||
"time": "2015-02-02T17:56:14+00:00"
|
"time": "2015-02-02T17:56:14+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "catfan/medoo",
|
||||||
|
"version": "v1.5.7",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/catfan/Medoo.git",
|
||||||
|
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/catfan/Medoo/zipball/8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||||
|
"reference": "8d90cba0e8ff176028847527d0ea76fe41a06ecf",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-pdo": "*",
|
||||||
|
"php": ">=5.4"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-pdo_dblib": "For MSSQL or Sybase database on Linux/UNIX platform",
|
||||||
|
"ext-pdo_mysql": "For MySQL or MariaDB database",
|
||||||
|
"ext-pdo_oci": "For Oracle database",
|
||||||
|
"ext-pdo_oci8": "For Oracle version 8 database",
|
||||||
|
"ext-pdo_pqsql": "For PostgreSQL database",
|
||||||
|
"ext-pdo_sqlite": "For SQLite database",
|
||||||
|
"ext-pdo_sqlsrv": "For MSSQL database"
|
||||||
|
},
|
||||||
|
"type": "framework",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Medoo\\": "/src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Angel Lai",
|
||||||
|
"email": "angel@catfan.me"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The lightest PHP database framework to accelerate development",
|
||||||
|
"homepage": "https://medoo.in",
|
||||||
|
"keywords": [
|
||||||
|
"database",
|
||||||
|
"lightweight",
|
||||||
|
"mariadb",
|
||||||
|
"mssql",
|
||||||
|
"mysql",
|
||||||
|
"oracle",
|
||||||
|
"php framework",
|
||||||
|
"postgresql",
|
||||||
|
"sql",
|
||||||
|
"sqlite"
|
||||||
|
],
|
||||||
|
"time": "2018-06-14T18:59:08+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ezyang/htmlpurifier",
|
"name": "ezyang/htmlpurifier",
|
||||||
"version": "v4.10.0",
|
"version": "v4.10.0",
|
||||||
@@ -318,16 +377,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "leafo/scssphp",
|
"name": "leafo/scssphp",
|
||||||
"version": "v0.7.6",
|
"version": "v0.7.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/leafo/scssphp.git",
|
"url": "https://github.com/leafo/scssphp.git",
|
||||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794"
|
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/leafo/scssphp/zipball/585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
"url": "https://api.github.com/repos/leafo/scssphp/zipball/1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||||
"reference": "585f6ae84de62ffecf69c23805f25d78d7e4b794",
|
"reference": "1d656f8c02a3a69404bba6b28ec4e06edddf0f49",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -366,7 +425,7 @@
|
|||||||
"scss",
|
"scss",
|
||||||
"stylesheet"
|
"stylesheet"
|
||||||
],
|
],
|
||||||
"time": "2018-05-24T02:18:53+00:00"
|
"time": "2018-07-22T01:22:08+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/plates",
|
"name": "league/plates",
|
||||||
@@ -751,16 +810,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/lock",
|
"name": "symfony/lock",
|
||||||
"version": "v4.1.0",
|
"version": "v4.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/lock.git",
|
"url": "https://github.com/symfony/lock.git",
|
||||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a"
|
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/lock/zipball/a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
"url": "https://api.github.com/repos/symfony/lock/zipball/d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||||
"reference": "a1df50492e927ad00ca271f29adb2949a14f2a5a",
|
"reference": "d508b5dd92272cb74300396ecaadde969d0f7976",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -808,7 +867,7 @@
|
|||||||
"redlock",
|
"redlock",
|
||||||
"semaphore"
|
"semaphore"
|
||||||
],
|
],
|
||||||
"time": "2018-05-30T07:26:09+00:00"
|
"time": "2018-06-21T11:15:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vlucas/valitron",
|
"name": "vlucas/valitron",
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ a.just_link {
|
|||||||
}
|
}
|
||||||
|
|
||||||
button.with_skin {
|
button.with_skin {
|
||||||
|
padding:0 4px;
|
||||||
background-color: black; color: white;
|
background-color: black; color: white;
|
||||||
font-family: '맑은 고딕';
|
font-family: '맑은 고딕';
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
+17
-2
@@ -52,8 +52,8 @@ input::-webkit-input-placeholder {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-button{
|
.login_btn_group{
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-register{
|
.login-register{
|
||||||
@@ -87,6 +87,21 @@ input::-webkit-input-placeholder {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full-content {
|
||||||
|
position:fixed;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
z-index:800;
|
||||||
|
}
|
||||||
|
|
||||||
|
#login_card{
|
||||||
|
z-index:801;
|
||||||
|
}
|
||||||
|
|
||||||
#btn_kakao_login{
|
#btn_kakao_login{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height:46px;
|
height:46px;
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
|
|
||||||
#user_info_container{
|
#user_info_container{
|
||||||
width:500px;
|
width:550px;
|
||||||
position:absolute;
|
position:absolute;
|
||||||
left:50%;
|
left:50%;
|
||||||
margin-left:-250px;
|
margin-left:-250px;
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,132 @@
|
|||||||
|
//download.js v3.0, by dandavis; 2008-2014. [CCBY2] see http://danml.com/download.html for tests/usage
|
||||||
|
// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
|
||||||
|
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
|
||||||
|
// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support
|
||||||
|
|
||||||
|
// data can be a string, Blob, File, or dataURL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function download(data, strFileName, strMimeType) {
|
||||||
|
|
||||||
|
var self = window, // this script is only for browsers anyway...
|
||||||
|
u = "application/octet-stream", // this default mime also triggers iframe downloads
|
||||||
|
m = strMimeType || u,
|
||||||
|
x = data,
|
||||||
|
D = document,
|
||||||
|
a = D.createElement("a"),
|
||||||
|
z = function(a){return String(a);},
|
||||||
|
|
||||||
|
|
||||||
|
B = self.Blob || self.MozBlob || self.WebKitBlob || z,
|
||||||
|
BB = self.MSBlobBuilder || self.WebKitBlobBuilder || self.BlobBuilder,
|
||||||
|
fn = strFileName || "download",
|
||||||
|
blob,
|
||||||
|
b,
|
||||||
|
ua,
|
||||||
|
fr;
|
||||||
|
|
||||||
|
//if(typeof B.bind === 'function' ){ B=B.bind(self); }
|
||||||
|
|
||||||
|
if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
|
||||||
|
x=[x, m];
|
||||||
|
m=x[0];
|
||||||
|
x=x[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//go ahead and download dataURLs right away
|
||||||
|
if(String(x).match(/^data\:[\w+\-]+\/[\w+\-]+[,;]/)){
|
||||||
|
return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:
|
||||||
|
navigator.msSaveBlob(d2b(x), fn) :
|
||||||
|
saver(x) ; // everyone else can save dataURLs un-processed
|
||||||
|
}//end if dataURL passed?
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
blob = x instanceof B ?
|
||||||
|
x :
|
||||||
|
new B([x], {type: m}) ;
|
||||||
|
}catch(y){
|
||||||
|
if(BB){
|
||||||
|
b = new BB();
|
||||||
|
b.append([x]);
|
||||||
|
blob = b.getBlob(m); // the blob
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function d2b(u) {
|
||||||
|
var p= u.split(/[:;,]/),
|
||||||
|
t= p[1],
|
||||||
|
dec= p[2] == "base64" ? atob : decodeURIComponent,
|
||||||
|
bin= dec(p.pop()),
|
||||||
|
mx= bin.length,
|
||||||
|
i= 0,
|
||||||
|
uia= new Uint8Array(mx);
|
||||||
|
|
||||||
|
for(i;i<mx;++i) uia[i]= bin.charCodeAt(i);
|
||||||
|
|
||||||
|
return new B([uia], {type: t});
|
||||||
|
}
|
||||||
|
|
||||||
|
function saver(url, winMode){
|
||||||
|
|
||||||
|
|
||||||
|
if ('download' in a) { //html5 A[download]
|
||||||
|
a.href = url;
|
||||||
|
a.setAttribute("download", fn);
|
||||||
|
a.innerHTML = "downloading...";
|
||||||
|
D.body.appendChild(a);
|
||||||
|
setTimeout(function() {
|
||||||
|
a.click();
|
||||||
|
D.body.removeChild(a);
|
||||||
|
if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(a.href);}, 250 );}
|
||||||
|
}, 66);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//do iframe dataURL download (old ch+FF):
|
||||||
|
var f = D.createElement("iframe");
|
||||||
|
D.body.appendChild(f);
|
||||||
|
if(!winMode){ // force a mime that will download:
|
||||||
|
url="data:"+url.replace(/^data:([\w\/\-\+]+)/, u);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
f.src = url;
|
||||||
|
setTimeout(function(){ D.body.removeChild(f); }, 333);
|
||||||
|
|
||||||
|
}//end saver
|
||||||
|
|
||||||
|
|
||||||
|
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
||||||
|
return navigator.msSaveBlob(blob, fn);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(self.URL){ // simple fast and modern way using Blob and URL:
|
||||||
|
saver(self.URL.createObjectURL(blob), true);
|
||||||
|
}else{
|
||||||
|
// handle non-Blob()+non-URL browsers:
|
||||||
|
if(typeof blob === "string" || blob.constructor===z ){
|
||||||
|
try{
|
||||||
|
return saver( "data:" + m + ";base64," + self.btoa(blob) );
|
||||||
|
}catch(y){
|
||||||
|
return saver( "data:" + m + "," + encodeURIComponent(blob) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blob but not URL:
|
||||||
|
fr=new FileReader();
|
||||||
|
fr.onload=function(e){
|
||||||
|
saver(this.result);
|
||||||
|
};
|
||||||
|
fr.readAsDataURL(blob);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} /* end download() */
|
||||||
|
|
||||||
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,155 @@
|
|||||||
|
(function($) {
|
||||||
|
$.extend($.summernote.lang, {
|
||||||
|
'ko-KR': {
|
||||||
|
font: {
|
||||||
|
bold: '굵게',
|
||||||
|
italic: '기울임꼴',
|
||||||
|
underline: '밑줄',
|
||||||
|
clear: '글자 효과 없애기',
|
||||||
|
height: '줄간격',
|
||||||
|
name: '글꼴',
|
||||||
|
superscript: '위 첨자',
|
||||||
|
subscript: '아래 첨자',
|
||||||
|
strikethrough: '취소선',
|
||||||
|
size: '글자 크기'
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
image: '사진',
|
||||||
|
insert: '사진 추가',
|
||||||
|
resizeFull: '100% 크기로 변경',
|
||||||
|
resizeHalf: '50% 크기로 변경',
|
||||||
|
resizeQuarter: '25% 크기로 변경',
|
||||||
|
floatLeft: '왼쪽 정렬',
|
||||||
|
floatRight: '오른쪽 정렬',
|
||||||
|
floatNone: '정렬하지 않음',
|
||||||
|
shapeRounded: '스타일: 둥근 모서리',
|
||||||
|
shapeCircle: '스타일: 원형',
|
||||||
|
shapeThumbnail: '스타일: 액자',
|
||||||
|
shapeNone: '스타일: 없음',
|
||||||
|
dragImageHere: '텍스트 혹은 사진을 이곳으로 끌어오세요',
|
||||||
|
dropImage: '텍스트 혹은 사진을 내려놓으세요',
|
||||||
|
selectFromFiles: '파일 선택',
|
||||||
|
maximumFileSize: 'Maximum file size',
|
||||||
|
maximumFileSizeError: 'Maximum file size exceeded.',
|
||||||
|
url: '사진 URL',
|
||||||
|
remove: '사진 삭제',
|
||||||
|
original: 'Original'
|
||||||
|
},
|
||||||
|
video: {
|
||||||
|
video: '동영상',
|
||||||
|
videoLink: '동영상 링크',
|
||||||
|
insert: '동영상 추가',
|
||||||
|
url: '동영상 URL',
|
||||||
|
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku 사용 가능)'
|
||||||
|
},
|
||||||
|
link: {
|
||||||
|
link: '링크',
|
||||||
|
insert: '링크 추가',
|
||||||
|
unlink: '링크 삭제',
|
||||||
|
edit: '수정',
|
||||||
|
textToDisplay: '링크에 표시할 내용',
|
||||||
|
url: '이동할 URL',
|
||||||
|
openInNewWindow: '새창으로 열기'
|
||||||
|
},
|
||||||
|
table: {
|
||||||
|
table: '테이블',
|
||||||
|
addRowAbove: 'Add row above',
|
||||||
|
addRowBelow: 'Add row below',
|
||||||
|
addColLeft: 'Add column left',
|
||||||
|
addColRight: 'Add column right',
|
||||||
|
delRow: 'Delete row',
|
||||||
|
delCol: 'Delete column',
|
||||||
|
delTable: 'Delete table'
|
||||||
|
},
|
||||||
|
hr: {
|
||||||
|
insert: '구분선 추가'
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
style: '스타일',
|
||||||
|
p: '본문',
|
||||||
|
blockquote: '인용구',
|
||||||
|
pre: '코드',
|
||||||
|
h1: '제목 1',
|
||||||
|
h2: '제목 2',
|
||||||
|
h3: '제목 3',
|
||||||
|
h4: '제목 4',
|
||||||
|
h5: '제목 5',
|
||||||
|
h6: '제목 6'
|
||||||
|
},
|
||||||
|
lists: {
|
||||||
|
unordered: '글머리 기호',
|
||||||
|
ordered: '번호 매기기'
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
help: '도움말',
|
||||||
|
fullscreen: '전체 화면',
|
||||||
|
codeview: '코드 보기'
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
paragraph: '문단 정렬',
|
||||||
|
outdent: '내어쓰기',
|
||||||
|
indent: '들여쓰기',
|
||||||
|
left: '왼쪽 정렬',
|
||||||
|
center: '가운데 정렬',
|
||||||
|
right: '오른쪽 정렬',
|
||||||
|
justify: '양쪽 정렬'
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
recent: '마지막으로 사용한 색',
|
||||||
|
more: '다른 색 선택',
|
||||||
|
background: '배경색',
|
||||||
|
foreground: '글자색',
|
||||||
|
transparent: '투명',
|
||||||
|
setTransparent: '투명',
|
||||||
|
reset: '취소',
|
||||||
|
resetToDefault: '기본 값으로 변경'
|
||||||
|
},
|
||||||
|
shortcut: {
|
||||||
|
shortcuts: '키보드 단축키',
|
||||||
|
close: '닫기',
|
||||||
|
textFormatting: '글자 스타일 적용',
|
||||||
|
action: '기능',
|
||||||
|
paragraphFormatting: '문단 스타일 적용',
|
||||||
|
documentStyle: '문서 스타일 적용',
|
||||||
|
extraKeys: 'Extra keys'
|
||||||
|
},
|
||||||
|
help: {
|
||||||
|
'insertParagraph': 'Insert Paragraph',
|
||||||
|
'undo': 'Undoes the last command',
|
||||||
|
'redo': 'Redoes the last command',
|
||||||
|
'tab': 'Tab',
|
||||||
|
'untab': 'Untab',
|
||||||
|
'bold': 'Set a bold style',
|
||||||
|
'italic': 'Set a italic style',
|
||||||
|
'underline': 'Set a underline style',
|
||||||
|
'strikethrough': 'Set a strikethrough style',
|
||||||
|
'removeFormat': 'Clean a style',
|
||||||
|
'justifyLeft': 'Set left align',
|
||||||
|
'justifyCenter': 'Set center align',
|
||||||
|
'justifyRight': 'Set right align',
|
||||||
|
'justifyFull': 'Set full align',
|
||||||
|
'insertUnorderedList': 'Toggle unordered list',
|
||||||
|
'insertOrderedList': 'Toggle ordered list',
|
||||||
|
'outdent': 'Outdent on current paragraph',
|
||||||
|
'indent': 'Indent on current paragraph',
|
||||||
|
'formatPara': 'Change current block\'s format as a paragraph(P tag)',
|
||||||
|
'formatH1': 'Change current block\'s format as H1',
|
||||||
|
'formatH2': 'Change current block\'s format as H2',
|
||||||
|
'formatH3': 'Change current block\'s format as H3',
|
||||||
|
'formatH4': 'Change current block\'s format as H4',
|
||||||
|
'formatH5': 'Change current block\'s format as H5',
|
||||||
|
'formatH6': 'Change current block\'s format as H6',
|
||||||
|
'insertHorizontalRule': 'Insert horizontal rule',
|
||||||
|
'linkDialog.show': 'Show Link Dialog'
|
||||||
|
},
|
||||||
|
history: {
|
||||||
|
undo: '실행 취소',
|
||||||
|
redo: '다시 실행'
|
||||||
|
},
|
||||||
|
specialChar: {
|
||||||
|
specialChar: '특수문자',
|
||||||
|
select: '특수문자를 선택하세요'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(jQuery);
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
.ext-databasic {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
min-height: 50px;
|
||||||
|
background-color: cyan;
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ext-databasic p {
|
||||||
|
color: white;
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,292 @@
|
|||||||
|
(function(factory) {
|
||||||
|
/* global define */
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['jquery'], factory);
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
// Node/CommonJS
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory(window.jQuery);
|
||||||
|
}
|
||||||
|
}(function($) {
|
||||||
|
// pull in some summernote core functions
|
||||||
|
var ui = $.summernote.ui;
|
||||||
|
var dom = $.summernote.dom;
|
||||||
|
|
||||||
|
// define the popover plugin
|
||||||
|
var DataBasicPlugin = function(context) {
|
||||||
|
var self = this;
|
||||||
|
var options = context.options;
|
||||||
|
var lang = options.langInfo;
|
||||||
|
|
||||||
|
self.icon = '<i class="fa fa-object-group"/>';
|
||||||
|
|
||||||
|
// add context menu button for dialog
|
||||||
|
context.memo('button.databasic', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: self.icon,
|
||||||
|
tooltip: lang.databasic.insert,
|
||||||
|
click: context.createInvokeHandler('databasic.showDialog')
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
|
||||||
|
// add popover edit button
|
||||||
|
context.memo('button.databasicDialog', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: self.icon,
|
||||||
|
tooltip: lang.databasic.edit,
|
||||||
|
click: context.createInvokeHandler('databasic.showDialog')
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
|
||||||
|
// add popover size buttons
|
||||||
|
context.memo('button.databasicSize100', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: '<span class="note-fontsize-10">100%</span>',
|
||||||
|
tooltip: lang.image.resizeFull,
|
||||||
|
click: context.createInvokeHandler('editor.resize', '1')
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
context.memo('button.databasicSize50', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: '<span class="note-fontsize-10">50%</span>',
|
||||||
|
tooltip: lang.image.resizeHalf,
|
||||||
|
click: context.createInvokeHandler('editor.resize', '0.5')
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
context.memo('button.databasicSize25', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: '<span class="note-fontsize-10">25%</span>',
|
||||||
|
tooltip: lang.image.resizeQuarter,
|
||||||
|
click: context.createInvokeHandler('editor.resize', '0.25')
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
|
||||||
|
self.events = {
|
||||||
|
'summernote.init': function(we, e) {
|
||||||
|
// update existing containers
|
||||||
|
$('data.ext-databasic', e.editable).each(function() { self.setContent($(this)); });
|
||||||
|
// TODO: make this an undo snapshot...
|
||||||
|
},
|
||||||
|
'summernote.keyup summernote.mouseup summernote.change summernote.scroll': function() {
|
||||||
|
self.update();
|
||||||
|
},
|
||||||
|
'summernote.dialog.shown': function() {
|
||||||
|
self.hidePopover();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.initialize = function() {
|
||||||
|
// create dialog markup
|
||||||
|
var $container = options.dialogsInBody ? $(document.body) : context.layoutInfo.editor;
|
||||||
|
|
||||||
|
var body = '<div class="form-group row-fluid">' +
|
||||||
|
'<label>' + lang.databasic.testLabel + '</label>' +
|
||||||
|
'<input class="ext-databasic-test form-control" type="text" />' +
|
||||||
|
'</div>';
|
||||||
|
var footer = '<button href="#" class="btn btn-primary ext-databasic-save">' + lang.databasic.insert + '</button>';
|
||||||
|
|
||||||
|
self.$dialog = ui.dialog({
|
||||||
|
title: lang.databasic.name,
|
||||||
|
fade: options.dialogsFade,
|
||||||
|
body: body,
|
||||||
|
footer: footer
|
||||||
|
}).render().appendTo($container);
|
||||||
|
|
||||||
|
// create popover
|
||||||
|
self.$popover = ui.popover({
|
||||||
|
className: 'ext-databasic-popover'
|
||||||
|
}).render().appendTo('body');
|
||||||
|
var $content = self.$popover.find('.popover-content');
|
||||||
|
|
||||||
|
context.invoke('buttons.build', $content, options.popover.databasic);
|
||||||
|
};
|
||||||
|
|
||||||
|
self.destroy = function() {
|
||||||
|
self.$popover.remove();
|
||||||
|
self.$popover = null;
|
||||||
|
self.$dialog.remove();
|
||||||
|
self.$dialog = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
self.update = function() {
|
||||||
|
// Prevent focusing on editable when invoke('code') is executed
|
||||||
|
if (!context.invoke('editor.hasFocus')) {
|
||||||
|
self.hidePopover();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var rng = context.invoke('editor.createRange');
|
||||||
|
var visible = false;
|
||||||
|
|
||||||
|
if (rng.isOnData()) {
|
||||||
|
var $data = $(rng.sc).closest('data.ext-databasic');
|
||||||
|
|
||||||
|
if ($data.length) {
|
||||||
|
var pos = dom.posFromPlaceholder($data[0]);
|
||||||
|
|
||||||
|
self.$popover.css({
|
||||||
|
display: 'block',
|
||||||
|
left: pos.left,
|
||||||
|
top: pos.top
|
||||||
|
});
|
||||||
|
|
||||||
|
// save editor target to let size buttons resize the container
|
||||||
|
context.invoke('editor.saveTarget', $data[0]);
|
||||||
|
|
||||||
|
visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// hide if not visible
|
||||||
|
if (!visible) {
|
||||||
|
self.hidePopover();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
self.hidePopover = function() {
|
||||||
|
self.$popover.hide();
|
||||||
|
};
|
||||||
|
|
||||||
|
// define plugin dialog
|
||||||
|
self.getInfo = function() {
|
||||||
|
var rng = context.invoke('editor.createRange');
|
||||||
|
|
||||||
|
if (rng.isOnData()) {
|
||||||
|
var $data = $(rng.sc).closest('data.ext-databasic');
|
||||||
|
|
||||||
|
if ($data.length) {
|
||||||
|
// Get the first node on range(for edit).
|
||||||
|
return {
|
||||||
|
node: $data,
|
||||||
|
test: $data.attr('data-test')
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
};
|
||||||
|
|
||||||
|
self.setContent = function($node) {
|
||||||
|
$node.html('<p contenteditable="false">' + self.icon + ' ' + lang.databasic.name + ': ' +
|
||||||
|
$node.attr('data-test') + '</p>');
|
||||||
|
};
|
||||||
|
|
||||||
|
self.updateNode = function(info) {
|
||||||
|
self.setContent(info.node
|
||||||
|
.attr('data-test', info.test));
|
||||||
|
};
|
||||||
|
|
||||||
|
self.createNode = function(info) {
|
||||||
|
var $node = $('<data class="ext-databasic"></data>');
|
||||||
|
|
||||||
|
if ($node) {
|
||||||
|
// save node to info structure
|
||||||
|
info.node = $node;
|
||||||
|
// insert node into editor dom
|
||||||
|
context.invoke('editor.insertNode', $node[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $node;
|
||||||
|
};
|
||||||
|
|
||||||
|
self.showDialog = function() {
|
||||||
|
var info = self.getInfo();
|
||||||
|
var newNode = !info.node;
|
||||||
|
context.invoke('editor.saveRange');
|
||||||
|
|
||||||
|
self
|
||||||
|
.openDialog(info)
|
||||||
|
.then(function(dialogInfo) {
|
||||||
|
// [workaround] hide dialog before restore range for IE range focus
|
||||||
|
ui.hideDialog(self.$dialog);
|
||||||
|
context.invoke('editor.restoreRange');
|
||||||
|
|
||||||
|
// insert a new node
|
||||||
|
if (newNode) {
|
||||||
|
self.createNode(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
// update info with dialog info
|
||||||
|
$.extend(info, dialogInfo);
|
||||||
|
|
||||||
|
self.updateNode(info);
|
||||||
|
})
|
||||||
|
.fail(function() {
|
||||||
|
context.invoke('editor.restoreRange');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.openDialog = function(info) {
|
||||||
|
return $.Deferred(function(deferred) {
|
||||||
|
var $inpTest = self.$dialog.find('.ext-databasic-test');
|
||||||
|
var $saveBtn = self.$dialog.find('.ext-databasic-save');
|
||||||
|
var onKeyup = function(event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
$saveBtn.trigger('click');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ui.onDialogShown(self.$dialog, function() {
|
||||||
|
context.triggerEvent('dialog.shown');
|
||||||
|
|
||||||
|
$inpTest.val(info.test).on('input', function() {
|
||||||
|
ui.toggleBtn($saveBtn, $inpTest.val());
|
||||||
|
}).trigger('focus').on('keyup', onKeyup);
|
||||||
|
|
||||||
|
$saveBtn
|
||||||
|
.text(info.node ? lang.databasic.edit : lang.databasic.insert)
|
||||||
|
.click(function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
deferred.resolve({ test: $inpTest.val() });
|
||||||
|
});
|
||||||
|
|
||||||
|
// init save button
|
||||||
|
ui.toggleBtn($saveBtn, $inpTest.val());
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.onDialogHidden(self.$dialog, function() {
|
||||||
|
$inpTest.off('input keyup');
|
||||||
|
$saveBtn.off('click');
|
||||||
|
|
||||||
|
if (deferred.state() === 'pending') {
|
||||||
|
deferred.reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.showDialog(self.$dialog);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Extends summernote
|
||||||
|
$.extend(true, $.summernote, {
|
||||||
|
plugins: {
|
||||||
|
databasic: DataBasicPlugin
|
||||||
|
},
|
||||||
|
|
||||||
|
options: {
|
||||||
|
popover: {
|
||||||
|
databasic: [
|
||||||
|
['databasic', ['databasicDialog', 'databasicSize100', 'databasicSize50', 'databasicSize25']]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// add localization texts
|
||||||
|
lang: {
|
||||||
|
'en-US': {
|
||||||
|
databasic: {
|
||||||
|
name: 'Basic Data Container',
|
||||||
|
insert: 'insert basic data container',
|
||||||
|
edit: 'edit basic data container',
|
||||||
|
testLabel: 'test input'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}));
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
(function(factory) {
|
||||||
|
/* global define */
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['jquery'], factory);
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
// Node/CommonJS
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory(window.jQuery);
|
||||||
|
}
|
||||||
|
}(function($) {
|
||||||
|
// Extends plugins for adding hello.
|
||||||
|
// - plugin is external module for customizing.
|
||||||
|
$.extend($.summernote.plugins, {
|
||||||
|
/**
|
||||||
|
* @param {Object} context - context object has status of editor.
|
||||||
|
*/
|
||||||
|
'hello': function(context) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
// ui has renders to build ui elements.
|
||||||
|
// - you can create a button with `ui.button`
|
||||||
|
var ui = $.summernote.ui;
|
||||||
|
|
||||||
|
// add hello button
|
||||||
|
context.memo('button.hello', function() {
|
||||||
|
// create button
|
||||||
|
var button = ui.button({
|
||||||
|
contents: '<i class="fa fa-child"/> Hello',
|
||||||
|
tooltip: 'hello',
|
||||||
|
click: function() {
|
||||||
|
self.$panel.show();
|
||||||
|
self.$panel.hide(500);
|
||||||
|
// invoke insertText method with 'hello' on editor module.
|
||||||
|
context.invoke('editor.insertText', 'hello');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// create jQuery object from button instance.
|
||||||
|
var $hello = button.render();
|
||||||
|
return $hello;
|
||||||
|
});
|
||||||
|
|
||||||
|
// This events will be attached when editor is initialized.
|
||||||
|
this.events = {
|
||||||
|
// This will be called after modules are initialized.
|
||||||
|
'summernote.init': function(we, e) {
|
||||||
|
console.log('summernote initialized', we, e);
|
||||||
|
},
|
||||||
|
// This will be called when user releases a key on editable.
|
||||||
|
'summernote.keyup': function(we, e) {
|
||||||
|
console.log('summernote keyup', we, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// This method will be called when editor is initialized by $('..').summernote();
|
||||||
|
// You can create elements for plugin
|
||||||
|
this.initialize = function() {
|
||||||
|
this.$panel = $('<div class="hello-panel"/>').css({
|
||||||
|
position: 'absolute',
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
left: '50%',
|
||||||
|
top: '50%',
|
||||||
|
background: 'red'
|
||||||
|
}).hide();
|
||||||
|
|
||||||
|
this.$panel.appendTo('body');
|
||||||
|
};
|
||||||
|
|
||||||
|
// This methods will be called when editor is destroyed by $('..').summernote('destroy');
|
||||||
|
// You should remove elements on `initialize`.
|
||||||
|
this.destroy = function() {
|
||||||
|
this.$panel.remove();
|
||||||
|
this.$panel = null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}));
|
||||||
@@ -0,0 +1,312 @@
|
|||||||
|
(function(factory) {
|
||||||
|
/* global define */
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['jquery'], factory);
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
// Node/CommonJS
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory(window.jQuery);
|
||||||
|
}
|
||||||
|
}(function($) {
|
||||||
|
$.extend($.summernote.plugins, {
|
||||||
|
'specialchars': function(context) {
|
||||||
|
var self = this;
|
||||||
|
var ui = $.summernote.ui;
|
||||||
|
|
||||||
|
var $editor = context.layoutInfo.editor;
|
||||||
|
var options = context.options;
|
||||||
|
var lang = options.langInfo;
|
||||||
|
|
||||||
|
var KEY = {
|
||||||
|
UP: 38,
|
||||||
|
DOWN: 40,
|
||||||
|
LEFT: 37,
|
||||||
|
RIGHT: 39,
|
||||||
|
ENTER: 13
|
||||||
|
};
|
||||||
|
var COLUMN_LENGTH = 15;
|
||||||
|
var COLUMN_WIDTH = 35;
|
||||||
|
|
||||||
|
var currentColumn = 0;
|
||||||
|
var currentRow = 0;
|
||||||
|
var totalColumn = 0;
|
||||||
|
var totalRow = 0;
|
||||||
|
|
||||||
|
// special characters data set
|
||||||
|
var specialCharDataSet = [
|
||||||
|
'"', '&', '<', '>', '¡', '¢',
|
||||||
|
'£', '¤', '¥', '¦', '§',
|
||||||
|
'¨', '©', 'ª', '«', '¬',
|
||||||
|
'®', '¯', '°', '±', '²',
|
||||||
|
'³', '´', 'µ', '¶', '·',
|
||||||
|
'¸', '¹', 'º', '»', '¼',
|
||||||
|
'½', '¾', '¿', '×', '÷',
|
||||||
|
'ƒ', 'ˆ', '˜', '–', '—',
|
||||||
|
'‘', '’', '‚', '“', '”',
|
||||||
|
'„', '†', '‡', '•', '…',
|
||||||
|
'‰', '′', '″', '‹', '›',
|
||||||
|
'‾', '⁄', '€', 'ℑ', '℘',
|
||||||
|
'ℜ', '™', 'ℵ', '←', '↑',
|
||||||
|
'→', '↓', '↔', '↵', '⇐',
|
||||||
|
'⇑', '⇒', '⇓', '⇔', '∀',
|
||||||
|
'∂', '∃', '∅', '∇', '∈',
|
||||||
|
'∉', '∋', '∏', '∑', '−',
|
||||||
|
'∗', '√', '∝', '∞', '∠',
|
||||||
|
'∧', '∨', '∩', '∪', '∫',
|
||||||
|
'∴', '∼', '≅', '≈', '≠',
|
||||||
|
'≡', '≤', '≥', '⊂', '⊃',
|
||||||
|
'⊄', '⊆', '⊇', '⊕', '⊗',
|
||||||
|
'⊥', '⋅', '⌈', '⌉', '⌊',
|
||||||
|
'⌋', '◊', '♠', '♣', '♥',
|
||||||
|
'♦'
|
||||||
|
];
|
||||||
|
|
||||||
|
context.memo('button.specialchars', function() {
|
||||||
|
return ui.button({
|
||||||
|
contents: '<i class="fa fa-font fa-flip-vertical">',
|
||||||
|
tooltip: lang.specialChar.specialChar,
|
||||||
|
click: function() {
|
||||||
|
self.show();
|
||||||
|
}
|
||||||
|
}).render();
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make Special Characters Table
|
||||||
|
*
|
||||||
|
* @member plugin.specialChar
|
||||||
|
* @private
|
||||||
|
* @return {jQuery}
|
||||||
|
*/
|
||||||
|
this.makeSpecialCharSetTable = function() {
|
||||||
|
var $table = $('<table/>');
|
||||||
|
$.each(specialCharDataSet, function(idx, text) {
|
||||||
|
var $td = $('<td/>').addClass('note-specialchar-node');
|
||||||
|
var $tr = (idx % COLUMN_LENGTH === 0) ? $('<tr/>') : $table.find('tr').last();
|
||||||
|
|
||||||
|
var $button = ui.button({
|
||||||
|
callback: function($node) {
|
||||||
|
$node.html(text);
|
||||||
|
$node.attr('title', text);
|
||||||
|
$node.attr('data-value', encodeURIComponent(text));
|
||||||
|
$node.css({
|
||||||
|
width: COLUMN_WIDTH,
|
||||||
|
'margin-right': '2px',
|
||||||
|
'margin-bottom': '2px'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).render();
|
||||||
|
|
||||||
|
$td.append($button);
|
||||||
|
|
||||||
|
$tr.append($td);
|
||||||
|
if (idx % COLUMN_LENGTH === 0) {
|
||||||
|
$table.append($tr);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
totalRow = $table.find('tr').length;
|
||||||
|
totalColumn = COLUMN_LENGTH;
|
||||||
|
|
||||||
|
return $table;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.initialize = function() {
|
||||||
|
var $container = options.dialogsInBody ? $(document.body) : $editor;
|
||||||
|
|
||||||
|
var body = '<div class="form-group row-fluid">' + this.makeSpecialCharSetTable()[0].outerHTML + '</div>';
|
||||||
|
|
||||||
|
this.$dialog = ui.dialog({
|
||||||
|
title: lang.specialChar.select,
|
||||||
|
body: body
|
||||||
|
}).render().appendTo($container);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.show = function() {
|
||||||
|
var text = context.invoke('editor.getSelectedText');
|
||||||
|
context.invoke('editor.saveRange');
|
||||||
|
this.showSpecialCharDialog(text).then(function(selectChar) {
|
||||||
|
context.invoke('editor.restoreRange');
|
||||||
|
|
||||||
|
// build node
|
||||||
|
var $node = $('<span></span>').html(selectChar)[0];
|
||||||
|
|
||||||
|
if ($node) {
|
||||||
|
// insert video node
|
||||||
|
context.invoke('editor.insertNode', $node);
|
||||||
|
}
|
||||||
|
}).fail(function() {
|
||||||
|
context.invoke('editor.restoreRange');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show image dialog
|
||||||
|
*
|
||||||
|
* @param {jQuery} $dialog
|
||||||
|
* @return {Promise}
|
||||||
|
*/
|
||||||
|
this.showSpecialCharDialog = function(text) {
|
||||||
|
return $.Deferred(function(deferred) {
|
||||||
|
var $specialCharDialog = self.$dialog;
|
||||||
|
var $specialCharNode = $specialCharDialog.find('.note-specialchar-node');
|
||||||
|
var $selectedNode = null;
|
||||||
|
var ARROW_KEYS = [KEY.UP, KEY.DOWN, KEY.LEFT, KEY.RIGHT];
|
||||||
|
var ENTER_KEY = KEY.ENTER;
|
||||||
|
|
||||||
|
function addActiveClass($target) {
|
||||||
|
if (!$target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$target.find('button').addClass('active');
|
||||||
|
$selectedNode = $target;
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeActiveClass($target) {
|
||||||
|
$target.find('button').removeClass('active');
|
||||||
|
$selectedNode = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// find next node
|
||||||
|
function findNextNode(row, column) {
|
||||||
|
var findNode = null;
|
||||||
|
$.each($specialCharNode, function(idx, $node) {
|
||||||
|
var findRow = Math.ceil((idx + 1) / COLUMN_LENGTH);
|
||||||
|
var findColumn = ((idx + 1) % COLUMN_LENGTH === 0) ? COLUMN_LENGTH : (idx + 1) % COLUMN_LENGTH;
|
||||||
|
if (findRow === row && findColumn === column) {
|
||||||
|
findNode = $node;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return $(findNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
function arrowKeyHandler(keyCode) {
|
||||||
|
// left, right, up, down key
|
||||||
|
var $nextNode;
|
||||||
|
var lastRowColumnLength = $specialCharNode.length % totalColumn;
|
||||||
|
|
||||||
|
if (KEY.LEFT === keyCode) {
|
||||||
|
if (currentColumn > 1) {
|
||||||
|
currentColumn = currentColumn - 1;
|
||||||
|
} else if (currentRow === 1 && currentColumn === 1) {
|
||||||
|
currentColumn = lastRowColumnLength;
|
||||||
|
currentRow = totalRow;
|
||||||
|
} else {
|
||||||
|
currentColumn = totalColumn;
|
||||||
|
currentRow = currentRow - 1;
|
||||||
|
}
|
||||||
|
} else if (KEY.RIGHT === keyCode) {
|
||||||
|
if (currentRow === totalRow && lastRowColumnLength === currentColumn) {
|
||||||
|
currentColumn = 1;
|
||||||
|
currentRow = 1;
|
||||||
|
} else if (currentColumn < totalColumn) {
|
||||||
|
currentColumn = currentColumn + 1;
|
||||||
|
} else {
|
||||||
|
currentColumn = 1;
|
||||||
|
currentRow = currentRow + 1;
|
||||||
|
}
|
||||||
|
} else if (KEY.UP === keyCode) {
|
||||||
|
if (currentRow === 1 && lastRowColumnLength < currentColumn) {
|
||||||
|
currentRow = totalRow - 1;
|
||||||
|
} else {
|
||||||
|
currentRow = currentRow - 1;
|
||||||
|
}
|
||||||
|
} else if (KEY.DOWN === keyCode) {
|
||||||
|
currentRow = currentRow + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentRow === totalRow && currentColumn > lastRowColumnLength) {
|
||||||
|
currentRow = 1;
|
||||||
|
} else if (currentRow > totalRow) {
|
||||||
|
currentRow = 1;
|
||||||
|
} else if (currentRow < 1) {
|
||||||
|
currentRow = totalRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
$nextNode = findNextNode(currentRow, currentColumn);
|
||||||
|
|
||||||
|
if ($nextNode) {
|
||||||
|
removeActiveClass($selectedNode);
|
||||||
|
addActiveClass($nextNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function enterKeyHandler() {
|
||||||
|
if (!$selectedNode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
deferred.resolve(decodeURIComponent($selectedNode.find('button').attr('data-value')));
|
||||||
|
$specialCharDialog.modal('hide');
|
||||||
|
}
|
||||||
|
|
||||||
|
function keyDownEventHandler(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var keyCode = event.keyCode;
|
||||||
|
if (keyCode === undefined || keyCode === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// check arrowKeys match
|
||||||
|
if (ARROW_KEYS.indexOf(keyCode) > -1) {
|
||||||
|
if ($selectedNode === null) {
|
||||||
|
addActiveClass($specialCharNode.eq(0));
|
||||||
|
currentColumn = 1;
|
||||||
|
currentRow = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
arrowKeyHandler(keyCode);
|
||||||
|
} else if (keyCode === ENTER_KEY) {
|
||||||
|
enterKeyHandler();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove class
|
||||||
|
removeActiveClass($specialCharNode);
|
||||||
|
|
||||||
|
// find selected node
|
||||||
|
if (text) {
|
||||||
|
for (var i = 0; i < $specialCharNode.length; i++) {
|
||||||
|
var $checkNode = $($specialCharNode[i]);
|
||||||
|
if ($checkNode.text() === text) {
|
||||||
|
addActiveClass($checkNode);
|
||||||
|
currentRow = Math.ceil((i + 1) / COLUMN_LENGTH);
|
||||||
|
currentColumn = (i + 1) % COLUMN_LENGTH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.onDialogShown(self.$dialog, function() {
|
||||||
|
$(document).on('keydown', keyDownEventHandler);
|
||||||
|
|
||||||
|
self.$dialog.find('button').tooltip();
|
||||||
|
|
||||||
|
$specialCharNode.on('click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
deferred.resolve(decodeURIComponent($(event.currentTarget).find('button').attr('data-value')));
|
||||||
|
ui.hideDialog(self.$dialog);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.onDialogHidden(self.$dialog, function() {
|
||||||
|
$specialCharNode.off('click');
|
||||||
|
|
||||||
|
self.$dialog.find('button').tooltip('destroy');
|
||||||
|
|
||||||
|
$(document).off('keydown', keyDownEventHandler);
|
||||||
|
|
||||||
|
if (deferred.state() === 'pending') {
|
||||||
|
deferred.reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.showDialog(self.$dialog);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}));
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+3
File diff suppressed because one or more lines are too long
+67
-21
@@ -49,40 +49,86 @@ function getFriendlyErrorType($type)
|
|||||||
return "{$type}";
|
return "{$type}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getExceptionTraceAsString($exception) {
|
||||||
|
//https://gist.github.com/abtris/1437966
|
||||||
|
$rtn = "";
|
||||||
|
$count = 0;
|
||||||
|
$rtn = [];
|
||||||
|
foreach ($exception->getTrace() as $frame) {
|
||||||
|
$args = "";
|
||||||
|
if (isset($frame['args'])) {
|
||||||
|
$args = array();
|
||||||
|
foreach ($frame['args'] as $arg) {
|
||||||
|
if (is_string($arg)) {
|
||||||
|
$args[] = "'" . $arg . "'";
|
||||||
|
} elseif (is_array($arg)) {
|
||||||
|
$args[] = "Array";
|
||||||
|
} elseif (is_null($arg)) {
|
||||||
|
$args[] = 'NULL';
|
||||||
|
} elseif (is_bool($arg)) {
|
||||||
|
$args[] = ($arg) ? "true" : "false";
|
||||||
|
} elseif (is_object($arg)) {
|
||||||
|
$args[] = get_class($arg);
|
||||||
|
} elseif (is_resource($arg)) {
|
||||||
|
$args[] = get_resource_type($arg);
|
||||||
|
} else {
|
||||||
|
$args[] = $arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$args = join(", ", $args);
|
||||||
|
}
|
||||||
|
$rtn[] = sprintf( "#%s %s:%s %s(%s)",
|
||||||
|
$count,
|
||||||
|
isset($frame['file']) ? $frame['file'] : 'unknown file',
|
||||||
|
isset($frame['line']) ? $frame['line'] : 'unknown line',
|
||||||
|
(isset($frame['class'])) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'],
|
||||||
|
$args );
|
||||||
|
$count++;
|
||||||
|
}
|
||||||
|
return $rtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
function logError(string $err, string $errstr, array $trace){
|
||||||
|
$fdb = FileDB::db(ROOT.'/d_log/err_log.sqlite3', ROOT.'/f_install/sql/err_log.sql');
|
||||||
|
$date = date("Ymd_His");
|
||||||
|
|
||||||
|
$trace = array_map(function(string $text){
|
||||||
|
return str_replace(ROOT, '{ROOT}', $text);
|
||||||
|
}, $trace);
|
||||||
|
|
||||||
|
$fdb->insert('err_log', [
|
||||||
|
'date'=>$date,
|
||||||
|
'err'=>$err,
|
||||||
|
'errstr'=>$errstr,
|
||||||
|
'trace'=>Json::encode($trace)
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
|
function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
|
||||||
if (!(error_reporting() & $errno)) {
|
if (!(error_reporting() & $errno)) {
|
||||||
// This error code is not included in error_reporting, so let it fall
|
// This error code is not included in error_reporting, so let it fall
|
||||||
// through to the standard PHP error handler
|
// through to the standard PHP error handler
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = date("Ymd_His");
|
|
||||||
$e = new \Exception();
|
$e = new \Exception();
|
||||||
|
|
||||||
$data = Json::encode([
|
logError(
|
||||||
'date'=>$date,
|
getFriendlyErrorType($errno),
|
||||||
'err'=>getFriendlyErrorType($errno),
|
$errstr,
|
||||||
'errstr'=>$errstr,
|
getExceptionTraceAsString($e)
|
||||||
'trace'=>explode("\n", $e->getTraceAsString())
|
);
|
||||||
], Json::PRETTY);
|
|
||||||
|
|
||||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
|
||||||
}
|
}
|
||||||
set_error_handler("\sammo\logErrorByCustomHandler");
|
set_error_handler("\sammo\logErrorByCustomHandler");
|
||||||
|
|
||||||
|
|
||||||
function logExceptionByCustomHandler(\Throwable $e){
|
function logExceptionByCustomHandler(\Throwable $e){
|
||||||
|
logError(
|
||||||
$date = date("Ymd_His");
|
get_class($e),
|
||||||
|
$e->getMessage(),
|
||||||
$data = Json::encode([
|
getExceptionTraceAsString($e)
|
||||||
'date'=>$date,
|
);
|
||||||
'err'=>get_class($e),
|
|
||||||
'errstr'=>$e->getMessage(),
|
|
||||||
'trace'=>explode("\n", $e->getTraceAsString())
|
|
||||||
], Json::PRETTY);
|
|
||||||
|
|
||||||
file_put_contents(ROOT.'/d_log/err_log.txt',"$data\n", FILE_APPEND);
|
|
||||||
echo $e->getTraceAsString();
|
echo $e->getTraceAsString();
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ $rootDB->insert('member',[
|
|||||||
'oauth_type' => 'NONE',
|
'oauth_type' => 'NONE',
|
||||||
'id' => $username,
|
'id' => $username,
|
||||||
'email' => null,
|
'email' => null,
|
||||||
|
'token_valid_until'=>'2999-01-01 00:00:00',
|
||||||
'pw' => $finalPassword,
|
'pw' => $finalPassword,
|
||||||
'salt' => $userSalt,
|
'salt' => $userSalt,
|
||||||
'grade'=> 6,
|
'grade'=> 6,
|
||||||
|
|||||||
@@ -217,8 +217,8 @@ $result = Util::generateFileUsingSimpleTemplate(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$result = Util::generateFileUsingSimpleTemplate(
|
$result = Util::generateFileUsingSimpleTemplate(
|
||||||
__dir__.'/templates/menu.orig.js',
|
__dir__.'/templates/menu.orig.json',
|
||||||
ROOT.'/d_shared/menu.js',
|
ROOT.'/d_shared/menu.json',
|
||||||
[],
|
[],
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,16 +20,18 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|||||||
CREATE TABLE `member` (
|
CREATE TABLE `member` (
|
||||||
`NO` INT(11) NOT NULL AUTO_INCREMENT,
|
`NO` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`oauth_id` BIGINT(20) NULL DEFAULT NULL,
|
`oauth_id` BIGINT(20) NULL DEFAULT NULL,
|
||||||
`oauth_type` ENUM('NONE','KAKAO') NOT NULL,
|
|
||||||
`ID` VARCHAR(64) NOT NULL,
|
`ID` VARCHAR(64) NOT NULL,
|
||||||
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
|
`EMAIL` VARCHAR(64) NULL DEFAULT NULL,
|
||||||
|
`oauth_type` ENUM('NONE','KAKAO') NOT NULL,
|
||||||
|
`oauth_info` TEXT NOT NULL DEFAULT '{}',
|
||||||
|
`token_valid_until` DATETIME NULL DEFAULT NULL,
|
||||||
`PW` CHAR(128) NOT NULL,
|
`PW` CHAR(128) NOT NULL,
|
||||||
`salt` CHAR(16) NOT NULL,
|
`salt` CHAR(16) NOT NULL,
|
||||||
`third_use` INT(1) NOT NULL DEFAULT '0',
|
`third_use` INT(1) NOT NULL DEFAULT '0',
|
||||||
`NAME` VARCHAR(64) NOT NULL,
|
`NAME` VARCHAR(64) NOT NULL,
|
||||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||||
`acl` text NOT NULL DEFAULT '{}' COMMENT 'json',
|
`acl` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||||
`GRADE` INT(1) NULL DEFAULT '1',
|
`GRADE` INT(1) NULL DEFAULT '1',
|
||||||
`REG_NUM` INT(3) NULL DEFAULT '0',
|
`REG_NUM` INT(3) NULL DEFAULT '0',
|
||||||
`REG_DATE` DATETIME NOT NULL,
|
`REG_DATE` DATETIME NOT NULL,
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS `err_log` (
|
||||||
|
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
|
`date` TEXT NOT NULL,
|
||||||
|
`err` TEXT NOT NULL,
|
||||||
|
`errstr` TEXT NOT NULL,
|
||||||
|
`trace` TEXT NOT NULL
|
||||||
|
);
|
||||||
|
CREATE INDEX IF NOT EXISTS `date` ON `err_log` (
|
||||||
|
`date` DESC
|
||||||
|
);
|
||||||
@@ -41,18 +41,86 @@
|
|||||||
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map_spring .map_body{
|
/*체 지도*/
|
||||||
background: url('_tK_gameImagePath_/map1.jpg') no-repeat;
|
.map_theme_che.map_spring .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map_summer .map_body{
|
.map_theme_che.map_summer .map_bglayer1{
|
||||||
background: url('_tK_gameImagePath_/map2.jpg') no-repeat;
|
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map_fall .map_body{
|
.map_theme_che.map_fall .map_bglayer1{
|
||||||
background: url('_tK_gameImagePath_/map3.jpg') no-repeat;
|
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.map_winter .map_body{
|
.map_theme_che.map_winter .map_bglayer1{
|
||||||
background: url('_tK_gameImagePath_/map4.jpg') no-repeat;
|
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_che .map_bgroad{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/che_road.png') no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*미니체 지도*/
|
||||||
|
.map_theme_miniche.map_spring .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/bg_spring.jpg') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_miniche.map_summer .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/bg_summer.jpg') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_miniche.map_fall .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/bg_fall.jpg') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_miniche.map_winter .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/bg_winter.jpg') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_miniche .map_bgroad{
|
||||||
|
background: url('_tK_gameImagePath_/map/che/miniche_road.png') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*루드라사움 지도*/
|
||||||
|
.map_theme_ludo_rathowm .map_bglayer1{
|
||||||
|
background: url('_tK_gameImagePath_/map/ludo_rathowm/back.jpg') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_ludo_rathowm .map_bgroad{
|
||||||
|
background: url('_tK_gameImagePath_/map/ludo_rathowm/road.png') no-repeat;
|
||||||
|
background-size: 700px 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_ludo_rathowm.map_detail.map_spring .map_title_text{
|
||||||
|
background:
|
||||||
|
url('_tK_gameImagePath_/spring.gif') no-repeat right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_ludo_rathowm.map_detail.map_summer .map_title_text{
|
||||||
|
background:
|
||||||
|
url('_tK_gameImagePath_/summer.gif') no-repeat right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_ludo_rathowm.map_detail.map_fall .map_title_text{
|
||||||
|
background:
|
||||||
|
url('_tK_gameImagePath_/fall.gif') no-repeat right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_theme_ludo_rathowm.map_detail.map_winter .map_title_text{
|
||||||
|
background:
|
||||||
|
url('_tK_gameImagePath_/winter.gif') no-repeat right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.world_map.map_theme_ludo_rathowm .map_title .map_title_text::before {
|
||||||
|
color:white;
|
||||||
|
content:'LP';
|
||||||
|
margin-right:1ch;
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
window.sammo_menu = [
|
|
||||||
['/bbs/board', '삼모게시판', '_blank'],
|
|
||||||
['/bbs/tip', '팁/강좌', '_blank'],
|
|
||||||
['/bbs/news', '삼국 일보', '_blank'],
|
|
||||||
['/bbs/history2', '개인 열전', '_blank'],
|
|
||||||
['/bbs/history3', '국가 열전', '_blank'],
|
|
||||||
['/bbs/patch', '패치 내역', '_blank']
|
|
||||||
];
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[
|
||||||
|
["/bbs/board", "삼모게시판", "_blank"],
|
||||||
|
["/bbs/tip", "팁/강좌", "_blank"],
|
||||||
|
["/bbs/news", "삼국 일보", "_blank"],
|
||||||
|
["/bbs/history2", "개인 열전", "_blank"],
|
||||||
|
["/bbs/history3", "국가 열전", "_blank"],
|
||||||
|
["/bbs/patch", "패치 내역", "_blank"]
|
||||||
|
]
|
||||||
@@ -6,6 +6,8 @@ include "func.php";
|
|||||||
|
|
||||||
$btn = Util::getReq('btn');
|
$btn = Util::getReq('btn');
|
||||||
$weap = Util::getReq('weap', 'int');
|
$weap = Util::getReq('weap', 'int');
|
||||||
|
$genlist = Util::getReq('genlist', 'array_int');
|
||||||
|
$msg = Util::getReq('msg', 'string');
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
extractMissingPostToGlobals();
|
||||||
|
|
||||||
@@ -93,7 +95,7 @@ switch($btn) {
|
|||||||
case "강제 사망":
|
case "강제 사망":
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'turn0'=>0,
|
'turn0'=>EncodeCommand(0, 0, 0, 0),
|
||||||
'killturn'=>0,
|
'killturn'=>0,
|
||||||
'turntime'=>$date,
|
'turntime'=>$date,
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
@@ -314,13 +316,13 @@ switch($btn) {
|
|||||||
break;
|
break;
|
||||||
case "하야입력":
|
case "하야입력":
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'turn0'=>'00000000000045'
|
'turn0'=>EncodeCommand(0, 0, 0, 45)
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "방랑해산":
|
case "방랑해산":
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'turn0'=>'00000000000047',
|
'turn0'=>EncodeCommand(0, 0, 0, 47),
|
||||||
'turn1'=>'00000000000056'
|
'turn1'=>EncodeCommand(0, 0, 0, 56)
|
||||||
], '`no` IN %li', $genlist);
|
], '`no` IN %li', $genlist);
|
||||||
break;
|
break;
|
||||||
case "NPC설정":
|
case "NPC설정":
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ switch($btn) {
|
|||||||
break;
|
break;
|
||||||
case "강제 사망":
|
case "강제 사망":
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
DB::db()->query('update general set turn0=0,killturn=0,turntime=%s where no IN %li',$date, $genlist);
|
DB::db()->query('update general set turn0=%s,killturn=0,turntime=%s where no IN %li',EncodeCommand(0, 0, 0, 0),$date, $genlist);
|
||||||
break;
|
break;
|
||||||
case "메세지 전달":
|
case "메세지 전달":
|
||||||
//TODO:새 갠메 시스템으로 변경
|
//TODO:새 갠메 시스템으로 변경
|
||||||
|
|||||||
-1660
@@ -1,1660 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
|
|
||||||
//로그인 검사
|
|
||||||
|
|
||||||
$isgen = Util::getReq('isgen');
|
|
||||||
|
|
||||||
$leader1 = Util::getReq('leader1', 'int', 0);
|
|
||||||
$power1 = Util::getReq('power1', 'int', 0);
|
|
||||||
$intel1 = Util::getReq('intel1', 'int', 0);
|
|
||||||
$type1 = Util::getReq('type1', 'int', 0);
|
|
||||||
$crew1 = Util::getReq('crew1', 'int', 0);
|
|
||||||
$train1 = Util::getReq('train1', 'int', 0);
|
|
||||||
$atmos1 = Util::getReq('atmos1', 'int', 0);
|
|
||||||
$level1 = Util::getReq('level1', 'int', 0);
|
|
||||||
$explevel1 = Util::getReq('explevel1', 'int', 0);
|
|
||||||
$tech1 = Util::getReq('tech1', 'int', 0);
|
|
||||||
|
|
||||||
$dex10 = Util::getReq('dex10', 'int', 0);
|
|
||||||
$dex110 = Util::getReq('dex110', 'int', 0);
|
|
||||||
$dex120 = Util::getReq('dex120', 'int', 0);
|
|
||||||
$dex130 = Util::getReq('dex130', 'int', 0);
|
|
||||||
$dex140 = Util::getReq('dex140', 'int', 0);
|
|
||||||
|
|
||||||
$dx10 = array_fill(0, 20, '');
|
|
||||||
$dx110 = array_fill(0, 20, '');
|
|
||||||
$dx120 = array_fill(0, 20, '');
|
|
||||||
$dx130 = array_fill(0, 20, '');
|
|
||||||
$dx140 = array_fill(0, 20, '');
|
|
||||||
|
|
||||||
$leader2 = Util::getReq('leader2', 'int', 0);
|
|
||||||
$power2 = Util::getReq('power2', 'int', 0);
|
|
||||||
$intel2 = Util::getReq('intel2', 'int', 0);
|
|
||||||
$type2 = Util::getReq('type2', 'int', 0);
|
|
||||||
$crew2 = Util::getReq('crew2', 'int', 0);
|
|
||||||
$train2 = Util::getReq('train2', 'int', 0);
|
|
||||||
$atmos2 = Util::getReq('atmos2', 'int', 0);
|
|
||||||
$level2 = Util::getReq('level2', 'int', 0);
|
|
||||||
$explevel2 = Util::getReq('explevel2', 'int', 0);
|
|
||||||
$tech2 = Util::getReq('tech2', 'int', 0);
|
|
||||||
|
|
||||||
$dex20 = Util::getReq('dex20', 'int', 0);
|
|
||||||
$dex210 = Util::getReq('dex210', 'int', 0);
|
|
||||||
$dex220 = Util::getReq('dex220', 'int', 0);
|
|
||||||
$dex230 = Util::getReq('dex230', 'int', 0);
|
|
||||||
$dex240 = Util::getReq('dex240', 'int', 0);
|
|
||||||
|
|
||||||
$dx20 = array_fill(0, 20, '');
|
|
||||||
$dx210 = array_fill(0, 20, '');
|
|
||||||
$dx220 = array_fill(0, 20, '');
|
|
||||||
$dx230 = array_fill(0, 20, '');
|
|
||||||
$dx240 = array_fill(0, 20, '');
|
|
||||||
|
|
||||||
$def = Util::getReq('def', 'int', 0);
|
|
||||||
$wall = Util::getReq('wall', 'int', 0);
|
|
||||||
$atmos3 = Util::getReq('atmos3', 'int', 0);
|
|
||||||
$train3 = Util::getReq('train3', 'int', 0);
|
|
||||||
|
|
||||||
$sellevel1 = array_fill(0, 13, '');
|
|
||||||
$sel1 = array_fill(0,44, '');
|
|
||||||
$tch1 = array_fill(0,11, '');
|
|
||||||
|
|
||||||
$sellevel2 = array_fill(0, 13, '');
|
|
||||||
$sel2 = array_fill(0,44, '');
|
|
||||||
$tch2 = array_fill(0,11, '');
|
|
||||||
|
|
||||||
$dec = 0;
|
|
||||||
$rice = 0;
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$connect=$db->get();
|
|
||||||
increaseRefresh("시뮬", 2);
|
|
||||||
|
|
||||||
$query = "select no,tournament,con,turntime from general where owner='{$userID}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$me = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$admin = $gameStor->getAll();
|
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
|
||||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
|
||||||
|
|
||||||
if($session->userGrade < 3) {
|
|
||||||
echo "특별회원이 아닙니다.";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$mydeathnumSum = 0;
|
|
||||||
$mykillnumSum = 0;
|
|
||||||
$expSum = 0;
|
|
||||||
$ricingSum = 0;
|
|
||||||
$expSum2 = 0;
|
|
||||||
$ricingSum2 = 0;
|
|
||||||
|
|
||||||
if($isgen == "장수평균" || $isgen == "성벽평균") {
|
|
||||||
$simulCount = 1000;
|
|
||||||
} else {
|
|
||||||
$simulCount = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$general = [
|
|
||||||
'no'=>1
|
|
||||||
];
|
|
||||||
$oppose = [
|
|
||||||
'no'=>2
|
|
||||||
];
|
|
||||||
$city = [
|
|
||||||
'gen1'=>0,
|
|
||||||
'gen2'=>0,
|
|
||||||
'gen3'=>0,
|
|
||||||
];
|
|
||||||
|
|
||||||
if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평균" || $isgen == "성벽평균") {
|
|
||||||
$msg2 = "";
|
|
||||||
for($i=0; $i < $simulCount; $i++) {
|
|
||||||
$general['leader'] = $leader1;
|
|
||||||
$general['power'] = $power1;
|
|
||||||
$general['intel'] = $intel1;
|
|
||||||
$general['crewtype'] = $type1;
|
|
||||||
$general['crew'] = $crew1;
|
|
||||||
$general['train'] = $train1;
|
|
||||||
$general['atmos'] = $atmos1;
|
|
||||||
$general['level'] = $level1;
|
|
||||||
$general['explevel'] = $explevel1;
|
|
||||||
$general['dex0'] = $dex10;
|
|
||||||
$general['dex10'] = $dex110;
|
|
||||||
$general['dex20'] = $dex120;
|
|
||||||
$general['dex30'] = $dex130;
|
|
||||||
$general['dex40'] = $dex140;
|
|
||||||
|
|
||||||
$general['injury'] = 0;
|
|
||||||
$general['horse'] = 0;
|
|
||||||
$general['weap'] = 0;
|
|
||||||
$general['book'] = 0;
|
|
||||||
|
|
||||||
$oppose['leader'] = $leader2;
|
|
||||||
$oppose['power'] = $power2;
|
|
||||||
$oppose['intel'] = $intel2;
|
|
||||||
$oppose['crewtype'] = $type2;
|
|
||||||
$oppose['crew'] = $crew2;
|
|
||||||
$oppose['train'] = $train2;
|
|
||||||
$oppose['atmos'] = $atmos2;
|
|
||||||
$oppose['level'] = $level2;
|
|
||||||
$oppose['explevel'] = $explevel2;
|
|
||||||
$oppose['dex0'] = $dex20;
|
|
||||||
$oppose['dex10'] = $dex210;
|
|
||||||
$oppose['dex20'] = $dex220;
|
|
||||||
$oppose['dex30'] = $dex230;
|
|
||||||
$oppose['dex40'] = $dex240;
|
|
||||||
|
|
||||||
$oppose['injury'] = 0;
|
|
||||||
$oppose['horse'] = 0;
|
|
||||||
$oppose['weap'] = 0;
|
|
||||||
$oppose['book'] = 0;
|
|
||||||
|
|
||||||
$city['def'] = $def;
|
|
||||||
$city['wall'] = $wall;
|
|
||||||
$city['agri'] = 0;
|
|
||||||
$city['comm'] = 0;
|
|
||||||
$city['secu'] = 0;
|
|
||||||
|
|
||||||
if($isgen == "장수공격" || $isgen == "장수평균") {
|
|
||||||
$opposecount = 1;
|
|
||||||
} else {
|
|
||||||
$opposecount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$warphase = getRate($admin, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
|
|
||||||
|
|
||||||
// 우선 스케일링
|
|
||||||
$city['def'] *= 10;
|
|
||||||
$city['wall'] *= 10;
|
|
||||||
|
|
||||||
$msg = "";
|
|
||||||
$msg .= "<C>●</>1월:공격장수가 <R>공격</>합니다.<br>";
|
|
||||||
|
|
||||||
$exp = 0; //병사 소진 시킨 만큼
|
|
||||||
$opexp = 0;
|
|
||||||
$exp2 = 1; //능력경험치
|
|
||||||
$phase = 0;
|
|
||||||
while($phase < $warphase) {
|
|
||||||
// 장수가 없어서 도시 공격
|
|
||||||
if($opposecount == 0) {
|
|
||||||
$josaRo = JosaUtil::pick(GameUnitConst::byID($general['crewtype'])->name, '로');
|
|
||||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."{$josaRo} 성을 <M>공격</>합니다.<br>";
|
|
||||||
|
|
||||||
$mykillnum = 0; $mydeathnum = 0;
|
|
||||||
while($phase < $warphase) {
|
|
||||||
$phase++;
|
|
||||||
$myAtt = getAtt($general, $tech1, 0);
|
|
||||||
$myDef = getDef($general, $tech1);
|
|
||||||
$cityAtt = getCityAtt($city);
|
|
||||||
$cityDef = getCityDef($city);
|
|
||||||
|
|
||||||
// 감소할 병사 수
|
|
||||||
$cityCrew = GameConst::$armperphase + $myAtt - $cityDef;
|
|
||||||
$myCrew = GameConst::$armperphase + $cityAtt - $myDef;
|
|
||||||
$cityweight = $myAtt - $cityDef;
|
|
||||||
$myweight = $cityAtt - $myDef;
|
|
||||||
|
|
||||||
//훈련 사기따라
|
|
||||||
$myCrew = getCrew($myCrew, $atmos3, $general['train']);
|
|
||||||
$cityCrew = getCrew($cityCrew, $general['atmos'], $train3);
|
|
||||||
//숙련도 따라
|
|
||||||
$genDexAtt = getGenDex($general, $general['crewtype']);
|
|
||||||
$genDexDef = getGenDex($general, 40);
|
|
||||||
$cityCrew *= getDexLog($genDexAtt, ($train3-60)*7200);
|
|
||||||
$myCrew *= getDexLog(($atmos3-60)*7200, $genDexDef);
|
|
||||||
|
|
||||||
$avoid = 1;
|
|
||||||
// 병종간 특성
|
|
||||||
if(intdiv($general['crewtype'], 10) == 3) { // 귀병
|
|
||||||
$int = $general['intel'] + getBookEff($general['book']);
|
|
||||||
if($general['crewtype'] == 30) {
|
|
||||||
$ratio2 = $int * 5; // 0~500 즉 50%
|
|
||||||
} elseif($general['crewtype'] == 31) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 32) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 33) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 34) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 35) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($general['crewtype'] == 36) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($general['crewtype'] == 37) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 38) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
}
|
|
||||||
$ratio = rand() % 1000; // 0~999
|
|
||||||
if($ratio <= $ratio2) {
|
|
||||||
$ratio = rand() % 100; // 0~99
|
|
||||||
if($ratio >= 30) {
|
|
||||||
$type = rand() % 3;
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>급습</>을 <C>성공</>했다!<br>";
|
|
||||||
$cityCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>위보</>를 <C>성공</>했다!<br>";
|
|
||||||
$cityCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>혼란</>을 <C>성공</>했다!<br>";
|
|
||||||
$cityCrew *= 1.6;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$type = rand() % 3;
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>급습</>을 <R>실패</>했다!<br>";
|
|
||||||
$cityCrew /= 1.2;
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>위보</>를 <R>실패</>했다!<br>";
|
|
||||||
$cityCrew /= 1.4;
|
|
||||||
$myCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>혼란</>을 <R>실패</>했다!<br>";
|
|
||||||
$cityCrew /= 1.6;
|
|
||||||
$myCrew *= 1.6;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif($general['crewtype'] == 40) { // 정란
|
|
||||||
$cityCrew = $cityCrew * 1.5;
|
|
||||||
} elseif($general['crewtype'] == 41) { // 충차
|
|
||||||
$cityCrew = $cityCrew * 2.0;
|
|
||||||
} elseif($general['crewtype'] == 42) { // 벽력거
|
|
||||||
$cityCrew = $cityCrew * 1.5;
|
|
||||||
}
|
|
||||||
//군주, 참모, 장군 공격 보정 5%
|
|
||||||
if($general['level'] == 12 || $general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
|
|
||||||
$cityCrew = $cityCrew * 1.05;
|
|
||||||
}
|
|
||||||
//레벨 보정
|
|
||||||
$cityCrew = $cityCrew * (100 + $general['explevel']/6)/100;
|
|
||||||
|
|
||||||
//크리
|
|
||||||
$rd = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio = CriticalRatio3($general['leader'], $general['power'], $general['intel']);
|
|
||||||
if($ratio >= $rd && $avoid == 1) {
|
|
||||||
$msg .= "<C>●</><C>필살</>공격!</><br>";
|
|
||||||
$cityCrew = CriticalScore2($cityCrew);
|
|
||||||
$avoid = 0;
|
|
||||||
}
|
|
||||||
//회피
|
|
||||||
$ratio = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
|
||||||
if($ratio < $ratio2 && $avoid == 1) {
|
|
||||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
|
||||||
$myCrew /= 10; // 10%만 소모
|
|
||||||
$avoid = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//랜타추가
|
|
||||||
$cityCrew *= (rand() % 21 + 90)/100; // 90~110%
|
|
||||||
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
|
|
||||||
|
|
||||||
$general['crew'] -= Util::round($myCrew);
|
|
||||||
$city['def'] -= Util::round($cityCrew);
|
|
||||||
$city['wall'] -= Util::round($cityCrew);
|
|
||||||
|
|
||||||
$tempMyCrew = $myCrew; $tempCityCrew = $cityCrew;
|
|
||||||
$tempGeneralCrew = $general['crew']; $tempCityDef = $city['def'];
|
|
||||||
|
|
||||||
if($city['wall'] <= 0) { $city['wall'] = 0; }
|
|
||||||
|
|
||||||
if($city['def'] < 0) {
|
|
||||||
$offset = Util::round($tempCityDef*$tempMyCrew/$tempCityCrew);
|
|
||||||
$myCrew += $offset;
|
|
||||||
$general['crew'] -= $offset;
|
|
||||||
$cityCrew += $tempCityDef;
|
|
||||||
$city['def'] = 0;
|
|
||||||
}
|
|
||||||
if($general['crew'] < 0) {
|
|
||||||
$offset = Util::round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
|
|
||||||
$cityCrew += $offset;
|
|
||||||
$city['def'] -= $offset;
|
|
||||||
$myCrew += $tempGeneralCrew;
|
|
||||||
$general['crew'] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$exp += $cityCrew;
|
|
||||||
$opexp += $myCrew;
|
|
||||||
$general['crew'] = Util::round($general['crew']);
|
|
||||||
$cityCrew = Util::round($cityCrew);
|
|
||||||
$myCrew = Util::round($myCrew);
|
|
||||||
$myAtt = round($myAtt, 2);
|
|
||||||
$myDef = round($myDef, 2);
|
|
||||||
$cityAtt = round($cityAtt, 2);
|
|
||||||
$cityDef = round($cityDef, 2);
|
|
||||||
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$city['def']} (-$cityCrew)</> <Y1>【성벽】</><br>";
|
|
||||||
|
|
||||||
$mykillnum += $cityCrew; $mydeathnum += $myCrew;
|
|
||||||
|
|
||||||
if($city['def'] <= 0) { break; }
|
|
||||||
if($general['crew'] <= 0) { break; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// 도시쌀 소모 계산
|
|
||||||
$opexp = Util::round($opexp / 50);
|
|
||||||
$rice = Util::round($opexp * 4 * getCrewtypeRice(0, 0) * ($train3/100 - 0.2));
|
|
||||||
|
|
||||||
//원래대로 스케일링
|
|
||||||
$city['def'] = Util::round($city['def'] / 10);
|
|
||||||
$city['wall'] = Util::round($city['wall'] / 10);
|
|
||||||
//내정 감소
|
|
||||||
$dec = Util::round($cityCrew / 10);
|
|
||||||
$city['agri'] -= $dec;
|
|
||||||
$city['comm'] -= $dec;
|
|
||||||
$city['secu'] -= $dec;
|
|
||||||
if($city['agri'] < 0) { $city['agri'] = 0; }
|
|
||||||
if($city['comm'] < 0) { $city['comm'] = 0; }
|
|
||||||
if($city['secu'] < 0) { $city['secu'] = 0; }
|
|
||||||
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
|
|
||||||
$msg .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
|
|
||||||
|
|
||||||
// $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</> ";
|
|
||||||
// $msg2 .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
|
|
||||||
|
|
||||||
if($city['def'] == 0 || $general['crew'] == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// 장수 대결
|
|
||||||
} else {
|
|
||||||
$josaUl = JosaUtil::pick(GameUnitConst::byID($oppose['crewtype'])->name, '을');
|
|
||||||
$josaRo = JosaUtil::pick(GameUnitConst::byID($general['crewtype'])->name, '로');
|
|
||||||
$msg .= "<C>●</>".GameUnitConst::byID($general['crewtype'])->name."{$josaRo} <Y>수비장수</>의 ".GameUnitConst::byID($oppose['crewtype'])->name."{$josaUl} 공격합니다.<br>";
|
|
||||||
|
|
||||||
$mykillnum = 0; $mydeathnum = 0;
|
|
||||||
while($phase < $warphase) {
|
|
||||||
$phase++;
|
|
||||||
|
|
||||||
$myAtt = getAtt($general, $tech1, 0);
|
|
||||||
$myDef = getDef($general, $tech1);
|
|
||||||
$opAtt = getAtt($oppose, $tech2, 0);
|
|
||||||
$opDef = getDef($oppose, $tech2);
|
|
||||||
// 감소할 병사 수
|
|
||||||
$myCrew = GameConst::$armperphase + $opAtt - $myDef;
|
|
||||||
$opCrew = GameConst::$armperphase + $myAtt - $opDef;
|
|
||||||
//훈련 사기따라
|
|
||||||
$myCrew = getCrew($myCrew, $oppose['atmos'], $general['train']);
|
|
||||||
$opCrew = getCrew($opCrew, $general['atmos'], $oppose['train']);
|
|
||||||
//숙련도 따라
|
|
||||||
$genDexAtt = getGenDex($general, $general['crewtype']);
|
|
||||||
$genDexDef = getGenDex($general, $oppose['crewtype']);
|
|
||||||
$oppDexAtt = getGenDex($oppose, $oppose['crewtype']);
|
|
||||||
$oppDexDef = getGenDex($oppose, $general['crewtype']);
|
|
||||||
$opCrew *= getDexLog($genDexAtt, $oppDexDef);
|
|
||||||
$myCrew *= getDexLog($oppDexAtt, $genDexDef);
|
|
||||||
|
|
||||||
$myAvoid = 1;
|
|
||||||
$opAvoid = 1;
|
|
||||||
// 병종간 특성
|
|
||||||
if(intdiv($general['crewtype'], 10) == 3) { // 귀병
|
|
||||||
$int = $general['intel'] + getBookEff($general['book']);
|
|
||||||
if($general['crewtype'] == 30) {
|
|
||||||
$ratio2 = $int * 5; // 0~500 즉 50%
|
|
||||||
} elseif($general['crewtype'] == 31) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 32) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 33) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 34) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 35) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($general['crewtype'] == 36) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($general['crewtype'] == 37) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($general['crewtype'] == 38) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
}
|
|
||||||
$ratio = rand() % 1000; // 0~999
|
|
||||||
if($ratio <= $ratio2) {
|
|
||||||
$ratio = rand() % 100;
|
|
||||||
if($ratio >= 30) {
|
|
||||||
$type = rand() % 5; // 0~4
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>위보</>를 <C>성공</>했다!<br>";
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>매복</>을 <C>성공</>했다!<br>";
|
|
||||||
$opCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>반목</>을 <C>성공</>했다!<br>";
|
|
||||||
$opCrew *= 1.6;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$msg .= "<C>●</><D>화계</>를 <C>성공</>했다!<br>";
|
|
||||||
$opCrew *= 1.8;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$msg .= "<C>●</><D>혼란</>을 <C>성공</>했다!<br>";
|
|
||||||
$opCrew *= 2.0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$type = rand() % 5; // 0~4
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>위보</>를 <R>실패</>했다!<br>";
|
|
||||||
$opCrew /= 1.1;
|
|
||||||
$myCrew *= 1.1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>매복</>을 <R>실패</>했다!<br>";
|
|
||||||
$opCrew /= 1.2;
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>반목</>을 <R>실패</>했다!<br>";
|
|
||||||
$opCrew /= 1.3;
|
|
||||||
$myCrew *= 1.3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$msg .= "<C>●</><D>화계</>를 <R>실패</>했다!<br>";
|
|
||||||
$opCrew /= 1.4;
|
|
||||||
$myCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$msg .= "<C>●</><D>혼란</>을 <R>실패</>했다!<br>";
|
|
||||||
$opCrew /= 1.5;
|
|
||||||
$myCrew *= 1.5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 상대 장수 병종간 특성
|
|
||||||
if(intdiv($oppose['crewtype'], 10) == 3) { // 귀병
|
|
||||||
$int = $oppose['intel'] + getBookEff($oppose['book']);
|
|
||||||
if($oppose['crewtype'] == 30) {
|
|
||||||
$ratio2 = $int * 5; // 0~500 즉 50%
|
|
||||||
} elseif($oppose['crewtype'] == 31) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($oppose['crewtype'] == 32) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($oppose['crewtype'] == 33) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($oppose['crewtype'] == 34) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($oppose['crewtype'] == 35) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($oppose['crewtype'] == 36) {
|
|
||||||
$ratio2 = $int * 8; // 0~800 즉 80%
|
|
||||||
} elseif($oppose['crewtype'] == 37) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
} elseif($oppose['crewtype'] == 38) {
|
|
||||||
$ratio2 = $int * 6; // 0~600 즉 60%
|
|
||||||
}
|
|
||||||
$ratio = rand() % 1000; // 0~999
|
|
||||||
if($ratio <= $ratio2) {
|
|
||||||
$ratio = rand() % 100;
|
|
||||||
if($ratio >= 30) {
|
|
||||||
$type = rand() % 5; // 0~4
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>위보</>에 당했다!<br>";
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>매복</>에 당했다!<br>";
|
|
||||||
$myCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>반목</>에 당했다!<br>";
|
|
||||||
$myCrew *= 1.6;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$msg .= "<C>●</><D>화계</>에 당했다!<br>";
|
|
||||||
$myCrew *= 1.8;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$msg .= "<C>●</><D>혼란</>에 당했다!<br>";
|
|
||||||
$myCrew *= 2.0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$type = rand() % 5; // 0~4
|
|
||||||
switch($type) {
|
|
||||||
case 0:
|
|
||||||
$msg .= "<C>●</><D>위보</>를 간파했다!<br>";
|
|
||||||
$myCrew /= 1.1;
|
|
||||||
$opCrew *= 1.1;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$msg .= "<C>●</><D>매복</>을 간파했다!<br>";
|
|
||||||
$myCrew /= 1.2;
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$msg .= "<C>●</><D>반목</>을 간파했다!<br>";
|
|
||||||
$myCrew /= 1.3;
|
|
||||||
$opCrew *= 1.3;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$msg .= "<C>●</><D>화계</>를 간파했다!<br>";
|
|
||||||
$myCrew /= 1.4;
|
|
||||||
$opCrew *= 1.4;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$msg .= "<C>●</><D>혼란</>을 간파했다!<br>";
|
|
||||||
$myCrew /= 1.5;
|
|
||||||
$opCrew *= 1.5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($oppose['crewtype'] == 43) { // 목우
|
|
||||||
$r = 0;
|
|
||||||
$r += $oppose['atmos'];
|
|
||||||
$r += $oppose['train'];
|
|
||||||
$ratio = rand() % 400; // 최대 50% 저지
|
|
||||||
if($ratio < $r && $opAvoid == 1) {
|
|
||||||
$msg .= "<C>●</><R>저지</>당했다!</><br>";
|
|
||||||
$opAvoid = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// my 입장 상성
|
|
||||||
// 보병계열 > 궁병계열
|
|
||||||
if(intdiv($general['crewtype'], 10) == 0 && intdiv($oppose['crewtype'], 10) == 1) {
|
|
||||||
$myCrew *= 0.8;
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 궁병계열 > 기병계열
|
|
||||||
if(intdiv($general['crewtype'], 10) == 1 && intdiv($oppose['crewtype'], 10) == 2) {
|
|
||||||
$myCrew *= 0.8;
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 기병계열 > 보병계열
|
|
||||||
if(intdiv($general['crewtype'], 10) == 2 && intdiv($oppose['crewtype'], 10) == 0) {
|
|
||||||
$myCrew *= 0.8;
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 차병계열
|
|
||||||
if(intdiv($general['crewtype'], 10) == 4) {
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
$opCrew *= 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
// op 입장 상성
|
|
||||||
// 보병계열 > 궁병계열
|
|
||||||
if(intdiv($oppose['crewtype'], 10) == 0 && intdiv($general['crewtype'], 10) == 1) {
|
|
||||||
$opCrew *= 0.8;
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 궁병계열 > 기병계열
|
|
||||||
if(intdiv($oppose['crewtype'], 10) == 1 && intdiv($general['crewtype'], 10) == 2) {
|
|
||||||
$opCrew *= 0.8;
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 기병계열 > 보병계열
|
|
||||||
if(intdiv($oppose['crewtype'], 10) == 2 && intdiv($general['crewtype'], 10) == 0) {
|
|
||||||
$opCrew *= 0.8;
|
|
||||||
$myCrew *= 1.2;
|
|
||||||
}
|
|
||||||
// 차병계열
|
|
||||||
if(intdiv($oppose['crewtype'], 10) == 4) {
|
|
||||||
$opCrew *= 1.2;
|
|
||||||
$myCrew *= 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
//군주, 참모, 장군 공격 보정 5%
|
|
||||||
if($general['level'] == 12 || $general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
|
|
||||||
$opCrew = $opCrew * 1.05;
|
|
||||||
}
|
|
||||||
//상대장수 관직 보정
|
|
||||||
//군주, 참모, 모사 방어 보정 5%
|
|
||||||
if($oppose['level'] == 12 || $oppose['level'] == 11 || $oppose['level'] == 9 || $oppose['level'] == 7 || $oppose['level'] == 5) {
|
|
||||||
$opCrew = $opCrew * 0.95;
|
|
||||||
} elseif($oppose['level'] == 4 && $oppose['no'] == $city['gen1']) { // 태수 보정
|
|
||||||
$opCrew = $opCrew * 0.95;
|
|
||||||
} elseif($oppose['level'] == 3 && $oppose['no'] == $city['gen2']) { // 군사 보정
|
|
||||||
$opCrew = $opCrew * 0.95;
|
|
||||||
} elseif($oppose['level'] == 2 && $oppose['no'] == $city['gen3']) { // 시중 보정
|
|
||||||
$opCrew = $opCrew * 0.95;
|
|
||||||
}
|
|
||||||
|
|
||||||
//레벨 보정
|
|
||||||
$myCrew = $myCrew * ((100 - $general['explevel']/3)/100);
|
|
||||||
$opCrew = $opCrew / ((100 - $general['explevel']/3)/100);
|
|
||||||
$myCrew = $myCrew / ((100 - $oppose['explevel']/3)/100);
|
|
||||||
$opCrew = $opCrew * ((100 - $oppose['explevel']/3)/100);
|
|
||||||
|
|
||||||
//크리
|
|
||||||
$rd = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio = CriticalRatio3($general['leader'], $general['power'], $general['intel']);
|
|
||||||
if($ratio >= $rd && $myAvoid == 1) {
|
|
||||||
$msg .= "<C>●</><C>필살</>공격!</><br>";
|
|
||||||
$opCrew = CriticalScore2($opCrew);
|
|
||||||
$myAvoid = 0;
|
|
||||||
}
|
|
||||||
//크리
|
|
||||||
$rd = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio = CriticalRatio3($oppose['leader'], $oppose['power'], $oppose['intel']);
|
|
||||||
if($ratio >= $rd && $opAvoid == 1) {
|
|
||||||
$msg .= "<C>●</>상대의 <R>필살</>공격!</><br>";
|
|
||||||
$myCrew = CriticalScore2($myCrew);
|
|
||||||
$opAvoid = 0;
|
|
||||||
}
|
|
||||||
//회피
|
|
||||||
$ratio = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio2 = getRate($admin, $general['crewtype'], "avd"); //회피율
|
|
||||||
if($ratio < $ratio2 && $myAvoid == 1) {
|
|
||||||
$msg .= "<C>●</><C>회피</>했다!</><br>";
|
|
||||||
$myCrew /= 10; // 10%만 소모
|
|
||||||
$myAvoid = 0;
|
|
||||||
}
|
|
||||||
//회피
|
|
||||||
$ratio = rand() % 100; // 0 ~ 99
|
|
||||||
$ratio2 = getRate($admin, $oppose['crewtype'], "avd"); //회피율
|
|
||||||
if($ratio < $ratio2 && $opAvoid == 1) {
|
|
||||||
$msg .= "<C>●</>상대가 <R>회피</>했다!</><br>";
|
|
||||||
$opCrew /= 10; // 10%만 소모
|
|
||||||
$opAvoid = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//랜타추가
|
|
||||||
$opCrew *= (rand() % 21 + 90)/100; // 90~110%
|
|
||||||
$myCrew *= (rand() % 21 + 90)/100; // 90~110%
|
|
||||||
|
|
||||||
$general['crew'] -= Util::round($myCrew);
|
|
||||||
$oppose['crew'] -= Util::round($opCrew);
|
|
||||||
$tempMyCrew = $myCrew; $tempOpCrew = $opCrew;
|
|
||||||
$tempGeneralCrew = $general['crew']; $tempOpposeCrew = $oppose['crew'];
|
|
||||||
if($general['crew'] <= 0 && $oppose['crew'] <= 0) {
|
|
||||||
$r1 = $tempGeneralCrew / $tempMyCrew;
|
|
||||||
$r2 = $tempOpposeCrew / $tempOpCrew;
|
|
||||||
|
|
||||||
if($r1 > $r2) {
|
|
||||||
$offset = Util::round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
|
|
||||||
$myCrew += $offset;
|
|
||||||
$general['crew'] -= $offset;
|
|
||||||
$opCrew += $tempOpposeCrew;
|
|
||||||
$oppose['crew'] = 0;
|
|
||||||
} else {
|
|
||||||
$offset = Util::round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
|
|
||||||
$opCrew += $offset;
|
|
||||||
$oppose['crew'] -= $offset;
|
|
||||||
$myCrew += $tempGeneralCrew;
|
|
||||||
$general['crew'] = 0;
|
|
||||||
}
|
|
||||||
} elseif($general['crew'] * $oppose['crew'] <= 0) {
|
|
||||||
if($oppose['crew'] < 0) {
|
|
||||||
$offset = Util::round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
|
|
||||||
$myCrew += $offset;
|
|
||||||
$general['crew'] -= $offset;
|
|
||||||
$opCrew += $tempOpposeCrew;
|
|
||||||
$oppose['crew'] = 0;
|
|
||||||
}
|
|
||||||
if($general['crew'] < 0) {
|
|
||||||
$offset = Util::round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
|
|
||||||
$opCrew += $offset;
|
|
||||||
$oppose['crew'] -= $offset;
|
|
||||||
$myCrew += $tempGeneralCrew;
|
|
||||||
$general['crew'] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$exp += $opCrew;
|
|
||||||
$opexp += $myCrew;
|
|
||||||
$general['crew'] = Util::round($general['crew']);
|
|
||||||
$oppose['crew'] = Util::round($oppose['crew']);
|
|
||||||
$myCrew = Util::round($myCrew);
|
|
||||||
$opCrew = Util::round($opCrew);
|
|
||||||
$myAtt = round($myAtt, 2);
|
|
||||||
$myDef = round($myDef, 2);
|
|
||||||
$opAtt = round($opAtt, 2);
|
|
||||||
$opDef = round($opDef, 2);
|
|
||||||
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>{$general['crew']} (-$myCrew)</> VS <C>{$oppose['crew']} (-$opCrew)</> <Y1>【수비장수】</><br>";
|
|
||||||
|
|
||||||
$mykillnum += $opCrew; $mydeathnum += $myCrew;
|
|
||||||
|
|
||||||
if($oppose['crew'] <= 0) { break; }
|
|
||||||
if($general['crew'] <= 0) { break; }
|
|
||||||
}
|
|
||||||
|
|
||||||
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
|
|
||||||
// $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</> ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 공헌, 명성 상승
|
|
||||||
$exp = Util::round($exp / 50);
|
|
||||||
$ricing = ($exp * 5 * getCrewtypeRice($general['crewtype'], $tech1));
|
|
||||||
$msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricing<br>";
|
|
||||||
// $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricing<br>";
|
|
||||||
|
|
||||||
$msg = ConvertLog($msg, 1);
|
|
||||||
|
|
||||||
$mydeathnumSum += $mydeathnum;
|
|
||||||
$mykillnumSum += $mykillnum;
|
|
||||||
$expSum += $exp;
|
|
||||||
$ricingSum += $ricing;
|
|
||||||
$expSum2 += $dec;
|
|
||||||
$ricingSum2 += $rice;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mydeathnumSum /= $simulCount;
|
|
||||||
$mykillnumSum /= $simulCount;
|
|
||||||
$expSum /= $simulCount;
|
|
||||||
$ricingSum /= $simulCount;
|
|
||||||
$expSum2 /= $simulCount;
|
|
||||||
$ricingSum2 /= $simulCount;
|
|
||||||
if($isgen == "성벽평균") {
|
|
||||||
$msg2 .= "{$simulCount}회 평균<br>";
|
|
||||||
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</> ";
|
|
||||||
$msg2 .= "<R>★</>【성벽】내정 감소량 : $expSum2 【성벽】쌀 소모 : $ricingSum2<br>";
|
|
||||||
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricingSum<br>";
|
|
||||||
} elseif($isgen == "장수평균") {
|
|
||||||
$msg2 .= "{$simulCount}회 평균<br>";
|
|
||||||
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</> ";
|
|
||||||
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($general['crewtype'], $tech1)." = $ricingSum<br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$msg2 = ConvertLog($msg2, 1);
|
|
||||||
} else {
|
|
||||||
$leader1 = 70;
|
|
||||||
$power1 = 70;
|
|
||||||
$intel1 = 10;
|
|
||||||
$type1 = 0;
|
|
||||||
$crew1 = 7000;
|
|
||||||
$train1 = 100;
|
|
||||||
$atmos1 = 100;
|
|
||||||
$level1 = 1;
|
|
||||||
$explevel1 = 20;
|
|
||||||
|
|
||||||
$leader2 = 70;
|
|
||||||
$power2 = 70;
|
|
||||||
$intel2 = 10;
|
|
||||||
$type2 = 0;
|
|
||||||
$crew2 = 7000;
|
|
||||||
$train2 = 100;
|
|
||||||
$atmos2 = 100;
|
|
||||||
$level2 = 1;
|
|
||||||
$explevel2 = 20;
|
|
||||||
|
|
||||||
$def = 7000;
|
|
||||||
$wall = 7000;
|
|
||||||
$train3 = $admin['city_rate'];
|
|
||||||
$atmos3 = $admin['city_rate'];
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($level1) {
|
|
||||||
case 12: $sellevel1[12] = "selected"; break;
|
|
||||||
case 11: $sellevel1[11] = "selected"; break;
|
|
||||||
case 10: $sellevel1[10] = "selected"; break;
|
|
||||||
case 9: $sellevel1[9] = "selected"; break;
|
|
||||||
case 8: $sellevel1[8] = "selected"; break;
|
|
||||||
case 7: $sellevel1[7] = "selected"; break;
|
|
||||||
case 6: $sellevel1[6] = "selected"; break;
|
|
||||||
case 5: $sellevel1[5] = "selected"; break;
|
|
||||||
case 1: $sellevel1[1] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($level2) {
|
|
||||||
case 12: $sellevel2[12] = "selected"; break;
|
|
||||||
case 11: $sellevel2[11] = "selected"; break;
|
|
||||||
case 10: $sellevel2[10] = "selected"; break;
|
|
||||||
case 9: $sellevel2[9] = "selected"; break;
|
|
||||||
case 8: $sellevel2[8] = "selected"; break;
|
|
||||||
case 7: $sellevel2[7] = "selected"; break;
|
|
||||||
case 6: $sellevel2[6] = "selected"; break;
|
|
||||||
case 5: $sellevel2[5] = "selected"; break;
|
|
||||||
case 1: $sellevel2[1] = "selected"; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($type1) {
|
|
||||||
case 0: $sel1[0] = "selected"; break;
|
|
||||||
case 1: $sel1[1] = "selected"; break;
|
|
||||||
case 2: $sel1[2] = "selected"; break;
|
|
||||||
case 3: $sel1[3] = "selected"; break;
|
|
||||||
case 4: $sel1[4] = "selected"; break;
|
|
||||||
case 5: $sel1[5] = "selected"; break;
|
|
||||||
case 10: $sel1[10] = "selected"; break;
|
|
||||||
case 11: $sel1[11] = "selected"; break;
|
|
||||||
case 12: $sel1[12] = "selected"; break;
|
|
||||||
case 13: $sel1[13] = "selected"; break;
|
|
||||||
case 14: $sel1[14] = "selected"; break;
|
|
||||||
case 20: $sel1[20] = "selected"; break;
|
|
||||||
case 21: $sel1[21] = "selected"; break;
|
|
||||||
case 22: $sel1[22] = "selected"; break;
|
|
||||||
case 23: $sel1[23] = "selected"; break;
|
|
||||||
case 24: $sel1[24] = "selected"; break;
|
|
||||||
case 25: $sel1[25] = "selected"; break;
|
|
||||||
case 26: $sel1[26] = "selected"; break;
|
|
||||||
case 27: $sel1[27] = "selected"; break;
|
|
||||||
case 30: $sel1[30] = "selected"; break;
|
|
||||||
case 31: $sel1[31] = "selected"; break;
|
|
||||||
case 32: $sel1[32] = "selected"; break;
|
|
||||||
case 33: $sel1[33] = "selected"; break;
|
|
||||||
case 34: $sel1[34] = "selected"; break;
|
|
||||||
case 35: $sel1[35] = "selected"; break;
|
|
||||||
case 36: $sel1[36] = "selected"; break;
|
|
||||||
case 37: $sel1[37] = "selected"; break;
|
|
||||||
case 38: $sel1[38] = "selected"; break;
|
|
||||||
case 40: $sel1[40] = "selected"; break;
|
|
||||||
case 41: $sel1[41] = "selected"; break;
|
|
||||||
case 42: $sel1[42] = "selected"; break;
|
|
||||||
case 43: $sel1[43] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($type2) {
|
|
||||||
case 0: $sel2[0] = "selected"; break;
|
|
||||||
case 1: $sel2[1] = "selected"; break;
|
|
||||||
case 2: $sel2[2] = "selected"; break;
|
|
||||||
case 3: $sel2[3] = "selected"; break;
|
|
||||||
case 4: $sel2[4] = "selected"; break;
|
|
||||||
case 5: $sel2[5] = "selected"; break;
|
|
||||||
case 10: $sel2[10] = "selected"; break;
|
|
||||||
case 11: $sel2[11] = "selected"; break;
|
|
||||||
case 12: $sel2[12] = "selected"; break;
|
|
||||||
case 13: $sel2[13] = "selected"; break;
|
|
||||||
case 14: $sel2[14] = "selected"; break;
|
|
||||||
case 20: $sel2[20] = "selected"; break;
|
|
||||||
case 21: $sel2[21] = "selected"; break;
|
|
||||||
case 22: $sel2[22] = "selected"; break;
|
|
||||||
case 23: $sel2[23] = "selected"; break;
|
|
||||||
case 24: $sel2[24] = "selected"; break;
|
|
||||||
case 25: $sel2[25] = "selected"; break;
|
|
||||||
case 26: $sel2[26] = "selected"; break;
|
|
||||||
case 27: $sel2[27] = "selected"; break;
|
|
||||||
case 30: $sel2[30] = "selected"; break;
|
|
||||||
case 31: $sel2[31] = "selected"; break;
|
|
||||||
case 32: $sel2[32] = "selected"; break;
|
|
||||||
case 33: $sel2[33] = "selected"; break;
|
|
||||||
case 34: $sel2[34] = "selected"; break;
|
|
||||||
case 35: $sel2[35] = "selected"; break;
|
|
||||||
case 36: $sel2[36] = "selected"; break;
|
|
||||||
case 37: $sel2[37] = "selected"; break;
|
|
||||||
case 38: $sel2[38] = "selected"; break;
|
|
||||||
case 40: $sel2[40] = "selected"; break;
|
|
||||||
case 41: $sel2[41] = "selected"; break;
|
|
||||||
case 42: $sel2[42] = "selected"; break;
|
|
||||||
case 43: $sel2[43] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($tech1) {
|
|
||||||
case 0: $tch1[0] = "selected"; break;
|
|
||||||
case 1000: $tch1[1] = "selected"; break;
|
|
||||||
case 2000: $tch1[2] = "selected"; break;
|
|
||||||
case 3000: $tch1[3] = "selected"; break;
|
|
||||||
case 4000: $tch1[4] = "selected"; break;
|
|
||||||
case 5000: $tch1[5] = "selected"; break;
|
|
||||||
case 6000: $tch1[6] = "selected"; break;
|
|
||||||
case 7000: $tch1[7] = "selected"; break;
|
|
||||||
case 8000: $tch1[8] = "selected"; break;
|
|
||||||
case 9000: $tch1[9] = "selected"; break;
|
|
||||||
case 10000: $tch1[10] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($tech2) {
|
|
||||||
case 0: $tch2[0] = "selected"; break;
|
|
||||||
case 1000: $tch2[1] = "selected"; break;
|
|
||||||
case 2000: $tch2[2] = "selected"; break;
|
|
||||||
case 3000: $tch2[3] = "selected"; break;
|
|
||||||
case 4000: $tch2[4] = "selected"; break;
|
|
||||||
case 5000: $tch2[5] = "selected"; break;
|
|
||||||
case 6000: $tch2[6] = "selected"; break;
|
|
||||||
case 7000: $tch2[7] = "selected"; break;
|
|
||||||
case 8000: $tch2[8] = "selected"; break;
|
|
||||||
case 9000: $tch2[9] = "selected"; break;
|
|
||||||
case 10000: $tch2[10] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex10) {
|
|
||||||
case 0: $dx10[0] = "selected"; break;
|
|
||||||
case 2500: $dx10[1] = "selected"; break;
|
|
||||||
case 7500: $dx10[2] = "selected"; break;
|
|
||||||
case 15000: $dx10[3] = "selected"; break;
|
|
||||||
case 25000: $dx10[4] = "selected"; break;
|
|
||||||
case 37500: $dx10[5] = "selected"; break;
|
|
||||||
case 52500: $dx10[6] = "selected"; break;
|
|
||||||
case 70000: $dx10[7] = "selected"; break;
|
|
||||||
case 90000: $dx10[8] = "selected"; break;
|
|
||||||
case 112500: $dx10[9] = "selected"; break;
|
|
||||||
case 137500: $dx10[10] = "selected"; break;
|
|
||||||
case 165000: $dx10[11] = "selected"; break;
|
|
||||||
case 195000: $dx10[12] = "selected"; break;
|
|
||||||
case 227500: $dx10[13] = "selected"; break;
|
|
||||||
case 262500: $dx10[14] = "selected"; break;
|
|
||||||
case 300000: $dx10[15] = "selected"; break;
|
|
||||||
case 340000: $dx10[16] = "selected"; break;
|
|
||||||
case 382500: $dx10[17] = "selected"; break;
|
|
||||||
case 427500: $dx10[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex110) {
|
|
||||||
case 0: $dx110[0] = "selected"; break;
|
|
||||||
case 2500: $dx110[1] = "selected"; break;
|
|
||||||
case 7500: $dx110[2] = "selected"; break;
|
|
||||||
case 15000: $dx110[3] = "selected"; break;
|
|
||||||
case 25000: $dx110[4] = "selected"; break;
|
|
||||||
case 37500: $dx110[5] = "selected"; break;
|
|
||||||
case 52500: $dx110[6] = "selected"; break;
|
|
||||||
case 70000: $dx110[7] = "selected"; break;
|
|
||||||
case 90000: $dx110[8] = "selected"; break;
|
|
||||||
case 112500: $dx110[9] = "selected"; break;
|
|
||||||
case 137500: $dx110[10] = "selected"; break;
|
|
||||||
case 165000: $dx110[11] = "selected"; break;
|
|
||||||
case 195000: $dx110[12] = "selected"; break;
|
|
||||||
case 227500: $dx110[13] = "selected"; break;
|
|
||||||
case 262500: $dx110[14] = "selected"; break;
|
|
||||||
case 300000: $dx110[15] = "selected"; break;
|
|
||||||
case 340000: $dx110[16] = "selected"; break;
|
|
||||||
case 382500: $dx110[17] = "selected"; break;
|
|
||||||
case 427500: $dx110[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex120) {
|
|
||||||
case 0: $dx120[0] = "selected"; break;
|
|
||||||
case 2500: $dx120[1] = "selected"; break;
|
|
||||||
case 7500: $dx120[2] = "selected"; break;
|
|
||||||
case 15000: $dx120[3] = "selected"; break;
|
|
||||||
case 25000: $dx120[4] = "selected"; break;
|
|
||||||
case 37500: $dx120[5] = "selected"; break;
|
|
||||||
case 52500: $dx120[6] = "selected"; break;
|
|
||||||
case 70000: $dx120[7] = "selected"; break;
|
|
||||||
case 90000: $dx120[8] = "selected"; break;
|
|
||||||
case 112500: $dx120[9] = "selected"; break;
|
|
||||||
case 137500: $dx120[10] = "selected"; break;
|
|
||||||
case 165000: $dx120[11] = "selected"; break;
|
|
||||||
case 195000: $dx120[12] = "selected"; break;
|
|
||||||
case 227500: $dx120[13] = "selected"; break;
|
|
||||||
case 262500: $dx120[14] = "selected"; break;
|
|
||||||
case 300000: $dx120[15] = "selected"; break;
|
|
||||||
case 340000: $dx120[16] = "selected"; break;
|
|
||||||
case 382500: $dx120[17] = "selected"; break;
|
|
||||||
case 427500: $dx120[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex130) {
|
|
||||||
case 0: $dx130[0] = "selected"; break;
|
|
||||||
case 2500: $dx130[1] = "selected"; break;
|
|
||||||
case 7500: $dx130[2] = "selected"; break;
|
|
||||||
case 15000: $dx130[3] = "selected"; break;
|
|
||||||
case 25000: $dx130[4] = "selected"; break;
|
|
||||||
case 37500: $dx130[5] = "selected"; break;
|
|
||||||
case 52500: $dx130[6] = "selected"; break;
|
|
||||||
case 70000: $dx130[7] = "selected"; break;
|
|
||||||
case 90000: $dx130[8] = "selected"; break;
|
|
||||||
case 112500: $dx130[9] = "selected"; break;
|
|
||||||
case 137500: $dx130[10] = "selected"; break;
|
|
||||||
case 165000: $dx130[11] = "selected"; break;
|
|
||||||
case 195000: $dx130[12] = "selected"; break;
|
|
||||||
case 227500: $dx130[13] = "selected"; break;
|
|
||||||
case 262500: $dx130[14] = "selected"; break;
|
|
||||||
case 300000: $dx130[15] = "selected"; break;
|
|
||||||
case 340000: $dx130[16] = "selected"; break;
|
|
||||||
case 382500: $dx130[17] = "selected"; break;
|
|
||||||
case 427500: $dx130[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex140) {
|
|
||||||
case 0: $dx140[0] = "selected"; break;
|
|
||||||
case 2500: $dx140[1] = "selected"; break;
|
|
||||||
case 7500: $dx140[2] = "selected"; break;
|
|
||||||
case 15000: $dx140[3] = "selected"; break;
|
|
||||||
case 25000: $dx140[4] = "selected"; break;
|
|
||||||
case 37500: $dx140[5] = "selected"; break;
|
|
||||||
case 52500: $dx140[6] = "selected"; break;
|
|
||||||
case 70000: $dx140[7] = "selected"; break;
|
|
||||||
case 90000: $dx140[8] = "selected"; break;
|
|
||||||
case 112500: $dx140[9] = "selected"; break;
|
|
||||||
case 137500: $dx140[10] = "selected"; break;
|
|
||||||
case 165000: $dx140[11] = "selected"; break;
|
|
||||||
case 195000: $dx140[12] = "selected"; break;
|
|
||||||
case 227500: $dx140[13] = "selected"; break;
|
|
||||||
case 262500: $dx140[14] = "selected"; break;
|
|
||||||
case 300000: $dx140[15] = "selected"; break;
|
|
||||||
case 340000: $dx140[16] = "selected"; break;
|
|
||||||
case 382500: $dx140[17] = "selected"; break;
|
|
||||||
case 427500: $dx140[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex20) {
|
|
||||||
case 0: $dx20[0] = "selected"; break;
|
|
||||||
case 2500: $dx20[1] = "selected"; break;
|
|
||||||
case 7500: $dx20[2] = "selected"; break;
|
|
||||||
case 15000: $dx20[3] = "selected"; break;
|
|
||||||
case 25000: $dx20[4] = "selected"; break;
|
|
||||||
case 37500: $dx20[5] = "selected"; break;
|
|
||||||
case 52500: $dx20[6] = "selected"; break;
|
|
||||||
case 70000: $dx20[7] = "selected"; break;
|
|
||||||
case 90000: $dx20[8] = "selected"; break;
|
|
||||||
case 112500: $dx20[9] = "selected"; break;
|
|
||||||
case 137500: $dx20[10] = "selected"; break;
|
|
||||||
case 165000: $dx20[11] = "selected"; break;
|
|
||||||
case 195000: $dx20[12] = "selected"; break;
|
|
||||||
case 227500: $dx20[13] = "selected"; break;
|
|
||||||
case 262500: $dx20[14] = "selected"; break;
|
|
||||||
case 300000: $dx20[15] = "selected"; break;
|
|
||||||
case 340000: $dx20[16] = "selected"; break;
|
|
||||||
case 382500: $dx20[17] = "selected"; break;
|
|
||||||
case 427500: $dx20[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex210) {
|
|
||||||
case 0: $dx210[0] = "selected"; break;
|
|
||||||
case 2500: $dx210[1] = "selected"; break;
|
|
||||||
case 7500: $dx210[2] = "selected"; break;
|
|
||||||
case 15000: $dx210[3] = "selected"; break;
|
|
||||||
case 25000: $dx210[4] = "selected"; break;
|
|
||||||
case 37500: $dx210[5] = "selected"; break;
|
|
||||||
case 52500: $dx210[6] = "selected"; break;
|
|
||||||
case 70000: $dx210[7] = "selected"; break;
|
|
||||||
case 90000: $dx210[8] = "selected"; break;
|
|
||||||
case 112500: $dx210[9] = "selected"; break;
|
|
||||||
case 137500: $dx210[10] = "selected"; break;
|
|
||||||
case 165000: $dx210[11] = "selected"; break;
|
|
||||||
case 195000: $dx210[12] = "selected"; break;
|
|
||||||
case 227500: $dx210[13] = "selected"; break;
|
|
||||||
case 262500: $dx210[14] = "selected"; break;
|
|
||||||
case 300000: $dx210[15] = "selected"; break;
|
|
||||||
case 340000: $dx210[16] = "selected"; break;
|
|
||||||
case 382500: $dx210[17] = "selected"; break;
|
|
||||||
case 427500: $dx210[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex220) {
|
|
||||||
case 0: $dx220[0] = "selected"; break;
|
|
||||||
case 2500: $dx220[1] = "selected"; break;
|
|
||||||
case 7500: $dx220[2] = "selected"; break;
|
|
||||||
case 15000: $dx220[3] = "selected"; break;
|
|
||||||
case 25000: $dx220[4] = "selected"; break;
|
|
||||||
case 37500: $dx220[5] = "selected"; break;
|
|
||||||
case 52500: $dx220[6] = "selected"; break;
|
|
||||||
case 70000: $dx220[7] = "selected"; break;
|
|
||||||
case 90000: $dx220[8] = "selected"; break;
|
|
||||||
case 112500: $dx220[9] = "selected"; break;
|
|
||||||
case 137500: $dx220[10] = "selected"; break;
|
|
||||||
case 165000: $dx220[11] = "selected"; break;
|
|
||||||
case 195000: $dx220[12] = "selected"; break;
|
|
||||||
case 227500: $dx220[13] = "selected"; break;
|
|
||||||
case 262500: $dx220[14] = "selected"; break;
|
|
||||||
case 300000: $dx220[15] = "selected"; break;
|
|
||||||
case 340000: $dx220[16] = "selected"; break;
|
|
||||||
case 382500: $dx220[17] = "selected"; break;
|
|
||||||
case 427500: $dx220[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex230) {
|
|
||||||
case 0: $dx230[0] = "selected"; break;
|
|
||||||
case 2500: $dx230[1] = "selected"; break;
|
|
||||||
case 7500: $dx230[2] = "selected"; break;
|
|
||||||
case 15000: $dx230[3] = "selected"; break;
|
|
||||||
case 25000: $dx230[4] = "selected"; break;
|
|
||||||
case 37500: $dx230[5] = "selected"; break;
|
|
||||||
case 52500: $dx230[6] = "selected"; break;
|
|
||||||
case 70000: $dx230[7] = "selected"; break;
|
|
||||||
case 90000: $dx230[8] = "selected"; break;
|
|
||||||
case 112500: $dx230[9] = "selected"; break;
|
|
||||||
case 137500: $dx230[10] = "selected"; break;
|
|
||||||
case 165000: $dx230[11] = "selected"; break;
|
|
||||||
case 195000: $dx230[12] = "selected"; break;
|
|
||||||
case 227500: $dx230[13] = "selected"; break;
|
|
||||||
case 262500: $dx230[14] = "selected"; break;
|
|
||||||
case 300000: $dx230[15] = "selected"; break;
|
|
||||||
case 340000: $dx230[16] = "selected"; break;
|
|
||||||
case 382500: $dx230[17] = "selected"; break;
|
|
||||||
case 427500: $dx230[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
switch($dex240) {
|
|
||||||
case 0: $dx240[0] = "selected"; break;
|
|
||||||
case 2500: $dx240[1] = "selected"; break;
|
|
||||||
case 7500: $dx240[2] = "selected"; break;
|
|
||||||
case 15000: $dx240[3] = "selected"; break;
|
|
||||||
case 25000: $dx240[4] = "selected"; break;
|
|
||||||
case 37500: $dx240[5] = "selected"; break;
|
|
||||||
case 52500: $dx240[6] = "selected"; break;
|
|
||||||
case 70000: $dx240[7] = "selected"; break;
|
|
||||||
case 90000: $dx240[8] = "selected"; break;
|
|
||||||
case 112500: $dx240[9] = "selected"; break;
|
|
||||||
case 137500: $dx240[10] = "selected"; break;
|
|
||||||
case 165000: $dx240[11] = "selected"; break;
|
|
||||||
case 195000: $dx240[12] = "selected"; break;
|
|
||||||
case 227500: $dx240[13] = "selected"; break;
|
|
||||||
case 262500: $dx240[14] = "selected"; break;
|
|
||||||
case 300000: $dx240[15] = "selected"; break;
|
|
||||||
case 340000: $dx240[16] = "selected"; break;
|
|
||||||
case 382500: $dx240[17] = "selected"; break;
|
|
||||||
case 427500: $dx240[18] = "selected"; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=1024" />
|
|
||||||
<title>전투시뮬레이션</title>
|
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
|
||||||
<style type="text/css">
|
|
||||||
select { background-color:black;color:white; }
|
|
||||||
input { background-color:black;color:white; }
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<form method=post action=_simul.php>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr id=bg1>
|
|
||||||
<td>공격장수</td>
|
|
||||||
<td>상대장수</td>
|
|
||||||
<td>상대성벽</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>관직
|
|
||||||
<select name=level1 size=1>
|
|
||||||
<option <?=$sellevel1[1]?> value=1>일반</option>
|
|
||||||
<option <?=$sellevel1[5]?> value=5>제3모사</option>
|
|
||||||
<option <?=$sellevel1[6]?> value=6>제3장군</option>
|
|
||||||
<option <?=$sellevel1[7]?> value=7>제2모사</option>
|
|
||||||
<option <?=$sellevel1[8]?> value=8>제2장군</option>
|
|
||||||
<option <?=$sellevel1[9]?> value=9>제1모사</option>
|
|
||||||
<option <?=$sellevel1[10]?> value=10>제1장군</option>
|
|
||||||
<option <?=$sellevel1[11]?> value=11>참모</option>
|
|
||||||
<option <?=$sellevel1[12]?> value=12>군주</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>관직
|
|
||||||
<select name=level2 size=1>
|
|
||||||
<option <?=$sellevel2[1]?> value=1>일반</option>
|
|
||||||
<option <?=$sellevel2[5]?> value=5>제3모사</option>
|
|
||||||
<option <?=$sellevel2[6]?> value=6>제3장군</option>
|
|
||||||
<option <?=$sellevel2[7]?> value=7>제2모사</option>
|
|
||||||
<option <?=$sellevel2[8]?> value=8>제2장군</option>
|
|
||||||
<option <?=$sellevel2[9]?> value=9>제1모사</option>
|
|
||||||
<option <?=$sellevel2[10]?> value=10>제1장군</option>
|
|
||||||
<option <?=$sellevel2[11]?> value=11>참모</option>
|
|
||||||
<option <?=$sellevel2[12]?> value=12>군주</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>-</td>
|
|
||||||
<tr>
|
|
||||||
<td>Lv <input size=2 maxlength=2 name=explevel1 value=<?=$explevel1?>></td>
|
|
||||||
<td>Lv <input size=2 maxlength=2 name=explevel2 value=<?=$explevel2?>></td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>통솔 <input size=3 maxlength=3 name=leader1 value=<?=$leader1?>></td>
|
|
||||||
<td>통솔 <input size=3 maxlength=3 name=leader2 value=<?=$leader2?>></td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>무력 <input size=3 maxlength=3 name=power1 value=<?=$power1?>></td>
|
|
||||||
<td>무력 <input size=3 maxlength=3 name=power2 value=<?=$power2?>></td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>지력 <input size=3 maxlength=3 name=intel1 value=<?=$intel1?>></td>
|
|
||||||
<td>지력 <input size=3 maxlength=3 name=intel2 value=<?=$intel2?>></td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>병종
|
|
||||||
<select name=type1 size=1>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel1[0]?> value=0>보병</option>
|
|
||||||
<option <?=$sel1[1]?> value=1>청주병</option>
|
|
||||||
<option <?=$sel1[2]?> value=2>수병</option>
|
|
||||||
<option <?=$sel1[3]?> value=3>자객병</option>
|
|
||||||
<option <?=$sel1[4]?> value=4>근위병</option>
|
|
||||||
<option <?=$sel1[5]?> value=5>등갑병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel1[10]?> value=10>궁병</option>
|
|
||||||
<option <?=$sel1[11]?> value=11>궁기병</option>
|
|
||||||
<option <?=$sel1[12]?> value=12>연노병</option>
|
|
||||||
<option <?=$sel1[13]?> value=13>강궁병</option>
|
|
||||||
<option <?=$sel1[14]?> value=14>석궁병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel1[20]?> value=20>기병</option>
|
|
||||||
<option <?=$sel1[21]?> value=21>백마병</option>
|
|
||||||
<option <?=$sel1[22]?> value=22>중장기병</option>
|
|
||||||
<option <?=$sel1[23]?> value=23>돌격기병</option>
|
|
||||||
<option <?=$sel1[24]?> value=24>철기병</option>
|
|
||||||
<option <?=$sel1[25]?> value=25>수렵기병</option>
|
|
||||||
<option <?=$sel1[26]?> value=26>맹수병</option>
|
|
||||||
<option <?=$sel1[27]?> value=27>호표기병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel1[30]?> value=30>귀병</option>
|
|
||||||
<option <?=$sel1[31]?> value=31>신귀병</option>
|
|
||||||
<option <?=$sel1[32]?> value=32>백귀병</option>
|
|
||||||
<option <?=$sel1[33]?> value=33>흑귀병</option>
|
|
||||||
<option <?=$sel1[34]?> value=34>악귀병</option>
|
|
||||||
<option <?=$sel1[35]?> value=35>남귀병</option>
|
|
||||||
<option <?=$sel1[36]?> value=36>황귀병</option>
|
|
||||||
<option <?=$sel1[37]?> value=37>천귀병</option>
|
|
||||||
<option <?=$sel1[38]?> value=38>마귀병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel1[40]?> value=40>정란</option>
|
|
||||||
<option <?=$sel1[41]?> value=41>충차</option>
|
|
||||||
<option <?=$sel1[42]?> value=42>벽력거</option>
|
|
||||||
<option <?=$sel1[43]?> value=43>목우</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>병종
|
|
||||||
<select name=type2 size=1>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel2[0]?> value=0>보병</option>
|
|
||||||
<option <?=$sel2[1]?> value=1>청주병</option>
|
|
||||||
<option <?=$sel2[2]?> value=2>수병</option>
|
|
||||||
<option <?=$sel2[3]?> value=3>자객병</option>
|
|
||||||
<option <?=$sel2[4]?> value=4>근위병</option>
|
|
||||||
<option <?=$sel2[5]?> value=5>등갑병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel2[10]?> value=10>궁병</option>
|
|
||||||
<option <?=$sel2[11]?> value=11>궁기병</option>
|
|
||||||
<option <?=$sel2[12]?> value=12>연노병</option>
|
|
||||||
<option <?=$sel2[13]?> value=13>강궁병</option>
|
|
||||||
<option <?=$sel2[14]?> value=14>석궁병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel2[20]?> value=20>기병</option>
|
|
||||||
<option <?=$sel2[21]?> value=21>백마병</option>
|
|
||||||
<option <?=$sel2[22]?> value=22>중장기병</option>
|
|
||||||
<option <?=$sel2[23]?> value=23>돌격기병</option>
|
|
||||||
<option <?=$sel2[24]?> value=24>철기병</option>
|
|
||||||
<option <?=$sel2[25]?> value=25>수렵기병</option>
|
|
||||||
<option <?=$sel2[26]?> value=26>맹수병</option>
|
|
||||||
<option <?=$sel2[27]?> value=27>호표기병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel2[30]?> value=30>귀병</option>
|
|
||||||
<option <?=$sel2[31]?> value=31>신귀병</option>
|
|
||||||
<option <?=$sel2[32]?> value=32>백귀병</option>
|
|
||||||
<option <?=$sel2[33]?> value=33>흑귀병</option>
|
|
||||||
<option <?=$sel2[34]?> value=34>악귀병</option>
|
|
||||||
<option <?=$sel2[35]?> value=35>남귀병</option>
|
|
||||||
<option <?=$sel2[36]?> value=36>황귀병</option>
|
|
||||||
<option <?=$sel2[37]?> value=37>천귀병</option>
|
|
||||||
<option <?=$sel2[38]?> value=38>마귀병</option>
|
|
||||||
<option value=0>--------</option>
|
|
||||||
<option <?=$sel2[40]?> value=40>정란</option>
|
|
||||||
<option <?=$sel2[41]?> value=41>충차</option>
|
|
||||||
<option <?=$sel2[42]?> value=42>벽력거</option>
|
|
||||||
<option <?=$sel2[43]?> value=43>목우</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>성벽 <input size=4 maxlength=4 name=wall value=<?=$wall?>></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>병력 <input size=5 maxlength=5 name=crew1 value=<?=$crew1?>></td>
|
|
||||||
<td>병력 <input size=5 maxlength=5 name=crew2 value=<?=$crew2?>></td>
|
|
||||||
<td>수비 <input size=4 maxlength=4 name=def value=<?=$def?>></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>훈련 <input size=3 maxlength=3 name=train1 value=<?=$train1?>></td>
|
|
||||||
<td>훈련 <input size=3 maxlength=3 name=train2 value=<?=$train2?>></td>
|
|
||||||
<td>훈련 <input size=3 maxlength=3 name=train3 value=<?=$train3?>></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>사기 <input size=3 maxlength=3 name=atmos1 value=<?=$atmos1?>></td>
|
|
||||||
<td>사기 <input size=3 maxlength=3 name=atmos2 value=<?=$atmos2?>></td>
|
|
||||||
<td>사기 <input size=3 maxlength=3 name=atmos3 value=<?=$atmos3?>></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>기술
|
|
||||||
<select name=tech1 size=1>
|
|
||||||
<option <?=$tch1[0]?> value=0>0등급</option>
|
|
||||||
<option <?=$tch1[1]?> value=1000>1등급</option>
|
|
||||||
<option <?=$tch1[2]?> value=2000>2등급</option>
|
|
||||||
<option <?=$tch1[3]?> value=3000>3등급</option>
|
|
||||||
<option <?=$tch1[4]?> value=4000>4등급</option>
|
|
||||||
<option <?=$tch1[5]?> value=5000>5등급</option>
|
|
||||||
<option <?=$tch1[6]?> value=6000>6등급</option>
|
|
||||||
<option <?=$tch1[7]?> value=7000>7등급</option>
|
|
||||||
<option <?=$tch1[8]?> value=8000>8등급</option>
|
|
||||||
<option <?=$tch1[9]?> value=9000>9등급</option>
|
|
||||||
<option <?=$tch1[10]?> value=10000>10등급</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>기술
|
|
||||||
<select name=tech2 size=1>
|
|
||||||
<option <?=$tch2[0]?> value=0>0등급</option>
|
|
||||||
<option <?=$tch2[1]?> value=1000>1등급</option>
|
|
||||||
<option <?=$tch2[2]?> value=2000>2등급</option>
|
|
||||||
<option <?=$tch2[3]?> value=3000>3등급</option>
|
|
||||||
<option <?=$tch2[4]?> value=4000>4등급</option>
|
|
||||||
<option <?=$tch2[5]?> value=5000>5등급</option>
|
|
||||||
<option <?=$tch2[6]?> value=6000>6등급</option>
|
|
||||||
<option <?=$tch2[7]?> value=7000>7등급</option>
|
|
||||||
<option <?=$tch2[8]?> value=8000>8등급</option>
|
|
||||||
<option <?=$tch2[9]?> value=9000>9등급</option>
|
|
||||||
<option <?=$tch2[10]?> value=10000>10등급</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>보
|
|
||||||
<select name=dex10 size=1>
|
|
||||||
<option <?=$dx10[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx10[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx10[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx10[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx10[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx10[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx10[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx10[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx10[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx10[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx10[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx10[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx10[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx10[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx10[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx10[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx10[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx10[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx10[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
궁
|
|
||||||
<select name=dex110 size=1>
|
|
||||||
<option <?=$dx110[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx110[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx110[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx110[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx110[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx110[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx110[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx110[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx110[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx110[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx110[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx110[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx110[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx110[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx110[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx110[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx110[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx110[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx110[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
기
|
|
||||||
<select name=dex120 size=1>
|
|
||||||
<option <?=$dx120[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx120[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx120[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx120[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx120[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx120[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx120[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx120[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx120[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx120[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx120[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx120[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx120[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx120[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx120[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx120[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx120[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx120[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx120[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
귀
|
|
||||||
<select name=dex130 size=1>
|
|
||||||
<option <?=$dx130[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx130[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx130[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx130[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx130[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx130[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx130[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx130[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx130[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx130[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx130[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx130[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx130[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx130[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx130[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx130[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx130[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx130[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx130[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
차
|
|
||||||
<select name=dex140 size=1>
|
|
||||||
<option <?=$dx140[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx140[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx140[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx140[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx140[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx140[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx140[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx140[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx140[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx140[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx140[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx140[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx140[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx140[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx140[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx140[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx140[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx140[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx140[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>보
|
|
||||||
<select name=dex20 size=1>
|
|
||||||
<option <?=$dx20[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx20[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx20[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx20[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx20[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx20[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx20[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx20[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx20[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx20[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx20[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx20[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx20[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx20[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx20[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx20[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx20[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx20[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx20[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
궁
|
|
||||||
<select name=dex210 size=1>
|
|
||||||
<option <?=$dx210[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx210[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx210[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx210[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx210[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx210[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx210[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx210[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx210[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx210[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx210[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx210[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx210[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx210[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx210[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx210[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx210[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx210[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx210[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
기
|
|
||||||
<select name=dex220 size=1>
|
|
||||||
<option <?=$dx220[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx220[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx220[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx220[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx220[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx220[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx220[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx220[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx220[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx220[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx220[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx220[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx220[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx220[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx220[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx220[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx220[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx220[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx220[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
귀
|
|
||||||
<select name=dex230 size=1>
|
|
||||||
<option <?=$dx230[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx230[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx230[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx230[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx230[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx230[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx230[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx230[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx230[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx230[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx230[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx230[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx230[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx230[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx230[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx230[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx230[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx230[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx230[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
차
|
|
||||||
<select name=dex240 size=1>
|
|
||||||
<option <?=$dx240[0]?> value=0>F</option>
|
|
||||||
<option <?=$dx240[1]?> value=2500>E-</option>
|
|
||||||
<option <?=$dx240[2]?> value=7500>E</option>
|
|
||||||
<option <?=$dx240[3]?> value=15000>E+</option>
|
|
||||||
<option <?=$dx240[4]?> value=25000>D-</option>
|
|
||||||
<option <?=$dx240[5]?> value=37500>D</option>
|
|
||||||
<option <?=$dx240[6]?> value=52500>D+</option>
|
|
||||||
<option <?=$dx240[7]?> value=70000>C-</option>
|
|
||||||
<option <?=$dx240[8]?> value=90000>C</option>
|
|
||||||
<option <?=$dx240[9]?> value=112500>C+</option>
|
|
||||||
<option <?=$dx240[10]?> value=137500>B-</option>
|
|
||||||
<option <?=$dx240[11]?> value=165000>B</option>
|
|
||||||
<option <?=$dx240[12]?> value=195000>B+</option>
|
|
||||||
<option <?=$dx240[13]?> value=227500>A-</option>
|
|
||||||
<option <?=$dx240[14]?> value=262500>A</option>
|
|
||||||
<option <?=$dx240[15]?> value=300000>A+</option>
|
|
||||||
<option <?=$dx240[16]?> value=340000>S</option>
|
|
||||||
<option <?=$dx240[17]?> value=382500>SS</option>
|
|
||||||
<option <?=$dx240[18]?> value=427500>SSS</option>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>-</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>-</td>
|
|
||||||
<td>
|
|
||||||
<input type=submit name=isgen value=장수공격>
|
|
||||||
<?='<input type=submit name=isgen value=장수평균>'?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type=submit name=isgen value=성벽공격>
|
|
||||||
<?='<input type=submit name=isgen value=성벽평균>'?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr><td colspan=3>
|
|
||||||
<?php
|
|
||||||
if($isgen == "장수공격" || $isgen == "성벽공격") {
|
|
||||||
echo $msg;
|
|
||||||
} elseif($isgen == "장수평균" || $isgen == "성벽평균") {
|
|
||||||
echo $msg2;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td></tr>
|
|
||||||
</table>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr id=bg1>
|
|
||||||
<td align=right></td>
|
|
||||||
<td align=center>공격</td>
|
|
||||||
<td align=center>방어</td>
|
|
||||||
<td align=center>기동</td>
|
|
||||||
<td align=center>회피</td>
|
|
||||||
<td align=center>가격</td>
|
|
||||||
<td align=center>군량</td>
|
|
||||||
<td width=500 align=center>-</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
for($i=0; $i <= 5; $i++) {
|
|
||||||
printSimul($admin, $i);
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
|
||||||
|
|
||||||
for($i=10; $i <= 14; $i++) {
|
|
||||||
printSimul($admin, $i);
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
|
||||||
|
|
||||||
for($i=20; $i <= 27; $i++) {
|
|
||||||
printSimul($admin, $i);
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
|
||||||
|
|
||||||
for($i=30; $i <= 38; $i++) {
|
|
||||||
printSimul($admin, $i);
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
|
||||||
|
|
||||||
for($i=40; $i <= 43; $i++) {
|
|
||||||
printSimul($admin, $i);
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<tr><td height=5 colspan=8 id=bg1></td></tr>";
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
function printSimul($admin, $i) {
|
|
||||||
$att = $admin["att{$i}"];
|
|
||||||
$def = $admin["def{$i}"];
|
|
||||||
$spd = $admin["spd{$i}"];
|
|
||||||
$avd = $admin["avd{$i}"];
|
|
||||||
$cst = $admin["cst{$i}"];
|
|
||||||
$ric = $admin["ric{$i}"];
|
|
||||||
echo "
|
|
||||||
<tr>
|
|
||||||
<td align=right>".GameUnitConst::byId($i)->name."</td>
|
|
||||||
<td align=center>$att</td>
|
|
||||||
<td align=center>$def</td>
|
|
||||||
<td align=center>$spd</td>
|
|
||||||
<td align=center>$avd</td>
|
|
||||||
<td align=center>$cst</td>
|
|
||||||
<td align=center>$ric</td>
|
|
||||||
<td align=center>-</td>
|
|
||||||
</tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
+4
-3
@@ -16,6 +16,10 @@ increaseRefresh("왕조일람", 1);
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
@@ -50,9 +54,6 @@ if ($showCurrentNation) {
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="background-color:#333333;" align=center colspan=8>
|
<td style="background-color:#333333;" align=center colspan=8>
|
||||||
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
|
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
|
||||||
|
|
||||||
<a href="a_emperior_detail.php"><button>자세히</button></a>
|
|
||||||
|
|
||||||
<a href="a_history.php"><button>역사 보기</button></a>
|
<a href="a_history.php"><button>역사 보기</button></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ increaseRefresh("왕조일람", 2);
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null);
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
@@ -33,7 +37,7 @@ $serverID = $emperior['server_id']??($emperior['serverID']??null);
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<table align=center width=1000 class="tb_layout bg0">
|
<table align=center width=1000 class="tb_layout bg0">
|
||||||
<tr><td><?=$emperior?'역 대 왕 조':'현 재 왕 조'?><br>
|
<tr><td>역 대 왕 조<br>
|
||||||
<button onclick=window.close()>창 닫기</button>
|
<button onclick=window.close()>창 닫기</button>
|
||||||
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
|
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
@@ -156,7 +160,7 @@ if($emperior):
|
|||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$showServers = $serverID || (!$emperior);
|
$showServers = $emperior;
|
||||||
|
|
||||||
if(!$serverID){
|
if(!$serverID){
|
||||||
$serverID = UniqueConst::$serverID;
|
$serverID = UniqueConst::$serverID;
|
||||||
|
|||||||
+28
-21
@@ -85,22 +85,22 @@ foreach (getAllNationStaticInfo() as $nation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch ($type) { //FIXME: $query 처리 조심.
|
switch ($type) { //FIXME: $query 처리 조심.
|
||||||
case 1: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
|
case 1: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by nation"; break;
|
||||||
case 2: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
|
case 2: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by leader desc"; break;
|
||||||
case 3: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
|
case 3: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by power desc"; break;
|
||||||
case 4: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
|
case 4: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by intel desc"; break;
|
||||||
case 5: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
case 5: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||||
case 6: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
|
case 6: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by dedication desc"; break;
|
||||||
case 7: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
|
case 7: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by level desc"; break;
|
||||||
case 8: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
|
case 8: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by killturn"; break;
|
||||||
default:
|
default:
|
||||||
case 9: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
|
case 9: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by connect desc"; break;
|
||||||
case 10: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
case 10: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by experience desc"; break;
|
||||||
case 11: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
|
case 11: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by personal"; break;
|
||||||
case 12: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
|
case 12: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special desc"; break;
|
||||||
case 13: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
|
case 13: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
|
||||||
case 14: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
|
case 14: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
|
||||||
case 15: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
|
case 15: $query = "select no,picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
|
||||||
}
|
}
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
@@ -136,20 +136,20 @@ for ($j=0; $j < $gencount; $j++) {
|
|||||||
$lbonus = 0;
|
$lbonus = 0;
|
||||||
}
|
}
|
||||||
if ($lbonus > 0) {
|
if ($lbonus > 0) {
|
||||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||||
} else {
|
} else {
|
||||||
$lbonus = "";
|
$lbonusText = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($general['injury'] > 0) {
|
if ($general['injury'] > 0) {
|
||||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||||
$power = "<font color=red>{$power}</font>";
|
$power = "<font color=red>{$power}</font>";
|
||||||
$intel = "<font color=red>{$intel}</font>";
|
$intel = "<font color=red>{$intel}</font>";
|
||||||
} else {
|
} else {
|
||||||
$leader = "{$general['leader']}{$lbonus}";
|
$leader = "{$general['leader']}{$lbonusText}";
|
||||||
$power = "{$general['power']}";
|
$power = "{$general['power']}";
|
||||||
$intel = "{$general['intel']}";
|
$intel = "{$general['intel']}";
|
||||||
}
|
}
|
||||||
@@ -166,8 +166,15 @@ for ($j=0; $j < $gencount; $j++) {
|
|||||||
|
|
||||||
$imageTemp = GetImageURL($general['imgsvr']);
|
$imageTemp = GetImageURL($general['imgsvr']);
|
||||||
echo "
|
echo "
|
||||||
<tr>
|
<tr data-general-id='{$general['no']}'
|
||||||
<td align=center><img width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
|
data-general-wounded='{$general['injury']}'
|
||||||
|
data-general-leadership='{$general['leader']}'
|
||||||
|
data-general-leadership-bonus='{$lbonus}'
|
||||||
|
data-general-power='{$general['power']}'
|
||||||
|
data-general-intel='{$general['intel']}'
|
||||||
|
data-is-npc='".($general['npc']>=2?'true':'false')."'
|
||||||
|
>
|
||||||
|
<td align=center><img class='generalIcon' width='64' height='64' src='{$imageTemp}/{$general['picture']}'></img></td>
|
||||||
<td align=center>$name</td>
|
<td align=center>$name</td>
|
||||||
<td align=center>{$general['age']}세</td>
|
<td align=center>{$general['age']}세</td>
|
||||||
<td align=center>".displayCharInfo($general['personal'])."</td>
|
<td align=center>".displayCharInfo($general['personal'])."</td>
|
||||||
|
|||||||
+24
-8
@@ -15,7 +15,6 @@ $userID = Session::getUserID();
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
if(!$serverID){
|
if(!$serverID){
|
||||||
$serverID = UniqueConst::$serverID;
|
$serverID = UniqueConst::$serverID;
|
||||||
@@ -25,11 +24,9 @@ if($serverID === UniqueConst::$serverID){
|
|||||||
increaseRefresh("연감", 1);
|
increaseRefresh("연감", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear','year','month']);
|
$admin = $gameStor->getValues(['startyear','year','month','map_theme']);
|
||||||
|
|
||||||
$query = "select con,turntime from general where owner='{$userID}'";
|
$me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $userID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$me = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
@@ -42,9 +39,21 @@ if ($con >= 2) {
|
|||||||
[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
|
[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
|
||||||
$s = $s_year * 12 + $s_month;
|
$s = $s_year * 12 + $s_month;
|
||||||
|
|
||||||
|
if($s_year === null){
|
||||||
|
echo '인자 에러';
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
|
||||||
$e = $e_year * 12 + $e_month;
|
$e = $e_year * 12 + $e_month;
|
||||||
|
|
||||||
|
if($serverID !== UniqueConst::$serverID){
|
||||||
|
$mapTheme = $db->queryFirstField('SELECT map FROM ng_games WHERE server_id=%s', $serverID)?:'che';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$mapTheme = $admin['map_theme']??'che';
|
||||||
|
}
|
||||||
|
|
||||||
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
|
||||||
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
if($serverID !== UniqueConst::$serverID && !$yearmonth){
|
||||||
$year = $s_year;
|
$year = $s_year;
|
||||||
@@ -89,11 +98,13 @@ if ($month <= 0) {
|
|||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 연감</title>
|
<title><?=UniqueConst::$serverName?>: 연감</title>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
<?=WebUtil::printJS('js/base_map.js')?>
|
<?=WebUtil::printJS("js/map/theme_{$mapTheme}.js")?>
|
||||||
<?=WebUtil::printJS('js/map.js')?>
|
<?=WebUtil::printJS('js/map.js')?>
|
||||||
|
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/map.css')?>
|
<?=WebUtil::printCSS('css/map.css')?>
|
||||||
@@ -133,7 +144,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
|||||||
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
<tr><td colspan=5 align=center id=bg1>중 원 지 도</td></tr>
|
||||||
<tr height=520>
|
<tr height=520>
|
||||||
<td width=698>
|
<td width=698>
|
||||||
<?=getMapHtml();?>
|
<?=getMapHtml($mapTheme);?>
|
||||||
|
|
||||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$history['nation']?></td>
|
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$history['nation']?></td>
|
||||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$history['power']?></td>
|
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$history['power']?></td>
|
||||||
@@ -158,10 +169,15 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
|
|||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
</table>
|
</table>
|
||||||
<script>
|
<script>
|
||||||
|
window.serverNick = '<?=DB::prefix()?>';
|
||||||
|
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||||
reloadWorldMap({
|
reloadWorldMap({
|
||||||
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
|
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
|
||||||
showMe:false,
|
showMe:false,
|
||||||
neutralView:true
|
neutralView:true,
|
||||||
|
useCachedMap:false,
|
||||||
|
year:<?=$year?>,
|
||||||
|
month:<?=$month?>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -28,10 +28,13 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
<title><?=UniqueConst::$serverName?>: 세력일람</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
|
||||||
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -29,13 +29,12 @@ $sel[$type] = "selected";
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
|
||||||
|
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
+10
-3
@@ -14,6 +14,8 @@ $connect=$db->get();
|
|||||||
increaseRefresh("세력도", 2);
|
increaseRefresh("세력도", 2);
|
||||||
checkTurn();
|
checkTurn();
|
||||||
|
|
||||||
|
$mapTheme = $gameStor->map_theme??'che';
|
||||||
|
|
||||||
$query = "select con,turntime from general where owner='{$userID}'";
|
$query = "select con,turntime from general where owner='{$userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
@@ -29,20 +31,25 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
|||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
<title><?=UniqueConst::$serverName?>: 세력도</title>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.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::printJS('js/map.js')?>
|
||||||
<script>
|
<script>
|
||||||
|
window.serverNick = '<?=DB::prefix()?>';
|
||||||
|
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
reloadWorldMap({
|
reloadWorldMap({
|
||||||
neutralView:true,
|
neutralView:true,
|
||||||
showMe:true
|
showMe:true,
|
||||||
|
useCachedMap:true
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
<?=WebUtil::printCSS('css/normalize.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
@@ -60,7 +67,7 @@ $(function(){
|
|||||||
<?=getGeneralPublicRecordRecent(34)?>
|
<?=getGeneralPublicRecordRecent(34)?>
|
||||||
</td>
|
</td>
|
||||||
<td width=698>
|
<td width=698>
|
||||||
<?=getMapHtml()?>
|
<?=getMapHtml($mapTheme)?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
+5
-1
@@ -53,6 +53,10 @@ if ($admin['maxonline'] < $curonline) {
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<style>
|
<style>
|
||||||
@@ -166,7 +170,7 @@ $max_refresh['name'] = '접속자 총합';
|
|||||||
$refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5'));
|
$refresh_result = array_merge([$max_refresh], $db->query('SELECT `name`,refresh,`connect` FROM general ORDER BY refresh DESC LIMIT 5'));
|
||||||
|
|
||||||
foreach ($refresh_result as $i=>$user) {
|
foreach ($refresh_result as $i=>$user) {
|
||||||
$w = round($user['refresh'] / $max_refresh['refresh'] * 100, 1);
|
$w = round($user['refresh'] / max(1, $max_refresh['refresh']) * 100, 1);
|
||||||
$w2 = round(100 - $w, 1);
|
$w2 = round(100 - $w, 1);
|
||||||
$color = getTrafficColor($w);
|
$color = getTrafficColor($w);
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ $vote = $admin['vote']?:['-'];
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ if ($msg2 == "") {
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ $sel[$type] = "selected";
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
@@ -156,7 +160,7 @@ for ($i=0; $i < $gencount; $i++) {
|
|||||||
<?=getBatResRecent($gen, 24)?>
|
<?=getBatResRecent($gen, 24)?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php if($npc > 1): ?>
|
<?php if($npc > 1 || $meLevel >= 5): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
|
<td align=center id=bg1><font color=orange size=3>개인 기록</font></td>
|
||||||
<td align=center id=bg1><font color=orange size=3> </font></td>
|
<td align=center id=bg1><font color=orange size=3> </font></td>
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ if($str3){
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
<title><?=UniqueConst::$serverName?>: 베팅장</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ if($me['level'] < 5) {
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ for($i= $lv - 1; $i>=5; $i--){
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
<title><?=UniqueConst::$serverName?>: 사령부</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
+168
-78
@@ -11,6 +11,7 @@ extractMissingPostToGlobals();
|
|||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
$userGrade = Session::getUserGrade();
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
@@ -34,6 +35,10 @@ $templates = new \League\Plates\Engine('templates');
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<style>
|
<style>
|
||||||
@@ -164,13 +169,13 @@ echo "
|
|||||||
unset($city);
|
unset($city);
|
||||||
|
|
||||||
// 첩보된 도시까지만 허용
|
// 첩보된 도시까지만 허용
|
||||||
if($valid == 0 && $session->userGrade < 5) {
|
if($valid == 0 && $userGrade < 5) {
|
||||||
$citylist = $me['city'];
|
$citylist = $me['city'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
|
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
|
||||||
$nation = getNationStaticInfo($city['nation']);
|
$cityNation = getNationStaticInfo($city['nation']);
|
||||||
|
|
||||||
//태수, 군사, 시중
|
//태수, 군사, 시중
|
||||||
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
|
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
|
||||||
@@ -180,81 +185,7 @@ $gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $cit
|
|||||||
if($city['trade'] == 0) {
|
if($city['trade'] == 0) {
|
||||||
$city['trade'] = "- ";
|
$city['trade'] = "- ";
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr><td><?=backButton()?></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<table align=center width=1000 class='tb_layout bg2'>
|
|
||||||
<tr>
|
|
||||||
<td colspan=12 align=center style=color:"<?=newColor($nation['color'])?>"; bgcolor=<?=$nation['color']?>>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align=center width=46 class=bg1>주민</td>
|
|
||||||
<td align=center width=140><?=$city['pop']?>/<?=$city['pop2']?></td>
|
|
||||||
<td align=center width=46 class=bg1>농업</td>
|
|
||||||
<td align=center width=140><?=$city['agri']?>/<?=$city['agri2']?></td>
|
|
||||||
<td align=center width=46 class=bg1>상업</td>
|
|
||||||
<td align=center width=140><?=$city['comm']?>/<?=$city['comm2']?></td>
|
|
||||||
<td align=center width=46 class=bg1>치안</td>
|
|
||||||
<td align=center width=140><?=$city['secu']?>/<?=$city['secu2']?></td>
|
|
||||||
<td align=center width=46 class=bg1>수비</td>
|
|
||||||
<td align=center width=140><?=$city['def']?>/<?=$city['def2']?></td>
|
|
||||||
<td align=center width=46 class=bg1>성벽</td>
|
|
||||||
<td align=center width=140><?=$city['wall']?>/<?=$city['wall2']?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align=center class=bg1>민심</td>
|
|
||||||
<td align=center><?=$city['rate']?></td>
|
|
||||||
<td align=center class=bg1>시세</td>
|
|
||||||
<td align=center><?=$city['trade']?>%</td>
|
|
||||||
<td align=center class=bg1>인구</td>
|
|
||||||
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
|
||||||
<td align=center class=bg1>태수</td>
|
|
||||||
<td align=center><?=$gen1['name']??'-'?></td>
|
|
||||||
<td align=center class=bg1>군사</td>
|
|
||||||
<td align=center><?=$gen2['name']??'-'?></td>
|
|
||||||
<td align=center class=bg1>시중</td>
|
|
||||||
<td align=center><?=$gen3['name']??'-'?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align=center class=bg1>장수</td>
|
|
||||||
<td colspan=11>
|
|
||||||
<?php
|
|
||||||
$query = "select name, npc from general where city='{$city['city']}' and nation='{$city['nation']}'"; // 장수 목록
|
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($genresult);
|
|
||||||
if($gencount == 0) echo "-";
|
|
||||||
for($i=0; $i < $gencount; $i++) {
|
|
||||||
$general = MYDB_fetch_array($genresult);
|
|
||||||
echo "{$general['name']}, ";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<table align=center class='tb_layout bg0'>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td width=64 align=center class=bg1>얼 굴</td>
|
|
||||||
<td width=128 align=center class=bg1>이 름</td>
|
|
||||||
<td width=48 align=center class=bg1>통솔</td>
|
|
||||||
<td width=48 align=center class=bg1>무력</td>
|
|
||||||
<td width=48 align=center class=bg1>지력</td>
|
|
||||||
<td width=78 align=center class=bg1>관 직</td>
|
|
||||||
<td width=28 align=center class=bg1>守</td>
|
|
||||||
<td width=78 align=center class=bg1>병 종</td>
|
|
||||||
<td width=78 align=center class=bg1>병 사</td>
|
|
||||||
<td width=48 align=center class=bg1>훈련</td>
|
|
||||||
<td width=48 align=center class=bg1>사기</td>
|
|
||||||
<td width=280 align=center class=bg1>명 령</td>
|
|
||||||
</tr></thead><tbody class='bg0' id='general_list'>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4,turn5 from general where city='{$city['city']}' order by dedication desc"; // 장수 목록
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
@@ -266,6 +197,9 @@ foreach(getAllNationStaticInfo() as $nation){
|
|||||||
$nationlevel[$nation['nation']] = $nation['level'];
|
$nationlevel[$nation['nation']] = $nation['level'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//도시명 오 적군 0/0(0) 병장(총) 0/0(4) 90병장 0/0 60병장 0/0 수비○ 0/0
|
||||||
|
$generalsFormat = [];
|
||||||
|
|
||||||
|
|
||||||
for($j=0; $j < $gencount; $j++) {
|
for($j=0; $j < $gencount; $j++) {
|
||||||
$general = MYDB_fetch_array($genresult);
|
$general = MYDB_fetch_array($genresult);
|
||||||
@@ -279,6 +213,10 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
$ourGeneral = false;
|
$ourGeneral = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($userGrade == 6){
|
||||||
|
$ourGeneral = true;
|
||||||
|
}
|
||||||
|
|
||||||
$isNPC = $general['npc']>1;
|
$isNPC = $general['npc']>1;
|
||||||
$wounded = $general['injury'];
|
$wounded = $general['injury'];
|
||||||
|
|
||||||
@@ -340,7 +278,7 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
$turnText = '';
|
$turnText = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $templates->render('cityGeneral', [
|
$generalsFormat[] = [
|
||||||
'ourGeneral'=>$ourGeneral,
|
'ourGeneral'=>$ourGeneral,
|
||||||
'isNPC'=>$isNPC,
|
'isNPC'=>$isNPC,
|
||||||
'wounded'=>$wounded,
|
'wounded'=>$wounded,
|
||||||
@@ -366,7 +304,159 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
'nation'=>$nation,
|
'nation'=>$nation,
|
||||||
'nationName'=>$nationName,
|
'nationName'=>$nationName,
|
||||||
'turnText'=>$turnText
|
'turnText'=>$turnText
|
||||||
]);
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$generalsName = array_map(function($gen){return $gen['name'];}, $generalsFormat);
|
||||||
|
|
||||||
|
$enemyCrew = 0;
|
||||||
|
$enemyCnt = 0;
|
||||||
|
$enemyArmedCnt = 0;
|
||||||
|
$crew90 = 0;
|
||||||
|
$gen90 = 0;
|
||||||
|
$crew80 = 0;
|
||||||
|
$gen80 = 0;
|
||||||
|
$crew60 = 0;
|
||||||
|
$gen60 = 0;
|
||||||
|
|
||||||
|
$crewDef = 0;
|
||||||
|
$genDef = 0 ;
|
||||||
|
|
||||||
|
$crewTotal = 0;
|
||||||
|
$armedGenTotal = 0;
|
||||||
|
$genTotal = 0;
|
||||||
|
|
||||||
|
|
||||||
|
foreach($generalsFormat as $general){
|
||||||
|
if($general['nation'] == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if($general['nation'] != $myNation['nation']){
|
||||||
|
$enemyCnt += 1;
|
||||||
|
$enemyCrew += $general['crew'];
|
||||||
|
if($general['crew'] > 0){
|
||||||
|
$enemyArmedCnt += 1;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$crewTotal += $general['crew'];
|
||||||
|
$genTotal += 1;
|
||||||
|
|
||||||
|
if($general['crew'] == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$armedGenTotal += 1;
|
||||||
|
|
||||||
|
if($general['train'] >= 90 && $general['atmos'] >= 90){
|
||||||
|
$crew90 += $general['crew'];
|
||||||
|
$gen90 += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$chkDef = false;
|
||||||
|
if($general['train'] >= 80 && $general['atmos'] >= 80){
|
||||||
|
$crew80 += $general['crew'];
|
||||||
|
$gen80 += 1;
|
||||||
|
if($general['defenceMode'] == 2){
|
||||||
|
$crewDef += $general['crew'];
|
||||||
|
$genDef += 1;
|
||||||
|
$chkDef = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['train'] >= 60 && $general['atmos'] >= 60){
|
||||||
|
$crew60 += $general['crew'];
|
||||||
|
$gen60 += 1;
|
||||||
|
|
||||||
|
if($general['defenceMode'] == 1 && !$chkDef){
|
||||||
|
$crewDef += $general['crew'];
|
||||||
|
$genDef += 1;
|
||||||
|
$chkDef = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
|
<tr><td><?=backButton()?></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table align=center width=1000 class='tb_layout bg2'>
|
||||||
|
<tr>
|
||||||
|
<td colspan=11 align=center style='color:<?=newColor($cityNation['color'])?>; background:<?=$cityNation['color']?>'>【 <?=CityConst::$regionMap[$city['region']]?> | <?=CityConst::$levelMap[$city['level']]?> 】 <?=$city['name']?></td>
|
||||||
|
<td style='color:<?=newColor($cityNation['color'])?>; background:<?=$cityNation['color']?>' class='center'><?=date('m-d H:i:s')?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align=center width=48 class=bg1>주민</td>
|
||||||
|
<td align=center width=112><?=$city['pop']?>/<?=$city['pop2']?></td>
|
||||||
|
<td align=center width=48 class=bg1>농업</td>
|
||||||
|
<td align=center width=108><?=$city['agri']?>/<?=$city['agri2']?></td>
|
||||||
|
<td align=center width=48 class=bg1>상업</td>
|
||||||
|
<td align=center width=108><?=$city['comm']?>/<?=$city['comm2']?></td>
|
||||||
|
<td align=center width=48 class=bg1>치안</td>
|
||||||
|
<td align=center width=108><?=$city['secu']?>/<?=$city['secu2']?></td>
|
||||||
|
<td align=center width=48 class=bg1>수비</td>
|
||||||
|
<td align=center width=108><?=$city['def']?>/<?=$city['def2']?></td>
|
||||||
|
<td align=center width=48 class=bg1>성벽</td>
|
||||||
|
<td align=center width=108><?=$city['wall']?>/<?=$city['wall2']?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align=center class=bg1>민심</td>
|
||||||
|
<td align=center><?=$city['rate']?></td>
|
||||||
|
<td align=center class=bg1>시세</td>
|
||||||
|
<td align=center><?=$city['trade']?>%</td>
|
||||||
|
<td align=center class=bg1>인구</td>
|
||||||
|
<td align=center><?=round($city['pop']/$city['pop2']*100, 2)?>%</td>
|
||||||
|
<td align=center class=bg1>태수</td>
|
||||||
|
<td align=center><?=$gen1['name']??'-'?></td>
|
||||||
|
<td align=center class=bg1>군사</td>
|
||||||
|
<td align=center><?=$gen2['name']??'-'?></td>
|
||||||
|
<td align=center class=bg1>시중</td>
|
||||||
|
<td align=center><?=$gen3['name']??'-'?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align=center class=bg1>도시명</td>
|
||||||
|
<td align=center><?=$city['name']?></td>
|
||||||
|
<td align=center class=bg1>적군</td>
|
||||||
|
<td align=center><?=number_format($enemyCrew)?>/<?=number_format($enemyArmedCnt)?>(<?=number_format($enemyCnt)?>)</td>
|
||||||
|
<td align=center class=bg1>병장(총)</td>
|
||||||
|
<td align=center><?=number_format($crewTotal)?>/<?=number_format($armedGenTotal)?>(<?=number_format($genTotal)?>)</td>
|
||||||
|
<td align=center class=bg1>90병장</td>
|
||||||
|
<td align=center><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
|
||||||
|
<td align=center class=bg1>60병장</td>
|
||||||
|
<td align=center><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
|
||||||
|
<td align=center class=bg1>수비○</td>
|
||||||
|
<td align=center><?=number_format($crewDef)?>/<?=number_format($genDef)?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align=center class=bg1>장수</td>
|
||||||
|
<td colspan=11><?=join(', ', $generalsName)?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<table align=center class='tb_layout bg0'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td width=64 align=center class=bg1>얼 굴</td>
|
||||||
|
<td width=128 align=center class=bg1>이 름</td>
|
||||||
|
<td width=48 align=center class=bg1>통솔</td>
|
||||||
|
<td width=48 align=center class=bg1>무력</td>
|
||||||
|
<td width=48 align=center class=bg1>지력</td>
|
||||||
|
<td width=78 align=center class=bg1>관 직</td>
|
||||||
|
<td width=28 align=center class=bg1>守</td>
|
||||||
|
<td width=78 align=center class=bg1>병 종</td>
|
||||||
|
<td width=78 align=center class=bg1>병 사</td>
|
||||||
|
<td width=48 align=center class=bg1>훈련</td>
|
||||||
|
<td width=48 align=center class=bg1>사기</td>
|
||||||
|
<td width=280 align=center class=bg1>명 령</td>
|
||||||
|
</tr></thead>
|
||||||
|
<tbody class='bg0' id='general_list'>
|
||||||
|
<?php
|
||||||
|
foreach($generalsFormat as $general){
|
||||||
|
echo $templates->render('cityGeneral', $general);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
+40
-5
@@ -48,13 +48,23 @@ if ($me['level'] >= 5) {
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||||
|
<script>
|
||||||
|
var editable = <?=($me['level']>=5?'true':'false')?>;
|
||||||
|
</script>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/summernote/summernote-bs4.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/summernote/lang/summernote-ko-KR.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printJS('js/dipcenter.js')?>
|
||||||
|
|
||||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/summernote/summernote-bs4.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
<?=WebUtil::printCSS('css/dipcenter.css')?>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic|Nanum+Myeongjo|Nanum+Pen+Script" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -223,10 +233,35 @@ if ($budgetricediff > 0) {
|
|||||||
<form name=form1 method=post action=c_dipcenter.php>
|
<form name=form1 method=post action=c_dipcenter.php>
|
||||||
<tr><td colspan=2 height=10></td></tr>
|
<tr><td colspan=2 height=10></td></tr>
|
||||||
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메시지</td></tr>
|
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메시지</td></tr>
|
||||||
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=16000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
|
<tr><td colspan='2'><div id='noticeForm'>
|
||||||
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=1000 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
|
<div class='bg1' style="display: flex; justify-content: space-around">
|
||||||
<tr><td colspan=2>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
|
<div style='flex: 1 1 auto;'>
|
||||||
<tr><td colspan=2 height=10></td></tr>
|
국가 방침
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type='submit' class='submit' name=btn value='국가방침 수정'><input type='button' class='cancel_edit' value='취소'>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<textarea type=hidden class='input_form' style='display:none;' name=msg><?=$nation['msg']?></textarea>
|
||||||
|
<div class='edit_form viewer'></div>
|
||||||
|
</div></td></tr>
|
||||||
|
<tr><td colspan='2'><div id='scoutMsgForm'>
|
||||||
|
<div class='bg1' style="display: flex; justify-content: space-around">
|
||||||
|
<div style='flex: 1 1 auto;'>
|
||||||
|
임관 권유
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type='submit' class='submit' name=btn value='임관 권유문 수정'><input type='button' class='cancel_edit' value='취소'>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style='border-bottom:solid gray 0.5px;'>870px x 200px를 넘어서는 내용은 표시되지 않습니다.</div>
|
||||||
|
<textarea type=hidden class='input_form' style='display:none;' name=scoutmsg><?=$nation['scoutmsg']?></textarea>
|
||||||
|
<div style="width:870px;margin-left:auto;">
|
||||||
|
<div class='edit_form viewer'></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div></td></tr>
|
||||||
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<td colspan=2>
|
||||||
|
|||||||
+11
-5
@@ -13,6 +13,8 @@ $connect=$db->get();
|
|||||||
|
|
||||||
increaseRefresh("중원정보", 1);
|
increaseRefresh("중원정보", 1);
|
||||||
|
|
||||||
|
$mapTheme = $gameStor->map_theme??'che';
|
||||||
|
|
||||||
$query = "select no,nation from general where owner='{$userID}'";
|
$query = "select no,nation from general where owner='{$userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
@@ -78,21 +80,25 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
|
|||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.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::printJS('js/map.js')?>
|
||||||
<script>
|
<script>
|
||||||
|
window.serverNick = '<?=DB::prefix()?>';
|
||||||
|
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
reloadWorldMap({
|
reloadWorldMap({
|
||||||
neutralView:true,
|
neutralView:true,
|
||||||
showMe:true
|
showMe:true,
|
||||||
|
useCachedMap:true
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?=WebUtil::printCSS('css/normalize.css')?>
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/map.css')?>
|
<?=WebUtil::printCSS('css/map.css')?>
|
||||||
@@ -171,7 +177,7 @@ for($i=0; $i < $nationcount; $i++) {
|
|||||||
";
|
";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr><td colspan=<?=$nationcount+1?> align=center>불가침 : <font color=limegreen>@</font>, 통합 : <font color=cyan>○</font>, 합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
|
<tr><td colspan=<?=$nationcount+1?> align=center>불가침 : <font color=limegreen>@</font>, <!--통합 : <font color=cyan>○</font>, -->합병 : <font color=skyblue>◎</font>, 통상 : ㆍ, 선포 : <font color=magenta>▲</font>, 교전 : <font color=red>★</font></td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php if ($realConflict) : ?>
|
<?php if ($realConflict) : ?>
|
||||||
@@ -214,7 +220,7 @@ for($i=0; $i < $nationcount; $i++) {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=698 height=420>
|
<td width=698 height=420>
|
||||||
<?=getMapHtml()?>
|
<?=getMapHtml($mapTheme)?>
|
||||||
</td>
|
</td>
|
||||||
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$nationStr?></td>
|
<td width=139 valign=top><div style='background-color:#cccccc;color:black;text-align:center'>국명</div><?=$nationStr?></td>
|
||||||
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$powerStr?></td>
|
<td width=70 valign=top style='text-align:center'><div style='background-color:#cccccc;color:black;'>국력</div><?=$powerStr?></td>
|
||||||
|
|||||||
+108
-87
@@ -9,8 +9,6 @@ if ($type <= 0 || $type > 8) {
|
|||||||
$type = 7;
|
$type = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
@@ -19,7 +17,7 @@ $db = DB::db();
|
|||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
increaseRefresh("암행부", 2);
|
increaseRefresh("암행부", 1);
|
||||||
|
|
||||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
$query = "select no,nation,level,con,turntime,belong from general where owner='{$userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
@@ -43,6 +41,8 @@ if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretli
|
|||||||
$sel = [];
|
$sel = [];
|
||||||
$sel[$type] = "selected";
|
$sel[$type] = "selected";
|
||||||
|
|
||||||
|
$templates = new \League\Plates\Engine('templates');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -65,7 +65,7 @@ $sel[$type] = "selected";
|
|||||||
<body>
|
<body>
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
<tr><td>암 행 부<br><?=closeButton()?></td></tr>
|
<tr><td>암 행 부<br><?=closeButton()?></td></tr>
|
||||||
<tr><td><form name=form1 method=post>정렬순서 :
|
<tr><td><form name=form1 method=get>정렬순서 :
|
||||||
<select name=type size=1>
|
<select name=type size=1>
|
||||||
<option <?=$sel[1]??''?> value=1>자금</option>
|
<option <?=$sel[1]??''?> value=1>자금</option>
|
||||||
<option <?=$sel[2]??''?> value=2>군량</option>
|
<option <?=$sel[2]??''?> value=2>군량</option>
|
||||||
@@ -80,54 +80,28 @@ $sel[$type] = "selected";
|
|||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
$query = "select troop,name from troop where nation='{$me['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$troopCount = MYDB_num_rows($result);
|
|
||||||
$troopName = [];
|
$troopName = [];
|
||||||
for ($i=0; $i < $troopCount; $i++) {
|
foreach($db->queryAllLists('SELECT troop, name FROM troop WHERE nation=%i', $me['nation']) as [$troopID, $tName]){
|
||||||
$troop = MYDB_fetch_array($result);
|
$troopName[$troopID] = $tName;
|
||||||
$troopName[$troop['troop']] = $troop['name'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$orderSQL = '';
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by gold desc"; break;
|
case 1: $orderSQL = "order by gold desc"; break;
|
||||||
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by rice desc"; break;
|
case 2: $orderSQL = "order by rice desc"; break;
|
||||||
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by city"; break;
|
case 3: $orderSQL = "order by city"; break;
|
||||||
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by crewtype desc"; break;
|
case 4: $orderSQL = "order by crewtype desc"; break;
|
||||||
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by crew desc"; break;
|
case 5: $orderSQL = "order by crew desc"; break;
|
||||||
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by killturn"; break;
|
case 6: $orderSQL = "order by killturn"; break;
|
||||||
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by turntime"; break;
|
case 7: $orderSQL = "order by turntime"; break;
|
||||||
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='{$me['nation']}' order by troop desc"; break;
|
case 8: $orderSQL = "order by troop desc"; break;
|
||||||
}
|
}
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$gencount = MYDB_num_rows($genresult);
|
|
||||||
|
|
||||||
?>
|
$generals = $db->query('SELECT npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general WHERE nation = %i %l', $me['nation'], $orderSQL);
|
||||||
<table align=center id='general_list' class='tb_layout bg0'>
|
|
||||||
<thead>
|
foreach ($generals as &$general) {
|
||||||
<tr>
|
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||||
<td width=98 align=center class=bg1>이 름</td>
|
$general['troopText'] = $troopName[$general['troop']]??'-';
|
||||||
<td width=98 align=center class=bg1>통무지</td>
|
|
||||||
<td width=98 align=center class=bg1>부 대</td>
|
|
||||||
<td width=58 align=center class=bg1>자 금</td>
|
|
||||||
<td width=58 align=center class=bg1>군 량</td>
|
|
||||||
<td width=48 align=center class=bg1>도시</td>
|
|
||||||
<td width=28 align=center class=bg1>守</td>
|
|
||||||
<td width=58 align=center class=bg1>병 종</td>
|
|
||||||
<td width=68 align=center class=bg1>병 사</td>
|
|
||||||
<td width=48 align=center class=bg1>훈련</td>
|
|
||||||
<td width=48 align=center class=bg1>사기</td>
|
|
||||||
<td width=148 align=center class=bg1>명 령</td>
|
|
||||||
<td width=58 align=center class=bg1>삭턴</td>
|
|
||||||
<td width=58 align=center class=bg1>턴</td>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php
|
|
||||||
for ($j=0; $j < $gencount; $j++) {
|
|
||||||
$general = MYDB_fetch_array($genresult);
|
|
||||||
$city = CityConst::byID($general['city'])->name;
|
|
||||||
$troop = $troopName[$general['troop']]??'-';
|
|
||||||
|
|
||||||
if ($general['level'] == 12) {
|
if ($general['level'] == 12) {
|
||||||
$lbonus = $nation['level'] * 2;
|
$lbonus = $nation['level'] * 2;
|
||||||
@@ -137,81 +111,128 @@ for ($j=0; $j < $gencount; $j++) {
|
|||||||
$lbonus = 0;
|
$lbonus = 0;
|
||||||
}
|
}
|
||||||
if ($lbonus > 0) {
|
if ($lbonus > 0) {
|
||||||
$lbonus = "<font color=cyan>+{$lbonus}</font>";
|
$lbonusText = "<font color=cyan>+{$lbonus}</font>";
|
||||||
} else {
|
} else {
|
||||||
$lbonus = "";
|
$lbonusText = "";
|
||||||
}
|
}
|
||||||
|
$general['lbonus'] = $lbonus;
|
||||||
|
$general['lbonusText'] = $lbonusText;
|
||||||
|
|
||||||
if ($general['injury'] > 0) {
|
if ($general['injury'] > 0) {
|
||||||
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
|
||||||
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
|
||||||
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
$intel = intdiv($general['intel'] * (100 - $general['injury']), 100);
|
||||||
$leader = "<font color=red>{$leader}</font>{$lbonus}";
|
$leader = "<font color=red>{$leader}</font>{$lbonusText}";
|
||||||
$power = "<font color=red>{$power}</font>";
|
$power = "<font color=red>{$power}</font>";
|
||||||
$intel = "<font color=red>{$intel}</font>";
|
$intel = "<font color=red>{$intel}</font>";
|
||||||
} else {
|
} else {
|
||||||
$leader = "{$general['leader']}{$lbonus}";
|
$leader = "{$general['leader']}{$lbonusText}";
|
||||||
$power = "{$general['power']}";
|
$power = "{$general['power']}";
|
||||||
$intel = "{$general['intel']}";
|
$intel = "{$general['intel']}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$general['leaderText'] = $leader;
|
||||||
|
$general['powerText'] = $power;
|
||||||
|
$general['intelText'] = $intel;
|
||||||
|
|
||||||
|
$general['expLevelText'] = getExpLevel($general['experience']);
|
||||||
|
|
||||||
if ($general['npc'] >= 2) {
|
if ($general['npc'] >= 2) {
|
||||||
$name = "<font color=cyan>{$general['name']}</font>";
|
$name = "<font color=cyan>{$general['name']}</font>";
|
||||||
} elseif ($general['npc'] == 1) {
|
} elseif ($general['npc'] == 1) {
|
||||||
$name = "<font color=skyblue>{$general['name']}</font>";
|
$name = "<font color=skyblue>{$general['name']}</font>";
|
||||||
} else {
|
} else {
|
||||||
$name = "{$general['name']}";
|
$name = $general['name'];
|
||||||
}
|
}
|
||||||
|
//TODO: npc 코드를 일원화
|
||||||
|
$general['nameText'] = $name;
|
||||||
|
|
||||||
switch ($general['mode']) {
|
switch ($general['mode']) {
|
||||||
case 0: $mode = "×"; break;
|
case 0: $mode = "×"; break;
|
||||||
case 1: $mode = "○"; break;
|
case 1: $mode = "○"; break;
|
||||||
case 2: $mode = "◎"; break;
|
case 2: $mode = "◎"; break;
|
||||||
}
|
}
|
||||||
|
$general['modeText'] = $mode;
|
||||||
|
$general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name??'-';
|
||||||
|
|
||||||
echo "
|
|
||||||
<tr>
|
if ($general['npc'] < 2) {
|
||||||
<td class='i_name' align=center><span class='t_name'>$name</span><br>Lv <span class='t_explevel'>".getExpLevel($general['experience'])."</span></td>
|
$turntext = [];
|
||||||
<td class='i_stat' align=center>{$leader}∥{$power}∥{$intel}</td>
|
|
||||||
<td class='i_troop' align=center>$troop</td>
|
|
||||||
<td class='i_gold' align=center>{$general['gold']}</td>
|
|
||||||
<td class='i_rice' align=center>{$general['rice']}</td>
|
|
||||||
<td class='i_city' align=center>$city</td>
|
|
||||||
<td align=center>$mode</td>
|
|
||||||
<td class='i_crewtype' align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
|
|
||||||
<td class='i_crew' align=center>{$general['crew']}</td>
|
|
||||||
<td class='i_train' align=center>{$general['train']}</td>
|
|
||||||
<td class='i_atmos' align=center>{$general['atmos']}</td>";
|
|
||||||
if ($general['npc'] >= 2) {
|
|
||||||
echo "
|
|
||||||
<td class='i_action'>
|
|
||||||
<font size=3>NPC 장수";
|
|
||||||
} else {
|
|
||||||
echo "
|
|
||||||
<td class='i_action'>
|
|
||||||
<font size=1>";
|
|
||||||
$turn = getTurn($general, 1, 0);
|
$turn = getTurn($general, 1, 0);
|
||||||
|
|
||||||
for ($i=0; $i < 5; $i++) {
|
for ($i=0; $i < 5; $i++) {
|
||||||
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 20);
|
$turn[$i] = StringUtil::subStringForWidth($turn[$i], 0, 41);
|
||||||
$k = $i+1;
|
$k = $i+1;
|
||||||
echo "
|
$turntext[] = " $k : $turn[$i]";
|
||||||
$k : $turn[$i] <br>";
|
|
||||||
}
|
}
|
||||||
|
$general['turntext'] = join("<br>\n", $turntext);
|
||||||
}
|
}
|
||||||
echo "
|
|
||||||
</font>
|
|
||||||
</td>
|
|
||||||
<td align=center>{$general['killturn']}</td>
|
|
||||||
<td class='i_turntime' align=center>".substr($general['turntime'], 14, 5)."</td>
|
|
||||||
</tr>";
|
|
||||||
}
|
}
|
||||||
echo "
|
unset($general);
|
||||||
|
|
||||||
|
$genCnt = count($generals);
|
||||||
|
$totalGold = 0;
|
||||||
|
$totalRice = 0;
|
||||||
|
$crew90 = 0;
|
||||||
|
$gen90 = 0;
|
||||||
|
$crew80 = 0;
|
||||||
|
$gen80 = 0;
|
||||||
|
$crew60 = 0;
|
||||||
|
$gen60 = 0;
|
||||||
|
$crewTotal = 0;
|
||||||
|
//$genTotal = 0;
|
||||||
|
foreach($generals as $general){
|
||||||
|
$totalGold += $general['gold'];
|
||||||
|
$totalRice += $general['rice'];
|
||||||
|
|
||||||
|
$crewTotal += $general['crew'];
|
||||||
|
|
||||||
|
if($general['crew'] == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if($general['train'] >= 90 && $general['atmos'] >= 90){
|
||||||
|
$crew90 += $general['crew'];
|
||||||
|
$gen90 += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['train'] >= 80 && $general['atmos'] >= 80){
|
||||||
|
$crew80 += $general['crew'];
|
||||||
|
$gen80 += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['train'] >= 60 && $general['atmos'] >= 60){
|
||||||
|
$crew60 += $general['crew'];
|
||||||
|
$gen60 += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table style='width:1000px;margin:5px auto' class='tb_layout bg0'>
|
||||||
|
<thead>
|
||||||
|
<colgroup>
|
||||||
|
<col style="width:120px;"><col>
|
||||||
|
<col style="width:120px;"><col>
|
||||||
|
<col style="width:120px;"><col>
|
||||||
|
<col style="width:120px;"><col>
|
||||||
|
</colgroup>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td class='bg1'>전체 금</td><td><?=number_format($totalGold)?></td>
|
||||||
|
<td class='bg1'>전체 쌀</td><td><?=number_format($totalRice)?></td>
|
||||||
|
<td class='bg1'>평균 금</td><td><?=number_format($totalGold/$genCnt, 2)?></td>
|
||||||
|
<td class='bg1'>평균 쌀</td><td><?=number_format($totalRice/$genCnt, 2)?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='bg1'>전체 병력/장수</td><td><?=number_format($crewTotal)?>/<?=number_format($genCnt)?></td>
|
||||||
|
<td class='bg1'>훈사 90 병력/장수</td><td><?=number_format($crew90)?>/<?=number_format($gen90)?></td>
|
||||||
|
<td class='bg1'>훈사 80 병력/장수</td><td><?=number_format($crew80)?>/<?=number_format($gen80)?></td>
|
||||||
|
<td class='bg1'>훈사 60 병력/장수</td><td><?=number_format($crew60)?>/<?=number_format($gen60)?></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
";
|
|
||||||
|
|
||||||
?>
|
<?=$templates->render('generalList', ['generals'=>$generals])?>
|
||||||
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
<tr><td><?=closeButton()?></td></tr>
|
<tr><td><?=closeButton()?></td></tr>
|
||||||
|
|||||||
+11
-12
@@ -33,6 +33,10 @@ if($meLevel == 0) {
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
<title><?=UniqueConst::$serverName?>: 인사부</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -88,10 +92,10 @@ for($i=12; $i >= $lv; $i-=2) {
|
|||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i1, $nation['level'])?></font></td>
|
<td width=98 align=center id=bg1><font size=4><?=getLevel($i1, $nation['level'])?></font></td>
|
||||||
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp1?>/<?=$level[$i1]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
<td width=64 class='generalIcon' height=64 style='background:no-repeat center url("<?=$imageTemp1?>/<?=$level[$i1]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||||
<td width=332><font size=4><?=$level[$i1]['name']??'-'?>(<?=$level[$i1]['belong']??'-'?>년)</font></td>
|
<td width=332><font size=4><?=$level[$i1]['name']??'-'?>(<?=$level[$i1]['belong']??'-'?>년)</font></td>
|
||||||
<td width=98 align=center id=bg1><font size=4><?=getLevel($i2, $nation['level'])?></font></td>
|
<td width=98 align=center id=bg1><font size=4><?=getLevel($i2, $nation['level'])?></font></td>
|
||||||
<td width=64 height=64 style='background:no-repeat center url("<?=$imageTemp2?>/<?=$level[$i2]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
<td width=64 class='generalIcon' height=64 style='background:no-repeat center url("<?=$imageTemp2?>/<?=$level[$i2]['picture']??'default.jpg'?>");background-size:64px;'></td>
|
||||||
<td width=332><font size=4><?=$level[$i2]['name']??'-'?>(<?=$level[$i2]['belong']??'-'?>년)</font></td>
|
<td width=332><font size=4><?=$level[$i2]['name']??'-'?>(<?=$level[$i2]['belong']??'-'?>년)</font></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
@@ -146,12 +150,15 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
|
|||||||
echo "
|
echo "
|
||||||
<select name=outlist size=1 style=color:white;background-color:black;>";
|
<select name=outlist size=1 style=color:white;background-color:black;>";
|
||||||
|
|
||||||
$query = "select no,name,level,leader,power,intel,killturn from general where nation='{$me['nation']}' and level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
$query = "select no,npc,name,level,leader,power,intel,killturn from general where nation='{$me['nation']}' and level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($result);
|
$gencount = MYDB_num_rows($result);
|
||||||
|
|
||||||
for($i=0; $i < $gencount; $i++) {
|
for($i=0; $i < $gencount; $i++) {
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
|
if($general['npc'] == 5){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
echo "
|
echo "
|
||||||
<option value={$general['no']}>{$general['name']} <small>({$general['leader']}/{$general['power']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
<option value={$general['no']}>{$general['name']} <small>({$general['leader']}/{$general['power']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||||
}
|
}
|
||||||
@@ -452,15 +459,7 @@ echo "
|
|||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$citylevel = [];
|
$citylevel = getCityLevelList();
|
||||||
$citylevel[1] = "수";
|
|
||||||
$citylevel[2] = "진";
|
|
||||||
$citylevel[3] = "관";
|
|
||||||
$citylevel[4] = "이";
|
|
||||||
$citylevel[5] = "소";
|
|
||||||
$citylevel[6] = "중";
|
|
||||||
$citylevel[7] = "대";
|
|
||||||
$citylevel[8] = "특";
|
|
||||||
|
|
||||||
$query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='{$nation['nation']}' order by region,level desc,binary(name)"; // 도시 이름 목록
|
$query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='{$nation['nation']}' order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
@@ -40,11 +40,14 @@ $sel = [$type => "selected"];
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
<title><?=UniqueConst::$serverName?>: 세력도시</title>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
|
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
<?=WebUtil::printJS('js/ext.expand_city.js')?>
|
<?=WebUtil::printJS('js/ext.expand_city.js')?>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
+1
-1
@@ -174,7 +174,7 @@ for($j=0; $j < $gencount; $j++) {
|
|||||||
$imageTemp = GetImageURL($general['imgsvr']);
|
$imageTemp = GetImageURL($general['imgsvr']);
|
||||||
echo "
|
echo "
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;' height=64></td>
|
<td align=center class='generalIcon' style='background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;' height=64></td>
|
||||||
<td align=center>$name</td>
|
<td align=center>$name</td>
|
||||||
<td align=center>"; echo getLevel($general['level'], $nationLevel); echo "</td>
|
<td align=center>"; echo getLevel($general['level'], $nationLevel); echo "</td>
|
||||||
<td align=center>".getDed($general['dedication'])."</td>
|
<td align=center>".getDed($general['dedication'])."</td>
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ if($me['level'] == 0) {
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
<title><?=UniqueConst::$serverName?>: 세력정보</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
|||||||
'tnmt'=>$tnmt
|
'tnmt'=>$tnmt
|
||||||
], 'owner=%i', $userID);
|
], 'owner=%i', $userID);
|
||||||
|
|
||||||
|
$me['mode'] = $mode;
|
||||||
|
$me['tnmt'] = $tnmt;
|
||||||
|
|
||||||
if($me['npc'] == 1 && $detachNPC){
|
if($me['npc'] == 1 && $detachNPC){
|
||||||
$turnterm = $gameStor->turnterm;
|
$turnterm = $gameStor->turnterm;
|
||||||
|
|
||||||
@@ -81,6 +84,11 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
<title><?=UniqueConst::$serverName?>: 내정보</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printJS('js/myPage.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
@@ -115,6 +123,8 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
|
|||||||
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
|
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
|
||||||
<!--빙의 해제용 삭턴 조절<br>
|
<!--빙의 해제용 삭턴 조절<br>
|
||||||
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
|
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
|
||||||
|
개인용 CSS<br>
|
||||||
|
<textarea id='custom_css' style='color:white;background-color:black;width:420px;height:150px;'></textarea>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ $me = MYDB_fetch_array($result);
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ increaseRefresh("국법", 1);
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
|
||||||
|
|||||||
+127
-101
@@ -12,13 +12,58 @@ $connect=$db->get();
|
|||||||
|
|
||||||
increaseRefresh("부대편성", 1);
|
increaseRefresh("부대편성", 1);
|
||||||
|
|
||||||
$query = "select no,nation,troop from general where owner='{$userID}'";
|
$me = $db->queryFirstRow('SELECT no,nation,troop FROM general WHERE owner=%i', $userID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$me = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select * from troop where nation='{$me['nation']}'";
|
$troops = [];
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
foreach($db->query('SELECT troop,name,no FROM troop WHERE nation = %i', $me['nation']) as $rawTroop){
|
||||||
$troopcount = MYDB_num_rows($result);
|
$troops[$rawTroop['troop']] = [
|
||||||
|
'troop'=>$rawTroop['troop'],
|
||||||
|
'name'=>$rawTroop['name'],
|
||||||
|
'no'=>$rawTroop['no'],
|
||||||
|
'users'=>[]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($db->query(
|
||||||
|
'SELECT no,name,turntime,troop,city FROM general WHERE troop!=0 AND nation = %i ORDER BY turntime ASC',
|
||||||
|
$me['nation']
|
||||||
|
) as $general
|
||||||
|
){
|
||||||
|
if(!key_exists($general['troop'], $troops)){
|
||||||
|
trigger_error("올바르지 않은 부대 소속 {$general['no']}, {$general['name']} : {$general['troop']}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||||
|
|
||||||
|
$troops[$general['troop']]['users'][] = $general;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($troops){
|
||||||
|
foreach($db->query(
|
||||||
|
'SELECT no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5,troop FROM general WHERE no IN %li',
|
||||||
|
array_column($troops, 'no')
|
||||||
|
) as $troopLeader
|
||||||
|
){
|
||||||
|
$imageTemp = GetImageURL($troopLeader['imgsvr']);
|
||||||
|
|
||||||
|
$troopLeader['pictureFullPath'] = "$imageTemp/{$troopLeader['picture']}";
|
||||||
|
$troopLeader['cityText'] = CityConst::byID($troopLeader['city'])->name;
|
||||||
|
|
||||||
|
$troopLeader['turnText'] = join('<br>', [
|
||||||
|
'1 : '.((DecodeCommand($troopLeader['turn0'])[0] == 26)?'집합':'~'),
|
||||||
|
'2 : '.((DecodeCommand($troopLeader['turn1'])[0] == 26)?'집합':'~'),
|
||||||
|
'3 : '.((DecodeCommand($troopLeader['turn2'])[0] == 26)?'집합':'~'),
|
||||||
|
'4 : '.((DecodeCommand($troopLeader['turn3'])[0] == 26)?'집합':'~'),
|
||||||
|
'5 : '.((DecodeCommand($troopLeader['turn4'])[0] == 26)?'집합':'~'),
|
||||||
|
]);
|
||||||
|
$troops[$troopLeader['troop']]['leader'] = $troopLeader;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uasort($troops, function($lhs, $rhs){
|
||||||
|
return $lhs['leader']['turntime']<=>$rhs['leader']['turntime'];
|
||||||
|
})
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -28,10 +73,14 @@ $troopcount = MYDB_num_rows($result);
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
<title><?=UniqueConst::$serverName?>: 부대편성</title>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
<?=WebUtil::printCSS('css/troops.css')?>
|
||||||
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@@ -50,120 +99,97 @@ $troopcount = MYDB_num_rows($result);
|
|||||||
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tfoot><tr><td colspan='5'>
|
||||||
|
<?php if(!$troops): ?>
|
||||||
|
<?php elseif($me['troop'] == 0): ?>
|
||||||
|
<input type=submit name=btn value='부 대 가 입'>
|
||||||
|
<?php else: ?>
|
||||||
|
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm("정말 부대를 탈퇴하시겠습니까?")'>
|
||||||
|
<?php endif;?>
|
||||||
|
</td></tr></tfoot>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
for($i=0; $i < $troopcount; $i++) {
|
foreach ($troops as $troopNo=>$troop) {
|
||||||
$troop = MYDB_fetch_array($result);
|
$troopLeader = $troop['leader'];
|
||||||
|
$genlistText = [];
|
||||||
|
$cityText = $troopLeader['cityText'];
|
||||||
|
$cityID = $troopLeader['city'];
|
||||||
|
$leaderID = $troopLeader['no'];
|
||||||
|
|
||||||
$genlist = "";
|
foreach ($troop['users'] as $troopUser) {
|
||||||
$query = "select no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5 from general where troop='{$troop['troop']}'";
|
$spanClass = 'troopUser';
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if ($troopUser['city'] !== $cityID) {
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$spanClass.= ' diffCity';
|
||||||
for($j=0; $j < $gencount; $j++) {
|
|
||||||
$general = MYDB_fetch_array($genresult);
|
|
||||||
$genlist .= $general['name'].", ";
|
|
||||||
if($troop['no'] == $general['no']) {
|
|
||||||
$picture = $general['picture'];
|
|
||||||
$imageTemp = GetImageURL($general['imgsvr']);
|
|
||||||
$name = $general['name'];
|
|
||||||
$turntime = $general['turntime'];
|
|
||||||
$query = "select name from city where city='{$general['city']}'";
|
|
||||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($cityresult);
|
|
||||||
$cityname = $city['name'];
|
|
||||||
$turn = "";
|
|
||||||
for($k=0; $k < 5; $k++) {
|
|
||||||
$m = $k+1;
|
|
||||||
if($general["turn{$k}"] == 26) {
|
|
||||||
$turn .= " $m : 집합<br>";
|
|
||||||
} else {
|
|
||||||
$turn .= " $m : ∼<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if ($troopUser['no'] == $leaderID) {
|
||||||
|
$spanClass.= ' leader';
|
||||||
|
}
|
||||||
|
$genlistText[] = "<span class='$spanClass' data-general-id='{$troopUser['no']}'
|
||||||
|
><span class='generalName'>{$troopUser['name']}</span><span class='cityText'>【{$troopUser['cityText']}】</span
|
||||||
|
></span>";
|
||||||
}
|
}
|
||||||
$genlist .= "({$gencount}명)";
|
|
||||||
|
|
||||||
if($me['troop'] == 0) {
|
$genlistText = sprintf('%s (%d명)', join(', ', $genlistText), count($genlistText)); ?>
|
||||||
echo "
|
|
||||||
|
<?php if ($me['troop'] == 0): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop['troop']}'></td>
|
<td align=center rowspan=2><input type='radio' name='troop' value='<?=$troop['troop']?>'></td>
|
||||||
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
|
<td align=center><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
|
||||||
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'> </td>
|
<td height=64 class='generalIcon' style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'> </td>
|
||||||
<td rowspan=2 width=62>$genlist</td>
|
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||||
<td rowspan=2>$turn</td>
|
<td rowspan=2><?=$troopLeader['turnText']?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
<tr>
|
||||||
<tr><td colspan=5>";
|
<td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||||
} else {
|
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||||
echo "
|
<tr><td colspan=5>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td align=center rowspan=2> </td>
|
<td align=center rowspan=2> </td>
|
||||||
<td align=center >{$troop['name']}<br>【 $cityname 】</td>
|
<td align=center ><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
|
||||||
<td height=64 style='background:no-repeat center url(\"{$imageTemp}/{$picture}\");background-size:64px;'> </td>
|
<td height=64 class='generalIcon' style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'> </td>
|
||||||
<td rowspan=2 width=576>$genlist</td>
|
<td rowspan=2 width=62><?=$genlistText?></td>
|
||||||
<td rowspan=2>";
|
<td rowspan=2>
|
||||||
|
<?php if ($me['no'] == $troopLeader['no']): ?>
|
||||||
if($troop['no'] == $me['no']) {
|
|
||||||
$query = "select no,name from general where troop='{$troop['troop']}' and no!='{$me['no']}' order by binary(name)";
|
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$genCount = MYDB_num_rows($genresult);
|
|
||||||
echo "
|
|
||||||
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
|
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
|
||||||
for($k=0; $k < $genCount; $k++) {
|
<?php foreach ($troop['users'] as $troopUser): ?>
|
||||||
$general = MYDB_fetch_array($genresult);
|
<?php if ($troopUser['no'] == $me['no']) {
|
||||||
echo "
|
continue;
|
||||||
<option value={$general['no']}>{$general['name']}</option>";
|
} ?>
|
||||||
}
|
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
|
||||||
echo "
|
<?php endforeach; ?>
|
||||||
</select><br>
|
</select><br>
|
||||||
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>";
|
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>
|
||||||
} else {
|
<?php else: ?>
|
||||||
echo $turn;
|
<?=$troopLeader['turnText']?>
|
||||||
}
|
<?php endif; ?>
|
||||||
|
|
||||||
echo "
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
|
<tr><td align=center><font size=2>【턴】 <?=substr($troopLeader['turntime'], 14)?></font></td>
|
||||||
<tr><td colspan=5></td></tr>";
|
<td align=center><font size=1><?=$troopLeader['name']?></font></td></tr>
|
||||||
}
|
<tr><td colspan=5></td></tr>
|
||||||
}
|
<?php endif;
|
||||||
echo "</tbody>
|
|
||||||
<tfoot><tr><td>";
|
} //foreach ($troops as $troopNo=>$troop) {
|
||||||
if ($troopcount == 0) {
|
?>
|
||||||
}
|
|
||||||
else if($me['troop'] == 0) {
|
</tbody>
|
||||||
echo"
|
|
||||||
<input type=submit name=btn value='부 대 가 입'>";
|
|
||||||
} else {
|
|
||||||
echo"
|
|
||||||
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm(\"정말 부대를 탈퇴하시겠습니까?\")'>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "
|
|
||||||
</td></tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
</table>
|
||||||
<br>";
|
<br>
|
||||||
|
|
||||||
echo "
|
|
||||||
<table width=1000 class='tb_layout bg0'>
|
<table width=1000 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=80 id=bg1>부 대 명</td>
|
<td width=80 id=bg1>부 대 명</td>
|
||||||
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>";
|
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
|
||||||
if($me['troop'] == 0) {
|
<?php if($me['troop'] == 0): ?>
|
||||||
echo "
|
<td><input type=submit name=btn value='부 대 창 설'></td>
|
||||||
<td><input type=submit name=btn value='부 대 창 설'></td>";
|
<?php else: ?>
|
||||||
} else {
|
<td><input type=submit name=btn value='부 대 변 경'></td>
|
||||||
echo "
|
<?php endif; ?>
|
||||||
<td><input type=submit name=btn value='부 대 변 경'></td>";
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>";
|
</table>
|
||||||
|
|
||||||
?>
|
|
||||||
<table width=1000 class='tb_layout bg0'>
|
<table width=1000 class='tb_layout bg0'>
|
||||||
<tr><td><?=backButton()?></td></tr>
|
<tr><td><?=backButton()?></td></tr>
|
||||||
<tr><td><?=banner()?> </td></tr>
|
<tr><td><?=banner()?> </td></tr>
|
||||||
|
|||||||
@@ -0,0 +1,473 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
include "lib.php";
|
||||||
|
include "func.php";
|
||||||
|
|
||||||
|
$session = Session::requireLogin()->setReadOnly();
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
|
$startYear = $gameStor->getValue('startyear');
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><?=UniqueConst::$serverName?>: 전투 시뮬레이터</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=1100" />
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
|
<?=WebUtil::printCSS('css/battle_simulator.css')?>
|
||||||
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/download2.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printJS('js/battle_simulator.js')?>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container">
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
전역 설정
|
||||||
|
</div>
|
||||||
|
<div class="card-body dragpad_battle">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="number" class="form-control" aria-describedby="text_year" value="<?=$startYear?>" disabled>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">년 시작</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control" id="year" value="<?=$startYear+3?>" min="<?=$startYear?>">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">년</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control" id="month" value="1" min="1" max="12">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">월</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="btn-toolbar" role="toolbar">
|
||||||
|
<div class="input-group mr-2" role="group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">반복 횟수</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select" id="repeat_cnt">
|
||||||
|
<option value="1">1회 (로그 표기)</option>
|
||||||
|
<option value="1000">1000회 (요약 표기)</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group mr-2" role="group">
|
||||||
|
<button type="button" class="btn btn-danger btn-begin_battle">전투</button>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group mr-2" role="group">
|
||||||
|
<button type="button" class="btn btn-info btn-battle-save">모두 저장</button>
|
||||||
|
<input type="file" class="form_load_battle_file" accept=".json" style="display: none;" />
|
||||||
|
<button type="button" class="btn btn-primary btn-battle-load">모두 불러오기</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="card mb-2 attacker_nation">
|
||||||
|
<div class="card-header">
|
||||||
|
출병국 설정
|
||||||
|
</div>
|
||||||
|
<div class="card-body nation_detail dragpad_battle">
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">국가 성향</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_nation_type" style="width:25ch;">
|
||||||
|
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
|
||||||
|
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">기술</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_tech" value="1" min="0" max="12">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">등급</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">국가 규모</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_nation_level">
|
||||||
|
<?php foreach(getNationLevelList() as $nationLevel => [$name,$chiefCnt,$cityCnt]): ?>
|
||||||
|
<option value="<?=$nationLevel?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">도시 규모</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_city_level">
|
||||||
|
<?php foreach(getCityLevelList() as $levelID => $name): ?>
|
||||||
|
<option value="<?=$levelID?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">수도</span>
|
||||||
|
</div>
|
||||||
|
<div class="input-group-append btn-group btn-group-toggle" data-toggle="buttons">
|
||||||
|
<label class="btn btn-secondary">
|
||||||
|
<input type="radio" name="is_attacker_capital" class="form_is_capital" value="1" autocomplete="off">Y
|
||||||
|
</label>
|
||||||
|
<label class="btn btn-secondary active">
|
||||||
|
<input type="radio" name="is_attacker_capital" class="form_is_capital" value="2" autocomplete="off" checked>N
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-2 attacker_form general_form" data-general_no='1'>
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="float-sm-left" style="line-height:25px;">출병자 설정</div>
|
||||||
|
<div class="float-sm-right btn-toolbar" role="toolbar">
|
||||||
|
<div class="btn-group btn-group-sm mr-2" role="group">
|
||||||
|
<button type="button" class="btn btn-info btn-general-save">저장</button>
|
||||||
|
<input type="file" class="form_load_general_file" accept=".json" style="display: none;" />
|
||||||
|
<button type="button" class="btn btn-primary btn-general-load">불러오기</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- <div class="col-sm"> -->
|
||||||
|
<div class="col-sm defender-column">
|
||||||
|
<div class="card mb-2 defender_nation">
|
||||||
|
<div class="card-header">
|
||||||
|
수비국 설정
|
||||||
|
</div>
|
||||||
|
<div class="card-body dragpad_battle">
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">국가 성향</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_nation_type" style="width:25ch;">
|
||||||
|
<?php foreach(getNationTypeList() as $typeID => [$name,$pros,$cons]): ?>
|
||||||
|
<option value="<?=$typeID?>"><?=$name?> (<?=$pros?>, <?=$cons?>)</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">기술</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_tech" value="1" min="0" max="12">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">등급</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">국가 규모</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_nation_level">
|
||||||
|
<?php foreach(getNationLevelList() as $nationLevel => [$name,$chiefCnt,$cityCnt]): ?>
|
||||||
|
<option value="<?=$nationLevel?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">도시 규모</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_city_level">
|
||||||
|
<?php foreach(getCityLevelList() as $levelID => $name): ?>
|
||||||
|
<option value="<?=$levelID?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">수도</span>
|
||||||
|
</div>
|
||||||
|
<div class="input-group-append btn-group btn-group-toggle" data-toggle="buttons">
|
||||||
|
<label class="btn btn-secondary">
|
||||||
|
<input type="radio" name="is_defender_capital" class="form_is_capital" value="1" autocomplete="off">Y
|
||||||
|
</label>
|
||||||
|
<label class="btn btn-secondary active">
|
||||||
|
<input type="radio" name="is_defender_capital" class="form_is_capital" value="0" autocomplete="off" checked>N
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">수비</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_def" id="city_def" value="1000" min="10" step="10">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">성벽</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_wall" id="city_wall" value="1000" min="0" step="10">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-2 defender_add_form">
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="float-sm-left" style="line-height:25px;">수비자 설정</div>
|
||||||
|
<div class="float-sm-right btn-toolbar" role="toolbar">
|
||||||
|
<div class="btn-group btn-group-sm mr-2" role="group">
|
||||||
|
<button type="button" class="btn btn-dark btn-reorder_defender">수비 순서대로 정렬</button>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group btn-group-sm" role="group">
|
||||||
|
<button type="button" class="btn btn-success add-defender">추가</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card mb-2 form_sample">
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="float-sm-left" style="line-height:25px;">수비자 설정</div>
|
||||||
|
<div class="float-sm-right btn-toolbar" role="toolbar">
|
||||||
|
<div class="btn-group btn-group-sm mr-2" role="group">
|
||||||
|
<button type="button" class="btn btn-info btn-general-save">저장</button>
|
||||||
|
<input type="file" class="form_load_general_file" accept=".json" style="display: none;" />
|
||||||
|
<button type="button" class="btn btn-primary btn-general-load">불러오기</button>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group btn-group-sm" role="group">
|
||||||
|
<button type="button" class="btn btn-warning copy-defender">복제</button>
|
||||||
|
<button type="button" class="btn btn-danger delete-defender">제거</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body general_detail">
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">이름</span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control form_general_name" value="무명" style="width:15ch;">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">직위</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_level" style="width:8ch;">
|
||||||
|
<option value="1">일반</option>
|
||||||
|
<option value="4">태수</option>
|
||||||
|
<option value="3">군사</option>
|
||||||
|
<option value="2">시중</option>
|
||||||
|
<option value="10">무장 수뇌</option>
|
||||||
|
<option value="9">지장 수뇌</option>
|
||||||
|
<option value="11">참모</option>
|
||||||
|
<option value="12">군주</option>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">Level</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_exp_level" value="20" min="0" max="300" step="1">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">통솔</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_leadership" value="50" min="1" max="300" step="1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">무력</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_power" value="50" min="1" max="300" step="1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">지력</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_intel" value="50" min="1" max="300" step="1">
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">명마</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_horse">
|
||||||
|
<?php foreach(range(0, 26) as $horseID): ?>
|
||||||
|
<option value="<?=$horseID?>"><?=getHorseName($horseID)?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">무기</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_weap">
|
||||||
|
<?php foreach(range(0, 26) as $weapID): ?>
|
||||||
|
<option value="<?=$weapID?>"><?=getWeapName($weapID)?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">서적</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_book">
|
||||||
|
<?php foreach(range(0, 26) as $bookID): ?>
|
||||||
|
<option value="<?=$bookID?>"><?=getBookName($bookID)?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">부상</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_injury" value="0" min="0" max="80" step="1">
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text">%(<span class="injury_helptext">건강</span>)</span>
|
||||||
|
</div>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">군량</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_rice" value="5000" min="50" max="40000" step="50">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">도구</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_item">
|
||||||
|
<?php foreach(range(0, 26) as $bookID): ?>
|
||||||
|
<option value="<?=$bookID?>"><?=getItemName($bookID)?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">병종</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_crewtype">
|
||||||
|
<?php foreach(GameUnitConst::all() as $crewTypeID => $crewType): ?>
|
||||||
|
<?php if($crewTypeID < 0){ continue; } ?>
|
||||||
|
<option value="<?=$crewTypeID?>"><?=$crewType->name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">병사</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_crew" value="7000" min="100" step="100">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">성격</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_character">
|
||||||
|
<?php foreach(getCharacterList() as $characterID => [$name,$info]): ?>
|
||||||
|
<option value="<?=$characterID?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">훈련</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_train" value="100" min="40" max="<?=GameConst::$maxTrainByWar?>" step="1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">사기</span>
|
||||||
|
</div>
|
||||||
|
<input type="number" class="form-control form_atmos" value="100" min="40" max="<?=GameConst::$maxAtmosByWar?>" step="1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">전특</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_general_special_war">
|
||||||
|
<option value="0">-</option>
|
||||||
|
<?php foreach(SpecialityConst::WAR as $specialWarID => [$name,$buff,$cond]): ?>
|
||||||
|
<option value="<?=$specialWarID?>"><?=$name?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">보병숙련</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_dex0">
|
||||||
|
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
|
||||||
|
<option value="<?=$dexAmount?>"><?="{$name} (".number_format($dexAmount).")"?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">궁병숙련</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_dex10">
|
||||||
|
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
|
||||||
|
<option value="<?=$dexAmount?>"><?="{$name} (".number_format($dexAmount).")"?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">기병숙련</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_dex20">
|
||||||
|
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
|
||||||
|
<option value="<?=$dexAmount?>"><?="{$name} (".number_format($dexAmount).")"?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-1">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">귀병숙련</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_dex30">
|
||||||
|
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
|
||||||
|
<option value="<?=$dexAmount?>"><?="{$name} (".number_format($dexAmount).")"?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text">차병숙련</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_dex40">
|
||||||
|
<?php foreach(getDexLevelList() as $dexLevel => [$dexAmount, $color, $name]): ?>
|
||||||
|
<option value="<?=$dexAmount?>"><?="{$name} (".number_format($dexAmount).")"?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-prepend only_defender">
|
||||||
|
<span class="input-group-text">수비여부</span>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select form_defend_mode only_defender">
|
||||||
|
<option value="2">훈사 80</option>
|
||||||
|
<option value="3">훈사 60</option>
|
||||||
|
<option value="0">안함</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div><!-- <div class="col-sm"> -->
|
||||||
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
전투 요약
|
||||||
|
</div>
|
||||||
|
<table class="table">
|
||||||
|
<tbody id="battle_result_summary">
|
||||||
|
<tr><th style='width:18ch;'>전투 일시</th><td id='result_datetime'></td></tr>
|
||||||
|
<tr><th>전투 횟수</th><td id='result_warcnt'></td></tr>
|
||||||
|
<tr><th>전투 페이즈</th><td id='result_phase'></td></tr>
|
||||||
|
<tr><th>준 피해</th><td><span id='result_killed'>0</span><span id='result_varKilled'> (<span id='result_minKilled'>0</span> ~ <span id='result_maxKilled'>0</span>)</span></td></tr>
|
||||||
|
<tr><th>받은 피해</th><td><span id='result_dead'>0</span><span id='result_varDead'> (<span id='result_minDead'>0</span> ~ <span id='result_maxDead'>0</span>)</span></td></tr>
|
||||||
|
<tr><th>출병자 군량 소모</th><td id='result_attackerRice'></td></tr>
|
||||||
|
<tr><th>수비자 군량 소모</th><td id='result_defenderRice'></td></tr>
|
||||||
|
<tr><th>공격자 스킬</th><td id='result_attackerSkills'></td></tr>
|
||||||
|
<tr class='result_defenderSkills'><th>수비자1 스킬</th><td></td></tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
마지막 전투 로그
|
||||||
|
</div>
|
||||||
|
<div class="card-body" id="generalBattleResultLog">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-header">
|
||||||
|
마지막 전투 상세 로그
|
||||||
|
</div>
|
||||||
|
<div class="card-body" id="generalBattleDetailLog">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+2
-2
@@ -28,13 +28,13 @@ if($me['level'] < 5) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "국가방침") {
|
if($btn == "국가방침 수정") {
|
||||||
$msg = mb_substr($msg, 0, 16384);
|
$msg = mb_substr($msg, 0, 16384);
|
||||||
//$msg = StringUtil::
|
//$msg = StringUtil::
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'msg'=>WebUtil::htmlPurify($msg)
|
'msg'=>WebUtil::htmlPurify($msg)
|
||||||
], 'nation=%i',$me['nation']);
|
], 'nation=%i',$me['nation']);
|
||||||
} elseif($btn == "임관권유") {
|
} elseif($btn == "임관 권유문 수정") {
|
||||||
$scoutmsg = mb_substr($scoutmsg, 0, 1000);
|
$scoutmsg = mb_substr($scoutmsg, 0, 1000);
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'scoutmsg'=>WebUtil::htmlPurify($scoutmsg)
|
'scoutmsg'=>WebUtil::htmlPurify($scoutmsg)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ if($third < 0) { $third = 0; }
|
|||||||
if($fourth < 0) { $fourth = 0; }
|
if($fourth < 0) { $fourth = 0; }
|
||||||
if($command > 99) { $command = 0; }
|
if($command > 99) { $command = 0; }
|
||||||
if($double > 9999) { $double = 9999; }
|
if($double > 9999) { $double = 9999; }
|
||||||
if($third > 9999) { $third = 9999; }
|
|
||||||
if($fourth > 9999) { $fourth = 9999; }
|
if($fourth > 9999) { $fourth = 9999; }
|
||||||
|
|
||||||
$comStr = EncodeCommand($fourth, $third, $double, $command);
|
$comStr = EncodeCommand($fourth, $third, $double, $command);
|
||||||
|
|||||||
+26
-3
@@ -75,6 +75,12 @@ if($btn == "임명") {
|
|||||||
header('location:b_myBossInfo.php');
|
header('location:b_myBossInfo.php');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//NPC 부대장 추방 불가
|
||||||
|
if($general['npc'] == 5){
|
||||||
|
header('location:b_myBossInfo.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//나와 대상 장수는 국가가 같아야 함
|
//나와 대상 장수는 국가가 같아야 함
|
||||||
@@ -134,8 +140,25 @@ if($btn == "추방") {
|
|||||||
$log[] = "<C>●</><D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
$log[] = "<C>●</><D><b>{$nation['name']}</b></>에서 <R>추방</>당하였습니다.";
|
||||||
|
|
||||||
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
|
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
|
||||||
$query = "update general set level=0,nation=0,belong=0,betray=betray+1,makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='{$general['no']}'";
|
if($admin['year'] <= $admin['startyear'] && $general['npc'] < 2){
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->update('general', [
|
||||||
|
'level'=>0,
|
||||||
|
'nation'=>0,
|
||||||
|
'belong'=>0,
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$db->update('general', [
|
||||||
|
'level'=>0,
|
||||||
|
'nation'=>0,
|
||||||
|
'belong'=>0,
|
||||||
|
'betray'=>$db->sqleval('betray + 1'),
|
||||||
|
'makelimit'=>12,
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'dedication'=>$db->sqleval('dedication * (1 - 0.1*betray)'),
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 부대 처리
|
// 부대 처리
|
||||||
$query = "select no from troop where troop='{$general['troop']}'";
|
$query = "select no from troop where troop='{$general['troop']}'";
|
||||||
@@ -163,7 +186,7 @@ if($btn == "추방") {
|
|||||||
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
$query = "update city set gen3='0' where gen3='{$general['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
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) {
|
switch(rand()%5) {
|
||||||
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
|
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
|
||||||
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
|
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
|
||||||
|
|||||||
@@ -38,9 +38,13 @@ case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($btn == '참가') {
|
if($btn == '참가') {
|
||||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='{$me['no']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if($db->queryFirstField('SELECT `no` FROM tournament WHERE `no`=%i', $me['no'])){
|
||||||
$general = MYDB_fetch_array($result);
|
header('location:b_tournament.php');
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$general = $db->queryFirstRow('SELECT no,name,npc,leader,power,intel,explevel,gold,horse,weap,book FROM general WHERE `no`=%i', $me['no']);
|
||||||
|
|
||||||
//{$admin['develcost']}원 참가비
|
//{$admin['develcost']}원 참가비
|
||||||
if($general['gold'] < $admin['develcost']) {
|
if($general['gold'] < $admin['develcost']) {
|
||||||
|
|||||||
+5
-1
@@ -16,6 +16,10 @@ $db = DB::db();
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=1024" />
|
<meta name="viewport" content="width=1024" />
|
||||||
|
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
<?=WebUtil::printCSS('css/common.css')?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -107,7 +111,7 @@ function myCommandList() {
|
|||||||
echo "
|
echo "
|
||||||
<tr height=28>
|
<tr height=28>
|
||||||
<td width=24 align=center height=24 id=bg0><b>$j</b></td>
|
<td width=24 align=center height=24 id=bg0><b>$j</b></td>
|
||||||
<td width=71 align=center height=24 id=bg1><b>{$year}年 {$month}月</b></td>
|
<td width=71 align=center height=24 id=bg1 style='overflow:hidden;'><b>{$year}年 {$month}月</b></td>
|
||||||
<td width=42 align=center bgcolor=black><b>$turndate</b></td>
|
<td width=42 align=center bgcolor=black><b>$turndate</b></td>
|
||||||
<td width=150 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
|
<td width=150 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
#container{
|
||||||
|
width:1024px;
|
||||||
|
margin:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.defender_add_form .general_detail{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.form_sample{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=number]{
|
||||||
|
text-align:right;
|
||||||
|
}
|
||||||
@@ -195,3 +195,26 @@ div.bar_out div.bar_in{
|
|||||||
.tooltiptext {
|
.tooltiptext {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-group-xs > .btn, .btn-xs {
|
||||||
|
padding : .25rem .4rem;
|
||||||
|
font-size : .875rem;
|
||||||
|
line-height : .5;
|
||||||
|
border-radius : .2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit_form.viewer{
|
||||||
|
max-height:200px;
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trumbowyg-box{
|
||||||
|
margin:0;
|
||||||
|
border-left:none;
|
||||||
|
border-right:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit_form.trumbowyg-editor{
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#scoutMsgForm .viewer{
|
||||||
|
max-height:200px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-editor.card {
|
||||||
|
background:inherit;
|
||||||
|
color:inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-editor.note-frame .note-editing-area .note-editable {
|
||||||
|
background:inherit;
|
||||||
|
color:inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
padding:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note-editor.note-frame .note-statusbar{
|
||||||
|
background-color:#444444;
|
||||||
|
border-top: 1px solid rgba(0,0,0,0.125);
|
||||||
|
}
|
||||||
+55
-1
@@ -27,12 +27,51 @@
|
|||||||
position:relative;
|
position:relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.map_body .map_bglayer1{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_body .map_bglayer2{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_body .map_bgroad{
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
position:absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_body .map_button_stack{
|
||||||
|
position:absolute;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_body .map_toggle_cityname::after{
|
||||||
|
content: "끄기"
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_body .map_toggle_cityname.active::after{
|
||||||
|
content: "켜기"
|
||||||
|
}
|
||||||
|
|
||||||
.world_map .city_tooltip{
|
.world_map .city_tooltip{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index:6;
|
z-index:6;
|
||||||
display:none;
|
display:none;
|
||||||
width:120px;
|
min-width:120px;
|
||||||
border: 0.02em gray solid;
|
border: 0.02em gray solid;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.world_map .city_name{
|
.world_map .city_name{
|
||||||
background-color: rgb(30, 164, 255);
|
background-color: rgb(30, 164, 255);
|
||||||
@@ -70,6 +109,19 @@
|
|||||||
background:transparent;
|
background:transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.world_map .city_detail_name{
|
||||||
|
background-color:rgba(0,0,0,0.5);
|
||||||
|
font-size:10px;
|
||||||
|
position:absolute;
|
||||||
|
white-space:nowrap;
|
||||||
|
left:70%;
|
||||||
|
bottom:-10px;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.world_map.hide_cityname .city_detail_name{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
.city_base{
|
.city_base{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
@@ -314,6 +366,8 @@
|
|||||||
|
|
||||||
/* Basic */
|
/* Basic */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.world_map.map_basic .city_filler{
|
.world_map.map_basic .city_filler{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#troop_list .cityText{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#troop_list .diffCity .cityText{
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#troop_list .diffCity {
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#troop_list .leader{
|
||||||
|
color:lightgreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
#troop_list .leader::before{
|
||||||
|
content:'*';
|
||||||
|
}
|
||||||
|
|
||||||
|
#troop_list .leader::after{
|
||||||
|
content:'*';
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class CityConst extends CityConstBase{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class GameConst extends GameConstBase
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
class GameCustomConst
|
|
||||||
{
|
|
||||||
/** @var int 유저 스탯 총합 */
|
|
||||||
public static $defaultStatTotal = _tK_statTotal_;
|
|
||||||
public static $defaultStatMin = _tK_statMin_;
|
|
||||||
public static $defaultStatMax = _tK_statMax_;
|
|
||||||
public static $defaultStatNPCMax = _tK_statNPCMax_;
|
|
||||||
public static $chiefStatMin = _tK_statChiefMin_;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
class GameUnitConst extends GameUnitConstBase
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Deny from all
|
||||||
+170
-13
@@ -417,14 +417,14 @@ function addCommand($typename, $value, $valid = 1, $color=0) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "
|
echo "
|
||||||
<option style=color:white;background-color:red; value={$value}>{$typename}</option>";
|
<option style=color:white;background-color:red; value={$value}>{$typename}(불가)</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function commandGroup($typename, $type=0) {
|
function commandGroup($typename, $type=0) {
|
||||||
if($type == 0) {
|
if($type == 0) {
|
||||||
echo "
|
echo "
|
||||||
<optgroup label='{$typename}' style=color:skyblue;background-color:black;>";
|
<optgroup label='{$typename}' style='color:skyblue;background-color:black;'>";
|
||||||
} else {
|
} else {
|
||||||
echo "
|
echo "
|
||||||
</optgroup>";
|
</optgroup>";
|
||||||
@@ -524,7 +524,7 @@ function commandTable() {
|
|||||||
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31);
|
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31);
|
||||||
addCommand("징병(통솔경험)", 11);
|
addCommand("징병(통솔경험)", 11);
|
||||||
addCommand("모병(통솔경험, 자금x2)", 12);
|
addCommand("모병(통솔경험, 자금x2)", 12);
|
||||||
addCommand("훈련(통솔경험, 사기↓)", 13);
|
addCommand("훈련(통솔경험)", 13);
|
||||||
addCommand("사기진작(통솔경험, 자금↓)", 14);
|
addCommand("사기진작(통솔경험, 자금↓)", 14);
|
||||||
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15);
|
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15);
|
||||||
addCommand("출병", 16);
|
addCommand("출병", 16);
|
||||||
@@ -532,7 +532,7 @@ function commandTable() {
|
|||||||
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31, 0);
|
addCommand("첩보(통솔경험, 자금$develcost3, 군량$develcost3)", 31, 0);
|
||||||
addCommand("징병(통솔경험)", 11, 0);
|
addCommand("징병(통솔경험)", 11, 0);
|
||||||
addCommand("모병(통솔경험, 자금x2)", 12, 0);
|
addCommand("모병(통솔경험, 자금x2)", 12, 0);
|
||||||
addCommand("훈련(통솔경험, 사기↓)", 13, 0);
|
addCommand("훈련(통솔경험)", 13, 0);
|
||||||
addCommand("사기진작(통솔경험, 자금↓)", 14, 0);
|
addCommand("사기진작(통솔경험, 자금↓)", 14, 0);
|
||||||
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15, 0);
|
//addCommand("전투태세/3턴(통솔경험, 자금↓)", 15, 0);
|
||||||
addCommand("출병", 16, 0);
|
addCommand("출병", 16, 0);
|
||||||
@@ -699,7 +699,8 @@ function CoreCommandTable() {
|
|||||||
if($city['supply'] == 0) { $valid = 0; }
|
if($city['supply'] == 0) { $valid = 0; }
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<select name=commandtype size=1 style='height:20px;color:white;background-color:black;font-size:13px;>";
|
<select name=commandtype size=1 style='height:20px;color:white;background-color:black;font-size:13px;'>";
|
||||||
|
commandGroup("====== 휴 식 ======");
|
||||||
addCommand("휴 식", 99);
|
addCommand("휴 식", 99);
|
||||||
commandGroup("", 1);
|
commandGroup("", 1);
|
||||||
commandGroup("====== 인 사 ======");
|
commandGroup("====== 인 사 ======");
|
||||||
@@ -708,7 +709,7 @@ function CoreCommandTable() {
|
|||||||
addCommand("몰수", 24, $valid);
|
addCommand("몰수", 24, $valid);
|
||||||
commandGroup("", 1);
|
commandGroup("", 1);
|
||||||
commandGroup("====== 외 교 ======");
|
commandGroup("====== 외 교 ======");
|
||||||
addCommand("통합 제의", 53, $valid);
|
//addCommand("통합 제의", 53, $valid);
|
||||||
|
|
||||||
addCommand("항복 권고", 51, $valid);
|
addCommand("항복 권고", 51, $valid);
|
||||||
if($nation['level'] >= 2) {
|
if($nation['level'] >= 2) {
|
||||||
@@ -876,7 +877,7 @@ function generalInfo($no) {
|
|||||||
$imageTemp = GetImageURL($general['imgsvr']);
|
$imageTemp = GetImageURL($general['imgsvr']);
|
||||||
echo "<table width=498 class='tb_layout bg2'>
|
echo "<table width=498 class='tb_layout bg2'>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=64 height=64 rowspan=3 style='text-align:center;background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;'> </td>
|
<td width=64 height=64 rowspan=3 class='generalIcon' style='text-align:center;background:no-repeat center url(\"{$imageTemp}/{$general['picture']}\");background-size:64px;'> </td>
|
||||||
<td colspan=9 height=16 style=text-align:center;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>{$general['name']} 【 {$level} | {$call} | {$color}{$injury}</font> 】 ".substr($general['turntime'], 11)."</td>
|
<td colspan=9 height=16 style=text-align:center;color:".newColor($nation['color']).";background-color:{$nation['color']};font-weight:bold;font-size:13px;>{$general['name']} 【 {$level} | {$call} | {$color}{$injury}</font> 】 ".substr($general['turntime'], 11)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height=16>
|
<tr height=16>
|
||||||
@@ -1147,7 +1148,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
|||||||
<td width=148 style='text-align:center;' class='bg1'>$when</td>
|
<td width=148 style='text-align:center;' class='bg1'>$when</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=90 height=64 valign=top><img width='64' height='64' src={$imageTemp}/{$picture} border='0'></td>
|
<td width=90 height=64 valign=top><img width='64' height='64' class='generalIcon' src='{$imageTemp}/{$picture}' border='0'></td>
|
||||||
<td width=906 colspan=2>$message[1]</td>
|
<td width=906 colspan=2>$message[1]</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
for($i=0; $i < $count; $i++) {
|
for($i=0; $i < $count; $i++) {
|
||||||
@@ -1244,14 +1245,16 @@ function increaseRefresh($type="", $cnt=1) {
|
|||||||
$session = Session::getInstance();
|
$session = Session::getInstance();
|
||||||
$userID = $session->userID;
|
$userID = $session->userID;
|
||||||
$generalID = $session->generalID;
|
$generalID = $session->generalID;
|
||||||
|
$userGrade = $session->userGrade;
|
||||||
|
|
||||||
$date = date('Y-m-d H:i:s');
|
$date = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$gameStor->refresh = $gameStor->refresh+$cnt; //TODO: +로 증가하는 값은 별도로 분리
|
$gameStor->refresh = $gameStor->refresh+$cnt; //TODO: +로 증가하는 값은 별도로 분리
|
||||||
|
$isunited = $gameStor->isunited;
|
||||||
|
|
||||||
if($generalID) {
|
if($isunited != 2 && $generalID && $userGrade < 6) {
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'lastrefresh'=>$date,
|
'lastrefresh'=>$date,
|
||||||
'con'=>$db->sqleval('con + %i', $cnt),
|
'con'=>$db->sqleval('con + %i', $cnt),
|
||||||
@@ -1812,7 +1815,7 @@ function PreprocessCommand($no) {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
$log = [];
|
$log = [];
|
||||||
|
|
||||||
$query = "select no,name,city,injury,special2,item,turn0 from general where no='$no'";
|
$query = "select no,name,city,injury,special2,item,turn0,rice,crew from general where no='$no'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -1870,7 +1873,7 @@ function PreprocessCommand($no) {
|
|||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
$josaUl = JosaUtil::pick($general['item'], '을');
|
||||||
$log[0] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용하여 치료합니다!";
|
$log[0] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용하여 치료합니다!";
|
||||||
pushGenLog($general, $log);
|
pushGenLog($general, $log);
|
||||||
} elseif($general['injury'] > 10 && $general['item'] == 1 && $general['turn0'] != EncodeCommand(0, 0, 0, 50)) {
|
} elseif($general['injury'] > 10 && $general['item'] == 1 && DecodeCommand($general['turn0'])[0] != 50) {
|
||||||
//환약 사용
|
//환약 사용
|
||||||
$query = "update general set injury=0,item=0 where no='$no'";
|
$query = "update general set injury=0,item=0 where no='$no'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -1887,6 +1890,27 @@ function PreprocessCommand($no) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($general['crew'] >= 100){
|
||||||
|
$newRice = $general['rice'] - $general['crew'] / 100;
|
||||||
|
if($newRice >= 0){
|
||||||
|
$db->update('general', [
|
||||||
|
'rice'=>Util::round($newRice)
|
||||||
|
], 'no=%i',$general['no']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$db->update('city', [
|
||||||
|
'pop'=>$db->sqleval('pop + %i', $general['crew'])
|
||||||
|
], 'city=%i', $general['city']);
|
||||||
|
$db->update('general', [
|
||||||
|
'crew'=>0,
|
||||||
|
'rice'=>0
|
||||||
|
], 'no=%i',$general['no']);
|
||||||
|
pushGenLog($general, ["<C>●</>군량이 모자라 병사들이 <R>소집해제</>되었습니다!"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2016,7 +2040,7 @@ function updateTurntime($no) {
|
|||||||
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
|
||||||
}
|
}
|
||||||
// 엔피씨,엠피씨,의병 사망로그
|
// 엔피씨,엠피씨,의병 사망로그
|
||||||
if($general['npc'] == 2) {
|
if($general['npc'] == 2 || $general['npc'] == 6) {
|
||||||
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
|
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
|
||||||
} elseif($general['npc'] >= 3) {
|
} elseif($general['npc'] >= 3) {
|
||||||
switch(rand()%10) {
|
switch(rand()%10) {
|
||||||
@@ -2166,6 +2190,7 @@ function CheckHall($no) {
|
|||||||
|
|
||||||
|
|
||||||
function uniqueItem($general, $log, $vote=0) {
|
function uniqueItem($general, $log, $vote=0) {
|
||||||
|
//TODO: uniqueItem 재 구현
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
@@ -2183,7 +2208,7 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gen = MYDB_fetch_array($result);
|
$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개월에 하나씩 등장
|
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
|
||||||
|
|
||||||
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
|
||||||
@@ -2294,6 +2319,69 @@ function uniqueItem($general, $log, $vote=0) {
|
|||||||
return $log;
|
return $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkAbilityEx(int $generalID, ActionLogger $actLog){
|
||||||
|
$db = DB::db();
|
||||||
|
$general = $db->queryFirstRow('SELECT leader,leader2,power,power2,intel,intel2 FROM general WHERE no = %i',$generalID);
|
||||||
|
|
||||||
|
if(!$general){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['leader2'] < 0){
|
||||||
|
$db->update('general',[
|
||||||
|
'leader2'=>$db->sqleval('leader2 + %i', GameConst::$upgradeLimit),
|
||||||
|
'leader'=>$db->sqleval('leader - 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['power2'] < 0){
|
||||||
|
$db->update('general',[
|
||||||
|
'power2'=>$db->sqleval('power2 + %i', GameConst::$upgradeLimit),
|
||||||
|
'power'=>$db->sqleval('power - 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['intel2'] < 0){
|
||||||
|
$db->update('general',[
|
||||||
|
'intel2'=>$db->sqleval('intel2 + %i', GameConst::$upgradeLimit),
|
||||||
|
'intel'=>$db->sqleval('intel - 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 떨어졌습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['leader2'] >= GameConst::$upgradeLimit){
|
||||||
|
$db->update('general',[
|
||||||
|
'leader2'=>$db->sqleval('leader2 - %i', GameConst::$upgradeLimit),
|
||||||
|
'leader'=>$db->sqleval('leader + 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>통솔</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['power2'] >= GameConst::$upgradeLimit){
|
||||||
|
$db->update('general',[
|
||||||
|
'power2'=>$db->sqleval('power2 - %i', GameConst::$upgradeLimit),
|
||||||
|
'power'=>$db->sqleval('power + 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>무력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['intel2'] >= GameConst::$upgradeLimit){
|
||||||
|
$db->update('general',[
|
||||||
|
'intel2'=>$db->sqleval('intel2 - %i', GameConst::$upgradeLimit),
|
||||||
|
'intel'=>$db->sqleval('intel + 1')
|
||||||
|
], 'no=%i', $generalID);
|
||||||
|
$actLog->pushGeneralActionLog('<R>지력</>이 <C>1</> 올랐습니다!', ActionLogger::PLAIN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function checkAbility($general, $log) {
|
function checkAbility($general, $log) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
@@ -2600,6 +2688,9 @@ function searchDistance(int $from, int $maxDist=99, bool $distForm = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isNeighbor(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
function isNeighbor(int $nation1, int $nation2, bool $includeNoSupply=true) {
|
||||||
|
if($nation1 === $nation2){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
$nation1Cities = [];
|
$nation1Cities = [];
|
||||||
@@ -2638,6 +2729,60 @@ function CharExperience($exp, $personal) {
|
|||||||
return $exp;
|
return $exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCharExpMultiplier($personal):float{
|
||||||
|
static $table = [
|
||||||
|
0 => 1.1,
|
||||||
|
1 => 1.1,
|
||||||
|
4 => 0.9,
|
||||||
|
5 => 0.9,
|
||||||
|
6 => 1.1,
|
||||||
|
7 => 0.9,
|
||||||
|
10 => 0.9
|
||||||
|
];
|
||||||
|
return $table[$personal] ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNationTechMultiplier($nationType):float{
|
||||||
|
static $table = [
|
||||||
|
3 => 1.1,
|
||||||
|
5 => 0.9,
|
||||||
|
6 => 0.9,
|
||||||
|
7 => 0.9,
|
||||||
|
8 => 0.9,
|
||||||
|
12 => 0.9,
|
||||||
|
13 => 1.1,
|
||||||
|
];
|
||||||
|
return $table[$nationType] ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNationWallMultiplier($nationType):float{
|
||||||
|
static $table = [
|
||||||
|
3 => 1.1,
|
||||||
|
5 => 1.1,
|
||||||
|
10 => 1.1,
|
||||||
|
11 => 1.1,
|
||||||
|
4 => 0.9,
|
||||||
|
7 => 0.9,
|
||||||
|
8 => 0.9,
|
||||||
|
13 => 0.9,
|
||||||
|
];
|
||||||
|
return $table[$nationType] ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNationPeopleMultiplier($nationType):float{
|
||||||
|
static $table = [
|
||||||
|
1 => 0.9,
|
||||||
|
2 => 1.1,
|
||||||
|
3 => 0.9,
|
||||||
|
4 => 1.1,
|
||||||
|
7 => 1.1,
|
||||||
|
9 => 0.9,
|
||||||
|
10 => 1.1,
|
||||||
|
];
|
||||||
|
return $table[$nationType] ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function CharDedication($ded, $personal) {
|
function CharDedication($ded, $personal) {
|
||||||
switch($personal) {
|
switch($personal) {
|
||||||
case 10:
|
case 10:
|
||||||
@@ -2648,6 +2793,13 @@ function CharDedication($ded, $personal) {
|
|||||||
return $ded;
|
return $ded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCharDedMultiplier($personal):float{
|
||||||
|
static $table = [
|
||||||
|
10 => 0.9
|
||||||
|
];
|
||||||
|
return $table[$personal] ?? 1;
|
||||||
|
}
|
||||||
|
|
||||||
function CharAtmos($atmos, $personal) {
|
function CharAtmos($atmos, $personal) {
|
||||||
switch($personal) {
|
switch($personal) {
|
||||||
case 2: case 4:
|
case 2: case 4:
|
||||||
@@ -2696,6 +2848,8 @@ function SabotageInjury($city, $type=0) {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
$log = [];
|
$log = [];
|
||||||
|
|
||||||
|
$injuryCount = 0;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$admin = $gameStor->getValues(['year', 'month']);
|
||||||
|
|
||||||
$query = "select no,name,nation from general where city='$city'";
|
$query = "select no,name,nation from general where city='$city'";
|
||||||
@@ -2717,8 +2871,11 @@ function SabotageInjury($city, $type=0) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
pushGenLog($general, $log);
|
pushGenLog($general, $log);
|
||||||
|
$injuryCount += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $injuryCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandTurn($term) {
|
function getRandTurn($term) {
|
||||||
|
|||||||
+9
-18
@@ -471,7 +471,7 @@ function processCommand($no) {
|
|||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
|
|
||||||
@@ -511,7 +511,7 @@ function processCommand($no) {
|
|||||||
case 27: process_27($general); break; //발령
|
case 27: process_27($general); break; //발령
|
||||||
case 51: process_51($general); break; //항복권고
|
case 51: process_51($general); break; //항복권고
|
||||||
case 52: process_52($general); break; //원조
|
case 52: process_52($general); break; //원조
|
||||||
case 53: process_53($general); break; //통합제의
|
//case 53: process_53($general); break; //통합제의
|
||||||
case 61: process_61($general); break; //불가침제의
|
case 61: process_61($general); break; //불가침제의
|
||||||
case 62: process_62($general); break; //선전 포고
|
case 62: process_62($general); break; //선전 포고
|
||||||
case 63: process_63($general); break; //종전 제의
|
case 63: process_63($general); break; //종전 제의
|
||||||
@@ -533,7 +533,7 @@ function processCommand($no) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//장수정보 재로드
|
//장수정보 재로드
|
||||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,affinity,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40,warnum,killnum,deathnum,killcrew,deathcrew,recwar from general where no='$no'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
}
|
}
|
||||||
@@ -628,7 +628,7 @@ function updateCommand($no, $type=0) {
|
|||||||
update general set
|
update general set
|
||||||
turn0=turn1,turn1=turn2,turn2=turn3,turn3=turn4,turn4=turn5,turn5=turn6,turn6=turn7,turn7=turn8,turn8=turn9,
|
turn0=turn1,turn1=turn2,turn2=turn3,turn3=turn4,turn4=turn5,turn5=turn6,turn6=turn7,turn7=turn8,turn8=turn9,
|
||||||
turn9=turn10,turn10=turn11,turn11=turn12,turn12=turn13,turn13=turn14,turn14=turn15,turn15=turn16,turn16=turn17,
|
turn9=turn10,turn10=turn11,turn11=turn12,turn12=turn13,turn13=turn14,turn14=turn15,turn15=turn16,turn16=turn17,
|
||||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='00000000000000'
|
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='".EncodeCommand(0, 0, 0, 0)."'
|
||||||
where no='{$general['no']}'
|
where no='{$general['no']}'
|
||||||
";
|
";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -642,7 +642,7 @@ update nation set
|
|||||||
{$turn}4={$turn}5,{$turn}5={$turn}6,
|
{$turn}4={$turn}5,{$turn}5={$turn}6,
|
||||||
{$turn}6={$turn}7,{$turn}7={$turn}8,
|
{$turn}6={$turn}7,{$turn}7={$turn}8,
|
||||||
{$turn}8={$turn}9,{$turn}9={$turn}10,
|
{$turn}8={$turn}9,{$turn}9={$turn}10,
|
||||||
{$turn}10={$turn}11,{$turn}11='00000000000099'
|
{$turn}10={$turn}11,{$turn}11='".EncodeCommand(0, 0, 0, 99)."'
|
||||||
where nation='{$general['nation']}'
|
where nation='{$general['nation']}'
|
||||||
";
|
";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -672,7 +672,7 @@ turn9=turn8,turn8=turn7,
|
|||||||
turn7=turn6,turn6=turn5,
|
turn7=turn6,turn6=turn5,
|
||||||
turn5=turn4,turn4=turn3,
|
turn5=turn4,turn4=turn3,
|
||||||
turn3=turn2,turn2=turn1,
|
turn3=turn2,turn2=turn1,
|
||||||
turn1=turn0,turn0='00000000000000'
|
turn1=turn0,turn0='".EncodeCommand(0, 0, 0, 0)."'
|
||||||
where no='$no'
|
where no='$no'
|
||||||
";
|
";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -685,7 +685,7 @@ update nation set
|
|||||||
{$turn}7={$turn}6,{$turn}6={$turn}5,
|
{$turn}7={$turn}6,{$turn}6={$turn}5,
|
||||||
{$turn}5={$turn}4,{$turn}4={$turn}3,
|
{$turn}5={$turn}4,{$turn}4={$turn}3,
|
||||||
{$turn}3={$turn}2,{$turn}2={$turn}1,
|
{$turn}3={$turn}2,{$turn}2={$turn}1,
|
||||||
{$turn}1={$turn}0,{$turn}0='00000000000099'
|
{$turn}1={$turn}0,{$turn}0='".EncodeCommand(0, 0, 0, 99)."'
|
||||||
where nation='{$general['nation']}'
|
where nation='{$general['nation']}'
|
||||||
";
|
";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -772,19 +772,10 @@ parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
|||||||
|
|
||||||
|
|
||||||
function EncodeCommand($fourth, $third, $double, $command) {
|
function EncodeCommand($fourth, $third, $double, $command) {
|
||||||
$str = StringUtil::padStringAlignRight((string)$fourth, 4, "0");
|
return Json::encode([$command, $double, $third, $fourth]);
|
||||||
$str .= StringUtil::padStringAlignRight((string)$third, 4, "0");
|
|
||||||
$str .= StringUtil::padStringAlignRight((string)$double, 4, "0");
|
|
||||||
$str .= StringUtil::padStringAlignRight((string)$command, 2, "0");
|
|
||||||
return $str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function DecodeCommand($str) {
|
function DecodeCommand($str) {
|
||||||
$command = [];
|
return Json::decode($str);
|
||||||
$command[3] = (int)(substr($str, 0, 4));
|
|
||||||
$command[2] = (int)(substr($str, 4, 4));
|
|
||||||
$command[1] = (int)(substr($str, 8, 4));
|
|
||||||
$command[0] = (int)(substr($str, 12, 2));
|
|
||||||
return $command;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+190
-280
@@ -8,42 +8,43 @@ namespace sammo;
|
|||||||
* Side effect 없이 값의 변환만을 수행하는 함수들의 모음.
|
* Side effect 없이 값의 변환만을 수행하는 함수들의 모음.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function NationCharCall($call) {
|
function NationCharCall($call) {
|
||||||
switch($call) {
|
static $invTable = [];
|
||||||
case '명가': $type =13; break;
|
if(!$invTable){
|
||||||
case '음양가': $type =12; break;
|
foreach(getNationTypeList() as $typeID => [$name, $pros, $cons]){
|
||||||
case '종횡가': $type =11; break;
|
$invTable[$name] = $typeID;
|
||||||
case '불가': $type =10; break;
|
}
|
||||||
case '도적': $type = 9; break;
|
|
||||||
case '오두미도':$type = 8; break;
|
|
||||||
case '태평도': $type = 7; break;
|
|
||||||
case '도가': $type = 6; break;
|
|
||||||
case '묵가': $type = 5; break;
|
|
||||||
case '덕가': $type = 4; break;
|
|
||||||
case '병가': $type = 3; break;
|
|
||||||
case '유가': $type = 2; break;
|
|
||||||
case '법가': $type = 1; break;
|
|
||||||
default: $type = 0; break;
|
|
||||||
}
|
}
|
||||||
return $type;
|
return $invTable[$call]??0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCharacterList(){
|
||||||
|
$infoText = [
|
||||||
|
9=>['안전', '사기 -5, 징·모병 비용 -20%'],
|
||||||
|
8=>['유지', '훈련 -5, 징·모병 비용 -20%'],
|
||||||
|
7=>['재간', '명성 -10%, 징·모병 비용 -20%'],
|
||||||
|
6=>['출세', '명성 +10%, 징·모병 비용 +20%'],
|
||||||
|
5=>['할거', '명성 -10%, 훈련 +5'],
|
||||||
|
4=>['정복', '명성 -10%, 사기 +5'],
|
||||||
|
3=>['패권', '훈련 +5, 징·모병 비용 +20%'],
|
||||||
|
2=>['의협', '사기 +5, 징·모병 비용 +20%'],
|
||||||
|
1=>['대의', '명성 +10%, 훈련 -5'],
|
||||||
|
0=>['왕좌', '명성 +10%, 사기 -5'],
|
||||||
|
10=>['은둔', '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%'],
|
||||||
|
];
|
||||||
|
return $infoText;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CharCall($call) {
|
function CharCall($call) {
|
||||||
switch($call) {
|
static $invTable = [];
|
||||||
case '은둔': $type =10; break;
|
if(\key_exists($call, $invTable)){
|
||||||
case '안전'; $type = 9; break;
|
return $invTable[$call];
|
||||||
case '유지'; $type = 8; break;
|
|
||||||
case '재간'; $type = 7; break;
|
|
||||||
case '출세'; $type = 6; break;
|
|
||||||
case '할거'; $type = 5; break;
|
|
||||||
case '정복'; $type = 4; break;
|
|
||||||
case '패권'; $type = 3; break;
|
|
||||||
case '의협'; $type = 2; break;
|
|
||||||
case '대의'; $type = 1; break;
|
|
||||||
case '왕좌'; $type = 0; break;
|
|
||||||
}
|
}
|
||||||
return $type;
|
|
||||||
|
foreach(getCharacterList() as $id => [$name, $info]){
|
||||||
|
$invTable[$name] = $id;
|
||||||
|
}
|
||||||
|
return $invTable[$call];
|
||||||
}
|
}
|
||||||
|
|
||||||
function SpecCall($call) {
|
function SpecCall($call) {
|
||||||
@@ -119,42 +120,14 @@ function getNationLevel($level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getGenChar($type) {
|
function getGenChar($type) {
|
||||||
switch($type) {
|
return getCharacterList()[$type][0];
|
||||||
case 10: $call = '은둔'; break;
|
|
||||||
case 9: $call = '안전'; break;
|
|
||||||
case 8: $call = '유지'; break;
|
|
||||||
case 7: $call = '재간'; break;
|
|
||||||
case 6: $call = '출세'; break;
|
|
||||||
case 5: $call = '할거'; break;
|
|
||||||
case 4: $call = '정복'; break;
|
|
||||||
case 3: $call = '패권'; break;
|
|
||||||
case 2: $call = '의협'; break;
|
|
||||||
case 1: $call = '대의'; break;
|
|
||||||
case 0: $call = '왕좌'; break;
|
|
||||||
}
|
|
||||||
return $call;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCharInfo(?int $type):?string {
|
function getCharInfo(?int $type):?string {
|
||||||
if($type === null){
|
if($type === null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return getCharacterList()[$type][1]??null;
|
||||||
$infoText = [
|
|
||||||
10=>['은둔', '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%'],
|
|
||||||
9=>['안전', '사기 -5, 징·모병 비용 -20%'],
|
|
||||||
8=>['유지', '훈련 -5, 징·모병 비용 -20%'],
|
|
||||||
7=>['재간', '명성 -10%, 징·모병 비용 -20%'],
|
|
||||||
6=>['출세', '명성 +10%, 징·모병 비용 +20%'],
|
|
||||||
5=>['할거', '명성 -10%, 훈련 +5'],
|
|
||||||
4=>['정복', '명성 -10%, 사기 +5'],
|
|
||||||
3=>['패권', '훈련 +5, 징·모병 비용 +20%'],
|
|
||||||
2=>['의협', '사기 +5, 징·모병 비용 +20%'],
|
|
||||||
1=>['대의', '명성 +10%, 훈련 -5'],
|
|
||||||
0=>['왕좌', '명성 +10%, 사기 -5'],
|
|
||||||
];
|
|
||||||
|
|
||||||
return $infoText[$type][1]??null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGenSpecial($type) {
|
function getGenSpecial($type) {
|
||||||
@@ -236,12 +209,12 @@ function getSpecialInfo(?int $type):?string{
|
|||||||
|
|
||||||
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
|
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
|
||||||
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
|
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
|
||||||
62 => ['견고', '[전투] 수비 시 대미지 +10%, 공격 시 아군 피해 -10%'],
|
62 => ['견고', '[전투] 상대 필살, 격노, 위압, 저격 불가, 상대 계략 시도시 성공 확률 -10%p, 부상 없음, 아군 피해 -5%'],
|
||||||
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
|
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
|
||||||
|
|
||||||
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
|
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
|
||||||
71 => ['필살', '[전투] 필살 확률 +20%p'],
|
71 => ['필살', '[전투] 필살 확률 +20%p'],
|
||||||
72 => ['징병', '[군사] 징·모병비 -50%'],
|
72 => ['징병', '[군사] 징·모병비 -50%, 통솔 순수 능력치 보정 +15%'],
|
||||||
73 => ['의술', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
73 => ['의술', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
|
||||||
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
|
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
|
||||||
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
|
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
|
||||||
@@ -250,24 +223,20 @@ function getSpecialInfo(?int $type):?string{
|
|||||||
return $infoText[$type][1]??null;
|
return $infoText[$type][1]??null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNationType($type) {
|
function getNationType(?int $type) {
|
||||||
switch($type) {
|
if($type === null){
|
||||||
case 13: $call = '명 가'; break;
|
return '-';
|
||||||
case 12: $call = '음 양 가'; break;
|
|
||||||
case 11: $call = '종 횡 가'; break;
|
|
||||||
case 10: $call = '불 가'; break;
|
|
||||||
case 9: $call = '도 적'; break;
|
|
||||||
case 8: $call = '오 두 미 도'; break;
|
|
||||||
case 7: $call = '태 평 도'; break;
|
|
||||||
case 6: $call = '도 가'; break;
|
|
||||||
case 5: $call = '묵 가'; break;
|
|
||||||
case 4: $call = '덕 가'; break;
|
|
||||||
case 3: $call = '병 가'; break;
|
|
||||||
case 2: $call = '유 가'; break;
|
|
||||||
case 1: $call = '법 가'; break;
|
|
||||||
case 0: $call = '-'; break;
|
|
||||||
}
|
}
|
||||||
return $call;
|
static $cache = [];
|
||||||
|
if(\key_exists($type, $cache)){
|
||||||
|
return $cache[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
$text = getNationTypeList()[$type][0]??'-';
|
||||||
|
$text = join(' ', StringUtil::splitString($text));
|
||||||
|
$cache[$type] = $text;
|
||||||
|
|
||||||
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -286,24 +255,12 @@ function getConnect($con) {
|
|||||||
return $conname;
|
return $conname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNationType2($type) {
|
function getNationType2(?int $type) {
|
||||||
switch($type) {
|
if($type === null){
|
||||||
case 13: $call = '<font color=cyan>기술↑ 인구↑</font> <font color=magenta>쌀수입↓ 수성↓</font>'; break;
|
return '-';
|
||||||
case 12: $call = '<font color=cyan>내정↑ 인구↑</font> <font color=magenta>기술↓ 전략↓</font>'; break;
|
|
||||||
case 11: $call = '<font color=cyan>전략↑ 수성↑</font> <font color=magenta>금수입↓ 내정↓</font>'; break;
|
|
||||||
case 10: $call = '<font color=cyan>민심↑ 수성↑</font> <font color=magenta>금수입↓</font>'; break;
|
|
||||||
case 9: $call = '<font color=cyan>계략↑</font> <font color=magenta>금수입↓ 치안↓ 민심↓</font>'; break;
|
|
||||||
case 8: $call = '<font color=cyan>쌀수입↑ 인구↑</font> <font color=magenta>기술↓ 수성↓ 내정↓</font>'; break;
|
|
||||||
case 7: $call = '<font color=cyan>인구↑ 민심↑</font> <font color=magenta>기술↓ 수성↓</font>'; break;
|
|
||||||
case 6: $call = '<font color=cyan>인구↑</font> <font color=magenta>기술↓ 치안↓</font>'; break;
|
|
||||||
case 5: $call = '<font color=cyan>수성↑</font> <font color=magenta>기술↓</font>'; break;
|
|
||||||
case 4: $call = '<font color=cyan>치안↑인구↑ 민심↑</font> <font color=magenta>쌀수입↓ 수성↓</font>'; break;
|
|
||||||
case 3: $call = '<font color=cyan>기술↑ 수성↑</font> <font color=magenta>인구↓ 민심↓</font>'; break;
|
|
||||||
case 2: $call = '<font color=cyan>내정↑ 민심↑</font> <font color=magenta>쌀수입↓</font>'; break;
|
|
||||||
case 1: $call = '<font color=cyan>금수입↑ 치안↑</font> <font color=magenta>인구↓ 민심↓</font>'; break;
|
|
||||||
case 0: $call = '-'; break;
|
|
||||||
}
|
}
|
||||||
return $call;
|
[$name, $pros, $cons] = getNationTypeList()[$type]??['-', '', ''];
|
||||||
|
return "<font color=cyan>{$pros}</font> <font color=magenta>{$cons}</font>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLevel($level, $nlevel=8) {
|
function getLevel($level, $nlevel=8) {
|
||||||
@@ -355,60 +312,46 @@ function getLevel($level, $nlevel=8) {
|
|||||||
|
|
||||||
function getCall($leader, $power, $intel) {
|
function getCall($leader, $power, $intel) {
|
||||||
$call = '평범';
|
$call = '평범';
|
||||||
if($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
|
||||||
$call = '만능';
|
if($leader < 40){
|
||||||
} elseif($leader >= GameConst::$chiefStatMin && $power >= GameConst::$chiefStatMin) {
|
if($power + $intel < 40){
|
||||||
$call = '용장';
|
return '아둔';
|
||||||
} elseif($leader >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
}
|
||||||
$call = '지장';
|
if($intel >= GameConst::$chiefStatMin && $power < $intel * 0.8){
|
||||||
} elseif($power >= GameConst::$chiefStatMin && $intel >= GameConst::$chiefStatMin) {
|
return '학자';
|
||||||
$call = '명장';
|
}
|
||||||
} elseif($leader >= GameConst::$chiefStatMin) {
|
if($power >= GameConst::$chiefStatMin && $intel < $power * 0.8){
|
||||||
$call = '명사';
|
return '장사';
|
||||||
} elseif($power >= GameConst::$chiefStatMin) {
|
}
|
||||||
$call = '용맹';
|
return '명사';
|
||||||
} elseif($intel >= GameConst::$chiefStatMin) {
|
|
||||||
$call = '현명';
|
|
||||||
}
|
}
|
||||||
return $call;
|
|
||||||
|
$maxStat = max($leader, $power, $intel);
|
||||||
|
$sum2Stat = min($leader+$power, $power+$intel, $intel+$leader);
|
||||||
|
if($maxStat >= GameConst::$chiefStatMin + GameConst::$statGradeLevel && $sum2Stat >= $maxStat * 1.7){
|
||||||
|
return '만능';
|
||||||
|
}
|
||||||
|
if($power >= GameConst::$chiefStatMin - GameConst::$statGradeLevel && $intel < $power * 0.8){
|
||||||
|
return '용장';
|
||||||
|
}
|
||||||
|
if($intel >= GameConst::$chiefStatMin - GameConst::$statGradeLevel && $power < $intel * 0.8){
|
||||||
|
return '명장';
|
||||||
|
}
|
||||||
|
if($leader >= GameConst::$chiefStatMin - GameConst::$statGradeLevel && $power + $intel < $leader){
|
||||||
|
return '차장';
|
||||||
|
}
|
||||||
|
return '평범';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDed($dedication) {
|
function getDed($dedication) {
|
||||||
if($dedication < 1 ) $level2 = '무품관';
|
$dedLevel = getDedLevel($dedication);
|
||||||
elseif($dedication < 10*10) $level2 = '30품관';
|
if($dedLevel == 0){
|
||||||
elseif($dedication < 20*20) $level2 = '29품관';
|
return '무품관';
|
||||||
elseif($dedication < 30*30) $level2 = '28품관';
|
|
||||||
elseif($dedication < 40*40) $level2 = '27품관';
|
|
||||||
elseif($dedication < 50*50) $level2 = '26품관';
|
|
||||||
elseif($dedication < 60*60) $level2 = '25품관';
|
|
||||||
elseif($dedication < 70*70) $level2 = '24품관';
|
|
||||||
elseif($dedication < 80*80) $level2 = '23품관';
|
|
||||||
elseif($dedication < 90*90) $level2 = '22품관';
|
|
||||||
elseif($dedication < 100*100) $level2 = '21품관';
|
|
||||||
elseif($dedication < 110*110) $level2 = '20품관';
|
|
||||||
elseif($dedication < 120*120) $level2 = '19품관';
|
|
||||||
elseif($dedication < 130*130) $level2 = '18품관';
|
|
||||||
elseif($dedication < 140*140) $level2 = '17품관';
|
|
||||||
elseif($dedication < 150*150) $level2 = '16품관';
|
|
||||||
elseif($dedication < 160*160) $level2 = '15품관';
|
|
||||||
elseif($dedication < 170*170) $level2 = '14품관';
|
|
||||||
elseif($dedication < 180*180) $level2 = '13품관';
|
|
||||||
elseif($dedication < 190*190) $level2 = '12품관';
|
|
||||||
elseif($dedication < 200*200) $level2 = '11품관'; // 40000
|
|
||||||
elseif($dedication < 210*210) $level2 = '10품관'; // 44100
|
|
||||||
elseif($dedication < 220*220) $level2 = '9품관'; // 48400
|
|
||||||
elseif($dedication < 230*230) $level2 = '8품관'; // 52900
|
|
||||||
elseif($dedication < 240*240) $level2 = '7품관'; // 57600
|
|
||||||
elseif($dedication < 250*250) $level2 = '6품관'; // 62500
|
|
||||||
elseif($dedication < 260*260) $level2 = '5품관'; // 67600
|
|
||||||
elseif($dedication < 270*270) $level2 = '4품관'; // 72900
|
|
||||||
elseif($dedication < 280*280) $level2 = '3품관'; // 78400
|
|
||||||
elseif($dedication < 290*290) $level2 = '2품관'; // 84100
|
|
||||||
else {
|
|
||||||
$level2 = '1품관';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $level2;
|
//{$maxDedLevel}품관 ~ 1품관
|
||||||
|
$dedInvLevel = GameConst::$maxDedLevel - $dedLevel + 1;
|
||||||
|
return "{$dedInvLevel}품관";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -435,16 +378,18 @@ function getExpLevel($experience) {
|
|||||||
if($experience < 1000) {
|
if($experience < 1000) {
|
||||||
$level = intdiv($experience, 100);
|
$level = intdiv($experience, 100);
|
||||||
} else {
|
} else {
|
||||||
for($level = 0; $experience > (($level+1)*($level+1)*10); $level++) {
|
$level = Util::toInt(sqrt($experience/10));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $level;
|
return $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDedLevel($dedication) {
|
function getDedLevel($dedication) {
|
||||||
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) {
|
$level = Util::valueFit(
|
||||||
}
|
ceil(sqrt($dedication) / 10),
|
||||||
|
0,
|
||||||
|
GameConst::$maxDedLevel
|
||||||
|
);
|
||||||
|
|
||||||
return $level;
|
return $level;
|
||||||
}
|
}
|
||||||
@@ -461,9 +406,7 @@ function getLevelPer($exp, $level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getBill(int $dedication) : int{
|
function getBill(int $dedication) : int{
|
||||||
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) {
|
$level = getDedLevel($dedication);
|
||||||
}
|
|
||||||
|
|
||||||
return ($level * 200 + 400);
|
return ($level * 200 + 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,142 +414,109 @@ function getCost(int $armtype) : int {
|
|||||||
return GameUnitConst::byID($armtype)->cost;
|
return GameUnitConst::byID($armtype)->cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
function TechLimit($startyear, $year, $tech) : int {
|
function getTechLevel($tech):int{
|
||||||
$limit = 0;
|
return Util::valueFit(
|
||||||
if($year < $startyear+ 5 && $tech >= 1000) { $limit = 1; }
|
floor($tech / 1000),
|
||||||
if($year < $startyear+10 && $tech >= 2000) { $limit = 1; }
|
0,
|
||||||
if($year < $startyear+15 && $tech >= 3000) { $limit = 1; }
|
GameConst::$maxTechLevel
|
||||||
if($year < $startyear+20 && $tech >= 4000) { $limit = 1; }
|
);
|
||||||
if($year < $startyear+25 && $tech >= 5000) { $limit = 1; }
|
}
|
||||||
if($year < $startyear+30 && $tech >= 6000) { $limit = 1; }
|
|
||||||
if($year < $startyear+35 && $tech >= 7000) { $limit = 1; }
|
function TechLimit($startYear, $year, $tech) : bool {
|
||||||
if($year < $startyear+40 && $tech >= 8000) { $limit = 1; }
|
|
||||||
if($year < $startyear+45 && $tech >= 9000) { $limit = 1; }
|
$relYear = $year - $startYear;
|
||||||
if($year < $startyear+50 && $tech >= 10000) { $limit = 1; }
|
|
||||||
if($year < $startyear+55 && $tech >= 11000) { $limit = 1; }
|
$relMaxTech = Util::valueFit(
|
||||||
if($year < $startyear+60 && $tech >= 12000) { $limit = 1; }
|
floor($relYear / 5) + 1,
|
||||||
return $limit;
|
1,
|
||||||
|
GameConst::$maxTechLevel
|
||||||
|
);
|
||||||
|
|
||||||
|
$techLevel = getTechLevel($tech);
|
||||||
|
|
||||||
|
return $techLevel >= $relMaxTech;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTechAbil($tech) : int{
|
function getTechAbil($tech) : int{
|
||||||
if($tech < 1000) { $abil = 0; }
|
return getTechLevel($tech) * 25;
|
||||||
elseif($tech < 2000) { $abil = 25; }
|
|
||||||
elseif($tech < 3000) { $abil = 50; }
|
|
||||||
elseif($tech < 4000) { $abil = 75; }
|
|
||||||
elseif($tech < 5000) { $abil = 100; }
|
|
||||||
elseif($tech < 6000) { $abil = 125; }
|
|
||||||
elseif($tech < 7000) { $abil = 150; }
|
|
||||||
elseif($tech < 8000) { $abil = 175; }
|
|
||||||
elseif($tech < 9000) { $abil = 200; }
|
|
||||||
elseif($tech < 10000) { $abil = 225; }
|
|
||||||
elseif($tech < 11000) { $abil = 250; }
|
|
||||||
elseif($tech < 12000) { $abil = 275; }
|
|
||||||
else { $abil = 300; }
|
|
||||||
return $abil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTechCost($tech) : float{
|
function getTechCost($tech) : float{
|
||||||
if($tech < 1000) { $cost = 1.00; }
|
return 1 + getTechLevel($tech) * 0.15;
|
||||||
elseif($tech < 2000) { $cost = 1.15; }
|
|
||||||
elseif($tech < 3000) { $cost = 1.30; }
|
|
||||||
elseif($tech < 4000) { $cost = 1.45; }
|
|
||||||
elseif($tech < 5000) { $cost = 1.60; }
|
|
||||||
elseif($tech < 6000) { $cost = 1.75; }
|
|
||||||
elseif($tech < 7000) { $cost = 1.90; }
|
|
||||||
elseif($tech < 8000) { $cost = 2.05; }
|
|
||||||
elseif($tech < 9000) { $cost = 2.20; }
|
|
||||||
elseif($tech < 10000) { $cost = 2.35; }
|
|
||||||
elseif($tech < 11000) { $cost = 2.50; }
|
|
||||||
elseif($tech < 12000) { $cost = 2.65; }
|
|
||||||
else { $cost = 2.80; }
|
|
||||||
return $cost;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTechCall($tech) : string {
|
function getTechCall($tech) : string {
|
||||||
if($tech < 1000) { $str = '0등급'; }
|
$techLevel = getTechLevel($tech);
|
||||||
elseif($tech < 2000) { $str = '1등급'; }
|
return "{$techLevel}등급";
|
||||||
elseif($tech < 3000) { $str = '2등급'; }
|
|
||||||
elseif($tech < 4000) { $str = '3등급'; }
|
|
||||||
elseif($tech < 5000) { $str = '4등급'; }
|
|
||||||
elseif($tech < 6000) { $str = '5등급'; }
|
|
||||||
elseif($tech < 7000) { $str = '6등급'; }
|
|
||||||
elseif($tech < 8000) { $str = '7등급'; }
|
|
||||||
elseif($tech < 9000) { $str = '8등급'; }
|
|
||||||
elseif($tech < 10000) { $str = '9등급'; }
|
|
||||||
elseif($tech < 11000) { $str = '10등급'; }
|
|
||||||
elseif($tech < 12000) { $str = '11등급'; }
|
|
||||||
else { $str = '12등급'; }
|
|
||||||
return $str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDexCall($dex) : string {
|
function getDexLevelList(): array{
|
||||||
if($dex < 2500) { $str = '<font color="navy">F-</font>'; }
|
return [
|
||||||
elseif($dex < 7500) { $str = '<font color="navy">F</font>'; }
|
[0, 'navy', 'F-'],
|
||||||
elseif($dex < 15000) { $str = '<font color="navy">F+</font>'; }
|
[2500, 'navy', 'F'],
|
||||||
elseif($dex < 25000) { $str = '<font color="skyblue">E-</font>'; }
|
[7500, 'navy', 'F+'],
|
||||||
elseif($dex < 37500) { $str = '<font color="skyblue">E</font>'; }
|
[15000, 'skyblue', 'E-'],
|
||||||
elseif($dex < 52500) { $str = '<font color="skyblue">E+</font>'; }
|
[25000, 'skyblue', 'E'],
|
||||||
elseif($dex < 70000) { $str = '<font color="seagreen">D-</font>'; }
|
[37500, 'skyblue', 'E+'],
|
||||||
elseif($dex < 90000) { $str = '<font color="seagreen">D</font>'; }
|
[52500, 'seagreen', 'D-'],
|
||||||
elseif($dex < 112500) { $str = '<font color="seagreen">D+</font>'; }
|
[70000, 'seagreen', 'D'],
|
||||||
elseif($dex < 137500) { $str = '<font color="teal">C-</font>'; }
|
[90000, 'seagreen', 'D+'],
|
||||||
elseif($dex < 165000) { $str = '<font color="teal">C</font>'; }
|
[112500, 'teal', 'C-'],
|
||||||
elseif($dex < 195000) { $str = '<font color="teal">C+</font>'; }
|
[137500, 'teal', 'C'],
|
||||||
elseif($dex < 227500) { $str = '<font color="limegreen">B-</font>'; }
|
[165000, 'teal', 'C+'],
|
||||||
elseif($dex < 262500) { $str = '<font color="limegreen">B</font>'; }
|
[195000, 'limegreen', 'B-'],
|
||||||
elseif($dex < 300000) { $str = '<font color="limegreen">B+</font>'; }
|
[227500, 'limegreen', 'B'],
|
||||||
elseif($dex < 340000) { $str = '<font color="gold">A-</font>'; }
|
[262500, 'limegreen', 'B+'],
|
||||||
elseif($dex < 382500) { $str = '<font color="gold">A</font>'; }
|
[300000, 'gold', 'A-'],
|
||||||
elseif($dex < 427500) { $str = '<font color="gold">A+</font>'; }
|
[340000, 'gold', 'A'],
|
||||||
elseif($dex < 475000) { $str = '<font color="darkorange">S-</font>'; }
|
[382500, 'gold', 'A+'],
|
||||||
elseif($dex < 525000) { $str = '<font color="darkorange">S</font>'; }
|
[427500, 'darkorange', 'S-'],
|
||||||
elseif($dex < 577500) { $str = '<font color="darkorange">S+</font>'; }
|
[475000, 'darkorange', 'S'],
|
||||||
elseif($dex < 632500) { $str = '<font color="tomato">SS-</font>'; }
|
[525000, 'darkorange', 'S+'],
|
||||||
elseif($dex < 690000) { $str = '<font color="tomato">SS</font>'; }
|
[577500, 'tomato', 'SS-'],
|
||||||
elseif($dex < 750000) { $str = '<font color="tomato">SS+</font>'; }
|
[632500, 'tomato', 'SS'],
|
||||||
elseif($dex < 812500) { $str = '<font color="red">SSS-</font>'; }
|
[690000, 'tomato', 'SS+'],
|
||||||
elseif($dex < 877500) { $str = '<font color="red">SSS</font>'; }
|
[750000, 'red', 'SSS-'],
|
||||||
elseif($dex < 945000) { $str = '<font color="red">SSS+</font>'; }
|
[812500, 'red', 'SSS'],
|
||||||
elseif($dex < 1015000) { $str = '<font color="darkviolet">Z-</font>'; }
|
[877500, 'red', 'SSS+'],
|
||||||
elseif($dex < 1087500) { $str = '<font color="darkviolet">Z</font>'; }
|
[945000, 'darkviolet', 'Z-'],
|
||||||
elseif($dex < 1162500) { $str = '<font color="darkviolet">Z+</font>'; }
|
[1015000, 'darkviolet', 'Z'],
|
||||||
else { $str = '<font color="white">?</font>'; }
|
[1087500, 'darkviolet', 'Z+'],
|
||||||
return $str;
|
[1162500, 'white', '?']
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDexLevel($dex) : int {
|
function getDexCall(int $dex) : string {
|
||||||
if($dex < 2500) { $lvl = 0; }
|
if($dex < 0){
|
||||||
elseif($dex < 7500) { $lvl = 1; }
|
throw new \InvalidArgumentException();
|
||||||
elseif($dex < 15000) { $lvl = 2; }
|
}
|
||||||
elseif($dex < 25000) { $lvl = 3; }
|
|
||||||
elseif($dex < 37500) { $lvl = 4; }
|
$color = null;
|
||||||
elseif($dex < 52500) { $lvl = 5; }
|
$name = null;
|
||||||
elseif($dex < 70000) { $lvl = 6; }
|
foreach(getDexLevelList() as $dexLevel => [$dexKey, $nextColor, $nextName]){
|
||||||
elseif($dex < 90000) { $lvl = 7; }
|
if($dex < $dexKey){
|
||||||
elseif($dex < 112500) { $lvl = 8; }
|
break;
|
||||||
elseif($dex < 137500) { $lvl = 9; }
|
}
|
||||||
elseif($dex < 165000) { $lvl = 10; }
|
$color = $nextColor;
|
||||||
elseif($dex < 195000) { $lvl = 11; }
|
$name = $nextName;
|
||||||
elseif($dex < 227500) { $lvl = 12; }
|
}
|
||||||
elseif($dex < 262500) { $lvl = 13; }
|
|
||||||
elseif($dex < 300000) { $lvl = 14; }
|
return "<font color='{$color}'>{$name}</font>";
|
||||||
elseif($dex < 340000) { $lvl = 15; }
|
}
|
||||||
elseif($dex < 382500) { $lvl = 16; }
|
|
||||||
elseif($dex < 427500) { $lvl = 17; }
|
function getDexLevel(int $dex) : int {
|
||||||
elseif($dex < 475000) { $lvl = 18; }
|
if($dex < 0){
|
||||||
elseif($dex < 525000) { $lvl = 19; }
|
throw new \InvalidArgumentException();
|
||||||
elseif($dex < 577500) { $lvl = 20; }
|
}
|
||||||
elseif($dex < 632500) { $lvl = 21; }
|
|
||||||
elseif($dex < 690000) { $lvl = 22; }
|
$retVal = null;
|
||||||
elseif($dex < 750000) { $lvl = 23; }
|
foreach(getDexLevelList() as $dexLevel => [$dexKey, $nextColor, $nextName]){
|
||||||
elseif($dex < 812500) { $lvl = 24; }
|
if($dex < $dexKey){
|
||||||
elseif($dex < 877500) { $lvl = 25; }
|
break;
|
||||||
elseif($dex < 945000) { $lvl = 26; }
|
}
|
||||||
elseif($dex < 1015000) { $lvl = 27; }
|
$retVal = $dexLevel;
|
||||||
elseif($dex < 1087500) { $lvl = 28; }
|
}
|
||||||
elseif($dex < 1162500) { $lvl = 29; }
|
return $dexLevel;
|
||||||
else { $lvl = 30; }
|
|
||||||
return $lvl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDexLog($dex1, $dex2) {
|
function getDexLog($dex1, $dex2) {
|
||||||
@@ -615,7 +525,7 @@ function getDexLog($dex1, $dex2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getWeapName($weap) : string {
|
function getWeapName($weap) : ?string {
|
||||||
switch($weap) {
|
switch($weap) {
|
||||||
case 0: $weapname = '-'; break;
|
case 0: $weapname = '-'; break;
|
||||||
case 1: $weapname = '단도(+1)'; break;
|
case 1: $weapname = '단도(+1)'; break;
|
||||||
@@ -649,7 +559,7 @@ function getWeapName($weap) : string {
|
|||||||
return $weapname;
|
return $weapname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWeapEff($weap) : int{
|
function getWeapEff($weap) : ?int{
|
||||||
switch($weap) {
|
switch($weap) {
|
||||||
case 7: $weap = 7; break;
|
case 7: $weap = 7; break;
|
||||||
case 8: $weap = 7; break;
|
case 8: $weap = 7; break;
|
||||||
@@ -676,7 +586,7 @@ function getWeapEff($weap) : int{
|
|||||||
return $weap;
|
return $weap;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBookName($book) : string {
|
function getBookName($book) : ?string {
|
||||||
switch($book) {
|
switch($book) {
|
||||||
case 0: $bookname = '-'; break;
|
case 0: $bookname = '-'; break;
|
||||||
case 1: $bookname = '효경전(+1)'; break;
|
case 1: $bookname = '효경전(+1)'; break;
|
||||||
@@ -710,7 +620,7 @@ function getBookName($book) : string {
|
|||||||
return $bookname;
|
return $bookname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBookEff($book) : int {
|
function getBookEff($book) : ?int {
|
||||||
switch($book) {
|
switch($book) {
|
||||||
case 7: $book = 7; break;
|
case 7: $book = 7; break;
|
||||||
case 8: $book = 7; break;
|
case 8: $book = 7; break;
|
||||||
@@ -737,7 +647,7 @@ function getBookEff($book) : int {
|
|||||||
return $book;
|
return $book;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHorseName($horse) : string {
|
function getHorseName($horse) : ?string {
|
||||||
switch($horse) {
|
switch($horse) {
|
||||||
case 0: $horsename = '-'; break;
|
case 0: $horsename = '-'; break;
|
||||||
case 1: $horsename = '노기(+1)'; break;
|
case 1: $horsename = '노기(+1)'; break;
|
||||||
@@ -771,7 +681,7 @@ function getHorseName($horse) : string {
|
|||||||
return $horsename;
|
return $horsename;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHorseEff($horse) : int {
|
function getHorseEff($horse) : ?int {
|
||||||
switch($horse) {
|
switch($horse) {
|
||||||
case 7: $horse = 7; break;
|
case 7: $horse = 7; break;
|
||||||
case 8: $horse = 7; break;
|
case 8: $horse = 7; break;
|
||||||
|
|||||||
+135
-40
@@ -5,6 +5,51 @@ namespace sammo;
|
|||||||
* 게임 룰에 해당하는 함수 모음
|
* 게임 룰에 해당하는 함수 모음
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function getNationLevelList():array{
|
||||||
|
$table = [
|
||||||
|
0 => ['방랑군', 2, 0],
|
||||||
|
1 => ['호족', 2, 1],
|
||||||
|
2 => ['군벌', 4, 2],
|
||||||
|
3 => ['주자사', 4, 5],
|
||||||
|
4 => ['주목', 6, 8],
|
||||||
|
5 => ['공', 6, 11],
|
||||||
|
6 => ['왕', 8, 16],
|
||||||
|
7 => ['황제', 8, 21],
|
||||||
|
];
|
||||||
|
return $table;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNationTypeList():array{
|
||||||
|
$table = [
|
||||||
|
13=>['명가', '기술↑ 인구↑', '쌀수입↓ 수성↓'],
|
||||||
|
12=>['음양가', '내정↑ 인구↑', '기술↓ 전략↓'],
|
||||||
|
11=>['종횡가', '전략↑ 수성↑', '금수입↓ 내정↓'],
|
||||||
|
10=>['불가', '민심↑ 수성↑', '금수입↓'],
|
||||||
|
9=>['도적', '계략↑', '금수입↓ 치안↓ 민심↓'],
|
||||||
|
8=>['오두미도', '쌀수입↑ 인구↑', '기술↓ 수성↓ 내정↓'],
|
||||||
|
7=>['태평도', '인구↑ 민심↑', '기술↓ 수성↓'],
|
||||||
|
6=>['도가', '인구↑', '기술↓ 치안↓'],
|
||||||
|
5=>['묵가', '수성↑', '기술↓'],
|
||||||
|
4=>['덕가', '치안↑인구↑ 민심↑', '쌀수입↓ 수성↓'],
|
||||||
|
3=>['병가', '기술↑ 수성↑', '인구↓ 민심↓'],
|
||||||
|
2=>['유가', '내정↑ 민심↑', '쌀수입↓'],
|
||||||
|
1=>['법가', '금수입↑ 치안↑', '인구↓ 민심↓'],
|
||||||
|
];
|
||||||
|
return $table;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCityLevelList():array{
|
||||||
|
return [
|
||||||
|
1 => '수',
|
||||||
|
2 => '진',
|
||||||
|
3 => '관',
|
||||||
|
4 => '이',
|
||||||
|
5 => '소',
|
||||||
|
6 => '중',
|
||||||
|
7 => '대',
|
||||||
|
8 => '특'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 게임 내부에 사용하는 유틸리티 함수들을 분리
|
* 게임 내부에 사용하는 유틸리티 함수들을 분리
|
||||||
@@ -115,22 +160,37 @@ function getSpecial2($leader, $power, $intel, $nodex=1, $dex0=0, $dex10=0, $dex2
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getGenDex($general, $type) {
|
function getGenDex($general, $type) {
|
||||||
$type = intdiv($type, 10) * 10;
|
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||||
return $general["dex{$type}"];
|
$ntype = GameUnitConst::byId($type)->armType * 10;
|
||||||
|
return $general["dex{$ntype}"]??0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addGenDex($no, $atmos, $train, $type, $exp) {
|
function addGenDex($no, $atmos, $train, $type, $exp) {
|
||||||
|
//XXX: 지금은 동작하지만.. 병종 구성이 보궁기귀차 에서 바뀌면...
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$type = intdiv($type, 10) * 10;
|
$armType = GameUnitConst::byId($type)->armType;
|
||||||
$dexType = "dex{$type}";
|
if($armType == GameUnitConst::T_CASTLE){
|
||||||
if($type == 30) { $exp = Util::round($exp * 0.90); } //귀병은 90%효율
|
$armType = GameUnitConst::T_SIEGE;
|
||||||
elseif($type == 40) { $exp = Util::round($exp * 0.90); } //차병은 90%효율
|
}
|
||||||
$exp = Util::round($exp * ($atmos+$train) / 200); // 사기 + 훈련 / 200
|
|
||||||
|
|
||||||
$query = "update general set {$dexType}={$dexType}+{$exp} where no='$no'";
|
if($armType < 0){
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ntype = $armType*10;
|
||||||
|
$dexType = "dex{$ntype}";
|
||||||
|
if($armType == GameUnitConst::T_WIZARD) {
|
||||||
|
$exp = Util::round($exp * 0.90);
|
||||||
|
}
|
||||||
|
else if($armType == GameUnitConst::T_SIEGE) {
|
||||||
|
$exp = Util::round($exp * 0.90);
|
||||||
|
}
|
||||||
|
$exp = Util::round($exp * ($atmos + $train) / 200); // 사기 + 훈련 / 200
|
||||||
|
|
||||||
|
$db->update('general', [
|
||||||
|
$dexType=>$db->sqleval('%b + %i', $dexType, $exp)
|
||||||
|
], 'no=%i', $no);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -169,7 +229,7 @@ function SetNationFront($nationNo) {
|
|||||||
|
|
||||||
if($adj){
|
if($adj){
|
||||||
$db->update('city', [
|
$db->update('city', [
|
||||||
'front'=>1
|
'front'=>($enemyCities?1:2),
|
||||||
], 'nation=%i and city in %li', $nationNo, array_keys($adj));
|
], 'nation=%i and city in %li', $nationNo, array_keys($adj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,27 +374,6 @@ function preUpdateMonthly() {
|
|||||||
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='{}',term=0,front=0 where rate<='30' and supply='0'";
|
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='{}',term=0,front=0 where rate<='30' and supply='0'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// 우선 병사수/100 만큼 소비
|
|
||||||
$query = "update general set rice=rice-round(crew/100) where crew>=100";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
// 쌀이 마이너스인 장수들 소집해제
|
|
||||||
$query = "select no,name,rice,crew,city from general where rice<0";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($result);
|
|
||||||
for($i=0; $i < $gencount; $i++) {
|
|
||||||
$general = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
// 주민으로 돌아감
|
|
||||||
$query = "update city set pop=pop+'{$general['crew']}' where city='{$general['city']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$query = "update general set crew=0,rice=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
pushGenLog($general, ["<C>●</>군량이 모자라 병사들이 <R>소집해제</>되었습니다!"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
//접률감소
|
//접률감소
|
||||||
$query = "update general set connect=floor(connect*0.99)";
|
$query = "update general set connect=floor(connect*0.99)";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -523,11 +562,14 @@ function postUpdateMonthly() {
|
|||||||
$genCount = $genNum[$dip['me']];
|
$genCount = $genNum[$dip['me']];
|
||||||
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
||||||
// 4000 / 10 * 0.25 = 100
|
// 4000 / 10 * 0.25 = 100
|
||||||
$term = Util::round($dip['dead'] / 100 / $genCount) + 1;
|
$term = floor($dip['dead'] / 100 / $genCount);
|
||||||
if($dip['term'] > $term) { $term = $dip['term']; }
|
$dip['dead'] -= $term * 100 * $genCount;
|
||||||
if($term > 13) { $term = 13; }
|
$term = Util::valueFit($dip['term'] + $term, 0, 13);
|
||||||
$query = "update diplomacy set term='{$term}' where (me='{$dip['me']}' and you='{$dip['you']}')";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->update('diplomacy', [
|
||||||
|
'term' => $term,
|
||||||
|
'dead'=> $dip['dead'],
|
||||||
|
], 'me = %i AND you = %i', $dip['me'], $dip['you']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//개전국 로그
|
//개전국 로그
|
||||||
@@ -570,7 +612,7 @@ function postUpdateMonthly() {
|
|||||||
}
|
}
|
||||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||||
//사상자 초기화
|
//사상자 초기화
|
||||||
$query = "update diplomacy set dead=0";
|
$query = "update diplomacy set dead=0 WHERE state != 0";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
//외교 기한-1
|
//외교 기한-1
|
||||||
$query = "update diplomacy set term=term-1 where term!=0";
|
$query = "update diplomacy set term=term-1 where term!=0";
|
||||||
@@ -921,9 +963,9 @@ function updateNationState() {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$history = array();
|
$history = array();
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm']);
|
||||||
|
|
||||||
$query = "select nation,name,level from nation";
|
$query = "select nation,name,level,gennum,tech from nation";
|
||||||
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$nationcount = MYDB_num_rows($nationresult);
|
$nationcount = MYDB_num_rows($nationresult);
|
||||||
|
|
||||||
@@ -957,6 +999,7 @@ function updateNationState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($nationlevel > $nation['level']) {
|
if($nationlevel > $nation['level']) {
|
||||||
|
$oldLevel = $nation['level'];
|
||||||
$nation['level'] = $nationlevel;
|
$nation['level'] = $nationlevel;
|
||||||
|
|
||||||
switch($nationlevel) {
|
switch($nationlevel) {
|
||||||
@@ -981,6 +1024,54 @@ function updateNationState() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$lastAssemblerID = $gameStor->assembler_id??0;
|
||||||
|
for($levelGen = max(1, $oldLevel) + 1; $levelGen <= $nationlevel; $levelGen+=1){
|
||||||
|
if(in_array($levelGen, [3, 5, 7])){
|
||||||
|
$genStep = 2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$genStep = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
while($genStep > 0){
|
||||||
|
$lastAssemblerID += 1;
|
||||||
|
$npcObj = new Scenario\NPC(
|
||||||
|
999, '부대장'.$lastAssemblerID, null, $nation['nation'], null,
|
||||||
|
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '척사'
|
||||||
|
);
|
||||||
|
$npcObj->npc = 5;
|
||||||
|
$npcObj->build($admin);
|
||||||
|
$npcID = $npcObj->generalID;
|
||||||
|
|
||||||
|
$db->insert('troop', [
|
||||||
|
'name'=>$npcObj->realName,
|
||||||
|
'nation'=>$nation['nation'],
|
||||||
|
'no'=>$npcID
|
||||||
|
]);
|
||||||
|
$troopID = $db->insertId();
|
||||||
|
|
||||||
|
$db->update('nation', [
|
||||||
|
'gennum'=>$nation['gennum']+1,
|
||||||
|
'totaltech'=>Util::valueFit($nation['gennum']+1, GameConst::$initialNationGenLimit) * $nation['tech'],
|
||||||
|
], 'nation=%i', $nation['nation']);
|
||||||
|
|
||||||
|
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||||
|
$db->update('general', [
|
||||||
|
'troop'=>$troopID,
|
||||||
|
'turn0'=>$command,
|
||||||
|
'turn1'=>$command,
|
||||||
|
'turn2'=>$command,
|
||||||
|
'turn3'=>$command,
|
||||||
|
'turn4'=>$command,
|
||||||
|
'turn5'=>$command,
|
||||||
|
'killturn'=>80
|
||||||
|
], 'no=%i', $npcID);
|
||||||
|
$genStep -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$gameStor->assembler_id = $lastAssemblerID;
|
||||||
|
|
||||||
//작위 상승
|
//작위 상승
|
||||||
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -1391,6 +1482,10 @@ function checkEmperior() {
|
|||||||
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
||||||
$serverName = UniqueConst::$serverName;
|
$serverName = UniqueConst::$serverName;
|
||||||
|
|
||||||
|
$db->update('ng_games', [
|
||||||
|
'winner_nation'=>$nation['nation']
|
||||||
|
], 'server_id=%s', UniqueConst::$serverID);
|
||||||
|
|
||||||
$db->insert('emperior', [
|
$db->insert('emperior', [
|
||||||
'phase'=>$serverName.$serverCnt.'기',
|
'phase'=>$serverName.$serverCnt.'기',
|
||||||
'server_id'=>UniqueConst::$serverID,
|
'server_id'=>UniqueConst::$serverID,
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ function getWorldMap($req){
|
|||||||
|
|
||||||
$session = Session::getInstance();
|
$session = Session::getInstance();
|
||||||
$userID = $session->userID;
|
$userID = $session->userID;
|
||||||
|
$userGrade = $session->userGrade;
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
@@ -146,6 +147,13 @@ function getWorldMap($req){
|
|||||||
array_map('\\sammo\\Util::toInt', [$r['city'], $r['level'], $r['state'], $r['nation'], $r['region'], $r['supply']]);
|
array_map('\\sammo\\Util::toInt', [$r['city'], $r['level'], $r['state'], $r['nation'], $r['region'], $r['supply']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($req->showMe || !$req->neutralView) && $userGrade >= 5){
|
||||||
|
$spyInfo = [];
|
||||||
|
foreach($cityList as $tmpCity){
|
||||||
|
$spyInfo[$tmpCity[0]] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'startYear' => $startYear,
|
'startYear' => $startYear,
|
||||||
'year' => $year,
|
'year' => $year,
|
||||||
|
|||||||
+143
-94
@@ -80,10 +80,22 @@ function SetDevelop($genType, $no, $city, $tech) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
$cities = [];
|
||||||
|
$regions = [];
|
||||||
|
|
||||||
|
foreach($db->queryAllLists('SELECT city, region FROM city WHERE nation = %i', $nationID) as [$cityID, $regionID]){
|
||||||
|
$cities[$cityID] = true;
|
||||||
|
$regions[$regionID] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
|
||||||
|
$relYear = Util::valueFit($year-$startyear, 0);
|
||||||
|
|
||||||
$type = 0;
|
$type = 0;
|
||||||
switch($genType) {
|
switch($genType) {
|
||||||
case 0: //무장
|
case 0: //무장
|
||||||
@@ -107,48 +119,52 @@ function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$types = [];
|
||||||
switch($sel) {
|
switch($sel) {
|
||||||
case 0:
|
case 0:
|
||||||
$type = 0; //보병
|
foreach(GameUnitConst::byType(GameUnitConst::T_FOOTMAN) as $crewtype){
|
||||||
if($tech >= 3000 && $city == 3) { $type = 4; } //근위병
|
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||||
elseif($tech >= 2000 && $city == 64) { $type = 3; } //자객병
|
$types[] = $crewtype->id;
|
||||||
elseif($tech >= 1000 && $region == 2) { $type = 1; } //청주병
|
}
|
||||||
elseif($tech >= 1000 && $region == 5) { $type = 5; } //등갑병
|
}
|
||||||
elseif($tech >= 1000 && $region == 7) { $type = 2; } //수병
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$type = 10; //궁병
|
foreach(GameUnitConst::byType(GameUnitConst::T_ARCHER) as $crewtype){
|
||||||
if($tech >= 3000 && $city == 7) { $type = 14; } //석궁병
|
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||||
elseif($tech >= 3000 && $city == 6) { $type = 13; } //강궁병
|
$types[] = $crewtype->id;
|
||||||
elseif($tech >= 1000 && $region == 4) { $type = 12; } //연노병
|
}
|
||||||
elseif($tech >= 1000 && $region == 8) { $type = 11; } //궁기병
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$type = 20; //기병
|
foreach(GameUnitConst::byType(GameUnitConst::T_CAVALRY) as $crewtype){
|
||||||
if($tech >= 3000 && $city == 2) { $type = 27; } //호표기병
|
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||||
elseif($tech >= 2000 && $city == 63) { $type = 24; } //철기병
|
$types[] = $crewtype->id;
|
||||||
elseif($tech >= 2000 && $city == 67) { $type = 25; } //수렵기병
|
}
|
||||||
elseif($tech >= 2000 && $city == 65) { $type = 23; } //돌격기병
|
}
|
||||||
elseif($tech >= 2000 && $city == 66) { $type = 26; } //맹수병
|
|
||||||
elseif($tech >= 1000 && $region == 1) { $type = 21; } //백마병
|
|
||||||
elseif($tech >= 1000 && $region == 3) { $type = 22; } //중장기병
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: //지장
|
case 1: //지장
|
||||||
case 3: //지내정장
|
case 3: //지내정장
|
||||||
$type = 30; //귀병
|
foreach(GameUnitConst::byType(GameUnitConst::T_WIZARD) as $crewtype){
|
||||||
if($tech >= 3000 && $city == 4) { $type = 34; } //악귀병
|
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
|
||||||
elseif($tech >= 3000 && $city == 5) { $type = 37; } //천귀병
|
$types[] = $crewtype->id;
|
||||||
elseif($tech >= 3000 && $city == 1) { $type = 38; } //마귀병
|
}
|
||||||
elseif($tech >= 2000 && $city == 69) { $type = 33; } //흑귀병
|
}
|
||||||
elseif($tech >= 2000 && $city == 68) { $type = 32; } //백귀병
|
|
||||||
elseif($tech >= 1000 && $region == 6) { $type = 31; } //신귀병
|
|
||||||
elseif($tech >= 3000 && $city == 3) { $type = 36; } //황귀병
|
|
||||||
elseif($tech >= 1000 && rand()%100 < 50) { $type = 35; } //남귀병
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($types){
|
||||||
|
$type = Util::choiceRandom($types);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$type = GameUnitConst::DEFAULT_CREWTYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$gold -= 200; // 사기비용
|
$gold -= 200; // 사기비용
|
||||||
|
|
||||||
$cost = getCost($type) * getTechCost($tech);
|
$cost = getCost($type) * getTechCost($tech);
|
||||||
@@ -176,12 +192,36 @@ function processAI($no) {
|
|||||||
$isStart = 0;
|
$isStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,troop,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI01 ".MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error("processAI01 ".MYDB_error($connect),"");
|
||||||
$general = MYDB_fetch_array($result);
|
$general = MYDB_fetch_array($result);
|
||||||
|
|
||||||
|
if($general['npc'] == 5){
|
||||||
|
if($general['nation'] == 0 && $general['killturn'] > 1){
|
||||||
|
$command = EncodeCommand(0, 0, 0, 0); //휴식
|
||||||
|
$db->update('general', [
|
||||||
|
'turn0'=>$command,
|
||||||
|
'killturn'=>1
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||||
|
$db->update('general', [
|
||||||
|
'turn0'=>$command,
|
||||||
|
'turn1'=>$command,
|
||||||
|
'turn2'=>$command,
|
||||||
|
'turn3'=>$command,
|
||||||
|
'turn4'=>$command,
|
||||||
|
'turn5'=>$command,
|
||||||
|
'killturn'=>rand(70,75),
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 입력된 턴이 있으면 그것 실행
|
// 입력된 턴이 있으면 그것 실행
|
||||||
if($general['turn0'] != "00000000000000") {
|
if(DecodeCommand($general['turn0'])[0] != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,12 +248,9 @@ function processAI($no) {
|
|||||||
$coreCommand = MYDB_fetch_array($result);
|
$coreCommand = MYDB_fetch_array($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$attackable = 0;
|
$cityCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND supply=1 AND front>0', $general['nation']);
|
||||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1";
|
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
|
||||||
$cityCount = MYDB_num_rows($result);
|
|
||||||
// 공격가능도시 있으면 1
|
// 공격가능도시 있으면 1
|
||||||
if($cityCount > 0) { $attackable = 1; }
|
$attackable = $cityCount > 0;
|
||||||
|
|
||||||
$dipState = 0;
|
$dipState = 0;
|
||||||
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term>8";
|
$query = "select no from diplomacy where me='{$general['nation']}' and state=1 and term>8";
|
||||||
@@ -307,10 +344,10 @@ function processAI($no) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//재야인경우
|
//재야인경우
|
||||||
if($general['npc'] == 5 && $general['level'] == 0) {
|
if($general['npc'] == 9 && $general['level'] == 0) {
|
||||||
// 오랑캐는 바로 임관
|
// 오랑캐는 바로 임관
|
||||||
|
|
||||||
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=5 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
|
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
|
||||||
|
|
||||||
if($ruler) {
|
if($ruler) {
|
||||||
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
|
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
|
||||||
@@ -320,7 +357,7 @@ function processAI($no) {
|
|||||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||||
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
|
||||||
return;
|
return;
|
||||||
} elseif($general['npc'] < 5 && $general['level'] == 0) {
|
} elseif($general['npc'] != 9 && $general['level'] == 0) {
|
||||||
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
|
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
|
||||||
//임관 10%
|
//임관 10%
|
||||||
case 0:
|
case 0:
|
||||||
@@ -377,7 +414,7 @@ function processAI($no) {
|
|||||||
//군주가 할일
|
//군주가 할일
|
||||||
if($general['level'] == 12) {
|
if($general['level'] == 12) {
|
||||||
//오랑캐인데 공격 못하면 바로 방랑/해산
|
//오랑캐인데 공격 못하면 바로 방랑/해산
|
||||||
if($general['npc'] == 5 && $dipState == 0 && $attackable == 0) {
|
if($general['npc'] == 9 && $dipState == 0 && !$attackable) {
|
||||||
//방랑군이냐 아니냐
|
//방랑군이냐 아니냐
|
||||||
if($nation['level'] == 0) {
|
if($nation['level'] == 0) {
|
||||||
// 해산
|
// 해산
|
||||||
@@ -443,37 +480,44 @@ function processAI($no) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//외교 평시에 선포
|
//외교 평시에 선포
|
||||||
if($dipState == 0 && $attackable == 0) {
|
|
||||||
//전방 체크 먼저
|
do{
|
||||||
|
if($dipState != 0){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if($attackable){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
SetNationFront($nation['nation']);
|
SetNationFront($nation['nation']);
|
||||||
|
|
||||||
$query = "select city from city where nation='{$general['nation']}' and front=1 limit 0,1";
|
$frontCount = $db->queryFirstField('SELECT count(city) FROM city WHERE nation=%i AND front>0', $general['nation']);
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
|
if($frontCount > 0){
|
||||||
$frontCount = MYDB_num_rows($result);
|
break;
|
||||||
//근접 공백지 없을때
|
|
||||||
if($frontCount == 0) {
|
|
||||||
$query = "select (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2))*100 as dev from city where nation='{$general['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$devRate = MYDB_fetch_array($result);
|
|
||||||
//내정이 80% 이상일때
|
|
||||||
if($devRate['dev'] > 80) {
|
|
||||||
$query = "select nation from nation where level>0 order by rand()";
|
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
|
||||||
$nationCount = MYDB_num_rows($result);
|
|
||||||
for($i=0; $i < $nationCount; $i++) {
|
|
||||||
$youNation = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if(isNeighbor($general['nation'], $youNation['nation'])) {
|
|
||||||
$command = EncodeCommand(0, 0, $youNation['nation'], 62);
|
|
||||||
$query = "update nation set l12turn0='$command' where nation='{$general['nation']}'";
|
|
||||||
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
|
|
||||||
$rulerCommand = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
$devRate = $db->queryFirstField('SELECT (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2)) from city where nation=%i', $general['nation']);
|
||||||
|
if($devRate < 0.8){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$nations = [];
|
||||||
|
foreach ($db->queryAllLists('SELECT nation, power FROM nation WHERE level>0') as [$youNationID, $youNationPower]) {
|
||||||
|
if(!isNeighbor($general['nation'], $youNationID)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$nations[$youNationID] = 1/sqrt($youNationPower+1);
|
||||||
|
}
|
||||||
|
if(!$nations){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$youNationID = Util::choiceRandomUsingWeight($nations);
|
||||||
|
$command = EncodeCommand(0, 0, $youNationID, 62);
|
||||||
|
$db->update('nation', [
|
||||||
|
'l12turn0'=>$command
|
||||||
|
], 'nation=%i', $general['nation']);
|
||||||
|
$rulerCommand = 1;
|
||||||
|
}while(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +626,7 @@ function processAI($no) {
|
|||||||
|
|
||||||
$target = array();
|
$target = array();
|
||||||
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
|
||||||
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
|
if($dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
|
||||||
$command = EncodeCommand(0, 0, 0, 17); //소집해제
|
$command = EncodeCommand(0, 0, 0, 17); //소집해제
|
||||||
} elseif($dipState <= 1 || $isStart == 1) {
|
} elseif($dipState <= 1 || $isStart == 1) {
|
||||||
//평시이거나 선포있어도 초반이면
|
//평시이거나 선포있어도 초반이면
|
||||||
@@ -701,7 +745,7 @@ function processAI($no) {
|
|||||||
//전시일때
|
//전시일때
|
||||||
if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
|
if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
|
||||||
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||||
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] > 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
|
||||||
elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
|
elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
|
||||||
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
|
||||||
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
|
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
|
||||||
@@ -783,9 +827,9 @@ function processAI($no) {
|
|||||||
if(count($target) == 0) {
|
if(count($target) == 0) {
|
||||||
//전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프
|
//전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프
|
||||||
if(rand()%100 < 30) {
|
if(rand()%100 < 30) {
|
||||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by gen1 desc,rand() limit 0,1";
|
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front>0 order by gen1 desc,rand() limit 0,1";
|
||||||
} else {
|
} else {
|
||||||
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front=1 order by rand() limit 0,1";
|
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front>0 order by rand() limit 0,1";
|
||||||
}
|
}
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
|
||||||
$cityCount = MYDB_num_rows($result);
|
$cityCount = MYDB_num_rows($result);
|
||||||
@@ -824,26 +868,11 @@ function processAI($no) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch($command) {
|
switch($command) {
|
||||||
case "00000000000001": //내정
|
case EncodeCommand(0, 0, 0, 1): //내정
|
||||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||||
return;
|
return;
|
||||||
case "00000000000011": //징병
|
case EncodeCommand(0, 0, 0, 11): //징병
|
||||||
$query = "select region from city where nation='{$general['nation']}' order by rand() limit 0,1";
|
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
|
||||||
$selRegion = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$selCity['city'] = 0;
|
|
||||||
// 90% 확률로 이민족 또는 특성병
|
|
||||||
if(rand()%100 < 90) {
|
|
||||||
$query = "select city from city where nation='{$general['nation']}' and (level='4' or level='8') order by rand() limit 0,1";
|
|
||||||
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
|
|
||||||
$selCity = MYDB_fetch_array($result);
|
|
||||||
}
|
|
||||||
// 특병 없으면 원래대로
|
|
||||||
if($selCity['city'] == 0) {
|
|
||||||
$selCity['city'] = $general['city'];
|
|
||||||
}
|
|
||||||
SetCrew($general['no'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $selRegion['region'], $selCity['city'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||||
@@ -908,7 +937,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
|
|
||||||
$commandList = [];
|
$commandList = [];
|
||||||
|
|
||||||
foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level` FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) {
|
foreach($db->query('SELECT `no`, nation, city, npc, `gold`, `rice`, leader, `power`, intel, killturn, crew, train, atmos, `level`, troop FROM general WHERE nation = %i', $general['nation']) as $nationGeneral) {
|
||||||
$cityID = $nationGeneral['city'];
|
$cityID = $nationGeneral['city'];
|
||||||
$generalID = $nationGeneral['no'];
|
$generalID = $nationGeneral['no'];
|
||||||
|
|
||||||
@@ -1077,7 +1106,15 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
}
|
}
|
||||||
} else{ // 포상
|
} else{ // 포상
|
||||||
$compNpcWar = $npcWarGeneralsID?$nationGenerals[$npcWarGeneralsID[0]]:null;
|
$compNpcWar = $npcWarGeneralsID?$nationGenerals[$npcWarGeneralsID[0]]:null;
|
||||||
$compNpcCivil = $npcCivilGeneralsID?$nationGenerals[$npcCivilGeneralsID[0]]:null;
|
$compNpcCivil = null;
|
||||||
|
foreach($npcCivilGeneralsID??[] as $npcCivilID){
|
||||||
|
$npcCivil = $nationGenerals[$npcCivilID];
|
||||||
|
if($npcCivil['npc'] == 5){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$compNpcCivil = $npcCivil;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if($compNpcWar && $compNpcWar[$resName] < 21000){
|
if($compNpcWar && $compNpcWar[$resName] < 21000){
|
||||||
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
$amount = min(100, intdiv(($nation[$resName]-($resName=='rice'?(GameConst::$baserice):(GameConst::$basegold))), 5000)*10 + 10);
|
||||||
@@ -1166,13 +1203,18 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
|
|
||||||
if($maxDevCity['dev'] >= 95 && $targetCity['city'] != $maxDevCity['city'] && $targetCity['dev'] <= 70){
|
if($maxDevCity['dev'] >= 95 && $targetCity['city'] != $maxDevCity['city'] && $targetCity['dev'] <= 70){
|
||||||
$targetGeneral = $nationGenerals[Util::choiceRandom($maxDevCity['generals'])];
|
$targetGeneral = $nationGenerals[Util::choiceRandom($maxDevCity['generals'])];
|
||||||
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2;
|
if($targetGeneral['troop'] != 0){
|
||||||
|
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($targetCity['generals']) < count($maxCity['generals']) - 2){
|
if(count($targetCity['generals']) < count($maxCity['generals']) - 2){
|
||||||
//세명 이상 차이나야 함
|
//세명 이상 차이나야 함
|
||||||
$targetGeneral = $nationGenerals[Util::choiceRandom($maxCity['generals'])];
|
$targetGeneral = $nationGenerals[Util::choiceRandom($maxCity['generals'])];
|
||||||
if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95){
|
if($targetGeneral['npc']==5){
|
||||||
|
|
||||||
|
}
|
||||||
|
else if($targetGeneral['npc']>=2 || $maxCity['dev'] >= 95 && $targetGeneral['troop'] == 0){
|
||||||
//유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함!
|
//유저장은 의도가 있을 것이므로 삽나지 않는 이상 발령 안함!
|
||||||
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5;
|
$commandList[EncodeCommand(0, $targetGeneral['no'], $targetCity['city'], 27)] = 5;
|
||||||
}
|
}
|
||||||
@@ -1200,6 +1242,10 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
if($nationGeneral['train'] * $nationGeneral['atmos'] < 75 * 75){
|
if($nationGeneral['train'] * $nationGeneral['atmos'] < 75 * 75){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($nationGeneral['troop'] != 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$score = 5;
|
$score = 5;
|
||||||
if($nationGeneral['npc']<2){
|
if($nationGeneral['npc']<2){
|
||||||
@@ -1250,6 +1296,9 @@ function NPCStaffWork($general, $nation, $dipState){
|
|||||||
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
if($generalCity['pop'] - 33000 > $nationGeneral['leader']){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if($nationGeneral['troop'] != 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$score = 5;
|
$score = 5;
|
||||||
if($nationGeneral['npc']<2){
|
if($nationGeneral['npc']<2){
|
||||||
|
|||||||
+176
-197
@@ -21,6 +21,12 @@ function getGeneralLeadership(&$general, $withInjury, $withItem, $withStatAdjust
|
|||||||
$leadership *= (100 - $general['injury']) / 100;
|
$leadership *= (100 - $general['injury']) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($withStatAdjust){
|
||||||
|
if($general['special2'] == 72){
|
||||||
|
$leadership *= 1.15;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($general['lbonus'])){
|
if(isset($general['lbonus'])){
|
||||||
$leadership += $general['lbonus'];
|
$leadership += $general['lbonus'];
|
||||||
}
|
}
|
||||||
@@ -267,6 +273,10 @@ function process_1(&$general, $type) {
|
|||||||
$exp = CharExperience($exp, $general['personal']);
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
|
|
||||||
|
if($city['front'] == 1 && $city['city'] != $nation['capital']){
|
||||||
|
$score *= 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
$score += $city["$stype"];
|
$score += $city["$stype"];
|
||||||
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
|
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
|
||||||
// 내정 상승
|
// 내정 상승
|
||||||
@@ -552,6 +562,16 @@ function process_5(&$general, $type) {
|
|||||||
$exp = $score * 0.7;
|
$exp = $score * 0.7;
|
||||||
$ded = $score * 1.0;
|
$ded = $score * 1.0;
|
||||||
|
|
||||||
|
if($city['front'] == 1 && $city['city'] != $nation['capital']){
|
||||||
|
if($stype == 'def'){
|
||||||
|
$score *= 0.5;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$score *= 0.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// 성격 보정
|
// 성격 보정
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
@@ -814,8 +834,8 @@ function process_9(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:{$stype}을 <C>$score</> 조달했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:{$stype}을 <C>$score</> 조달했습니다. <1>$date</>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = $score * 0.7;
|
$exp = $score * 0.7 / 3;
|
||||||
$ded = $score * 1.0;
|
$ded = $score * 1.0 / 3;
|
||||||
|
|
||||||
// 성격 보정
|
// 성격 보정
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
@@ -852,188 +872,175 @@ function process_9(&$general) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function process_11(&$general, $type) {
|
function process_11(&$general, $type) {
|
||||||
|
if($type == 1){
|
||||||
|
$type = '징병';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$type = '모병';
|
||||||
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
|
||||||
if($type == 1) { $defaultatmos = GameConst::$defaultAtmosLow; $defaulttrain = GameConst::$defaultTrainLow; }
|
if($type === '징병') {
|
||||||
else { $defaultatmos = GameConst::$defaultAtmosHigh; $defaulttrain = GameConst::$defaultTrainHigh; }
|
$defaultatmos = GameConst::$defaultAtmosLow;
|
||||||
|
$defaulttrain = GameConst::$defaultTrainLow;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$defaultatmos = GameConst::$defaultAtmosHigh;
|
||||||
|
$defaulttrain = GameConst::$defaultTrainHigh;
|
||||||
|
}
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear', 'year', 'month']);
|
[$startyear, $year, $month] = $gameStor->getValuesAsArray(['startyear', 'year', 'month']);
|
||||||
|
|
||||||
$query = "select level,tech from nation where nation='{$general['nation']}'";
|
$actLog = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$nation = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$lbonus = setLeadershipBonus($general, $nation['level']);
|
|
||||||
|
|
||||||
$query = "select * from city where city='{$general['city']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$command = DecodeCommand($general['turn0']);
|
$command = DecodeCommand($general['turn0']);
|
||||||
$armtype = $command[2];
|
$crewType = $command[2];
|
||||||
$crew = $command[1];
|
$rawCrew = $command[1];
|
||||||
|
|
||||||
|
|
||||||
if($armtype != $general['crewtype']) { $general['crew'] = 0; $general['train'] = $defaulttrain; $general['atmos'] = $defaultatmos; }
|
if($crewType != $general['crewtype']) {
|
||||||
|
$general['crew'] = 0;
|
||||||
if($crew*100 + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
$general['train'] = $defaulttrain;
|
||||||
$crew = Util::round(getGeneralLeadership($general, true, true, true) - $general['crew']/100);
|
$general['atmos'] = $defaultatmos;
|
||||||
}
|
}
|
||||||
if($crew < 0) { $crew = 0; }
|
|
||||||
$cost = $crew * getCost($armtype);
|
if($general['crew'] != 0) {
|
||||||
//기술로 가격
|
$dtype = "추가".$type;
|
||||||
$cost *= getTechCost($nation['tech']);
|
}
|
||||||
|
else {
|
||||||
|
$dtype = $type;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$general['nation']){
|
||||||
|
$actLog->pushGeneralActionLog("재야입니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$city = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $general['city']);
|
||||||
|
|
||||||
|
if($city['nation'] != $general['nation']){
|
||||||
|
$actLog->pushGeneralActionLog("아국이 아닙니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$crewTypeObj = GameUnitConst::byID($crewType);
|
||||||
|
if($crewTypeObj === null){
|
||||||
|
$actLog->pushGeneralActionLog("병종 코드 에러. $type 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[$nationLevel, $tech] = $db->queryFirstList('SELECT `level`,tech FROM nation WHERE nation=%i', $general['nation']);
|
||||||
|
|
||||||
|
$lbonus = setLeadershipBonus($general, $nationLevel);
|
||||||
|
|
||||||
|
//NOTE: 입력 변수는 100명 단위임
|
||||||
|
$crew = $rawCrew * 100;
|
||||||
|
if($crew + $general['crew'] > getGeneralLeadership($general, true, true, true)*100) {
|
||||||
|
$crew = max(0, getGeneralLeadership($general, true, true, true) * 100 - $general['crew']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($crew <= 0) {
|
||||||
|
$actLog->pushGeneralActionLog("더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cost = $crewTypeObj->costWithTech($tech, $crew);
|
||||||
|
if($type === '모병') {
|
||||||
|
$cost *= 2;
|
||||||
|
}
|
||||||
//성격 보정
|
//성격 보정
|
||||||
$cost = CharCost($cost, $general['personal']);
|
$cost = Util::round(CharCost($cost, $general['personal']));
|
||||||
$cost = Util::round($cost);
|
|
||||||
|
|
||||||
//특기 보정 : 보병, 궁병, 기병, 귀병, 공성, 징병
|
//특기 보정 : 징병, 보병, 궁병, 기병, 귀병, 공성
|
||||||
if(intdiv($armtype, 10) == 0 && $general['special2'] == 50) { $cost *= 0.9; }
|
|
||||||
if(intdiv($armtype, 10) == 1 && $general['special2'] == 51) { $cost *= 0.9; }
|
|
||||||
if(intdiv($armtype, 10) == 2 && $general['special2'] == 52) { $cost *= 0.9; }
|
|
||||||
if(intdiv($armtype, 10) == 3 && $general['special2'] == 40) { $cost *= 0.9; }
|
|
||||||
if(intdiv($armtype, 10) == 4 && $general['special2'] == 53) { $cost *= 0.9; }
|
|
||||||
if($general['special2'] == 72) { $cost *= 0.5; }
|
if($general['special2'] == 72) { $cost *= 0.5; }
|
||||||
|
else if($general['special2'] == 50 && $crewTypeObj->armType == GameUnitConstBase::T_FOOTMAN) { $cost *= 0.9; }
|
||||||
if($type == 1) { $dtype = "징병"; }
|
else if($general['special2'] == 51 && $crewTypeObj->armType == GameUnitConstBase::T_ARCHER) { $cost *= 0.9; }
|
||||||
elseif($type == 2) { $dtype = "모병"; $cost *= 2; }
|
else if($general['special2'] == 52 && $crewTypeObj->armType == GameUnitConstBase::T_CAVALRY) { $cost *= 0.9; }
|
||||||
if($general['crew'] != 0) { $dtype = "추가".$dtype; }
|
else if($general['special2'] == 40 && $crewTypeObj->armType == GameUnitConstBase::T_WIZARD) { $cost *= 0.9; }
|
||||||
|
else if($general['special2'] == 53 && $crewTypeObj->armType == GameUnitConstBase::T_SIEGE) { $cost *= 0.9; }
|
||||||
//현재 가능한지 검사
|
|
||||||
switch($armtype) {
|
if($general['gold'] < $cost){
|
||||||
case 0: case 10: case 20: case 30: case 35: // 보병 궁병 기병 귀병 남귀병
|
$actLog->pushGeneralActionLog("자금이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||||
$sel = 0; break;
|
return;
|
||||||
|
|
||||||
case 1: $sel = 1; $rg = 2; break; // 청주병(중원)
|
|
||||||
case 2: $sel = 1; $rg = 7; break; // 수병(오월)
|
|
||||||
case 3: $sel = 2; $ct = 64; break; // 자객병(저)
|
|
||||||
case 4: $sel = 2; $ct = 3; break; // 근위병(낙양)
|
|
||||||
case 5: $sel = 1; $rg = 5; break; // 등갑병(남중)
|
|
||||||
|
|
||||||
case 11: $sel = 1; $rg = 8; break; // 궁기병(동이)
|
|
||||||
case 12: $sel = 1; $rg = 4; break; // 연노병(서촉)
|
|
||||||
case 13: $sel = 2; $ct = 6; break; // 강궁병(양양)
|
|
||||||
case 14: $sel = 2; $ct = 7; break; // 석궁병(건업)
|
|
||||||
|
|
||||||
case 21: $sel = 1; $rg = 1; break; // 백마병(하북)
|
|
||||||
case 22: $sel = 1; $rg = 3; break; // 중장기병(서북)
|
|
||||||
case 23: $sel = 2; $ct = 65; break; // 돌격기병(흉노)
|
|
||||||
case 24: $sel = 2; $ct = 63; break; // 철기병(강)
|
|
||||||
case 25: $sel = 2; $ct = 67; break; // 수렵기병(산월)
|
|
||||||
case 26: $sel = 2; $ct = 66; break; // 맹수병(남만)
|
|
||||||
case 27: $sel = 2; $ct = 2; break; // 호표기병(허창)
|
|
||||||
|
|
||||||
case 31: $sel = 1; $rg = 6; break; // 신귀병(초)
|
|
||||||
case 32: $sel = 2; $ct = 68; break; // 백귀병(오환)
|
|
||||||
case 33: $sel = 2; $ct = 69; break; // 흑귀병(왜)
|
|
||||||
case 34: $sel = 2; $ct = 4; break; // 악귀병(장안)
|
|
||||||
case 36: $sel = 2; $ct = 3; break; // 황귀병(낙양)
|
|
||||||
case 37: $sel = 2; $ct = 5; break; // 천귀병(성도)
|
|
||||||
case 38: $sel = 2; $ct = 1; break; // 마귀병(업)
|
|
||||||
|
|
||||||
case 40: $sel = 0; break; // 정란
|
|
||||||
case 41: $sel = 0; break; // 충차
|
|
||||||
case 42: $sel = 2; $ct = 1; break; // 벽력거(업)
|
|
||||||
case 43: $sel = 2; $ct = 5; break; // 목우(성도)
|
|
||||||
|
|
||||||
default: $sel = 0; $armtype = 0; break;
|
|
||||||
}
|
|
||||||
if($sel == 0) {
|
|
||||||
// 남귀병은 기술1등급부터
|
|
||||||
// 충차는 기술1등급부터
|
|
||||||
if($armtype == 35 && $nation['tech'] < 1000) {
|
|
||||||
$cnt = 0;
|
|
||||||
} elseif($armtype == 41 && $nation['tech'] < 1000) {
|
|
||||||
$cnt = 0;
|
|
||||||
} else {
|
|
||||||
$cnt = 1;
|
|
||||||
}
|
|
||||||
} elseif($sel == 1) {
|
|
||||||
$query = "select city,level from city where nation='{$general['nation']}' and region='$rg'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$cnt = MYDB_num_rows($result);
|
|
||||||
$rgcity = MYDB_fetch_array($result);
|
|
||||||
// 기술 1000 이상부터 지역병
|
|
||||||
if($cnt > 0 && $nation['tech'] < 1000) {
|
|
||||||
$cnt = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$query = "select city,level from city where nation='{$general['nation']}' and city='$ct'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$cnt = MYDB_num_rows($result);
|
|
||||||
$ctcity = MYDB_fetch_array($result);
|
|
||||||
// 기술 2000 이상부터 이민족병
|
|
||||||
if($cnt > 0 && $ctcity['level'] == 4 && $nation['tech'] < 2000) {
|
|
||||||
$cnt = 0;
|
|
||||||
}
|
|
||||||
// 기술 3000 이상부터 특수병
|
|
||||||
if($cnt > 0 && $ctcity['level'] == 8 && $nation['tech'] < 3000) {
|
|
||||||
$cnt = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($cnt > 0) { $valid = 1; }
|
|
||||||
else { $valid = 0; }
|
|
||||||
|
|
||||||
// 초반 제한중 차병 불가
|
|
||||||
if($admin['year'] < $admin['startyear']+3 && intdiv($armtype, 10) == 4) {
|
|
||||||
$valid = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($general['level'] == 0) {
|
if($general['rice'] < $crew / 100) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. $dtype 실패. <1>$date</>";
|
$actLog->pushGeneralActionLog("군량이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||||
} elseif($city['nation'] != $general['nation']) {
|
return;
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. $dtype 실패. <1>$date</>";
|
|
||||||
// } elseif($city['supply'] == 0) {
|
|
||||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($crew <= 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:더이상 $dtype 할 수 없습니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $cost) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($general['rice'] < $crew) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($valid == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($city['pop']-30000 < $crew*100) { // 주민 30000명 이상만 가능
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:주민이 모자랍니다. $dtype 실패. <1>$date</>";
|
|
||||||
} elseif($city['rate'] < 20) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:".GameUnitConst::byId($armtype)->name."을(를) <C>{$crew}00</>명 {$dtype}했습니다. <1>$date</>";
|
|
||||||
$exp = $crew;
|
|
||||||
$ded = $crew;
|
|
||||||
// 숙련도 증가
|
|
||||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $armtype, $crew);
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew*100) / ($general['crew'] + $crew*100));
|
|
||||||
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew*100) / ($general['crew'] + $crew*100));
|
|
||||||
$general['crew'] += $crew*100;
|
|
||||||
$general['gold'] -= $cost;
|
|
||||||
// 주민수 감소 // 민심 김소
|
|
||||||
if($type == 1) { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*100); }
|
|
||||||
else { $city['rate'] = $city['rate'] - Util::round(($crew*100 / $city['pop'])*50); }
|
|
||||||
if($city['rate'] < 0) { $city['rate'] = 0; }
|
|
||||||
$query = "update city set pop=pop-({$crew}*100),rate='{$city['rate']}' where city='{$general['city']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
|
||||||
$general['leader2']++;
|
|
||||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',crewtype='$armtype',crew='{$general['crew']}',train='$train',atmos='$atmos',gold='{$general['gold']}',rice=rice-'$crew',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
$log = uniqueItem($general, $log);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pushGenLog($general, $log);
|
$ownCities = [];
|
||||||
|
$ownRegions = [];
|
||||||
|
foreach($db->queryFirstColumn('SELECT city FROM city WHERE nation = %i', $general['nation']) as $ownCity){
|
||||||
|
$ownCities[$ownCity] = 1;
|
||||||
|
$ownRegions[CityConst::byId($ownCity)->region] = 1;
|
||||||
|
}
|
||||||
|
$valid = $crewTypeObj->isValid($ownCities, $ownRegions, $year - $startyear, $tech);
|
||||||
|
|
||||||
|
if(!$valid) {
|
||||||
|
$actLog->pushGeneralActionLog("현재 $dtype 할 수 없는 병종입니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($city['pop']-30000 < $crew) { // 주민 30000명 이상만 가능
|
||||||
|
$actLog->pushGeneralActionLog("주민이 모자랍니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if($city['rate'] < 20) {
|
||||||
|
$actLog->pushGeneralActionLog("민심이 낮아 주민들이 도망갑니다. $dtype 실패. <1>$date</>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$josaUl = JosaUtil::pick($crewTypeObj->name, '을');
|
||||||
|
$actLog->pushGeneralActionLog($crewTypeObj->name."{$josaUl} <C>{$crew}</>명 {$dtype}했습니다. <1>$date</>");
|
||||||
|
$exp = Util::round($crew / 100);
|
||||||
|
$ded = Util::round($crew / 100);
|
||||||
|
// 숙련도 증가
|
||||||
|
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $crewType, $crew/100);
|
||||||
|
|
||||||
|
// 성격 보정
|
||||||
|
$exp = CharExperience($exp, $general['personal']);
|
||||||
|
$ded = CharDedication($ded, $general['personal']);
|
||||||
|
|
||||||
|
$atmos = Util::round(($general['atmos'] * $general['crew'] + $defaultatmos * $crew) / ($general['crew'] + $crew));
|
||||||
|
$train = Util::round(($general['train'] * $general['crew'] + $defaulttrain * $crew) / ($general['crew'] + $crew));
|
||||||
|
$general['crew'] += $crew;
|
||||||
|
$general['gold'] -= $cost;
|
||||||
|
// 주민수 감소 // 민심 감소
|
||||||
|
if($type === '징병') {
|
||||||
|
$city['rate'] -= Util::round(($crew / $city['pop'])*100);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$city['rate'] -= Util::round(($crew / 2 / $city['pop'])*100);
|
||||||
|
}
|
||||||
|
if($city['rate'] < 0) { $city['rate'] = 0; }
|
||||||
|
|
||||||
|
$db->update('city', [
|
||||||
|
'pop'=>$db->sqleval('pop-%i', $crew),
|
||||||
|
'rate'=>$city['rate']
|
||||||
|
], 'city = %i', $general['city']);
|
||||||
|
|
||||||
|
// 통솔경험, 병종 변경, 병사수 변경, 훈련치 변경, 사기치 변경, 자금 군량 하락, 공헌도, 명성 상승
|
||||||
|
$general['leader2']++;
|
||||||
|
$db->update('general', [
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'leader2'=>$general['leader2'],
|
||||||
|
'crewtype'=>$crewTypeObj->id,
|
||||||
|
'crew'=>$general['crew'],
|
||||||
|
'train'=>$train,
|
||||||
|
'atmos'=>$atmos,
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$db->sqleval('rice - %i', Util::round($crew/100)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', $ded),
|
||||||
|
'experience'=>$db->sqleval('experience + %i', $exp)
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $actLog);
|
||||||
|
$log = uniqueItem($general, []);//TODO: uniqueItem 재 구현
|
||||||
|
$actLog->pushGeneralActionLog($log, ActionLogger::RAWTEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_13(&$general) {
|
function process_13(&$general) {
|
||||||
@@ -1060,14 +1067,10 @@ function process_13(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 훈련 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 훈련 실패. <1>$date</>";
|
||||||
} elseif($city['nation'] != $general['nation']) {
|
} elseif($city['nation'] != $general['nation']) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 훈련 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 훈련 실패. <1>$date</>";
|
||||||
// } elseif($city['supply'] == 0) {
|
|
||||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 훈련 실패. <1>$date</>";
|
|
||||||
} elseif($general['crew'] == 0) {
|
} elseif($general['crew'] == 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 훈련 실패. <1>$date</>";
|
||||||
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
|
} elseif($general['train'] >= GameConst::$maxTrainByCommand) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:병사들은 이미 정예병사들입니다. <1>$date</>";
|
||||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
|
||||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 훈련이 불가능합니다. <1>$date</>";
|
|
||||||
} else {
|
} else {
|
||||||
// 훈련시
|
// 훈련시
|
||||||
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
|
$score = Util::round(getGeneralLeadership($general, true, true, true) * 100 / $general['crew'] * GameConst::$trainDelta);
|
||||||
@@ -1128,16 +1131,12 @@ function process_14(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 사기진작 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 사기진작 실패. <1>$date</>";
|
||||||
} elseif($city['nation'] != $general['nation']) {
|
} elseif($city['nation'] != $general['nation']) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 사기진작 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 사기진작 실패. <1>$date</>";
|
||||||
// } elseif($city['supply'] == 0) {
|
|
||||||
// $log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 사기진작 실패. <1>$date</>";
|
|
||||||
} elseif($general['crew'] == 0) {
|
} elseif($general['crew'] == 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:병사가 없습니다. 사기진작 실패. <1>$date</>";
|
||||||
} elseif($general['gold'] < $general['crew']/100) {
|
} elseif($general['gold'] < $general['crew']/100) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 사기진작 실패. <1>$date</>";
|
||||||
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
|
} elseif($general['atmos'] >= GameConst::$maxAtmosByCommand) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:이미 사기는 하늘을 찌를듯 합니다. <1>$date</>";
|
||||||
// } elseif(intdiv($general['crewtype'], 10) == 4) {
|
|
||||||
// $log[] = "<C>●</>{$admin['month']}월:병기는 사기 진작이 불가능합니다. <1>$date</>";
|
|
||||||
} else {
|
} else {
|
||||||
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
$score = Util::round(getGeneralLeadership($general, true, true, true)*100 / $general['crew'] * GameConst::$atmosDelta);
|
||||||
$gold = $general['gold'] - Util::round($general['crew']/100);
|
$gold = $general['gold'] - Util::round($general['crew']/100);
|
||||||
@@ -1310,20 +1309,7 @@ function process_16(&$general) {
|
|||||||
// 숙련도 증가
|
// 숙련도 증가
|
||||||
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
addGenDex($general['no'], GameConst::$maxAtmosByCommand, GameConst::$maxTrainByCommand, $general['crewtype'], Util::round($general['crew']/100));
|
||||||
// 전투 처리
|
// 전투 처리
|
||||||
$dead = processWar($general, $destcity);
|
processWar($general, $destcity);
|
||||||
|
|
||||||
// 기술력 따라서 보정
|
|
||||||
$dead['att'] = Util::round($dead['att'] * getTechCost($nation['tech']));
|
|
||||||
$dead['def'] = Util::round($dead['def'] * getTechCost($dnation['tech']));
|
|
||||||
|
|
||||||
// 사상자 누적
|
|
||||||
if($nation['nation'] > 0 && $dnation['nation'] > 0) {
|
|
||||||
$query = "update diplomacy set dead=dead+'{$dead['att']}' where me='{$nation['nation']}' and you='{$dnation['nation']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$query = "update diplomacy set dead=dead+'{$dead['def']}' where you='{$nation['nation']}' and me='{$dnation['nation']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
|
||||||
$log = uniqueItem($general, $log);
|
$log = uniqueItem($general, $log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1812,14 +1798,7 @@ function process_41(&$general) {
|
|||||||
} elseif($crewexp == 0) {
|
} elseif($crewexp == 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:병사가 모자랍니다. 단련 실패. <1>$date</>";
|
||||||
} else {
|
} else {
|
||||||
$type = intdiv($general['crewtype'], 10);
|
$crewstr = GameUnitConst::allType()[GameUnitConst::byID($general['crewtype'])->armType];
|
||||||
switch($type) {
|
|
||||||
case 0: $crewstr = '보병'; break;
|
|
||||||
case 1: $crewstr = '궁병'; break;
|
|
||||||
case 2: $crewstr = '기병'; break;
|
|
||||||
case 3: $crewstr = '귀병'; break;
|
|
||||||
case 4: $crewstr = '차병'; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($ratio < 33) {
|
if($ratio < 33) {
|
||||||
// 숙련도 증가
|
// 숙련도 증가
|
||||||
|
|||||||
+7
-115
@@ -66,12 +66,6 @@ function process_23(&$general) {
|
|||||||
} else {
|
} else {
|
||||||
$genlog[] = "<C>●</>$dtype <C>$amount</>을 포상으로 받았습니다.";
|
$genlog[] = "<C>●</>$dtype <C>$amount</>을 포상으로 받았습니다.";
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게 $dtype <C>$amount</>을 수여했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게 $dtype <C>$amount</>을 수여했습니다. <1>$date</>";
|
||||||
$exp = 1;
|
|
||||||
$ded = 1;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
if($what == 1) {
|
if($what == 1) {
|
||||||
$gen['gold'] += $amount;
|
$gen['gold'] += $amount;
|
||||||
@@ -91,8 +85,7 @@ function process_23(&$general) {
|
|||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 경험치 상승
|
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// $log = checkAbility($general, $log);
|
// $log = checkAbility($general, $log);
|
||||||
@@ -193,12 +186,6 @@ function process_24(&$general) {
|
|||||||
|
|
||||||
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
|
$genlog[] = "<C>●</>$dtype {$amount}을 몰수 당했습니다.";
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게서 $dtype <C>$amount</>을 몰수했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<Y>{$gen['name']}</>에게서 $dtype <C>$amount</>을 몰수했습니다. <1>$date</>";
|
||||||
$exp = 1;
|
|
||||||
$ded = 1;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
if($what == 1) {
|
if($what == 1) {
|
||||||
$gen['gold'] -= $amount;
|
$gen['gold'] -= $amount;
|
||||||
@@ -219,7 +206,7 @@ function process_24(&$general) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 경험치 상승
|
// 경험치 상승
|
||||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// $log = checkAbility($general, $log);
|
// $log = checkAbility($general, $log);
|
||||||
@@ -283,19 +270,13 @@ function process_27(&$general) {
|
|||||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<Y>{$you['name']}</>{$josaUl} <G><b>{$destcity['name']}</b></>{$josaRo} 발령했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<Y>{$you['name']}</>{$josaUl} <G><b>{$destcity['name']}</b></>{$josaRo} 발령했습니다. <1>$date</>";
|
||||||
$youlog[] = "<C>●</><Y>{$general['name']}</>에 의해 <G><b>{$destcity['name']}</b></>{$josaRo} 발령됐습니다. <1>$date</>";
|
$youlog[] = "<C>●</><Y>{$general['name']}</>에 의해 <G><b>{$destcity['name']}</b></>{$josaRo} 발령됐습니다. <1>$date</>";
|
||||||
$exp = 1;
|
|
||||||
$ded = 1;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 발령
|
// 발령
|
||||||
$query = "update general set city='$where' where no='{$you['no']}'";
|
$query = "update general set city='$where' where no='{$you['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// 경험치 상승
|
// 경험치 상승
|
||||||
$query = "update general set resturn='SUCCESS',experience=experience+'$exp',dedication=dedication+'$ded' where no='{$general['no']}'";
|
$query = "update general set resturn='SUCCESS' where no='{$general['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
// $log = checkAbility($general, $log);
|
// $log = checkAbility($general, $log);
|
||||||
@@ -342,13 +323,6 @@ function process_51(&$general) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 상대에게 발송
|
// 상대에게 발송
|
||||||
$src = new MessageTarget(
|
$src = new MessageTarget(
|
||||||
$general['no'],
|
$general['no'],
|
||||||
@@ -383,11 +357,6 @@ function process_51(&$general) {
|
|||||||
);
|
);
|
||||||
$msg->send();
|
$msg->send();
|
||||||
|
|
||||||
$db->update('general', [
|
|
||||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
|
||||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 항복 권고 서신을 보냈습니다.<1>$date</>"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -428,7 +397,7 @@ function process_52(&$general) {
|
|||||||
$younation = MYDB_fetch_array($result);
|
$younation = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if($gold > $mynation['gold']-GameConst::$basegold) { $gold = $mynation['gold'] - GameConst::$basegold; }
|
if($gold > $mynation['gold']-GameConst::$basegold) { $gold = $mynation['gold'] - GameConst::$basegold; }
|
||||||
if($rice > $mynation['rice']-GameConst::$baserice) { $rice = $mynation['rice'] - GameConst::$basegold; }
|
if($rice > $mynation['rice']-GameConst::$baserice) { $rice = $mynation['rice'] - GameConst::$baserice; }
|
||||||
|
|
||||||
if($younation['nation'] == 0) {
|
if($younation['nation'] == 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 원조 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:멸망한 국가입니다. 원조 실패. <1>$date</>";
|
||||||
@@ -538,13 +507,6 @@ function process_53(&$general) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 상대에게 발송
|
// 상대에게 발송
|
||||||
$src = new MessageTarget(
|
$src = new MessageTarget(
|
||||||
$general['no'],
|
$general['no'],
|
||||||
@@ -579,11 +541,6 @@ function process_53(&$general) {
|
|||||||
);
|
);
|
||||||
$msg->send();
|
$msg->send();
|
||||||
|
|
||||||
$db->update('general', [
|
|
||||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
|
||||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 통합 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||||
}
|
}
|
||||||
@@ -625,13 +582,6 @@ function process_61(&$general) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 상대에게 발송
|
// 상대에게 발송
|
||||||
$src = new MessageTarget(
|
$src = new MessageTarget(
|
||||||
$general['no'],
|
$general['no'],
|
||||||
@@ -682,11 +632,6 @@ function process_61(&$general) {
|
|||||||
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||||
// 3턴후
|
// 3턴후
|
||||||
|
|
||||||
$db->update('general', [
|
|
||||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
|
||||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,12 +697,6 @@ function process_62(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:초반제한 해제 2년전부터 가능합니다. 선포 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:초반제한 해제 2년전부터 가능합니다. 선포 실패. <1>$date</>";
|
||||||
} else {
|
} else {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 선전 포고 했습니다.<1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<D><b>{$younation['name']}</b></>으로 선전 포고 했습니다.<1>$date</>";
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||||
@@ -774,9 +713,6 @@ function process_62(&$general) {
|
|||||||
$query = "update diplomacy set state='1',term='24' where me='{$younation['nation']}' and you='{$nation['nation']}'";
|
$query = "update diplomacy set state='1',term='24' where me='{$younation['nation']}' and you='{$nation['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error("ally ".MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error("ally ".MYDB_error($connect),"");
|
||||||
|
|
||||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
//국메로 저장
|
//국메로 저장
|
||||||
$text = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
|
$text = "【외교】{$admin['year']}년 {$admin['month']}월:{$nation['name']}에서 {$younation['name']}에 선전포고";
|
||||||
|
|
||||||
@@ -846,13 +782,6 @@ function process_63(&$general) {
|
|||||||
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 상대에게 발송
|
// 상대에게 발송
|
||||||
$src = new MessageTarget(
|
$src = new MessageTarget(
|
||||||
@@ -888,11 +817,6 @@ function process_63(&$general) {
|
|||||||
);
|
);
|
||||||
$msg->send();
|
$msg->send();
|
||||||
|
|
||||||
$db->update('general', [
|
|
||||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
|
||||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 종전 제의 서신을 보냈습니다. <1>$date</>"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -931,13 +855,6 @@ function process_64(&$general) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
// 상대에게 발송
|
// 상대에게 발송
|
||||||
$src = new MessageTarget(
|
$src = new MessageTarget(
|
||||||
$general['no'],
|
$general['no'],
|
||||||
@@ -972,11 +889,6 @@ function process_64(&$general) {
|
|||||||
);
|
);
|
||||||
$msg->send();
|
$msg->send();
|
||||||
|
|
||||||
$db->update('general', [
|
|
||||||
'dedication'=>$db->sqleval('dedication+%i', $ded),
|
|
||||||
'experience'=>$db->sqleval('experience+%i', $exp)
|
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
$josaRo = JosaUtil::pick($destNation['name'], '로');
|
||||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>{$josaRo} 불가침 파기 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||||
}
|
}
|
||||||
@@ -1036,12 +948,6 @@ function process_65(&$general) {
|
|||||||
} else {
|
} else {
|
||||||
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
$josaUl = JosaUtil::pick($destcity['name'], '을');
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 초토화했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaUl} 초토화했습니다. <1>$date</>";
|
||||||
$exp = 5;
|
|
||||||
$ded = 5;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||||
@@ -1064,10 +970,6 @@ function process_65(&$general) {
|
|||||||
$query = "update city set pop=pop*0.1,rate=50,agri=agri*0.1,comm=comm*0.1,secu=secu*0.1,nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='{}' where city='{$destcity['city']}'";
|
$query = "update city set pop=pop*0.1,rate=50,agri=agri*0.1,comm=comm*0.1,secu=secu*0.1,nation='0',front='0',gen1='0',gen2='0',gen3='0',conflict='{}' where city='{$destcity['city']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
//경험치, 공헌치
|
|
||||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
//전장수 10% 삭감
|
//전장수 10% 삭감
|
||||||
$query = "update general set experience=experience*0.9,dedication=dedication*0.9 where nation='{$general['nation']}'";
|
$query = "update general set experience=experience*0.9,dedication=dedication*0.9 where nation='{$general['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -1130,7 +1032,7 @@ function process_66(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. 천도 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:인접도시가 아닙니다. 천도 실패. <1>$date</>";
|
||||||
} elseif($nation['capset'] == 1) {
|
} elseif($nation['capset'] == 1) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:다음 분기에 가능합니다. 천도 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:다음 분기에 가능합니다. 천도 실패. <1>$date</>";
|
||||||
} elseif($nation['gold']-GameConst::$basegold < $amount || $nation['rice']-GameConst::$basegold < $amount) {
|
} elseif($nation['gold']-GameConst::$basegold < $amount || $nation['rice']-GameConst::$baserice < $amount) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:물자가 부족합니다. 천도 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:물자가 부족합니다. 천도 실패. <1>$date</>";
|
||||||
} elseif($term < 3) {
|
} elseif($term < 3) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:천도중... ({$term}/3) <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:천도중... ({$term}/3) <1>$date</>";
|
||||||
@@ -1140,12 +1042,6 @@ function process_66(&$general) {
|
|||||||
} else {
|
} else {
|
||||||
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
$josaRo = JosaUtil::pick($destcity['name'], '로');
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 천도했습니다. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaRo} 천도했습니다. <1>$date</>";
|
||||||
$exp = 15;
|
|
||||||
$ded = 15;
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($general['name'], '이');
|
$josaYi = JosaUtil::pick($general['name'], '이');
|
||||||
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
$josaYiNation = JosaUtil::pick($nation['name'], '이');
|
||||||
@@ -1159,10 +1055,6 @@ function process_66(&$general) {
|
|||||||
$query = "update nation set l{$general['level']}term='0',capital='{$destcity['city']}',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
$query = "update nation set l{$general['level']}term='0',capital='{$destcity['city']}',capset='1',gold=gold-'$amount',rice=rice-'$amount' where nation='{$general['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
//경험치, 공헌치
|
|
||||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1222,7 +1114,7 @@ function process_67(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 증축 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 증축 실패. <1>$date</>";
|
||||||
} elseif($nation['capset'] == 1) {
|
} elseif($nation['capset'] == 1) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:다음 분기에 가능합니다. 증축 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:다음 분기에 가능합니다. 증축 실패. <1>$date</>";
|
||||||
} elseif($nation['gold']-GameConst::$basegold < $amount || $nation['rice']-GameConst::$basegold < $amount) {
|
} elseif($nation['gold']-GameConst::$basegold < $amount || $nation['rice']-GameConst::$baserice < $amount) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:물자가 부족합니다. 증축 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:물자가 부족합니다. 증축 실패. <1>$date</>";
|
||||||
} elseif($term < 6) {
|
} elseif($term < 6) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:증축중... ({$term}/6) <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:증축중... ({$term}/6) <1>$date</>";
|
||||||
@@ -2184,7 +2076,7 @@ function process_76(&$general) {
|
|||||||
) values (
|
) values (
|
||||||
'$npccount','$npc','$npc','$affinity','$name','$picture','{$nation['nation']}',
|
'$npccount','$npc','$npc','$affinity','$name','$picture','{$nation['nation']}',
|
||||||
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
|
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
|
||||||
'1','100','100','0','0','0','0','0',
|
'1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||||
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
|
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
|
||||||
'0','$bornyear','$deadyear',
|
'0','$bornyear','$deadyear',
|
||||||
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ function process_25(&$general) {
|
|||||||
$joinedNations = Json::decode($general['nations']);
|
$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(
|
$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',
|
'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',
|
||||||
@@ -172,9 +172,9 @@ function process_25(&$general) {
|
|||||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
||||||
} elseif($admin['year'] < $admin['startyear']+3 && $gencount >= GameConst::$initialNationGenLimit) {
|
} elseif($admin['year'] < $admin['startyear']+3 && $gencount >= GameConst::$initialNationGenLimit) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 제한되고 있습니다. 임관 실패.";
|
||||||
} elseif($nation['scout'] == 1 && $general['npc'] < 5) {
|
} elseif($nation['scout'] == 1 && $general['npc'] != 9) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 금지되어 있습니다. 임관 실패.";
|
$log[] = "<C>●</>{$admin['month']}월:현재 <D>{$nation['name']}</>{$josaUn} 임관이 금지되어 있습니다. 임관 실패.";
|
||||||
} elseif($general['makelimit'] > 0 && $general['npc'] < 5) {
|
} elseif($general['makelimit'] > 0 && $general['npc'] != 9) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야가 된지 12턴이 지나야 합니다. 임관 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:재야가 된지 12턴이 지나야 합니다. 임관 실패. <1>$date</>";
|
||||||
} elseif(in_array($nation['nation'], $joinedNations)) {
|
} elseif(in_array($nation['nation'], $joinedNations)) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
|
||||||
@@ -339,7 +339,7 @@ function process_29(&$general) {
|
|||||||
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
// 체섭시 무장 20%, 지장 20%, 무지장 60%
|
||||||
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
// 마이너 무장 40%, 지장 40%, 무지장 20%
|
||||||
$type = rand() % 10;
|
$type = rand() % 10;
|
||||||
if($admin['scenario'] == 0) {
|
if($admin['scenario'] < 100) {
|
||||||
switch($type) {
|
switch($type) {
|
||||||
case 0: case 1:
|
case 0: case 1:
|
||||||
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
$leader = GameConst::$defaultStatMax - 10 + rand()%11;
|
||||||
@@ -452,7 +452,7 @@ function process_29(&$general) {
|
|||||||
) values (
|
) values (
|
||||||
'$npccount','$npc','$npc','$affinity','$name','$picture','$scoutNation',
|
'$npccount','$npc','$npc','$affinity','$name','$picture','$scoutNation',
|
||||||
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
|
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
|
||||||
'$scoutLevel','100','100','0','0','0','0','0',
|
'$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
|
||||||
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
|
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
|
||||||
'0','$bornyear','$deadyear',
|
'0','$bornyear','$deadyear',
|
||||||
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
'{$avgGen['dex0']}','{$avgGen['dex10']}','{$avgGen['dex20']}','{$avgGen['dex30']}','{$avgGen['dex40']}'
|
||||||
|
|||||||
+640
-470
@@ -2,538 +2,708 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
function calcSabotageAttackScore(string $statType, array $general, array $nation):array{
|
||||||
|
setLeadershipBonus($general, $nation['level']);
|
||||||
|
|
||||||
|
if($statType === 'leader'){
|
||||||
|
$genScore = getGeneralLeadership($general, true, true, true);
|
||||||
|
}
|
||||||
|
else if($statType === 'power'){
|
||||||
|
$genScore = getGeneralPower($general, true, true, true);
|
||||||
|
}
|
||||||
|
else if($statType === 'intel'){
|
||||||
|
$genScore = getGeneralIntel($general, true, true, true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
throw new MustNotBeReachedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
$genScore /= GameConst::$sabotageProbCoefByStat;
|
||||||
|
|
||||||
|
$specialScore = 0;
|
||||||
|
|
||||||
|
if($general['special'] == 31){
|
||||||
|
//귀모
|
||||||
|
$specialScore += 0.2;
|
||||||
|
}
|
||||||
|
if($general['special2'] == 41){
|
||||||
|
//신산
|
||||||
|
$specialScore += 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general['item'] == 21){
|
||||||
|
//육도
|
||||||
|
$specialScore += 0.2;
|
||||||
|
}
|
||||||
|
else if($general['item'] == 22){
|
||||||
|
//삼략
|
||||||
|
$specialScore += 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemScore = 0;
|
||||||
|
if($general['item'] == 5){
|
||||||
|
//이추
|
||||||
|
$itemScore += 0.1;
|
||||||
|
}
|
||||||
|
else if($general['item'] == 6){
|
||||||
|
//향낭
|
||||||
|
$itemScore += 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$nationScore = 0;
|
||||||
|
if($nation['type'] == 9){
|
||||||
|
$nationScore = 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
$genScore,
|
||||||
|
$specialScore,
|
||||||
|
$itemScore,
|
||||||
|
$nationScore,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function calcSabotageDefendScore(string $statType, array $generalList, array $city, array $nation):array{
|
||||||
|
$maxGenScore = 0;
|
||||||
|
|
||||||
|
foreach ($generalList as $general) {
|
||||||
|
setLeadershipBonus($general, $nation['level']);
|
||||||
|
|
||||||
|
if ($statType === 'leader') {
|
||||||
|
$maxGenScore = max($maxGenScore, getGeneralLeadership($general, true, true, true));
|
||||||
|
} elseif ($statType === 'power') {
|
||||||
|
$maxGenScore = max($maxGenScore, getGeneralPower($general, true, true, true));
|
||||||
|
} elseif ($statType === 'intel') {
|
||||||
|
$maxGenScore = max($maxGenScore, getGeneralIntel($general, true, true, true));
|
||||||
|
} else {
|
||||||
|
throw new MustNotBeReachedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$cityScore = $city['secu'] / $city['secu2'] / 5;
|
||||||
|
$supplyScore = $city['supply'] ? 0.1 : 0;
|
||||||
|
|
||||||
|
return [
|
||||||
|
($maxGenScore / GameConst::$sabotageProbCoefByStat),
|
||||||
|
$cityScore,
|
||||||
|
$supplyScore
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState):?string{
|
||||||
|
$srcNationID = $general['nation'];
|
||||||
|
$destNationID = $destCity['nation'];
|
||||||
|
|
||||||
|
if(!$destCity){
|
||||||
|
return '없는 도시입니다.';
|
||||||
|
}
|
||||||
|
if($general['level'] == 0){
|
||||||
|
return '재야입니다.';
|
||||||
|
}
|
||||||
|
if($srcNationID != $srcCity['nation']){
|
||||||
|
return '아국이 아닙니다.';
|
||||||
|
}
|
||||||
|
if(!$srcCity['supply']){
|
||||||
|
return '고립된 도시입니다.';
|
||||||
|
}
|
||||||
|
if($destNationID == 0){
|
||||||
|
return '공백지입니다.';
|
||||||
|
}
|
||||||
|
if($general['gold'] < $reqGold){
|
||||||
|
return '자금이 모자랍니다.';
|
||||||
|
}
|
||||||
|
if($general['rice'] < $reqRice){
|
||||||
|
return '군량이 모자랍니다.';
|
||||||
|
}
|
||||||
|
if($srcNationID == $destNationID){
|
||||||
|
return '아국입니다.';
|
||||||
|
}
|
||||||
|
if($dipState >= 7){
|
||||||
|
return '불가침국입니다.';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function process_32(&$general) {
|
function process_32(&$general) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
|
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
$sabotageName = '화계';
|
||||||
|
$statType = 'intel';
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||||
|
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||||
|
|
||||||
$dist = searchDistance($general['city'], 5, false);
|
$reqGold = $develCost * 5;
|
||||||
$command = DecodeCommand($general['turn0']);
|
$reqRice = $develCost * 5;
|
||||||
$destination = $command[1];
|
|
||||||
|
$srcCityID = $general['city'];
|
||||||
|
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||||
|
|
||||||
$query = "select * from city where city='$destination'";
|
$dist = searchDistance($srcCityID, 5, false);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||||
$destcity = MYDB_fetch_array($result);
|
$destCity = $db->queryFirstRow('SELECT city,name,level,nation,secu,secu2,supply,agri,comm,def,wall,rate FROM city WHERE city=%i',$destCityID);
|
||||||
|
$destCityName = $destCity['name']??null;
|
||||||
|
|
||||||
$nation = getNationStaticInfo($general['nation']);
|
$srcNationID = $general['nation'];
|
||||||
|
$destNationID = $destCity['nation'];
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if($failReason !== null){
|
||||||
$dip = MYDB_fetch_array($result);
|
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||||
|
return;
|
||||||
if(!$destcity) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 화계 실패. <1>$date</>";
|
|
||||||
} elseif($general['level'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] != $city['nation'] && $nation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($city['supply'] == 0 && $nation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($destcity['nation'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] == $destcity['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} elseif($dip['state'] >= 7) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 화계 실패. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by intel desc";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$intelgen = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$ratio = Util::round(((getGeneralIntel($general, true, true, true, false) - getGeneralIntel($intelgen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
|
||||||
$ratio2 = rand() % 100;
|
|
||||||
|
|
||||||
if($general['item'] == 5) {
|
|
||||||
// 이추 사용
|
|
||||||
$ratio += 10;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] == 6) {
|
|
||||||
// 향낭 사용
|
|
||||||
$ratio += 20;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
|
||||||
// 육도, 삼략 사용
|
|
||||||
$ratio += 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 특기보정 : 신산, 귀모
|
|
||||||
if($general['special2'] == 41) { $ratio += 10; }
|
|
||||||
if($general['special'] == 31) { $ratio += 20; }
|
|
||||||
|
|
||||||
// 국가보정
|
|
||||||
if($nation['type'] == 9) { $ratio += 10; }
|
|
||||||
|
|
||||||
// 거리보정
|
|
||||||
$ratio /= Util::array_get($dist[$destination], 99);
|
|
||||||
|
|
||||||
if($ratio > $ratio2) {
|
|
||||||
$josaYi = JosaUtil::pick($destcity['name'], '이');
|
|
||||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>{$josaYi} 불타고 있습니다.";
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 성공했습니다. <1>$date</>";
|
|
||||||
|
|
||||||
$destcity['agri'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
|
||||||
$destcity['comm'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
|
||||||
if($destcity['agri'] < 0) { $destcity['agri'] = 0; }
|
|
||||||
if($destcity['comm'] < 0) { $destcity['comm'] = 0; }
|
|
||||||
$query = "update city set state=32,agri='{$destcity['agri']}',comm='{$destcity['comm']}' where city='$destination'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
SabotageInjury($destination);
|
|
||||||
$exp = rand() % 100 + 201;
|
|
||||||
$ded = rand() % 70 + 141;
|
|
||||||
} else {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 화계가 실패했습니다. <1>$date</>";
|
|
||||||
$exp = rand() % 100 + 1;
|
|
||||||
$ded = rand() % 70 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$general['intel2']++;
|
|
||||||
$general['gold'] -= $admin['develcost']*5;
|
|
||||||
$general['rice'] -= $admin['develcost']*5;
|
|
||||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
}
|
}
|
||||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
|
||||||
pushGenLog($general, $log);
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
|
$destNation = getNationStaticInfo($destNationID);
|
||||||
|
|
||||||
|
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level,special,special2 FROM general WHERE city=%i and nation=%i', $destCity['city'], $destCity['nation']);
|
||||||
|
|
||||||
|
[
|
||||||
|
$srcGenScore,
|
||||||
|
$srcSpecialScore,
|
||||||
|
$srcItemScore,
|
||||||
|
$srcNationScore,
|
||||||
|
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||||
|
|
||||||
|
[
|
||||||
|
$destGenScore,
|
||||||
|
$destCityScore,
|
||||||
|
$destSupplyScore
|
||||||
|
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||||
|
|
||||||
|
$sabotageProb = (
|
||||||
|
GameConst::$sabotageDefaultProb
|
||||||
|
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||||
|
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 거리보정
|
||||||
|
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||||
|
|
||||||
|
if(!Util::randBool($sabotageProb)){
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(1, 100);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(1, 70);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($srcItemScore){
|
||||||
|
$itemName = getItemName($general['item']);
|
||||||
|
$josaUl = JosaUtil::pick($itemName, '을');
|
||||||
|
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||||
|
$general['item'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$josaYi = JosaUtil::pick($destCityName, '이');
|
||||||
|
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>{$josaYi} 불타고 있습니다.");
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
$agriAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['agri']);
|
||||||
|
$commAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['comm']);
|
||||||
|
$destCity['agri'] -= $agriAmount;
|
||||||
|
$destCity['comm'] -= $commAmount;
|
||||||
|
|
||||||
|
$db->update('city', [
|
||||||
|
'state'=>32,
|
||||||
|
'agri'=>$destCity['agri'],
|
||||||
|
'comm'=>$destCity['comm']
|
||||||
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 농업이 <C>{$agriAmount}</>, 상업이 <C>{$commAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(201, 300);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(141, 210);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
'firenum' => $db->sqleval('firenum + 1'),
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'item'=>$general['item'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_33(&$general) {
|
function process_33(&$general) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
$date = substr($general['turntime'],11,5);
|
||||||
$alllog = [];
|
$sabotageName = '탈취';
|
||||||
$history = [];
|
$statType = 'power';
|
||||||
|
|
||||||
|
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||||
|
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||||
|
|
||||||
|
$reqGold = $develCost * 5;
|
||||||
|
$reqRice = $develCost * 5;
|
||||||
|
|
||||||
|
$srcCityID = $general['city'];
|
||||||
|
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||||
|
|
||||||
|
$dist = searchDistance($srcCityID, 5, false);
|
||||||
|
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||||
|
$destCity = $db->queryFirstRow('SELECT city,name,level,nation,secu,secu2,supply,agri,comm,def,wall,rate FROM city WHERE city=%i',$destCityID);
|
||||||
|
$destCityName = $destCity['name']??null;
|
||||||
|
|
||||||
|
$srcNationID = $general['nation'];
|
||||||
|
$destNationID = $destCity['nation'];
|
||||||
|
|
||||||
//탈취는 0까지 무제한
|
//탈취는 0까지 무제한
|
||||||
$date = substr($general['turntime'],11,5);
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
|
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||||
|
|
||||||
$dist = searchDistance($general['city'], 5, false);
|
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||||
$command = DecodeCommand($general['turn0']);
|
if($failReason !== null){
|
||||||
$destination = $command[1];
|
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||||
|
return;
|
||||||
$query = "select name,level,nation,secu,secu2 from city where city='$destination'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$destcity = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select gold,rice from nation where nation='{$destcity['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$nation = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$mynation = getNationStaticInfo($general['nation']);
|
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$dip = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if(!$destcity) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($general['level'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($destcity['nation'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] == $destcity['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} elseif($dip['state'] >= 7) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 탈취 실패. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by power desc";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$powergen = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
|
||||||
$ratio2 = rand() % 100;
|
|
||||||
|
|
||||||
if($general['item'] == 5) {
|
|
||||||
// 이추 사용
|
|
||||||
$ratio += 10;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] == 6) {
|
|
||||||
// 향낭 사용
|
|
||||||
$ratio += 20;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
|
||||||
// 육도, 삼략 사용
|
|
||||||
$ratio += 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 특기보정 : 신산, 귀모
|
|
||||||
if($general['special2'] == 41) { $ratio += 10; }
|
|
||||||
if($general['special'] == 31) { $ratio += 20; }
|
|
||||||
|
|
||||||
// 국가보정
|
|
||||||
if($mynation['type'] == 9) { $ratio += 10; }
|
|
||||||
|
|
||||||
// 거리보정
|
|
||||||
$ratio /= Util::array_get($dist[$destination], 99);
|
|
||||||
|
|
||||||
if($ratio > $ratio2) {
|
|
||||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에서 금과 쌀을 도둑맞았습니다.";
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 성공했습니다. <1>$date</>";
|
|
||||||
|
|
||||||
// 탈취 최대 400 * 8
|
|
||||||
$gold = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
|
||||||
$rice = (rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount) * $destcity['level'];
|
|
||||||
|
|
||||||
$nation['gold'] -= $gold;
|
|
||||||
$nation['rice'] -= $rice;
|
|
||||||
if($nation['gold'] < GameConst::$minNationalGold) { $gold += ($nation['gold'] - GameConst::$minNationalGold); $nation['gold'] = GameConst::$minNationalGold; }
|
|
||||||
if($nation['rice'] < GameConst::$minNationalRice) { $rice += ($nation['rice'] - GameConst::$minNationalRice); $nation['rice'] = GameConst::$minNationalRice; }
|
|
||||||
$query = "update nation set gold='{$nation['gold']}',rice='{$nation['rice']}' where nation='{$destcity['nation']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update city set state=34 where city='$destination'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 본국으로 회수, 재야이면 본인이 소유
|
|
||||||
if($general['nation'] != 0) {
|
|
||||||
$query = "select gold,rice from nation where nation='{$general['nation']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$nation = MYDB_fetch_array($result);
|
|
||||||
$nation['gold'] += $gold;
|
|
||||||
$nation['rice'] += $rice;
|
|
||||||
$query = "update nation set gold='{$nation['gold']}',rice='{$nation['rice']}' where nation='{$general['nation']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
} else {
|
|
||||||
$general['gold'] += $gold;
|
|
||||||
$general['rice'] += $rice;
|
|
||||||
$query = "update general set gold='{$general['gold']}',rice='{$general['rice']}' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
|
||||||
$log[] = "<C>●</>금<C>$gold</> 쌀<C>$rice</>을 획득했습니다.";
|
|
||||||
|
|
||||||
// SabotageInjury($destination);
|
|
||||||
$exp = rand() % 100 + 201;
|
|
||||||
$ded = rand() % 70 + 141;
|
|
||||||
} else {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 탈취가 실패했습니다. <1>$date</>";
|
|
||||||
$exp = rand() % 100 + 1;
|
|
||||||
$ded = rand() % 70 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$general['power2']++;
|
|
||||||
$general['gold'] -= $admin['develcost']*5;
|
|
||||||
$general['rice'] -= $admin['develcost']*5;
|
|
||||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
}
|
}
|
||||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
|
||||||
pushGenLog($general, $log);
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
|
$destNation = getNationStaticInfo($destNationID);
|
||||||
|
|
||||||
|
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level,special,special2 FROM general WHERE city=%i and nation=%i', $destCity['city'], $destCity['nation']);
|
||||||
|
|
||||||
|
[
|
||||||
|
$srcGenScore,
|
||||||
|
$srcSpecialScore,
|
||||||
|
$srcItemScore,
|
||||||
|
$srcNationScore,
|
||||||
|
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||||
|
|
||||||
|
[
|
||||||
|
$destGenScore,
|
||||||
|
$destCityScore,
|
||||||
|
$destSupplyScore
|
||||||
|
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||||
|
|
||||||
|
$sabotageProb = (
|
||||||
|
GameConst::$sabotageDefaultProb
|
||||||
|
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||||
|
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 거리보정
|
||||||
|
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||||
|
|
||||||
|
if(!Util::randBool($sabotageProb)){
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(1, 100);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(1, 70);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($srcItemScore){
|
||||||
|
$itemName = getItemName($general['item']);
|
||||||
|
$josaUl = JosaUtil::pick($itemName, '을');
|
||||||
|
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||||
|
$general['item'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>에서 금과 쌀을 도둑맞았습니다.");
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
// 탈취 최대 400 * 8
|
||||||
|
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'];
|
||||||
|
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'];
|
||||||
|
|
||||||
|
if($destCity['supply']){
|
||||||
|
[$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID);
|
||||||
|
|
||||||
|
$destNationGold -= $gold;
|
||||||
|
$destNationRice -= $rice;
|
||||||
|
|
||||||
|
if($destNationGold < GameConst::$minNationalGold) {
|
||||||
|
$gold += $destNationGold - GameConst::$minNationalGold;
|
||||||
|
$destNationGold = GameConst::$minNationalGold;
|
||||||
|
}
|
||||||
|
if($destNationRice < GameConst::$minNationalRice) {
|
||||||
|
$rice += $destNationRice - GameConst::$minNationalRice;
|
||||||
|
$destNationRice = GameConst::$minNationalRice;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->update('nation', [
|
||||||
|
'gold'=>$destNationGold,
|
||||||
|
'rice'=>$destNationRice
|
||||||
|
], 'nation=%i', $destNationID);
|
||||||
|
$db->update('city', [
|
||||||
|
'state'=>34
|
||||||
|
], 'city=%i', $destCityID);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$db->update('city', [
|
||||||
|
'comm'=>Util::valueFit($destCity['comm'] - $gold / 12, 0),
|
||||||
|
'agri'=>Util::valueFit($destCity['agri'] - $rice / 12, 0),
|
||||||
|
'state'=>34
|
||||||
|
], 'city=%i', $destCityID);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 본국으로 일부 회수, 재야이면 본인이 전량 소유
|
||||||
|
if($general['nation'] != 0) {
|
||||||
|
$db->update('nation', [
|
||||||
|
'gold' => $db->sqleval('gold + %i', Util::round($gold * 0.7)),
|
||||||
|
'rice' => $db->sqleval('rice + %i', Util::round($rice * 0.7))
|
||||||
|
], 'nation=%i', $srcNationID);
|
||||||
|
$general['gold'] += $gold - Util::round($gold * 0.7);
|
||||||
|
$general['rice'] += $rice - Util::round($rice * 0.7);
|
||||||
|
} else {
|
||||||
|
$general['gold'] += $gold;
|
||||||
|
$general['rice'] += $rice;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("금<C>{$gold}</> 쌀<C>{$rice}</>을 획득했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(201, 300);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(141, 210);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
'firenum' => $db->sqleval('firenum + 1'),
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'item'=>$general['item'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_34(&$general) {
|
function process_34(&$general) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
|
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
$sabotageName = '파괴';
|
||||||
|
$statType = 'power';
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||||
|
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||||
|
|
||||||
$dist = searchDistance($general['city'], 5, false);
|
$reqGold = $develCost * 5;
|
||||||
$command = DecodeCommand($general['turn0']);
|
$reqRice = $develCost * 5;
|
||||||
$destination = $command[1];
|
|
||||||
|
|
||||||
$query = "select name,nation,def,wall,secu,secu2 from city where city='$destination'";
|
$srcCityID = $general['city'];
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||||
$destcity = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$mynation = getNationStaticInfo($general['nation']);
|
$dist = searchDistance($srcCityID, 5, false);
|
||||||
|
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||||
|
$destCity = $db->queryFirstRow('SELECT city,name,level,nation,secu,secu2,supply,agri,comm,def,wall,rate FROM city WHERE city=%i',$destCityID);
|
||||||
|
$destCityName = $destCity['name']??null;
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
$srcNationID = $general['nation'];
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$destNationID = $destCity['nation'];
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||||
$dip = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if(!$destcity) {
|
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 파괴 실패. <1>$date</>";
|
if($failReason !== null){
|
||||||
} elseif($general['level'] == 0) {
|
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
return;
|
||||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
}
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($destcity['nation'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] == $destcity['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} elseif($dip['state'] >= 7) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 파괴 실패. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by power desc";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$powergen = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$ratio = Util::round(((getGeneralPower($general, true, true, true, false) - getGeneralPower($powergen, true, true, true, false)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
$ratio2 = rand() % 100;
|
$destNation = getNationStaticInfo($destNationID);
|
||||||
|
|
||||||
if($general['item'] == 5) {
|
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level,special,special2 FROM general WHERE city=%i and nation=%i', $destCity['city'], $destCity['nation']);
|
||||||
// 이추 사용
|
|
||||||
$ratio += 10;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] == 6) {
|
|
||||||
// 향낭 사용
|
|
||||||
$ratio += 20;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
|
||||||
// 육도, 삼략 사용
|
|
||||||
$ratio += 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 특기보정 : 신산, 귀모
|
[
|
||||||
if($general['special2'] == 41) { $ratio += 10; }
|
$srcGenScore,
|
||||||
if($general['special'] == 31) { $ratio += 20; }
|
$srcSpecialScore,
|
||||||
|
$srcItemScore,
|
||||||
|
$srcNationScore,
|
||||||
|
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||||
|
|
||||||
// 국가보정
|
[
|
||||||
if($mynation['type'] == 9) { $ratio += 10; }
|
$destGenScore,
|
||||||
|
$destCityScore,
|
||||||
|
$destSupplyScore
|
||||||
|
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||||
|
|
||||||
// 거리보정
|
$sabotageProb = (
|
||||||
$ratio /= Util::array_get($dist[$destination], 99);
|
GameConst::$sabotageDefaultProb
|
||||||
|
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||||
|
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||||
|
);
|
||||||
|
|
||||||
if($ratio > $ratio2) {
|
// 거리보정
|
||||||
$alllog[] = "<C>●</>{$admin['month']}월:누군가가 <G><b>{$destcity['name']}</b></>의 성벽을 허물었습니다.";
|
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 성공했습니다. <1>$date</>";
|
|
||||||
|
|
||||||
// 파괴
|
if(!Util::randBool($sabotageProb)){
|
||||||
$destcity['def'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
$destcity['wall'] -= rand() % GameConst::$sabotageAmountCoef + GameConst::$sabotageDefaultAmount;
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||||
if($destcity['def'] < 100) { $destcity['def'] = 100; }
|
|
||||||
if($destcity['wall'] < 100) { $destcity['wall'] = 100; }
|
|
||||||
$query = "update city set state=34,def='{$destcity['def']}',wall='{$destcity['wall']}' where city='$destination'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
SabotageInjury($destination);
|
$exp = Util::randRangeInt(1, 100);
|
||||||
$exp = rand() % 100 + 201;
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
$ded = rand() % 70 + 141;
|
$ded = Util::randRangeInt(1, 70);
|
||||||
} else {
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 파괴가 실패했습니다. <1>$date</>";
|
|
||||||
$exp = rand() % 100 + 1;
|
|
||||||
$ded = rand() % 70 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 성격 보정
|
$general[$statType.'2'] += 1;
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
$general['gold'] -= $reqGold;
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
$general['power2']++;
|
checkAbilityEx($general['no'], $logger);
|
||||||
$general['gold'] -= $admin['develcost']*5;
|
return;
|
||||||
$general['rice'] -= $admin['develcost']*5;
|
|
||||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
}
|
}
|
||||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
|
||||||
pushGenLog($general, $log);
|
if($srcItemScore){
|
||||||
|
$itemName = getItemName($general['item']);
|
||||||
|
$josaUl = JosaUtil::pick($itemName, '을');
|
||||||
|
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||||
|
$general['item'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->pushGlobalActionLog("누군가가 <G><b>{$destCityName}</b></>의 성벽을 허물었습니다.");
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
// 파괴
|
||||||
|
$defAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['def'] - 100);
|
||||||
|
$wallAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['wall'] - 100);
|
||||||
|
if($defAmount < 0){ $defAmount = 0; }
|
||||||
|
if($wallAmount < 0){ $wallAmount = 0; }
|
||||||
|
|
||||||
|
$destCity['def'] -= $defAmount;
|
||||||
|
$destCity['wall'] -= $wallAmount;
|
||||||
|
|
||||||
|
$db->update('city', [
|
||||||
|
'state'=>32,
|
||||||
|
'def'=>$destCity['def'],
|
||||||
|
'wall'=>$destCity['wall']
|
||||||
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 수비가 <C>{$defAmount}</>, 성벽이 <C>{$wallAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(201, 300);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(141, 210);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
'firenum' => $db->sqleval('firenum + 1'),
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'item'=>$general['item'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_35(&$general) {
|
function process_35(&$general) {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
|
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
$sabotageName = '선동';
|
||||||
|
$statType = 'leader';
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year','month','develcost']);
|
[$year, $month, $develCost] = $gameStor->getValuesAsArray(['year','month','develcost']);
|
||||||
|
$logger = new ActionLogger($general['no'], $general['nation'], $year, $month);
|
||||||
|
|
||||||
$dist = searchDistance($general['city'], 5, false);
|
$reqGold = $develCost * 5;
|
||||||
$command = DecodeCommand($general['turn0']);
|
$reqRice = $develCost * 5;
|
||||||
$destination = $command[1];
|
|
||||||
|
|
||||||
$query = "select name,nation,rate,secu,secu2 from city where city='$destination'";
|
$srcCityID = $general['city'];
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$destCityID = DecodeCommand($general['turn0'])[1];
|
||||||
$destcity = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$mynation = getNationStaticInfo($general['nation']);
|
$dist = searchDistance($srcCityID, 5, false);
|
||||||
|
$srcCity = $db->queryFirstRow('SELECT city,nation,supply FROM city WHERE city=%i', $srcCityID);
|
||||||
|
$destCity = $db->queryFirstRow('SELECT city,name,level,nation,secu,secu2,supply,agri,comm,def,wall,rate FROM city WHERE city=%i',$destCityID);
|
||||||
|
$destCityName = $destCity['name']??null;
|
||||||
|
|
||||||
$lbonus = setLeadershipBonus($general, $mynation['level']);
|
$srcNationID = $general['nation'];
|
||||||
|
$destNationID = $destCity['nation'];
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$dipState = $db->queryFirstField('SELECT `state` FROM diplomacy WHERE me=%i AND you=%i', $srcNationID, $destNationID);
|
||||||
$city = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select state from diplomacy where me='{$general['nation']}' and you='{$destcity['nation']}'";
|
$lbonus = setLeadershipBonus($general, $srcNation['level']);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$dip = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if(!$destcity) {
|
$failReason = checkSabotageFailCondition($general, $srcCity, $destCity, $reqGold, $reqRice, $dipState);
|
||||||
$log[] = "<C>●</>{$admin['month']}월:없는 도시입니다. 선동 실패. <1>$date</>";
|
if($failReason !== null){
|
||||||
} elseif($general['level'] == 0) {
|
$logger->pushGeneralActionLog("{$failReason} {$sabotageName} 실패. <1>{$date}</>");
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
return;
|
||||||
} elseif($general['nation'] != $city['nation'] && $mynation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($city['supply'] == 0 && $mynation['level'] != 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($destcity['nation'] == 0) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:공백지입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($general['gold'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($general['rice'] < $admin['develcost']*5) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($general['nation'] == $destcity['nation']) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:아국입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} elseif($dip['state'] >= 7) {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:불가침국입니다. <G><b>{$destcity['name']}</b></>에 선동 실패. <1>$date</>";
|
|
||||||
} else {
|
|
||||||
$query = "select leader,horse,power,weap,intel,book,injury from general where city='$destination' and nation='{$destcity['nation']}' order by leader desc";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gen = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$ratio = Util::round(((getGeneralLeadership($general, true, true, true) - getGeneralLeadership($gen, true, true, true)) / GameConst::$sabotageProbCoefByStat - ($destcity['secu']/$destcity['secu2'])/5 + GameConst::$sabotageDefaultProb)*100);
|
|
||||||
$ratio2 = rand() % 100;
|
|
||||||
|
|
||||||
if($general['item'] == 5) {
|
|
||||||
// 이추 사용
|
|
||||||
$ratio += 10;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] == 6) {
|
|
||||||
// 향낭 사용
|
|
||||||
$ratio += 20;
|
|
||||||
$query = "update general set item=0 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$josaUl = JosaUtil::pick($general['item'], '을');
|
|
||||||
$log[] = "<C>●</><C>".getItemName($general['item'])."</>{$josaUl} 사용!";
|
|
||||||
$general['item'] = 0;
|
|
||||||
} elseif($general['item'] >= 21 && $general['item'] <= 22) {
|
|
||||||
// 육도, 삼략 사용
|
|
||||||
$ratio += 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 특기보정 : 신산, 귀모
|
|
||||||
if($general['special2'] == 41) { $ratio += 10; }
|
|
||||||
if($general['special'] == 31) { $ratio += 20; }
|
|
||||||
|
|
||||||
// 국가보정
|
|
||||||
if($mynation['type'] == 9) { $ratio += 10; }
|
|
||||||
|
|
||||||
// 거리보정
|
|
||||||
$ratio /= Util::array_get($dist[$destination], 99);
|
|
||||||
|
|
||||||
if($ratio > $ratio2) {
|
|
||||||
$alllog[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>의 백성들이 동요하고 있습니다.";
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 성공했습니다. <1>$date</>";
|
|
||||||
|
|
||||||
// 선동 최대 10
|
|
||||||
$destcity['secu'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/2) + GameConst::$sabotageDefaultAmount;
|
|
||||||
$destcity['rate'] -= rand() % Util::round(GameConst::$sabotageAmountCoef/50) + GameConst::$sabotageDefaultAmount/50;
|
|
||||||
if($destcity['secu'] < 0) { $destcity['secu'] = 0; }
|
|
||||||
if($destcity['rate'] < 0) { $destcity['rate'] = 0; }
|
|
||||||
$query = "update city set state=32,rate='{$destcity['rate']}',secu='{$destcity['secu']}' where city='$destination'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
SabotageInjury($destination);
|
|
||||||
$exp = rand() % 100 + 201;
|
|
||||||
$ded = rand() % 70 + 141;
|
|
||||||
} else {
|
|
||||||
$log[] = "<C>●</>{$admin['month']}월:<G><b>{$destcity['name']}</b></>에 선동이 실패했습니다. <1>$date</>";
|
|
||||||
$exp = rand() % 100 + 1;
|
|
||||||
$ded = rand() % 70 + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 성격 보정
|
|
||||||
$exp = CharExperience($exp, $general['personal']);
|
|
||||||
$ded = CharDedication($ded, $general['personal']);
|
|
||||||
|
|
||||||
$general['leader2']++;
|
|
||||||
$general['gold'] -= $admin['develcost']*5;
|
|
||||||
$general['rice'] -= $admin['develcost']*5;
|
|
||||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$log = checkAbility($general, $log);
|
|
||||||
}
|
}
|
||||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
|
||||||
pushGenLog($general, $log);
|
$srcNation = getNationStaticInfo($srcNationID);
|
||||||
|
$destNation = getNationStaticInfo($destNationID);
|
||||||
|
|
||||||
|
$generalList = $db->query('SELECT `no`,leader,horse,power,weap,intel,book,injury,level,special,special2 FROM general WHERE city=%i and nation=%i', $destCity['city'], $destCity['nation']);
|
||||||
|
[
|
||||||
|
$srcGenScore,
|
||||||
|
$srcSpecialScore,
|
||||||
|
$srcItemScore,
|
||||||
|
$srcNationScore,
|
||||||
|
] = calcSabotageAttackScore($statType, $general, $srcNation);
|
||||||
|
|
||||||
|
[
|
||||||
|
$destGenScore,
|
||||||
|
$destCityScore,
|
||||||
|
$destSupplyScore
|
||||||
|
] = calcSabotageDefendScore($statType, $generalList, $destCity, $destNation);
|
||||||
|
|
||||||
|
$sabotageProb = (
|
||||||
|
GameConst::$sabotageDefaultProb
|
||||||
|
+ ($srcGenScore + $srcSpecialScore + $srcItemScore + $srcNationScore)
|
||||||
|
- ($destGenScore + $destCityScore + $destSupplyScore)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 거리보정
|
||||||
|
$sabotageProb /= Util::array_get($dist[$destCityID], 99);
|
||||||
|
|
||||||
|
if(!Util::randBool($sabotageProb)){
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 실패했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(1, 100);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(1, 70);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($srcItemScore){
|
||||||
|
$itemName = getItemName($general['item']);
|
||||||
|
$josaUl = JosaUtil::pick($itemName, '을');
|
||||||
|
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 사용!", ActionLogger::PLAIN);
|
||||||
|
$general['item'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->pushGlobalActionLog("<G><b>{$destCityName}</b></>의 백성들이 동요하고 있습니다.");
|
||||||
|
$josaYi = JosaUtil::pick($sabotageName, '이');
|
||||||
|
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>에 {$sabotageName}{$josaYi} 성공했습니다. <1>$date</>");
|
||||||
|
|
||||||
|
// 선동 최대 10
|
||||||
|
$secuAmount = Util::valueFit(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax), null, $destCity['secu']);
|
||||||
|
$rateAmount = Util::valueFit(
|
||||||
|
Util::round(Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) / 50),
|
||||||
|
null,
|
||||||
|
$destCity['rate']
|
||||||
|
);
|
||||||
|
$destCity['secu'] -= $secuAmount;
|
||||||
|
$destCity['rate'] -= $rateAmount;
|
||||||
|
|
||||||
|
$db->update('city', [
|
||||||
|
'state'=>32,
|
||||||
|
'secu'=>$destCity['secu'],
|
||||||
|
'rate'=>$destCity['rate']
|
||||||
|
], 'city=%i', $destCityID);
|
||||||
|
|
||||||
|
$injuryCount = SabotageInjury($destCityID);
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("도시의 치안이 <C>{$secuAmount}</>, 민심이 <C>{$rateAmount}</>만큼 감소하고, 장수 <C>{$injuryCount}</>명이 부상 당했습니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
$exp = Util::randRangeInt(201, 300);
|
||||||
|
$exp *= getCharExpMultiplier($general['personal']);
|
||||||
|
$ded = Util::randRangeInt(141, 210);
|
||||||
|
$ded *= getCharDedMultiplier($general['personal']);
|
||||||
|
|
||||||
|
$general[$statType.'2'] += 1;
|
||||||
|
$general['gold'] -= $reqGold;
|
||||||
|
$general['rice'] -= $reqRice;
|
||||||
|
$db->update('general', [
|
||||||
|
'firenum' => $db->sqleval('firenum + 1'),
|
||||||
|
($statType.'2') => $general[$statType.'2'],
|
||||||
|
'resturn'=>'SUCCESS',
|
||||||
|
'gold'=>$general['gold'],
|
||||||
|
'rice'=>$general['rice'],
|
||||||
|
'item'=>$general['item'],
|
||||||
|
'experience'=>$db->sqleval('experience + %i', Util::round($exp)),
|
||||||
|
'dedication'=>$db->sqleval('dedication + %i', Util::round($ded))
|
||||||
|
], 'no=%i', $general['no']);
|
||||||
|
|
||||||
|
checkAbilityEx($general['no'], $logger);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-3
@@ -203,11 +203,18 @@ function formatName(string $name, int $npc): string{
|
|||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMapHtml(){
|
function getMapHtml(?string $mapTheme=null){
|
||||||
//NOTE: 필요한가?
|
|
||||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||||
|
|
||||||
return $templates->render('map');
|
if($mapTheme === null){
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
$mapTheme = $gameStor->map_theme??'che';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $templates->render('map', [
|
||||||
|
'mapTheme'=>$mapTheme
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getInvitationList(array $nationList){
|
function getInvitationList(array $nationList){
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ function processGoldIncome() {
|
|||||||
$query = "update nation set gold='{$nation['gold']}' where nation='{$nation['nation']}'";
|
$query = "update nation set gold='{$nation['gold']}' where nation='{$nation['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
$query = "select no,name,nation,dedication,gold from general where nation='{$nation['nation']}'";
|
$query = "select no,name,nation,dedication,gold from general where nation='{$nation['nation']}' AND npc != 5";
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ function getGoldOutcome($nation, $bill) {
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
$query = "select dedication from general where nation='$nation' AND npc != 5"; // 장수 목록
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ function processRiceIncome() {
|
|||||||
$query = "update nation set rice='{$nation['rice']}' where nation='{$nation['nation']}'";
|
$query = "update nation set rice='{$nation['rice']}' where nation='{$nation['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
$query = "select no,name,nation,dedication,rice from general where nation='{$nation['nation']}'";
|
$query = "select no,name,nation,dedication,rice from general where nation='{$nation['nation']}' AND npc != 5";
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
|
|
||||||
@@ -517,7 +517,7 @@ function getRiceOutcome($nation, $bill) {
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
$query = "select dedication from general where nation='$nation' AND npc != 5"; // 장수 목록
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$gencount = MYDB_num_rows($genresult);
|
$gencount = MYDB_num_rows($genresult);
|
||||||
|
|
||||||
@@ -594,14 +594,14 @@ function disaster() {
|
|||||||
|
|
||||||
for($i=0; $i < $citycount; $i++) {
|
for($i=0; $i < $citycount; $i++) {
|
||||||
$city = MYDB_fetch_array($cityresult);
|
$city = MYDB_fetch_array($cityresult);
|
||||||
//호황 발생 도시 선택 ( 기본 3% 이므로 약 3개 도시 )
|
//호황 발생 도시 선택 ( 기본 2% )
|
||||||
//재해 발생 도시 선택 ( 기본 6% 이므로 약 6개 도시 )
|
//재해 발생 도시 선택 ( 기본 6% )
|
||||||
if($isgood == 1) { $ratio = 3 + Util::round(1.0*$city['secu']/$city['secu2']*3); } // 3 ~ 6%
|
if($isgood == 1) { $ratio = 2 + Util::round($city['secu']/$city['secu2']*5); } // 2 ~ 7%
|
||||||
else { $ratio = 6 - Util::round(1.0*$city['secu']/$city['secu2']*3); } // 3 ~ 6%
|
else { $ratio = 6 - Util::round($city['secu']/$city['secu2']*5); } // 1 ~ 6%
|
||||||
|
|
||||||
if(rand()%100+1 < $ratio) {
|
if(rand()%100+1 < $ratio) {
|
||||||
$disastercity[] = $city['city'];
|
$disastercity[] = $city['city'];
|
||||||
$disasterratio[] = 1.0 * $city['secu'] / $city['secu2'];
|
$disasterratio[] = Util::valueFit($city['secu'] / 0.8 / $city['secu2'], 0, 1);
|
||||||
$disastername[] = $city['name'];
|
$disastername[] = $city['name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ function fillLowGenAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
//자동신청하고, 돈 있고, 아직 참가 안한 장수
|
||||||
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='{$develcost}' order by rand() limit 0,64";
|
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' order by rand() limit 0,64";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$genCount = MYDB_num_rows($result);
|
$genCount = MYDB_num_rows($result);
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ function fillLowGenAll() {
|
|||||||
if($genCount > 0) {
|
if($genCount > 0) {
|
||||||
$genCount--;
|
$genCount--;
|
||||||
$gen = MYDB_fetch_array($result);
|
$gen = MYDB_fetch_array($result);
|
||||||
$query = "update general set gold=gold-'{$develcost}',tournament='1' where no='{$gen['no']}'";
|
$query = "update general set tournament='1' where no='{$gen['no']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|
||||||
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('{$gen['no']}', '{$gen['npc']}', '{$gen['name']}', '{$gen['leader']}', '{$gen['power']}', '{$gen['intel']}', '{$gen['explevel']}', '$i', '$grpCount[$i]')";
|
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('{$gen['no']}', '{$gen['npc']}', '{$gen['name']}', '{$gen['leader']}', '{$gen['power']}', '{$gen['intel']}', '{$gen['explevel']}', '$i', '$grpCount[$i]')";
|
||||||
|
|||||||
+17
-14
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
|||||||
], 'owner=%i', $userID);
|
], 'owner=%i', $userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title']);
|
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
|
||||||
|
|
||||||
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ if ($admin['npcmode'] == 0) {
|
|||||||
$valid = 1;
|
$valid = 1;
|
||||||
}
|
}
|
||||||
$color = "cyan";
|
$color = "cyan";
|
||||||
|
$mapTheme = $admin['map_theme'];
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -91,13 +91,16 @@ $color = "cyan";
|
|||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
<?=WebUtil::printJS('js/main.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/map.js')?>
|
||||||
<?=WebUtil::printJS('js/msg.js')?>
|
<?=WebUtil::printJS('js/msg.js')?>
|
||||||
<script>
|
<script>
|
||||||
|
window.serverNick = '<?=DB::prefix()?>';
|
||||||
|
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||||
$(function(){
|
$(function(){
|
||||||
reloadWorldMap({
|
reloadWorldMap({
|
||||||
hrefTemplate:'b_currentCity.php?citylist={0}'
|
hrefTemplate:'b_currentCity.php?citylist={0}',
|
||||||
|
useCachedMap:true
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(function(){
|
setInterval(function(){
|
||||||
@@ -111,7 +114,7 @@ $(function(){
|
|||||||
<?=WebUtil::printCSS('css/main.css')?>
|
<?=WebUtil::printCSS('css/main.css')?>
|
||||||
<?=WebUtil::printCSS('css/map.css')?>
|
<?=WebUtil::printCSS('css/map.css')?>
|
||||||
<?=WebUtil::printCSS('css/msg.css')?>
|
<?=WebUtil::printCSS('css/msg.css')?>
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Nanum+Gothic|Nanum+Myeongjo|Nanum+Pen+Script" rel="stylesheet">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body class="img_back">
|
<body class="img_back">
|
||||||
@@ -197,7 +200,7 @@ echo "
|
|||||||
?>
|
?>
|
||||||
<tr><td colspan=5 style="text-align:left;">접속중인 국가: <?=onlinenation()?></td></tr>
|
<tr><td colspan=5 style="text-align:left;">접속중인 국가: <?=onlinenation()?></td></tr>
|
||||||
<tr><td colspan=5 style="text-align:left;"><?=adminMsg()?></td></tr>
|
<tr><td colspan=5 style="text-align:left;"><?=adminMsg()?></td></tr>
|
||||||
<tr><td colspan=5 style="text-align:left;"><div>【 국가방침 】</div><div style="color:orange;"><?=nationMsg()?></div></td></tr>
|
<tr><td colspan=5 style="text-align:left;"><div>【 국가방침 】</div><div><?=nationMsg()?></div></td></tr>
|
||||||
<tr><td colspan=5 style="text-align:left;">【 접속자 】<?=onlinegen()?></td></tr>
|
<tr><td colspan=5 style="text-align:left;">【 접속자 】<?=onlinegen()?></td></tr>
|
||||||
<?php
|
<?php
|
||||||
if ($session->userGrade >= 5) {
|
if ($session->userGrade >= 5) {
|
||||||
@@ -229,19 +232,19 @@ else if($session->userGrade == 4){
|
|||||||
</table>
|
</table>
|
||||||
<table class="tb_layout bg0" style="width:1000px;">
|
<table class="tb_layout bg0" style="width:1000px;">
|
||||||
<tr>
|
<tr>
|
||||||
<td width=698 height=520 colspan=2>
|
<td style='width:700px;height:520px;' colspan=2>
|
||||||
<?=getMapHtml()?>
|
<?=getMapHtml($mapTheme)?>
|
||||||
</td>
|
</td>
|
||||||
<td width=298 rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
<td style='width:300px;' rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' style='width:300px;height:700px;' frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
||||||
</tr>
|
</tr>
|
||||||
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
||||||
<td width=646 style="border:none;text-align:center;"><?php cityInfo(); ?></td>
|
<td style="width:650px;border:none;text-align:center;"><?php cityInfo(); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=646 align=right>
|
<td style='width:650px;' align=right>
|
||||||
<font color=cyan><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능 반복&수정<b>→</b></font>
|
<font color=cyan><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능 반복&수정<b>→</b></font>
|
||||||
<select name=sel size=1 style=color:white;background-color:black;font-size:13px;>
|
<select name=sel size=1 style=color:white;background-color:black;font-size:13px;>
|
||||||
<option value=1>1턴</option>
|
<option value=1>1턴</option>
|
||||||
<option value=2>2턴</option>
|
<option value=2>2턴</option>
|
||||||
@@ -255,11 +258,11 @@ else if($session->userGrade == 4){
|
|||||||
<option value=10>10턴</option>
|
<option value=10>10턴</option>
|
||||||
<option value=11>11턴</option>
|
<option value=11>11턴</option>
|
||||||
<option value=12>12턴</option>
|
<option value=12>12턴</option>
|
||||||
</select><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:50px;font-size:13px; value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
|
</select><input type=button style='background-color:<?=GameConst::$basecolor2?>;color:white;width:70px;font-size:13px;margin-left:1ch;margin-right:2ch;' value='반복' onclick='refreshing(this, 2,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▼미루기' onclick='refreshing(this, 2,1)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:80px;font-size:13px; value='▲당기기' onclick='refreshing(this, 2,2)'>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=646 align=right style="border:none;">
|
<td align=right style="'width:650px;border:none;">
|
||||||
<?php commandTable(); ?>
|
<?php commandTable(); ?>
|
||||||
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로비로' onclick=location.replace('../')><br>
|
<input id="mainBtnSubmit" type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='실 행' onclick='refreshing(this, 3,form2)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:110px;font-size:13px; value='갱 신' onclick='refreshing(this, 0,0)'><input type=button style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;font-size:13px; value='로비로' onclick=location.replace('../')><br>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
+8
-1
@@ -19,6 +19,14 @@ $allowReset = in_array('reset', $serverAcl);
|
|||||||
$allowFullReset = in_array('fullReset',$serverAcl);
|
$allowFullReset = in_array('fullReset',$serverAcl);
|
||||||
$allowReset |= $allowFullReset;
|
$allowReset |= $allowFullReset;
|
||||||
|
|
||||||
|
$reserve_open = Util::getReq('reserve_open');
|
||||||
|
if($reserve_open && $reserve_open < date('Y-m-d H:i')){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'현재 시간보다 이전 시간대를 예약 시간으로 지정했습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
if($session->userGrade < 5 && !$allowReset){
|
if($session->userGrade < 5 && !$allowReset){
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
@@ -85,7 +93,6 @@ $npcmode = (int)$_POST['npcmode'];
|
|||||||
$show_img_level = (int)$_POST['show_img_level'];
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
$tournament_trig = (int)$_POST['tournament_trig'];
|
$tournament_trig = (int)$_POST['tournament_trig'];
|
||||||
|
|
||||||
$reserve_open = Util::getReq('reserve_open');
|
|
||||||
if($reserve_open){
|
if($reserve_open){
|
||||||
$reserve_open = new \DateTime($reserve_open);
|
$reserve_open = new \DateTime($reserve_open);
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ $username = Util::getReq('db_id');
|
|||||||
$password = Util::getReq('db_pw');
|
$password = Util::getReq('db_pw');
|
||||||
$dbName = Util::getReq('db_name');
|
$dbName = Util::getReq('db_name');
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
|
||||||
|
|
||||||
if(!$host || !$port || !$username || !$password || !$dbName){
|
if(!$host || !$port || !$username || !$password || !$dbName){
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ $year = Util::getReq('year', 'int');
|
|||||||
$month = Util::getReq('month', 'int');
|
$month = Util::getReq('month', 'int');
|
||||||
$serverID = Util::getReq('serverID', 'string', null);
|
$serverID = Util::getReq('serverID', 'string', null);
|
||||||
|
|
||||||
extractMissingPostToGlobals();
|
|
||||||
|
|
||||||
$url = '/a_history.php';
|
$url = '/a_history.php';
|
||||||
|
|
||||||
if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
|
if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
|
||||||
@@ -19,7 +17,7 @@ if(!strpos($_SERVER['HTTP_REFERER'], $url)) {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$year || !$month) {
|
if($year === null || !$month) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
'reason'=>'year, month가 지정되지 않았습니다'
|
'reason'=>'year, month가 지정되지 않았습니다'
|
||||||
|
|||||||
@@ -0,0 +1,437 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
include "lib.php";
|
||||||
|
include "func.php";
|
||||||
|
|
||||||
|
$session = Session::requireLogin([])->setReadOnly();
|
||||||
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
|
$query = Util::getReq('query');
|
||||||
|
if($query === null){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'입력값이 없습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$action = Util::getReq('action');
|
||||||
|
if($action === null || !in_array($action, ['reorder', 'battle'])){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'원하는 동작이 지정되지 않았습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = Json::decode($query);
|
||||||
|
if($query === null){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'올바르지 않은 JSON입니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$defaultCheck = [
|
||||||
|
'required'=>[
|
||||||
|
'attackerGeneral', 'attackerCity', 'attackerNation',
|
||||||
|
'defenderGenerals', 'defenderCity', 'defenderNation',
|
||||||
|
'year', 'month', 'repeatCnt'
|
||||||
|
],
|
||||||
|
'integer'=>[
|
||||||
|
'year','month','repeatCnt'
|
||||||
|
],
|
||||||
|
'between'=>[
|
||||||
|
['month', [1, 12]]
|
||||||
|
],
|
||||||
|
'in'=>[
|
||||||
|
['repeatCnt', [1, 1000]]
|
||||||
|
],
|
||||||
|
'min'=>[
|
||||||
|
['year', 0]
|
||||||
|
],
|
||||||
|
'array'=>[
|
||||||
|
'attackerGeneral', 'attackerCity', 'attackerNation',
|
||||||
|
'defenderGenerals', 'defenderCity', 'defenderNation'
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$v = new Validator($query);
|
||||||
|
$v->rules($defaultCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$year = $query['year'];
|
||||||
|
$month = $query['month'];
|
||||||
|
$repeatCnt = $query['repeatCnt'];
|
||||||
|
|
||||||
|
$rawAttacker = $query['attackerGeneral'];
|
||||||
|
$rawAttacker['turntime'] = date('Y-m-d H:i:s');
|
||||||
|
$rawAttackerCity = $query['attackerCity'];
|
||||||
|
$rawAttackerNation = $query['attackerNation'];
|
||||||
|
|
||||||
|
$defenderList = $query['defenderGenerals'];
|
||||||
|
$rawDefenderCity = $query['defenderCity'];
|
||||||
|
$rawDefenderNation = $query['defenderNation'];
|
||||||
|
|
||||||
|
|
||||||
|
$generalCheck = [
|
||||||
|
'required'=>[
|
||||||
|
'no', 'name', 'nation', 'turntime', 'personal', 'special2', 'crew', 'crewtype', 'atmos', 'train',
|
||||||
|
'intel', 'intel2', 'book', 'power', 'power2', 'weap', 'injury', 'leader', 'leader2', 'horse', 'item',
|
||||||
|
'explevel', 'experience', 'dedication', 'level', 'gold', 'rice', 'dex0', 'dex10', 'dex20', 'dex30', 'dex40',
|
||||||
|
'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew', 'recwar'
|
||||||
|
],
|
||||||
|
'integer'=>[
|
||||||
|
'no', 'nation', 'personal', 'special2', 'crew', 'crewtype', 'atmos', 'train',
|
||||||
|
'intel', 'intel2', 'book', 'power', 'power2', 'weap', 'injury', 'leader', 'leader2', 'horse', 'item',
|
||||||
|
'explevel', 'experience', 'dedication', 'level', 'gold', 'rice', 'dex0', 'dex10', 'dex20', 'dex30', 'dex40',
|
||||||
|
'warnum', 'killnum', 'deathnum', 'killcrew', 'deathcrew'
|
||||||
|
],
|
||||||
|
'min'=>[
|
||||||
|
['no', 1],
|
||||||
|
['nation', 1],
|
||||||
|
['crew', 0],
|
||||||
|
['intel', 0],
|
||||||
|
['power', 0],
|
||||||
|
['leader', 0],
|
||||||
|
['experience', 0],
|
||||||
|
['gold', 0],
|
||||||
|
['rice', 0],
|
||||||
|
['dex0', 0],
|
||||||
|
['dex10', 0],
|
||||||
|
['dex20', 0],
|
||||||
|
['dex30', 0],
|
||||||
|
['dex40', 0],
|
||||||
|
],
|
||||||
|
'between'=>[
|
||||||
|
['train', [40, GameConst::$maxTrainByWar]],
|
||||||
|
['atmos', [40, GameConst::$maxAtmosByWar]],
|
||||||
|
['book', [0, 26]],
|
||||||
|
['weap', [0, 26]],
|
||||||
|
['horse', [0, 26]],
|
||||||
|
['item', [0, 26]],
|
||||||
|
['explevel', [0, 300]],
|
||||||
|
['injury', [0, 80]],
|
||||||
|
['level', [1, 12]]
|
||||||
|
],
|
||||||
|
'in'=>[
|
||||||
|
['personal', array_keys(getCharacterList())],
|
||||||
|
['special2', array_merge(array_keys(SpecialityConst::WAR), [0])],
|
||||||
|
['crewtype', array_keys(GameUnitConst::all())],
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$v = new Validator($rawAttacker);
|
||||||
|
$v->rules($generalCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'[출병자]'.$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($defenderList as $idx=>$rawDefenderGeneral){
|
||||||
|
$v = new Validator($rawDefenderGeneral);
|
||||||
|
$v->rules($generalCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
$idx+=1;
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>"[수비자{$idx}]".$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$cityCheck = [
|
||||||
|
'required'=>[
|
||||||
|
'city', 'nation', 'supply', 'name',
|
||||||
|
'pop', 'agri', 'comm', 'secu', 'def', 'wall',
|
||||||
|
'rate', 'level',
|
||||||
|
'pop2', 'agri2', 'comm2', 'secu2', 'def2', 'wall2',
|
||||||
|
'dead', 'state', 'gen1', 'gen2', 'gen3', 'conflict',
|
||||||
|
],
|
||||||
|
'numeric'=>[
|
||||||
|
'pop', 'agri', 'comm', 'secu', 'def', 'wall', 'rate', 'dead'
|
||||||
|
],
|
||||||
|
'integer'=>[
|
||||||
|
'city', 'nation', 'supply',
|
||||||
|
'pop2', 'agri2', 'comm2', 'secu2', 'def2', 'wall2',
|
||||||
|
'state', 'gen1', 'gen2', 'gen3'
|
||||||
|
],
|
||||||
|
'min'=>[
|
||||||
|
['def', 0],
|
||||||
|
['wall', 0],
|
||||||
|
['rate', 0],
|
||||||
|
['pop', 0],
|
||||||
|
['comm', 0],
|
||||||
|
['secu', 0],
|
||||||
|
['city', 1],
|
||||||
|
['nation', 0]
|
||||||
|
],
|
||||||
|
'in'=>[
|
||||||
|
['level', array_keys(getCityLevelList())]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$v = new Validator($rawAttackerCity);
|
||||||
|
$v->rules($cityCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'[출병도시]'.$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$v = new Validator($rawDefenderCity);
|
||||||
|
$v->rules($cityCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'[수비도시]'.$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$nationCheck = [
|
||||||
|
'required'=>[
|
||||||
|
'type', 'tech', 'level', 'capital',
|
||||||
|
'nation', 'name', 'gold', 'rice', 'totaltech', 'gennum'
|
||||||
|
],
|
||||||
|
'integer'=>[
|
||||||
|
'type', 'level', 'capital', 'nation', 'gennum',
|
||||||
|
],
|
||||||
|
'numeric'=>[
|
||||||
|
'tech', 'gold', 'rice', 'totaltech'
|
||||||
|
],
|
||||||
|
'min'=>[
|
||||||
|
['tech', 0],
|
||||||
|
['totaltech', 0],
|
||||||
|
['gold', 0],
|
||||||
|
['rice', 0],
|
||||||
|
['gennum', 1],
|
||||||
|
['gen1', 0],
|
||||||
|
['gen2', 0],
|
||||||
|
['gen3', 0],
|
||||||
|
],
|
||||||
|
'in'=>[
|
||||||
|
['type', array_keys(getNationTypeList())],
|
||||||
|
['level', array_keys(getNationLevelList())]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
$v = new Validator($rawAttackerNation);
|
||||||
|
$v->rules($nationCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'[출병국]'.$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$v = new Validator($rawDefenderNation);
|
||||||
|
$v->rules($nationCheck);
|
||||||
|
if(!$v->validate()){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'[수비국]'.$v->errorStr()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($action == 'reorder'){
|
||||||
|
usort($defenderList, function($lhs, $rhs){
|
||||||
|
return -(extractBattleOrder($lhs) <=> extractBattleOrder($rhs));
|
||||||
|
});
|
||||||
|
|
||||||
|
$order = [];
|
||||||
|
foreach($defenderList as $rawDefenderGeneral){
|
||||||
|
$order[] = $rawDefenderGeneral['no'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::die([
|
||||||
|
'result'=>true,
|
||||||
|
'reason'=>'success',
|
||||||
|
'order'=>$order
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
usort($defenderList, function($lhs, $rhs){
|
||||||
|
return -(extractBattleOrder($lhs) <=> extractBattleOrder($rhs));
|
||||||
|
});
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
$startYear = $gameStor->startyear;
|
||||||
|
$cityRate = Util::round(($year - $startYear) / 1.5) + 60;
|
||||||
|
|
||||||
|
|
||||||
|
function simulateBattle(
|
||||||
|
$rawAttacker, $rawAttackerCity, $rawAttackerNation,
|
||||||
|
$defenderList, $rawDefenderCity, $rawDefenderNation,
|
||||||
|
$startYear, $year, $month, $cityRate
|
||||||
|
){
|
||||||
|
$attacker = new WarUnitGeneral($rawAttacker, $rawAttackerCity, $rawAttackerNation, true, $year, $month);
|
||||||
|
$city = new WarUnitCity($rawDefenderCity, $rawDefenderNation, $year, $month, $cityRate);
|
||||||
|
|
||||||
|
$iterDefender = new \ArrayIterator($defenderList);
|
||||||
|
$iterDefender->rewind();
|
||||||
|
|
||||||
|
$battleResult = [];
|
||||||
|
|
||||||
|
$attackerRice = $rawAttacker['rice'];
|
||||||
|
$defenderRice = 0;
|
||||||
|
|
||||||
|
$getNextDefender = function(?WarUnit $prevDefender, bool $reqNext)
|
||||||
|
use ($iterDefender, $rawDefenderCity, $rawDefenderNation, $year, $month, &$battleResult, &$defenderRice) {
|
||||||
|
if($prevDefender !== null){
|
||||||
|
$prevDefender->getLogger()->rollback();
|
||||||
|
$battleResult[] = $prevDefender;
|
||||||
|
if($prevDefender instanceof WarUnitGeneral){
|
||||||
|
$defenderRice -= $prevDefender->getVar('rice');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$reqNext){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$iterDefender->valid()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rawGeneral = $iterDefender->current();
|
||||||
|
if(extractBattleOrder($rawGeneral) <= 0){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$defenderRice += $rawGeneral['rice'];
|
||||||
|
|
||||||
|
$retVal = new WarUnitGeneral($rawGeneral, $rawDefenderCity, $rawDefenderNation, false, $year, $month);
|
||||||
|
$iterDefender->next();
|
||||||
|
return $retVal;
|
||||||
|
};
|
||||||
|
|
||||||
|
$conquerCity = processWar_NG($attacker, $getNextDefender, $city, $year - $startYear);
|
||||||
|
|
||||||
|
$rawDefenderCity = $city->getRaw();
|
||||||
|
$updateAttackerNation = [];
|
||||||
|
$updateDefenderNation = [];
|
||||||
|
|
||||||
|
$attackerRice -= $attacker->getVar('rice');
|
||||||
|
|
||||||
|
if($city->getPhase() > 0){
|
||||||
|
$rice = $city->getKilled() / 100 * 0.8;
|
||||||
|
$rice *= $city->getCrewType()->rice;
|
||||||
|
$rice *= getTechCost($rawDefenderNation['tech']);
|
||||||
|
$rice *= $cityRate / 100 - 0.2;
|
||||||
|
Util::setRound($rice);
|
||||||
|
|
||||||
|
$defenderRice += $rice;
|
||||||
|
}
|
||||||
|
|
||||||
|
$totalDead = $attacker->getKilled() + $attacker->getDead();
|
||||||
|
$attackerCityDead = $totalDead * 0.4;
|
||||||
|
$defenderCityDead = $totalDead * 0.6;
|
||||||
|
|
||||||
|
return [$attacker, $city, $battleResult, $conquerCity, $attackerRice, $defenderRice];
|
||||||
|
}
|
||||||
|
|
||||||
|
$lastWarLog = [];
|
||||||
|
|
||||||
|
$attackerKilled = 0;
|
||||||
|
$attackerDead = 0;
|
||||||
|
|
||||||
|
$attackerMaxKilled = 0;
|
||||||
|
$attackerMinKilled = PHP_INT_MAX;
|
||||||
|
|
||||||
|
$attackerMaxDead = 0;
|
||||||
|
$attackerMinDead = PHP_INT_MAX;
|
||||||
|
|
||||||
|
|
||||||
|
$attackerAvgRice = 0;
|
||||||
|
$defenderAvgRice = 0;
|
||||||
|
|
||||||
|
$avgPhase = 0;
|
||||||
|
$avgWar = 0;
|
||||||
|
|
||||||
|
$attackerActivatedSkills = [];
|
||||||
|
$defendersActivatedSkills = [];
|
||||||
|
|
||||||
|
foreach(range(1, $repeatCnt) as $repeatIdx){
|
||||||
|
[$attacker, $city, $battleResult, $conquerCity, $attackerRice, $defenderRice] = simulateBattle(
|
||||||
|
$rawAttacker, $rawAttackerCity, $rawAttackerNation,
|
||||||
|
$defenderList, $rawDefenderCity, $rawDefenderNation,
|
||||||
|
$startYear, $year, $month, $cityRate
|
||||||
|
);
|
||||||
|
$lastWarLog = Util::mapWithKey(function($key, $values){
|
||||||
|
return ConvertLog(join('<br>', $values));
|
||||||
|
}, $attacker->getLogger()->rollback());
|
||||||
|
|
||||||
|
$avgPhase += $attacker->getPhase() / $repeatCnt;
|
||||||
|
|
||||||
|
$killed = $attacker->getKilled();
|
||||||
|
$dead = $attacker->getDead();
|
||||||
|
|
||||||
|
$attackerKilled += $killed / $repeatCnt;
|
||||||
|
$attackerDead += $dead / $repeatCnt;
|
||||||
|
|
||||||
|
$attackerMaxKilled = max($attackerMaxKilled, $killed);
|
||||||
|
$attackerMinKilled = min($attackerMinKilled, $killed);
|
||||||
|
|
||||||
|
$attackerMaxDead = max($attackerMaxDead, $dead);
|
||||||
|
$attackerMinDead = min($attackerMinDead, $dead);
|
||||||
|
|
||||||
|
$attackerAvgRice += $attackerRice / $repeatCnt;
|
||||||
|
$defenderAvgRice += $defenderRice / $repeatCnt;
|
||||||
|
|
||||||
|
$avgWar += count($battleResult) / $repeatCnt;
|
||||||
|
|
||||||
|
foreach($attacker->getActivatedSkillLog() as $skillName => $skillCnt){
|
||||||
|
if(!key_exists($skillName, $attackerActivatedSkills)){
|
||||||
|
$attackerActivatedSkills[$skillName] = $skillCnt / $repeatCnt;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$attackerActivatedSkills[$skillName] += $skillCnt / $repeatCnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($battleResult as $idx=>$defender){
|
||||||
|
while($idx >= count($defendersActivatedSkills)){
|
||||||
|
$defendersActivatedSkills[] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$activatedSkills = &$defendersActivatedSkills[$idx];
|
||||||
|
foreach($defender->getActivatedSkillLog() as $skillName => $skillCnt){
|
||||||
|
if(!key_exists($skillName, $activatedSkills)){
|
||||||
|
$activatedSkills[$skillName] = $skillCnt / $repeatCnt;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$activatedSkills[$skillName] += $skillCnt / $repeatCnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::die([
|
||||||
|
'result'=>true,
|
||||||
|
'datetime'=>$rawAttacker['turntime'],
|
||||||
|
'reason'=>'success',
|
||||||
|
'lastWarLog'=>$lastWarLog,
|
||||||
|
'avgWar'=>$avgWar,
|
||||||
|
'phase'=>$avgPhase,
|
||||||
|
'killed'=>$attackerKilled,
|
||||||
|
'maxKilled'=>$attackerMaxKilled,
|
||||||
|
'minKilled'=>$attackerMinKilled,
|
||||||
|
'dead'=>$attackerDead,
|
||||||
|
'maxDead'=>$attackerMaxDead,
|
||||||
|
'minDead'=>$attackerMinDead,
|
||||||
|
'attackerRice'=>$attackerAvgRice,
|
||||||
|
'defenderRice'=>$defenderAvgRice,
|
||||||
|
'attackerSkills'=>$attackerActivatedSkills,
|
||||||
|
'defendersSkills'=>$defendersActivatedSkills,
|
||||||
|
]);
|
||||||
+1
-1
@@ -84,7 +84,7 @@ $nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation
|
|||||||
echo getInvitationList($nationList);
|
echo getInvitationList($nationList);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form name=form1 method=post action=join_post.php>
|
<form id='join_form' name=form1 method=post action=join_post.php>
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
<table align=center width=1000 class='tb_layout bg0'>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=3 align=center id=bg1>장수 생성</td>
|
<td colspan=3 align=center id=bg1>장수 생성</td>
|
||||||
|
|||||||
+21
-6
@@ -155,26 +155,40 @@ $leader = $leader + $pleader;
|
|||||||
$power = $power + $ppower;
|
$power = $power + $ppower;
|
||||||
$intel = $intel + $pintel;
|
$intel = $intel + $pintel;
|
||||||
|
|
||||||
|
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level', 'startyear', 'year']);
|
||||||
|
$relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0);
|
||||||
|
|
||||||
$age = 20 + ($pleader + $ppower + $pintel) * 2 - (mt_rand(0, 1));
|
$age = 20 + ($pleader + $ppower + $pintel) * 2 - (mt_rand(0, 1));
|
||||||
// 아직 남았고 천재등록상태이면 특기 부여
|
// 아직 남았고 천재등록상태이면 특기 부여
|
||||||
if ($genius) {
|
if ($genius) {
|
||||||
$specage2 = $age;
|
$specage2 = $age;
|
||||||
$special2 = getSpecial2($leader, $power, $intel);
|
$special2 = getSpecial2($leader, $power, $intel);
|
||||||
} else {
|
} else {
|
||||||
$specage2 = Util::round((80 - $age)/3) + $age;
|
$specage2 = Util::valueFit(Util::round((80 - $age)/4 - $relYear / 2), 3) + $age;
|
||||||
$special2 = 0;
|
$special2 = 0;
|
||||||
}
|
}
|
||||||
//내특
|
//내특
|
||||||
$specage = Util::round((80 - $age)/12) + $age;
|
$specage = Util::valueFit(Util::round((80 - $age)/12 - $relYear / 2), 3) + $age;
|
||||||
$special = 0;
|
$special = 0;
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level']);
|
if ($admin['scenario'] >= 1000) {
|
||||||
|
|
||||||
if ($admin['scenario'] > 0) {
|
|
||||||
$specage2 = $age + 3;
|
$specage2 = $age + 3;
|
||||||
$specage = $age + 3;
|
$specage = $age + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($relYear < 3){
|
||||||
|
$experience = 0;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 5');
|
||||||
|
$targetGenOrder = Util::round($expGenCount * 0.2);
|
||||||
|
$experience = $db->queryFirstField(
|
||||||
|
'SELECT experience FROM general WHERE nation != 0 AND npc < 5 ORDER BY experience ASC LIMIT %i, 1',
|
||||||
|
$targetGenOrder - 1
|
||||||
|
);
|
||||||
|
$experience *= 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
$turntime = getRandTurn($admin['turnterm']);
|
$turntime = getRandTurn($admin['turnterm']);
|
||||||
|
|
||||||
$lastconnect = date('Y-m-d H:i:s');
|
$lastconnect = date('Y-m-d H:i:s');
|
||||||
@@ -211,7 +225,7 @@ $db->insert('general', [
|
|||||||
'leader' => $leader,
|
'leader' => $leader,
|
||||||
'power' => $power,
|
'power' => $power,
|
||||||
'intel' => $intel,
|
'intel' => $intel,
|
||||||
'experience' => 0,
|
'experience' => $experience,
|
||||||
'dedication' => 0,
|
'dedication' => 0,
|
||||||
'gold' => 1000,
|
'gold' => 1000,
|
||||||
'rice' => 1000,
|
'rice' => 1000,
|
||||||
@@ -222,6 +236,7 @@ $db->insert('general', [
|
|||||||
'turntime' => $turntime,
|
'turntime' => $turntime,
|
||||||
'killturn' => 6,
|
'killturn' => 6,
|
||||||
'lastconnect' => $lastconnect,
|
'lastconnect' => $lastconnect,
|
||||||
|
'crewtype'=>GameUnitConst::DEFAULT_CREWTYPE,
|
||||||
'makelimit' => 0,
|
'makelimit' => 0,
|
||||||
'age' => $age,
|
'age' => $age,
|
||||||
'startage' => $age,
|
'startage' => $age,
|
||||||
|
|||||||
@@ -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],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,817 @@
|
|||||||
|
jQuery(function($){
|
||||||
|
|
||||||
|
|
||||||
|
var $generalForm = $('.form_sample .general_detail');
|
||||||
|
var $defenderHeaderForm = $('.form_sample .card-header');
|
||||||
|
var $defenderColumn = $('.defender-column');
|
||||||
|
|
||||||
|
var defenderNoList = {};
|
||||||
|
|
||||||
|
var $attackerCard = $('.attacker_form');
|
||||||
|
|
||||||
|
var initBasicEvent = function(){
|
||||||
|
|
||||||
|
$('.form_injury').change(function(){
|
||||||
|
var $this = $(this);
|
||||||
|
var $general = getGeneralDetail($this);
|
||||||
|
var $helptext = $general.find('.injury_helptext');
|
||||||
|
|
||||||
|
var injury = parseInt($this.val());
|
||||||
|
//FIXME: PHP 코드와 항상 일치하도록 변경
|
||||||
|
var text = '건강';
|
||||||
|
var color = 'white';
|
||||||
|
if(injury > 60){
|
||||||
|
text = '위독';
|
||||||
|
color = 'red';
|
||||||
|
}
|
||||||
|
else if(injury > 40){
|
||||||
|
text = '심각';
|
||||||
|
color = 'magenta';
|
||||||
|
}
|
||||||
|
else if(injury > 20){
|
||||||
|
text = '중상';
|
||||||
|
color = 'orange';
|
||||||
|
}
|
||||||
|
else if(injury > 0){
|
||||||
|
text = '경상';
|
||||||
|
color = 'yellow';
|
||||||
|
}
|
||||||
|
$helptext.html(text).css('color', color);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.export_general').click(function(){
|
||||||
|
var $btn = $(this);
|
||||||
|
var $general = getGeneralDetail($btn);
|
||||||
|
|
||||||
|
var values = exportGeneralInfo($general);
|
||||||
|
console.log(values);
|
||||||
|
});
|
||||||
|
$('.delete-defender').click(function(){
|
||||||
|
var $card = getGeneralFrame($(this));
|
||||||
|
deleteDefender($card);
|
||||||
|
});
|
||||||
|
$('.copy-defender').click(function(){
|
||||||
|
var $card = getGeneralFrame($(this));
|
||||||
|
copyDefender($card);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.add-defender').click(function(){
|
||||||
|
addDefender();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-general-load').click(function(){
|
||||||
|
var $file = $(this).prev();
|
||||||
|
$file[0].click();
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.form_load_general_file').on('change', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
var $card = getGeneralFrame($this);
|
||||||
|
|
||||||
|
var files = e.target.files;
|
||||||
|
|
||||||
|
importGeneralInfoByFile(files, $card);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-general-save').click(function(){
|
||||||
|
var $this = $(this);
|
||||||
|
var $general = getGeneralDetail($this);
|
||||||
|
var generalData = exportGeneralInfo($general);
|
||||||
|
|
||||||
|
var filename = "general_{0}.json".format(generalData.name);
|
||||||
|
var saveData = JSON.stringify({
|
||||||
|
objType:'general',
|
||||||
|
data:generalData
|
||||||
|
}, null, 4);
|
||||||
|
|
||||||
|
download(saveData, filename, 'application/json');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-battle-load').click(function(){
|
||||||
|
var $file = $(this).prev();
|
||||||
|
$file[0].click();
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.form_load_battle_file').on('change', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
var files = e.target.files;
|
||||||
|
|
||||||
|
importBattleInfoByFile(files);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-battle-save').click(function(){
|
||||||
|
var battleData = exportAllData();
|
||||||
|
var filename = "battle_{0}.json".format(moment().format('YYYYMMDD_hhmmss'));
|
||||||
|
var saveData = JSON.stringify({
|
||||||
|
objType:'battle',
|
||||||
|
data:battleData
|
||||||
|
}, null, 4);
|
||||||
|
|
||||||
|
download(saveData, filename, 'application/json');
|
||||||
|
})
|
||||||
|
|
||||||
|
var $generals = $('.general_detail');
|
||||||
|
$generals.bind('dragover dragleave', function(e) {
|
||||||
|
e.stopPropagation()
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
$generals.bind('drop', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
var $card = getGeneralFrame($this);
|
||||||
|
|
||||||
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
|
||||||
|
importGeneralInfoByFile(files, $card);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
var $battlePad = $('.dragpad_battle');
|
||||||
|
$battlePad.bind('dragover dragleave', function(e) {
|
||||||
|
e.stopPropagation()
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
$battlePad.bind('drop', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
|
|
||||||
|
importBattleInfoByFile(files);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var importGeneralInfo = function($general, data){
|
||||||
|
var setVal = function(query, val){
|
||||||
|
$general.find(query).val(val).change();
|
||||||
|
}
|
||||||
|
|
||||||
|
setVal('.form_general_name', data.name);
|
||||||
|
|
||||||
|
setVal('.form_general_level', data.level);
|
||||||
|
setVal('.form_exp_level', data.explevel);
|
||||||
|
setVal('.form_injury', data.injury);
|
||||||
|
|
||||||
|
setVal('.form_leadership', data.leader);
|
||||||
|
setVal('.form_general_horse', data.horse);
|
||||||
|
setVal('.form_power', data.power);
|
||||||
|
setVal('.form_general_weap', data.weap);
|
||||||
|
setVal('.form_intel', data.intel);
|
||||||
|
setVal('.form_general_book', data.book);
|
||||||
|
setVal('.form_general_item', data.item);
|
||||||
|
|
||||||
|
setVal('.form_injury', data.injury);
|
||||||
|
|
||||||
|
setVal('.form_rice', data.rice);
|
||||||
|
|
||||||
|
setVal('.form_general_character', data.personal);
|
||||||
|
setVal('.form_general_special_war', data.special2);
|
||||||
|
|
||||||
|
setVal('.form_crew', data.crew);
|
||||||
|
setVal('.form_crewtype', data.crewtype);
|
||||||
|
setVal('.form_atmos', data.atmos);
|
||||||
|
setVal('.form_train', data.train);
|
||||||
|
|
||||||
|
setVal('.form_dex0', data.dex0);
|
||||||
|
setVal('.form_dex10', data.dex10);
|
||||||
|
setVal('.form_dex20', data.dex20);
|
||||||
|
setVal('.form_dex30', data.dex30);
|
||||||
|
setVal('.form_dex40', data.dex40);
|
||||||
|
setVal('.form_defend_mode', data.mode);
|
||||||
|
|
||||||
|
if(!setGeneralNo($general, data.no)){
|
||||||
|
setGeneralNo($general, generateNewGeneralNo());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var exportGeneralInfo = function($general){
|
||||||
|
var getInt = function(query){
|
||||||
|
return parseInt($general.find(query).val());
|
||||||
|
}
|
||||||
|
|
||||||
|
var getVal = function(query){
|
||||||
|
return $general.find(query).val();
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
no:getGeneralNo($general),
|
||||||
|
name:getVal('.form_general_name'),
|
||||||
|
level:getInt('.form_general_level'),
|
||||||
|
explevel:getInt('.form_exp_level'),
|
||||||
|
|
||||||
|
leader:getInt('.form_leadership'),
|
||||||
|
horse:getInt('.form_general_horse'),
|
||||||
|
power:getInt('.form_power'),
|
||||||
|
weap:getInt('.form_general_weap'),
|
||||||
|
intel:getInt('.form_intel'),
|
||||||
|
book:getInt('.form_general_book'),
|
||||||
|
item:getInt('.form_general_item'),
|
||||||
|
|
||||||
|
injury:getInt('.form_injury'),
|
||||||
|
|
||||||
|
rice:getInt('.form_rice'),
|
||||||
|
|
||||||
|
personal:getInt('.form_general_character'),
|
||||||
|
special2:getInt('.form_general_special_war'),
|
||||||
|
|
||||||
|
crew:getInt('.form_crew'),
|
||||||
|
crewtype:getInt('.form_crewtype'),
|
||||||
|
atmos:getInt('.form_atmos'),
|
||||||
|
train:getInt('.form_train'),
|
||||||
|
|
||||||
|
dex0:getInt('.form_dex0'),
|
||||||
|
dex10:getInt('.form_dex10'),
|
||||||
|
dex20:getInt('.form_dex20'),
|
||||||
|
dex30:getInt('.form_dex30'),
|
||||||
|
dex40:getInt('.form_dex40'),
|
||||||
|
mode:getInt('.form_defend_mode'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var importBattleInfoByFile = function(files){
|
||||||
|
if(files === null){
|
||||||
|
alert('파일 에러!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(files.length < 1){
|
||||||
|
alert("파일 에러!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var file = files[0];
|
||||||
|
if(file.size > 1024*1024){
|
||||||
|
alert('파일이 너무 큽니다!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(file.type === ''){
|
||||||
|
alert('폴더를 업로드할 수 없습니다!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(){
|
||||||
|
var battleData = {};
|
||||||
|
try {
|
||||||
|
battleData = JSON.parse(reader.result);
|
||||||
|
} catch(e) {
|
||||||
|
alert('올바르지 않은 파일 형식입니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!('objType' in battleData)){
|
||||||
|
alert('파일 형식을 확인할 수 없습니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(battleData.objType != 'battle'){
|
||||||
|
alert('전투 데이터가 아닙니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
importBattleInfo(battleData.data);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
alert('파일을 읽는데 실패했습니다.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var importGeneralInfoByFile = function(files, $card){
|
||||||
|
if($card === undefined){
|
||||||
|
$card = addDefender();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(files === null){
|
||||||
|
alert('파일 에러!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(files.length < 1){
|
||||||
|
alert("파일 에러!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var file = files[0];
|
||||||
|
if(file.size > 1024*1024){
|
||||||
|
alert('파일이 너무 큽니다!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(file.type === ''){
|
||||||
|
alert('폴더를 업로드할 수 없습니다!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(){
|
||||||
|
var generalData = {};
|
||||||
|
try {
|
||||||
|
generalData = JSON.parse(reader.result);
|
||||||
|
} catch(e) {
|
||||||
|
alert('올바르지 않은 파일 형식입니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!('objType' in generalData)){
|
||||||
|
alert('파일 형식을 확인할 수 없습니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(generalData.objType == 'battle'){
|
||||||
|
importBattleInfo(generalData.data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if(generalData.objType != 'general'){
|
||||||
|
alert('장수 데이터가 아닙니다');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$card.find('.form_load_general_file').val('');
|
||||||
|
|
||||||
|
importGeneralInfo($card, generalData.data);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
alert('파일을 읽는데 실패했습니다.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var extendGeneralInfoForDB = function(generalData){
|
||||||
|
|
||||||
|
var dbVal = {
|
||||||
|
nation: (generalData.no)<=1 ? 1 : 2,
|
||||||
|
city: (generalData.no)<=1 ? 1 : 3,
|
||||||
|
turntime:'2018-08-26 12:00',
|
||||||
|
special:0,
|
||||||
|
leader2:0,
|
||||||
|
power2:0,
|
||||||
|
intel2:0,
|
||||||
|
|
||||||
|
gold:10000,
|
||||||
|
|
||||||
|
dedication:0,
|
||||||
|
warnum:0,
|
||||||
|
killnum:0,
|
||||||
|
deathnum:0,
|
||||||
|
|
||||||
|
killcrew:20000,
|
||||||
|
deathcrew:20000,
|
||||||
|
recwar:'SUCCESS',
|
||||||
|
experience:Math.pow(generalData.explevel, 2),
|
||||||
|
};
|
||||||
|
|
||||||
|
return $.extend({}, generalData, dbVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
var getGeneralFrame = function($btn){
|
||||||
|
var $card = $btn.closest('.general_form');
|
||||||
|
return $card;
|
||||||
|
}
|
||||||
|
|
||||||
|
var getGeneralDetail = function($btn){
|
||||||
|
var $card = getGeneralFrame($btn);
|
||||||
|
var $general = $card.find('.general_detail');
|
||||||
|
return $general;
|
||||||
|
}
|
||||||
|
|
||||||
|
var getGeneralNo = function($btn){
|
||||||
|
return parseInt(getGeneralFrame($btn).data('general_no'));
|
||||||
|
}
|
||||||
|
|
||||||
|
var setGeneralNo = function($btn, value){
|
||||||
|
if(value == 1){
|
||||||
|
//1번은 무조건 공격자임
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(value in defenderNoList){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var $card = getGeneralFrame($btn);
|
||||||
|
$card.data('general_no', value);
|
||||||
|
defenderNoList[value] = $card;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var generateNewGeneralNo = function(){
|
||||||
|
while(true){
|
||||||
|
var newGeneralNo = parseInt(Math.random()*(1<<24))+2;
|
||||||
|
if(newGeneralNo in defenderNoList){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return newGeneralNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var deleteGeneralNo = function($btn){
|
||||||
|
var $card = getGeneralFrame($btn);
|
||||||
|
$card.removeData('general_no');
|
||||||
|
var generalNo = getGeneralNo($card);
|
||||||
|
delete defenderNoList[generalNo];
|
||||||
|
}
|
||||||
|
|
||||||
|
var addDefender = function($cardAfter){
|
||||||
|
var $newCard = $('<div class="card mb-2 defender_form general_form"></div>');
|
||||||
|
|
||||||
|
if($cardAfter === undefined){
|
||||||
|
$defenderColumn.append($newCard);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$cardAfter.after($newCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
$newCard.append($defenderHeaderForm.clone(true,true));
|
||||||
|
$newCard.append($generalForm.clone(true,true));
|
||||||
|
|
||||||
|
$newGeneral = getGeneralDetail($newCard);
|
||||||
|
setGeneralNo($newCard, generateNewGeneralNo());
|
||||||
|
|
||||||
|
return $newCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
var deleteDefender = function($card){
|
||||||
|
deleteGeneralNo($card);
|
||||||
|
$card.detach();
|
||||||
|
}
|
||||||
|
|
||||||
|
var copyDefender = function($card){
|
||||||
|
var $general = getGeneralDetail($card);
|
||||||
|
|
||||||
|
var generalData = exportGeneralInfo($general);
|
||||||
|
var $newObj = addDefender($card);
|
||||||
|
importGeneralInfo(getGeneralDetail($newObj), generalData);
|
||||||
|
}
|
||||||
|
|
||||||
|
var importBattleInfo = function(battleData){
|
||||||
|
|
||||||
|
$('.form_load_battle_file').val('');
|
||||||
|
console.log(battleData);
|
||||||
|
|
||||||
|
var $attackerNation = $('.attacker_nation');
|
||||||
|
var $defenderNation = $('.defender_nation');
|
||||||
|
|
||||||
|
var attackerGeneral = battleData.attackerGeneral;
|
||||||
|
var attackerCity = battleData.attackerCity;
|
||||||
|
var attackerNation = battleData.attackerNation;
|
||||||
|
|
||||||
|
var defenderGenerals = battleData.defenderGenerals;
|
||||||
|
var defenderCity = battleData.defenderCity;
|
||||||
|
var defenderNation = battleData.defenderNation;
|
||||||
|
|
||||||
|
$('#year').val(battleData.year);
|
||||||
|
$('#month').val(battleData.month);
|
||||||
|
$('#repeat_cnt').val(battleData.repeatCnt);
|
||||||
|
|
||||||
|
$('.delete-defender').click();
|
||||||
|
|
||||||
|
$attackerNation.find('.form_nation_type').val(attackerNation.type);
|
||||||
|
$attackerNation.find('.form_tech').val(Math.floor(attackerNation.tech/1000));
|
||||||
|
$attackerNation.find('.form_nation_level').val(attackerNation.level);
|
||||||
|
if(attackerNation.capital == 1){
|
||||||
|
$attackerNation.find('.form_is_capital:first').click();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$attackerNation.find('.form_is_capital:last').click();
|
||||||
|
}
|
||||||
|
$attackerNation.find('.form_city_level').val(attackerCity.level);
|
||||||
|
|
||||||
|
importGeneralInfo($('.attacker_form'), attackerGeneral);
|
||||||
|
|
||||||
|
$defenderNation.find('.form_nation_type').val(defenderNation.type);
|
||||||
|
$defenderNation.find('.form_tech').val(Math.floor(defenderNation.tech/1000));
|
||||||
|
$defenderNation.find('.form_nation_level').val(defenderNation.level);
|
||||||
|
if(defenderNation.capital == 1){
|
||||||
|
$defenderNation.find('.form_is_capital:first').click();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$defenderNation.find('.form_is_capital:last').click();
|
||||||
|
}
|
||||||
|
$defenderNation.find('.form_city_level').val(defenderCity.level);
|
||||||
|
$('#city_def').val(defenderCity.def);
|
||||||
|
$('#city_wall').val(defenderCity.wall);
|
||||||
|
|
||||||
|
$.each(defenderGenerals, function(idx, defenderGeneral){
|
||||||
|
var $card = addDefender();
|
||||||
|
importGeneralInfo($card, defenderGeneral);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var exportAllData = function(){
|
||||||
|
var $attackerNation = $('.attacker_nation');
|
||||||
|
var $defenderNation = $('.defender_nation');
|
||||||
|
|
||||||
|
var attackerGeneral = exportGeneralInfo($('.attacker_form'));
|
||||||
|
|
||||||
|
var attackerCity = {
|
||||||
|
level:parseInt($attackerNation.find('.form_city_level').val()),
|
||||||
|
};
|
||||||
|
|
||||||
|
var attackerNation = {
|
||||||
|
type:parseInt($attackerNation.find('.form_nation_type').val()),
|
||||||
|
tech:parseInt($attackerNation.find('.form_tech').val()) * 1000,
|
||||||
|
level:parseInt($attackerNation.find('.form_nation_level').val()),
|
||||||
|
capital:$attackerNation.find('.form_is_capital:checked').val()=='1'?1:2,
|
||||||
|
}
|
||||||
|
|
||||||
|
var defenderGenerals = $('.defender_form').map(function(){
|
||||||
|
return exportGeneralInfo($(this));
|
||||||
|
}).toArray();
|
||||||
|
|
||||||
|
var defenderCity = {
|
||||||
|
def: parseInt($('#city_def').val()),
|
||||||
|
wall: parseInt($('#city_wall').val()),
|
||||||
|
level:parseInt($defenderNation.find('.form_city_level').val()),
|
||||||
|
};
|
||||||
|
|
||||||
|
var defenderNation = {
|
||||||
|
type:parseInt($defenderNation.find('.form_nation_type').val()),
|
||||||
|
tech:parseInt($defenderNation.find('.form_tech').val()) * 1000,
|
||||||
|
level:parseInt($defenderNation.find('.form_nation_level').val()),
|
||||||
|
capital:$defenderNation.find('.form_is_capital:checked').val()=='1'?3:4,
|
||||||
|
}
|
||||||
|
|
||||||
|
var year = parseInt($('#year').val());
|
||||||
|
var month = parseInt($('#month').val());
|
||||||
|
var repeatCnt = parseInt($('#repeat_cnt').val());
|
||||||
|
|
||||||
|
return {
|
||||||
|
attackerGeneral:attackerGeneral,
|
||||||
|
attackerCity:attackerCity,
|
||||||
|
attackerNation:attackerNation,
|
||||||
|
|
||||||
|
defenderGenerals:defenderGenerals,
|
||||||
|
defenderCity:defenderCity,
|
||||||
|
defenderNation:defenderNation,
|
||||||
|
|
||||||
|
year:year,
|
||||||
|
month:month,
|
||||||
|
repeatCnt:repeatCnt,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var extendAllDataForDB = function(allData){
|
||||||
|
var defaultNation = {
|
||||||
|
nation:0,
|
||||||
|
name:'재야',
|
||||||
|
capital:0,
|
||||||
|
level:0,
|
||||||
|
gold:0,
|
||||||
|
rice:2000,
|
||||||
|
type:0,
|
||||||
|
tech:0,
|
||||||
|
totaltech:0,
|
||||||
|
gennum:200,
|
||||||
|
};
|
||||||
|
|
||||||
|
var defaultCity = {
|
||||||
|
nation:0,
|
||||||
|
supply:1,
|
||||||
|
name:'도시',
|
||||||
|
|
||||||
|
pop:500000,
|
||||||
|
agri:10000,
|
||||||
|
comm:10000,
|
||||||
|
secu:10000,
|
||||||
|
def:1000,
|
||||||
|
wall:1000,
|
||||||
|
|
||||||
|
rate:100,
|
||||||
|
|
||||||
|
pop2:600000,
|
||||||
|
agri2:12000,
|
||||||
|
comm2:12000,
|
||||||
|
secu2:10000,
|
||||||
|
def2:12000,
|
||||||
|
wall2:12000,
|
||||||
|
|
||||||
|
dead:0,
|
||||||
|
|
||||||
|
state:0,
|
||||||
|
gen1:0,
|
||||||
|
gen2:0,
|
||||||
|
gen3:0,
|
||||||
|
|
||||||
|
conflict:'{}',
|
||||||
|
};
|
||||||
|
|
||||||
|
var attackerNation = $.extend({}, defaultNation, allData.attackerNation);
|
||||||
|
attackerNation.nation = 1;
|
||||||
|
attackerNation.name = '출병국';
|
||||||
|
attackerNation.totaltech = attackerNation.tech * attackerNation.gennum;
|
||||||
|
|
||||||
|
var attackerCity = $.extend({}, defaultCity, allData.attackerCity);
|
||||||
|
attackerCity.nation = 1;
|
||||||
|
attackerCity.city = 1;
|
||||||
|
|
||||||
|
var attackerGeneral = extendGeneralInfoForDB(allData.attackerGeneral);
|
||||||
|
if(attackerGeneral.level == 4){
|
||||||
|
attackerCity.gen1 = attackerGeneral.no;
|
||||||
|
}
|
||||||
|
if(attackerGeneral.level == 3){
|
||||||
|
attackerCity.gen2 = attackerGeneral.no;
|
||||||
|
}
|
||||||
|
if(attackerGeneral.level == 2){
|
||||||
|
attackerCity.gen3 = attackerGeneral.no;
|
||||||
|
}
|
||||||
|
|
||||||
|
var defenderNation = $.extend({}, defaultNation, allData.defenderNation);
|
||||||
|
defenderNation.nation = 2;
|
||||||
|
defenderNation.name = '수비국';
|
||||||
|
defenderNation.totaltech = defenderNation.tech * defenderNation.gennum;
|
||||||
|
|
||||||
|
var defenderCity = $.extend({}, defaultCity, allData.defenderCity);
|
||||||
|
defenderCity.nation = 2;
|
||||||
|
defenderCity.city = 3;
|
||||||
|
defenderCity.wall2 = defenderCity.wall/5*6;
|
||||||
|
defenderCity.def2 = defenderCity.def/5*6;
|
||||||
|
|
||||||
|
var defenderGenerals = [];
|
||||||
|
$.each(allData.defenderGenerals, function(){
|
||||||
|
var defenderGeneral = extendGeneralInfoForDB(this);
|
||||||
|
if(defenderGeneral.level == 4){
|
||||||
|
defenderCity.gen1 = defenderGeneral.no;
|
||||||
|
}
|
||||||
|
if(defenderGeneral.level == 3){
|
||||||
|
defenderCity.gen2 = defenderGeneral.no;
|
||||||
|
}
|
||||||
|
if(defenderGeneral.level == 2){
|
||||||
|
defenderCity.gen3 = defenderGeneral.no;
|
||||||
|
}
|
||||||
|
|
||||||
|
defenderGenerals.push(defenderGeneral);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return $.extend({}, allData, {
|
||||||
|
attackerGeneral:attackerGeneral,
|
||||||
|
attackerCity:attackerCity,
|
||||||
|
attackerNation:attackerNation,
|
||||||
|
|
||||||
|
defenderGenerals:defenderGenerals,
|
||||||
|
defenderCity:defenderCity,
|
||||||
|
defenderNation:defenderNation,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var parseSkillCount = function(skills){
|
||||||
|
var result = [];
|
||||||
|
$.each(skills, function(key, value){
|
||||||
|
result.push("{0}({1}회)".format(key, toPretty(value)));
|
||||||
|
})
|
||||||
|
|
||||||
|
if(result.length == 0){
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return result.join(', ');
|
||||||
|
}
|
||||||
|
|
||||||
|
var toPretty = function(number){
|
||||||
|
if(isInt(number)){
|
||||||
|
number = parseInt(number);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
number = parseFloat(number).toFixed(2);
|
||||||
|
}
|
||||||
|
return numberWithCommas(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
var showBattleResult = function(result){
|
||||||
|
$('#result_datetime').html(result.datetime);
|
||||||
|
$('#result_warcnt').html(toPretty(result.avgWar));
|
||||||
|
$('#result_phase').html(toPretty(result.phase));
|
||||||
|
$('#result_killed').html(toPretty(result.killed));
|
||||||
|
if(result.minKilled != result.maxKilled){
|
||||||
|
$('#result_maxKilled').html(toPretty(result.maxKilled));
|
||||||
|
$('#result_minKilled').html(toPretty(result.minKilled));
|
||||||
|
$('#result_varKilled').show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#result_varKilled').hide();
|
||||||
|
}
|
||||||
|
$('#result_dead').html(toPretty(result.dead));
|
||||||
|
if(result.minDead != result.maxDead){
|
||||||
|
$('#result_maxDead').html(toPretty(result.maxDead));
|
||||||
|
$('#result_minDead').html(toPretty(result.minDead));
|
||||||
|
$('#result_varDead').show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#result_varDead').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#result_attackerRice').html(toPretty(result.attackerRice));
|
||||||
|
$('#result_defenderRice').html(toPretty(result.defenderRice));
|
||||||
|
$('#result_attackerSkills').html(parseSkillCount(result.attackerSkills));
|
||||||
|
|
||||||
|
$('.result_defenderSkills').detach();
|
||||||
|
|
||||||
|
var $summary = $('#battle_result_summary');
|
||||||
|
|
||||||
|
$.each(result.defendersSkills, function(idx, defenderSkills){
|
||||||
|
console.log(defenderSkills);
|
||||||
|
var $result = $("<tr class='result_defenderSkills'><th>수비자{0} 스킬</th><td></td></tr>".format(idx + 1));
|
||||||
|
$result.find('td').html(parseSkillCount(defenderSkills));
|
||||||
|
$summary.append($result);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#generalBattleResultLog').html(result.lastWarLog.generalBattleResultLog);
|
||||||
|
$('#generalBattleDetailLog').html(result.lastWarLog.generalBattleDetailLog);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var beginBattle = function(){
|
||||||
|
var data = extendAllDataForDB(exportAllData());
|
||||||
|
console.log(data);
|
||||||
|
$.ajax({
|
||||||
|
type:'post',
|
||||||
|
url:'j_simulate_battle.php',
|
||||||
|
dataType:'json',
|
||||||
|
data:{
|
||||||
|
action:'battle',
|
||||||
|
query:JSON.stringify(data),
|
||||||
|
}
|
||||||
|
}).then(function(result){
|
||||||
|
console.log(result);
|
||||||
|
if(!result.result){
|
||||||
|
alert(result.reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showBattleResult(result);
|
||||||
|
|
||||||
|
}, function(result){
|
||||||
|
alert('전투 개시 실패!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var reorderDefender = function(defenderOrder){
|
||||||
|
$.each(defenderOrder, function(idx, generalNo){
|
||||||
|
|
||||||
|
if(!(generalNo in defenderNoList)){
|
||||||
|
//음..?
|
||||||
|
alert("{0}이 수비자 리스트에 없습니다. 버그인 듯 합니다.".format(generalNo));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var $defenderObj = defenderNoList[generalNo];
|
||||||
|
$defenderObj.detach();
|
||||||
|
$defenderColumn.append($defenderObj);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var requestReorderDefender = function(){
|
||||||
|
var data = extendAllDataForDB(exportAllData());
|
||||||
|
console.log(data);
|
||||||
|
$.ajax({
|
||||||
|
type:'post',
|
||||||
|
url:'j_simulate_battle.php',
|
||||||
|
dataType:'json',
|
||||||
|
data:{
|
||||||
|
action:'reorder',
|
||||||
|
query:JSON.stringify(data),
|
||||||
|
}
|
||||||
|
}).then(function(result){
|
||||||
|
console.log(result);
|
||||||
|
if(!result.result){
|
||||||
|
alert(result.reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
reorderDefender(result.order);
|
||||||
|
|
||||||
|
}, function(result){
|
||||||
|
alert('재정렬 실패!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
initBasicEvent();
|
||||||
|
$attackerCard.append($generalForm.clone(true,true));
|
||||||
|
addDefender();
|
||||||
|
|
||||||
|
$('.btn-begin_battle').click(function(){
|
||||||
|
beginBattle();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btn-reorder_defender').click(function(){
|
||||||
|
requestReorderDefender();
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -23,6 +23,14 @@ var escapeHtml = (function (string) {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 변수가 정수인지 확인하는 함수
|
||||||
|
* @param {*} n 정수인지 확인하기 위한 인자
|
||||||
|
* @return {boolean} 정수인지 여부
|
||||||
|
*/
|
||||||
|
function isInt(n) {
|
||||||
|
return +n === n && !(n % 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* object의 array를 id를 key로 삼는 object로 재 변환
|
* object의 array를 id를 key로 삼는 object로 재 변환
|
||||||
@@ -89,6 +97,11 @@ function convColorValue(color) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function numberWithCommas(x) {
|
||||||
|
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 단순한 Template 함수. <%변수명%>으로 template 가능
|
* 단순한 Template 함수. <%변수명%>으로 template 가능
|
||||||
* @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js
|
* @see https://github.com/krasimir/absurd/blob/master/lib/processors/html/helpers/TemplateEngine.js
|
||||||
@@ -137,4 +150,11 @@ jQuery(function($){
|
|||||||
},
|
},
|
||||||
html:true
|
html:true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var customCSS = localStorage.getItem('sam_customCSS');
|
||||||
|
if(customCSS){
|
||||||
|
var $style = $('<style type="text/css"></style>');
|
||||||
|
$style.text(customCSS);
|
||||||
|
$style.appendTo($('head'));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user