Compare commits

..
42 Commits
Author SHA1 Message Date
Hide_D 83d6a2169b 유산 포인트 시스템, 추가 기수 대비 (#187)
- 유산 포인트
  - 기수 뒤로도 누적되는 포인트
  - 생존, 최대 임관년 수, 최대 연속 내정 성공, 병종 상성 우위 횟수, 전투 횟수, 계략 성공 횟수, 천통 기여(규모 상승, 천통 수뇌, 천통 군주), 숙련도, 토너먼트, 베팅 당첨
  - 유산 관리 페이지 제공

- 태수국
  - 181년 1월에 자동 생성되는 u장수국
  - 시간이 지나면 사실상 자동 소멸
  - 유저국과는 4칸 거리, 서로는 2칸 거리
  - 이 시스템으로 인해 m장 거병 차단

- NPC 원조시 불가침
  - 1년 세수만큼 받은 경우 24개월 불가침 제안
  - 최소 6개월
  - 불가침을 받지 않고 추가 원조한 경우 계속해서 기간 상승
  - 단, 불가침 수락 전에 선포를 할 수 있음

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/187
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
2021-08-11 21:57:52 +09:00
Hide_D 21e7a4d966 Dep: update
주로 PHAN
2021-08-06 22:39:09 +09:00
Hide_D 404cd24855 작위보상 비중 수정 2021-05-02 02:00:16 +09:00
Hide_D b4ad72ee67 환약을 유니크로 습득하는 버그 수정 2021-05-01 23:48:01 +09:00
Hide_D bea628b619 환약을 습득하게 되는 버그 수정 2021-05-01 23:46:33 +09:00
Hide_D 3637e54982 유니크 onCalcStat 버그 수정 2021-05-01 23:38:06 +09:00
Hide_D e0d1a0a612 아이템 효과 텍스트 수정 2021-04-30 22:36:24 +09:00
Hide_D 3040996671 무쌍 누락분 수정 2021-04-30 16:35:34 +09:00
Hide_D dd830e7500 TypeCode 추가 2021-04-29 22:38:46 +09:00
Hide_D d2dfe2c418 전투 수비 파트 약 상향 2021-04-29 21:10:47 +09:00
Hide_D 139fb6b6e0 국가 규모 승급시 아이템 습득 방식 변경 2021-04-29 20:31:32 +09:00
Hide_D c4f6976c42 유니크 아이템에 효과 추가 2021-04-29 19:50:12 +09:00
Hide_D ab428fc104 유니크 기본 획득 확률 변경 2021-04-29 18:49:19 +09:00
Hide_D aa97f78acd 무쌍 초반 버프, 후반 너프 2021-04-29 18:47:55 +09:00
Hide_D dbce900aeb 유니크 중복 획득 가능 2021-04-29 18:44:09 +09:00
Hide_D 30b382e2e7 초반 등록 NPC 30명 2021-04-29 18:30:46 +09:00
Hide_D 433c4abb86 fix: 이민족 종료 시점 2021-04-11 23:17:47 +09:00
Hide_D 64404e4092 fix: 이민족 종료조건 추가 2021-04-11 21:22:06 +09:00
Hide_D 08d483af8a fix: 후방 워프 인구 충분 판단 기준 수정 2021-04-10 16:01:21 +09:00
Hide_D fa19c17941 fix: AI 발령 턴 오류 수정 2021-04-10 15:39:03 +09:00
Hide_D c896a999ad fix: 전방 도시가 '관'처럼 인구가 적은 경우 후방 워프하지 않는 버그 수정
feat: 후방 발령 관련 로직도 후방 워프와 유사하게 재 적용
2021-04-10 11:51:10 +09:00
Hide_D f9bca935ac fix: 장수수 카운트에 "의병장"을 포함하여 계산하는 버그 수정 2021-04-02 14:39:57 +09:00
Hide_D 7abf274d89 이민족 난이도 기본 수치 변경 2021-03-29 22:45:43 +09:00
Hide_D e2ad417306 feat: 이민족 등장 2021-03-28 16:31:01 +09:00
Hide_D 2ea9655f6b fix: 이민족 2021-03-28 05:57:53 +09:00
Hide_D f450d5d9de fix: 수비자 도시 버그
fix: RaiseInvader 버그 수정 중
2021-03-28 04:12:10 +09:00
Hide_D f8f4b73a09 feat: RaiserInvader 초기 구현 2021-03-28 03:13:03 +09:00
Hide_D 926d96732d fix: 가상 역사 모드에서 후계자 지정이 사실 모드 설정을 따라가는 버그 수정 2021-03-23 13:24:34 +09:00
Hide_D 167113d6a3 fix: 빙의 해제시 owner 값 버그 수정 2021-03-23 13:19:40 +09:00
Hide_D 911cb614a5 fix: RegNPC 버그 수정, event handler 규격 버그 수정 2021-03-19 18:09:53 +09:00
Hide_D 7a939b7024 fix: RegNPC 버그 수정 2021-03-19 17:44:34 +09:00
Hide_D 6e57a60997 RegNPC 버그 수정 2021-03-19 17:36:13 +09:00
Hide_D 9f1151e699 fix: can부대구출발령 없음 2021-03-19 17:22:48 +09:00
Hide_D 3fbe1fb63d 디버그2 2021-02-28 01:39:47 +09:00
Hide_D d4906eec5a 디버그 코드 추가 2021-02-28 01:33:58 +09:00
Hide_D ebe0663e74 에러 로그용 추가 2021-02-28 01:05:27 +09:00
Hide_D 04c89b9711 긴급 호출 대비 2021-02-21 00:40:49 +09:00
Hide_D 4f2bc874e5 initFull을 할 필요가 없었던 것! 2021-02-10 21:24:04 +09:00
Hide_D 316ac5c3c8 불가침인데도 선포 가능한 버그 수정 2021-01-12 17:14:36 +09:00
Hide_D 7882aa667e 관리자 도구 수정 2021-01-07 22:22:04 +09:00
Hide_D 8b8d5eecbf 모반시도 버그 수정 2021-01-07 01:12:06 +09:00
Hide_D 65b76643ee feat: 빙의일람에 장수 선택 내역
fix: 장수 선택 내역에서 owner_name 미반영 버그 수정
fix: 온라인 장수에서 npc가 뜨는 버그 수정
2021-01-03 18:31:18 +09:00
1202 changed files with 94567 additions and 33659 deletions
+18
View File
@@ -0,0 +1,18 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"browsers": [
"last 2 versions"
]
},
"modules":false
}
]
],
"plugins": [
"lodash"
]
}
+22
View File
@@ -0,0 +1,22 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
"project": "./tsconfig.json"
},
ignorePatterns: ['*.test.ts', '.eslintrc.js', 'webpack.config.js', '*.js'],
overrides: [{
files: ['*.ts', '*.tsx'],
}],
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
rules: {
'@typescript-eslint/no-floating-promises': 'error',
}
}
+2 -1
View File
@@ -4,7 +4,8 @@
!.vscode/launch.json
!.vscode/extensions.json
/node_modules
package-lock.json
# 체섭 ignore
-1
View File
@@ -23,7 +23,6 @@ return [
'f_config/config.php',
'hwe/a_bestGeneral.php',
'hwe/a_emperior.php',
'hwe/a_emperior2.php',
'hwe/a_emperior_detail.php',
'hwe/a_genList.php',
'hwe/a_hallOfFame.php',
+1 -1
View File
@@ -26,7 +26,7 @@
"ezyang/htmlpurifier": "^4.10",
"xemlock/htmlpurifier-html5": "^0.1.7",
"catfan/medoo": "^1.5",
"phan/phan": "^2.7",
"phan/phan": "*",
"erusev/parsedown-extra": "^0.8.1",
"nette/caching": "^3.0"
},
Generated
+1175 -289
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ab1175c8592ba7f7756d5f02a3aa051c",
"content-hash": "2aeb036fc53a6fdc343bd2707d4697ee",
"packages": [
{
"name": "brandonwamboldt/utilphp",
@@ -50,20 +50,24 @@
"php",
"utility"
],
"support": {
"issues": "https://github.com/brandonwamboldt/utilphp/issues",
"source": "https://github.com/brandonwamboldt/utilphp/tree/master"
},
"time": "2015-02-02T17:56:14+00:00"
},
{
"name": "catfan/medoo",
"version": "v1.7.8",
"version": "v1.7.10",
"source": {
"type": "git",
"url": "https://github.com/catfan/Medoo.git",
"reference": "dd9d570584cfb1e09ec470608479b86e41d5b60d"
"reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/catfan/Medoo/zipball/dd9d570584cfb1e09ec470608479b86e41d5b60d",
"reference": "dd9d570584cfb1e09ec470608479b86e41d5b60d",
"url": "https://api.github.com/repos/catfan/Medoo/zipball/2d675f73e23f63bbaeb9a8aa33318659a3d3c32f",
"reference": "2d675f73e23f63bbaeb9a8aa33318659a3d3c32f",
"shasum": ""
},
"require": {
@@ -110,32 +114,37 @@
"sql",
"sqlite"
],
"time": "2019-12-19T05:04:34+00:00"
"support": {
"issues": "https://github.com/catfan/Medoo/issues",
"source": "https://github.com/catfan/Medoo"
},
"time": "2020-02-11T08:20:42+00:00"
},
{
"name": "composer/semver",
"version": "1.5.1",
"version": "3.2.5",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
"reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de"
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de",
"reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de",
"url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9",
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0"
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.0.5"
"phpstan/phpstan": "^0.12.54",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-main": "3.x-dev"
}
},
"autoload": {
@@ -171,28 +180,48 @@
"validation",
"versioning"
],
"time": "2020-01-13T12:06:48+00:00"
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.2.5"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2021-05-24T12:41:47+00:00"
},
{
"name": "composer/xdebug-handler",
"version": "1.4.1",
"version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
"reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7"
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7",
"reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7",
"url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339",
"reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0",
"psr/log": "^1.0"
"psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8"
"phpstan/phpstan": "^0.12.55",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
"autoload": {
@@ -215,7 +244,26 @@
"Xdebug",
"performance"
],
"time": "2020-03-01T12:26:26+00:00"
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
"source": "https://github.com/composer/xdebug-handler/tree/2.0.2"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"time": "2021-07-31T17:03:58+00:00"
},
{
"name": "erusev/parsedown",
@@ -261,6 +309,10 @@
"markdown",
"parser"
],
"support": {
"issues": "https://github.com/erusev/parsedown/issues",
"source": "https://github.com/erusev/parsedown/tree/1.7.x"
},
"time": "2019-12-30T22:54:17+00:00"
},
{
@@ -308,20 +360,24 @@
"parsedown",
"parser"
],
"support": {
"issues": "https://github.com/erusev/parsedown-extra/issues",
"source": "https://github.com/erusev/parsedown-extra/tree/0.8.x"
},
"time": "2019-12-30T23:20:37+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.12.0",
"version": "v4.13.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "a617e55bc62a87eec73bd456d146d134ad716f03"
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/a617e55bc62a87eec73bd456d146d134ad716f03",
"reference": "a617e55bc62a87eec73bd456d146d134ad716f03",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
"shasum": ""
},
"require": {
@@ -337,6 +393,9 @@
},
"files": [
"library/HTMLPurifier.composer.php"
],
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -355,29 +414,33 @@
"keywords": [
"html"
],
"time": "2019-10-28T03:44:26+00:00"
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/master"
},
"time": "2020-06-29T00:56:53+00:00"
},
{
"name": "felixfbecker/advanced-json-rpc",
"version": "v3.1.1",
"version": "v3.2.1",
"source": {
"type": "git",
"url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
"reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40"
"reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40",
"reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40",
"url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447",
"reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447",
"shasum": ""
},
"require": {
"netresearch/jsonmapper": "^1.0 || ^2.0",
"php": ">=7.0",
"phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0"
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
"php": "^7.1 || ^8.0",
"phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0.0"
"phpunit/phpunit": "^7.0 || ^8.0"
},
"type": "library",
"autoload": {
@@ -396,7 +459,11 @@
}
],
"description": "A more advanced JSONRPC implementation",
"time": "2020-03-11T15:21:41+00:00"
"support": {
"issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues",
"source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1"
},
"time": "2021-06-11T22:34:44+00:00"
},
{
"name": "firephp/firephp-core",
@@ -432,27 +499,33 @@
],
"description": "Traditional FirePHPCore library for sending PHP variables to the browser.",
"homepage": "https://github.com/firephp/firephp-core",
"support": {
"forum": "http://groups.google.com/group/firephp-dev",
"issues": "https://github.com/firephp/firephp-core/issues",
"source": "https://github.com/firephp/firephp-core"
},
"time": "2013-04-23T15:28:20+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.5.2",
"version": "6.5.5",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82"
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82",
"reference": "43ece0e75098b7ecd8d13918293029e555a50f82",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.6.1",
"php": ">=5.5"
"php": ">=5.5",
"symfony/polyfill-intl-idn": "^1.17.0"
},
"require-dev": {
"ext-curl": "*",
@@ -460,7 +533,6 @@
"psr/log": "^1.1"
},
"suggest": {
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"type": "library",
@@ -499,27 +571,31 @@
"rest",
"web service"
],
"time": "2019-12-23T11:57:10+00:00"
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/6.5"
},
"time": "2020-06-16T21:01:06+00:00"
},
{
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
"symfony/phpunit-bridge": "^4.4 || ^5.1"
},
"type": "library",
"extra": {
@@ -550,20 +626,24 @@
"keywords": [
"promise"
],
"time": "2016-12-20T10:07:11+00:00"
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.4.1"
},
"time": "2021-03-07T09:25:29+00:00"
},
{
"name": "guzzlehttp/psr7",
"version": "1.6.1",
"version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
"reference": "dc960a912984efb74d0a90222870c72c87f10c91"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91",
"shasum": ""
},
"require": {
@@ -576,15 +656,15 @@
},
"require-dev": {
"ext-zlib": "*",
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10"
},
"suggest": {
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
"dev-master": "1.7-dev"
}
},
"autoload": {
@@ -621,29 +701,33 @@
"uri",
"url"
],
"time": "2019-07-01T23:21:34+00:00"
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.8.2"
},
"time": "2021-04-26T09:17:50+00:00"
},
{
"name": "league/plates",
"version": "3.3.0",
"version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/plates.git",
"reference": "b1684b6f127714497a0ef927ce42c0b44b45a8af"
"reference": "6d3ee31199b536a4e003b34a356ca20f6f75496a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/plates/zipball/b1684b6f127714497a0ef927ce42c0b44b45a8af",
"reference": "b1684b6f127714497a0ef927ce42c0b44b45a8af",
"url": "https://api.github.com/repos/thephpleague/plates/zipball/6d3ee31199b536a4e003b34a356ca20f6f75496a",
"reference": "6d3ee31199b536a4e003b34a356ca20f6f75496a",
"shasum": ""
},
"require": {
"php": "^5.3 | ^7.0"
"php": "^7.0|^8.0"
},
"require-dev": {
"mikey179/vfsstream": "^1.4",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~1.5"
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"extra": {
@@ -665,10 +749,15 @@
"name": "Jonathan Reinink",
"email": "jonathan@reinink.ca",
"role": "Developer"
},
{
"name": "RJ Garcia",
"email": "ragboyjr@icloud.com",
"role": "Developer"
}
],
"description": "Plates, the native PHP template system that's fast, easy to use and easy to extend.",
"homepage": "http://platesphp.com",
"homepage": "https://platesphp.com",
"keywords": [
"league",
"package",
@@ -676,27 +765,31 @@
"templating",
"views"
],
"time": "2016-12-28T00:14:17+00:00"
"support": {
"issues": "https://github.com/thephpleague/plates/issues",
"source": "https://github.com/thephpleague/plates/tree/v3.4.0"
},
"time": "2020-12-25T05:00:37+00:00"
},
{
"name": "microsoft/tolerant-php-parser",
"version": "v0.0.20",
"version": "v0.1.1",
"source": {
"type": "git",
"url": "https://github.com/microsoft/tolerant-php-parser.git",
"reference": "c5e2bf5d8c9f4f27eef1370bd39ea2d1f374eeb4"
"reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/c5e2bf5d8c9f4f27eef1370bd39ea2d1f374eeb4",
"reference": "c5e2bf5d8c9f4f27eef1370bd39ea2d1f374eeb4",
"url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16",
"reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16",
"shasum": ""
},
"require": {
"php": ">=7.0"
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": "^6.4"
"phpunit/phpunit": "^8.5.15"
},
"type": "library",
"autoload": {
@@ -717,20 +810,24 @@
}
],
"description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios",
"time": "2020-02-18T02:57:19+00:00"
"support": {
"issues": "https://github.com/microsoft/tolerant-php-parser/issues",
"source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1"
},
"time": "2021-07-16T21:28:12+00:00"
},
{
"name": "monolog/monolog",
"version": "1.25.3",
"version": "1.26.1",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1"
"reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fa82921994db851a8becaf3787a9e73c5976b6f1",
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c6b00f05152ae2c9b04a448f99c7590beb6042f5",
"reference": "c6b00f05152ae2c9b04a448f99c7590beb6042f5",
"shasum": ""
},
"require": {
@@ -744,11 +841,10 @@
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpstan/phpstan": "^0.12.59",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
@@ -767,11 +863,6 @@
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
@@ -795,20 +886,34 @@
"logging",
"psr-3"
],
"time": "2019-12-20T14:15:16+00:00"
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/1.26.1"
},
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2021-05-28T08:32:12+00:00"
},
{
"name": "netresearch/jsonmapper",
"version": "v2.1.0",
"version": "v4.0.0",
"source": {
"type": "git",
"url": "https://github.com/cweiske/jsonmapper.git",
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e"
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
"reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d",
"shasum": ""
},
"require": {
@@ -816,10 +921,10 @@
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.6"
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0",
"phpunit/phpunit": "~7.5 || ~8.0 || ~9.0",
"squizlabs/php_codesniffer": "~3.5"
},
"type": "library",
@@ -841,31 +946,37 @@
}
],
"description": "Map nested JSON structures onto PHP classes",
"time": "2020-04-16T18:48:43+00:00"
"support": {
"email": "cweiske@cweiske.de",
"issues": "https://github.com/cweiske/jsonmapper/issues",
"source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0"
},
"time": "2020-12-01T19:48:11+00:00"
},
{
"name": "nette/caching",
"version": "v3.0.1",
"version": "v3.1.1",
"source": {
"type": "git",
"url": "https://github.com/nette/caching.git",
"reference": "b9ecbf920f240bd1ab14900d9a77876924ad7fb4"
"reference": "3e771c589dee414724be473c24ad16dae50c1960"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/caching/zipball/b9ecbf920f240bd1ab14900d9a77876924ad7fb4",
"reference": "b9ecbf920f240bd1ab14900d9a77876924ad7fb4",
"url": "https://api.github.com/repos/nette/caching/zipball/3e771c589dee414724be473c24ad16dae50c1960",
"reference": "3e771c589dee414724be473c24ad16dae50c1960",
"shasum": ""
},
"require": {
"nette/finder": "^2.4 || ^3.0",
"nette/utils": "^2.4 || ^3.0",
"php": ">=7.1"
"php": ">=7.2 <8.1"
},
"require-dev": {
"latte/latte": "^2.4",
"latte/latte": "^2.10",
"nette/di": "^v3.0",
"nette/tester": "^2.0",
"phpstan/phpstan": "^0.12",
"tracy/tracy": "^2.4"
},
"suggest": {
@@ -874,7 +985,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
}
},
"autoload": {
@@ -885,8 +996,8 @@
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
"GPL-2.0-only",
"GPL-3.0-only"
],
"authors": [
{
@@ -907,7 +1018,11 @@
"nette",
"sqlite"
],
"time": "2019-11-19T18:41:40+00:00"
"support": {
"issues": "https://github.com/nette/caching/issues",
"source": "https://github.com/nette/caching/tree/v3.1.1"
},
"time": "2021-03-06T14:07:38+00:00"
},
{
"name": "nette/finder",
@@ -970,24 +1085,31 @@
"iterator",
"nette"
],
"support": {
"issues": "https://github.com/nette/finder/issues",
"source": "https://github.com/nette/finder/tree/v2.5.2"
},
"time": "2020-01-03T20:35:40+00:00"
},
{
"name": "nette/utils",
"version": "v3.1.2",
"version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "488f58378bba71767e7831c83f9e0fa808bf83b9"
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/488f58378bba71767e7831c83f9e0fa808bf83b9",
"reference": "488f58378bba71767e7831c83f9e0fa808bf83b9",
"url": "https://api.github.com/repos/nette/utils/zipball/967cfc4f9a1acd5f1058d76715a424c53343c20c",
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2 <8.1"
},
"conflict": {
"nette/di": "<3.0.6"
},
"require-dev": {
"nette/tester": "~2.0",
@@ -1006,7 +1128,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
"dev-master": "3.2-dev"
}
},
"autoload": {
@@ -1030,7 +1152,7 @@
"homepage": "https://nette.org/contributors"
}
],
"description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
"description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
"homepage": "https://nette.org",
"keywords": [
"array",
@@ -1048,7 +1170,11 @@
"utility",
"validation"
],
"time": "2020-05-27T09:58:51+00:00"
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v3.2.2"
},
"time": "2021-03-03T22:53:25+00:00"
},
{
"name": "pguardiario/phpuri",
@@ -1072,47 +1198,52 @@
},
"notification-url": "https://packagist.org/downloads/",
"description": "A php library for converting relative urls to absolute.",
"support": {
"issues": "https://github.com/monkeysuffrage/phpuri/issues",
"source": "https://github.com/monkeysuffrage/phpuri/tree/1.0.0"
},
"time": "2015-05-24T09:13:17+00:00"
},
{
"name": "phan/phan",
"version": "2.7.1",
"version": "5.0.0",
"source": {
"type": "git",
"url": "https://github.com/phan/phan.git",
"reference": "67c51bb1593e5c30271fc16d691b82e318b90b77"
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phan/phan/zipball/67c51bb1593e5c30271fc16d691b82e318b90b77",
"reference": "67c51bb1593e5c30271fc16d691b82e318b90b77",
"url": "https://api.github.com/repos/phan/phan/zipball/f36b6b9a2f4143a25f35ce94d712ceb0527e9d90",
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90",
"shasum": ""
},
"require": {
"composer/semver": "^1.4",
"composer/xdebug-handler": "^1.3.2",
"composer/semver": "^1.4|^2.0|^3.0",
"composer/xdebug-handler": "^1.3.2|^2.0.0",
"ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
"felixfbecker/advanced-json-rpc": "^3.0.4",
"microsoft/tolerant-php-parser": "0.0.20",
"netresearch/jsonmapper": "^1.6.0|^2.0",
"php": "^7.1.0",
"sabre/event": "^5.0",
"symfony/console": "^2.3|^3.0|^4.0|^5.0",
"microsoft/tolerant-php-parser": "^0.1.0",
"netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0",
"php": "^7.2.0|^8.0.0",
"sabre/event": "^5.0.3",
"symfony/console": "^3.2|^4.0|^5.0",
"symfony/polyfill-mbstring": "^1.11.0",
"symfony/polyfill-php72": "^1.15"
"symfony/polyfill-php80": "^1.20.0",
"tysonandre/var_representation_polyfill": "^0.0.2"
},
"require-dev": {
"brianium/paratest": "^4.0.0",
"phpunit/phpunit": "^7.5.0"
"phpunit/phpunit": "^8.5.0"
},
"suggest": {
"ext-ast": "Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.6+ is recommended.",
"ext-ast": "Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.14+ is recommended.",
"ext-iconv": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8",
"ext-igbinary": "Improves performance of polyfill when ext-ast is unavailable",
"ext-mbstring": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8",
"ext-tokenizer": "Needed for fallback/polyfill parser support and file/line-based suppressions."
"ext-tokenizer": "Needed for fallback/polyfill parser support and file/line-based suppressions.",
"ext-var_representation": "Suggested for converting values to strings in issue messages"
},
"bin": [
"phan",
@@ -1146,7 +1277,11 @@
"php",
"static"
],
"time": "2020-04-12T01:25:29+00:00"
"support": {
"issues": "https://github.com/phan/phan/issues",
"source": "https://github.com/phan/phan/tree/5.0.0"
},
"time": "2021-08-01T18:17:28+00:00"
},
{
"name": "php-extended/php-system",
@@ -1186,6 +1321,10 @@
"php",
"system"
],
"support": {
"issues": "https://gitlab.com/php-extended/php-system/issues",
"source": "https://gitlab.com/php-extended/php-system"
},
"time": "2018-06-07T06:03:27+00:00"
},
{
@@ -1230,29 +1369,33 @@
"php",
"tail"
],
"support": {
"issues": "https://gitlab.com/php-extended/php-tail/issues",
"source": "https://gitlab.com/php-extended/php-tail"
},
"time": "2018-06-07T06:04:58+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "2.1.0",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b"
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
"reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
"dev-2.x": "2.x-dev"
}
},
"autoload": {
@@ -1279,32 +1422,35 @@
"reflection",
"static analysis"
],
"time": "2020-04-27T09:25:28+00:00"
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
},
"time": "2020-06-27T09:03:43+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "5.1.0",
"version": "5.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": ""
},
"require": {
"ext-filter": "^7.1",
"php": "^7.2",
"phpdocumentor/reflection-common": "^2.0",
"phpdocumentor/type-resolver": "^1.0",
"webmozart/assert": "^1"
"ext-filter": "*",
"php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
"phpdocumentor/type-resolver": "^1.3",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
"doctrine/instantiator": "^1",
"mockery/mockery": "^1"
"mockery/mockery": "~1.3.2"
},
"type": "library",
"extra": {
@@ -1332,34 +1478,37 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2020-02-22T12:28:44+00:00"
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
},
"time": "2020-09-03T19:13:55+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.1.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
"reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": ""
},
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"ext-tokenizer": "^7.2",
"mockery/mockery": "~1"
"ext-tokenizer": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-1.x": "1.x-dev"
}
},
"autoload": {
@@ -1378,31 +1527,30 @@
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2020-02-18T18:59:58+00:00"
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
},
"time": "2020-09-17T18:55:26+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
"php": ">=7.2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
@@ -1415,7 +1563,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
@@ -1427,7 +1575,11 @@
"container-interop",
"psr"
],
"time": "2017-02-14T16:28:37+00:00"
"support": {
"issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/1.1.1"
},
"time": "2021-03-05T17:36:06+00:00"
},
{
"name": "psr/http-message",
@@ -1477,20 +1629,23 @@
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/master"
},
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "psr/log",
"version": "1.1.2",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
@@ -1514,7 +1669,7 @@
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
@@ -1524,7 +1679,10 @@
"psr",
"psr-3"
],
"time": "2019-11-01T11:05:21+00:00"
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.4"
},
"time": "2021-05-03T11:20:27+00:00"
},
{
"name": "ralouphie/getallheaders",
@@ -1564,28 +1722,33 @@
}
],
"description": "A polyfill for getallheaders.",
"support": {
"issues": "https://github.com/ralouphie/getallheaders/issues",
"source": "https://github.com/ralouphie/getallheaders/tree/develop"
},
"time": "2019-03-08T08:55:37+00:00"
},
{
"name": "sabre/event",
"version": "5.1.0",
"version": "5.1.2",
"source": {
"type": "git",
"url": "https://github.com/sabre-io/event.git",
"reference": "d00a17507af0e7544cfe17096372f5d733e3b276"
"reference": "c120bec57c17b6251a496efc82b732418b49d50a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sabre-io/event/zipball/d00a17507af0e7544cfe17096372f5d733e3b276",
"reference": "d00a17507af0e7544cfe17096372f5d733e3b276",
"url": "https://api.github.com/repos/sabre-io/event/zipball/c120bec57c17b6251a496efc82b732418b49d50a",
"reference": "c120bec57c17b6251a496efc82b732418b49d50a",
"shasum": ""
},
"require": {
"php": "^7.1"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.16.1",
"phpunit/phpunit": "^7 || ^8"
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
},
"type": "library",
"autoload": {
@@ -1624,20 +1787,25 @@
"reactor",
"signal"
],
"time": "2020-01-31T18:52:29+00:00"
"support": {
"forum": "https://groups.google.com/group/sabredav-discuss",
"issues": "https://github.com/sabre-io/event/issues",
"source": "https://github.com/fruux/sabre-event"
},
"time": "2020-10-03T11:02:22+00:00"
},
{
"name": "scssphp/scssphp",
"version": "1.0.6",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
"reference": "5b3c9d704950d8f9637f5110c36c281ec47dc13c"
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/5b3c9d704950d8f9637f5110c36c281ec47dc13c",
"reference": "5b3c9d704950d8f9637f5110c36c281ec47dc13c",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/b83594e2323c5d6e80785df3f91b9d1d32aad530",
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530",
"shasum": ""
},
"require": {
@@ -1646,11 +1814,19 @@
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3",
"squizlabs/php_codesniffer": "~2.5",
"twbs/bootstrap": "~4.3",
"bamarni/composer-bin-plugin": "^1.4",
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4",
"sass/sass-spec": "*",
"squizlabs/php_codesniffer": "~3.5",
"symfony/phpunit-bridge": "^5.1",
"twbs/bootstrap": "~5.0",
"twbs/bootstrap4": "4.6.0",
"zurb/foundation": "~6.5"
},
"suggest": {
"ext-iconv": "Can be used as fallback when ext-mbstring is not available",
"ext-mbstring": "For best performance, mbstring should be installed as it is faster than ext-iconv"
},
"bin": [
"bin/pscss"
],
@@ -1685,24 +1861,28 @@
"scss",
"stylesheet"
],
"time": "2019-12-12T05:00:52+00:00"
"support": {
"issues": "https://github.com/scssphp/scssphp/issues",
"source": "https://github.com/scssphp/scssphp/tree/v1.6.0"
},
"time": "2021-07-02T16:28:10+00:00"
},
{
"name": "sergeytsalkov/meekrodb",
"version": "v2.3",
"version": "v2.4",
"source": {
"type": "git",
"url": "https://github.com/SergeyTsalkov/meekrodb.git",
"reference": "eb36858f1aff94ae1665900e681a1cfb78563ee1"
"reference": "e30c240d54bc81f58c58507a9ed768032eb494a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SergeyTsalkov/meekrodb/zipball/eb36858f1aff94ae1665900e681a1cfb78563ee1",
"reference": "eb36858f1aff94ae1665900e681a1cfb78563ee1",
"url": "https://api.github.com/repos/SergeyTsalkov/meekrodb/zipball/e30c240d54bc81f58c58507a9ed768032eb494a5",
"reference": "e30c240d54bc81f58c58507a9ed768032eb494a5",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
@@ -1728,39 +1908,49 @@
"mysqli",
"pdo"
],
"time": "2014-06-16T22:40:22+00:00"
"support": {
"email": "support@meekro.com",
"issues": "https://github.com/SergeyTsalkov/meekrodb/issues",
"source": "https://github.com/SergeyTsalkov/meekrodb/tree/v2.4"
},
"time": "2021-06-29T04:31:23+00:00"
},
{
"name": "symfony/console",
"version": "v5.0.8",
"version": "v5.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935"
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935",
"reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935",
"url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2",
"shasum": ""
},
"require": {
"php": "^7.2.5",
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/service-contracts": "^1.1|^2"
"symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1|^2",
"symfony/string": "^5.1"
},
"conflict": {
"psr/log": ">=3",
"symfony/dependency-injection": "<4.4",
"symfony/dotenv": "<5.1",
"symfony/event-dispatcher": "<4.4",
"symfony/lock": "<4.4",
"symfony/process": "<4.4"
},
"provide": {
"psr/log-implementation": "1.0"
"psr/log-implementation": "1.0|2.0"
},
"require-dev": {
"psr/log": "~1.0",
"psr/log": "^1|^2",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0",
@@ -1775,11 +1965,6 @@
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
@@ -1802,42 +1987,127 @@
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"description": "Eases the creation of beautiful and testable command line interfaces",
"homepage": "https://symfony.com",
"time": "2020-03-30T11:42:42+00:00"
"keywords": [
"cli",
"command line",
"console",
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.3.6"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-07-27T19:10:22+00:00"
},
{
"name": "symfony/lock",
"version": "v4.4.3",
"name": "symfony/deprecation-contracts",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/lock.git",
"reference": "6c4f5b620871cfef5b004fc57f2ca74572ae03b3"
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/lock/zipball/6c4f5b620871cfef5b004fc57f2ca74572ae03b3",
"reference": "6c4f5b620871cfef5b004fc57f2ca74572ae03b3",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627",
"reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "~1.0"
},
"conflict": {
"doctrine/dbal": "<2.5"
},
"require-dev": {
"doctrine/dbal": "~2.5",
"mongodb/mongodb": "~1.1",
"predis/predis": "~1.0"
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
"dev-main": "2.4-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"files": [
"function.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-03-23T23:28:01+00:00"
},
{
"name": "symfony/lock",
"version": "v4.4.27",
"source": {
"type": "git",
"url": "https://github.com/symfony/lock.git",
"reference": "6ca476d4ac992802f2a4043929f68f1818449486"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/lock/zipball/6ca476d4ac992802f2a4043929f68f1818449486",
"reference": "6ca476d4ac992802f2a4043929f68f1818449486",
"shasum": ""
},
"require": {
"php": ">=7.1.3",
"psr/log": "^1|^2|^3",
"symfony/polyfill-php80": "^1.16"
},
"conflict": {
"doctrine/dbal": "<2.6"
},
"require-dev": {
"doctrine/dbal": "^2.6|^3.0",
"predis/predis": "~1.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Lock\\": ""
@@ -1860,7 +2130,7 @@
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Lock Component",
"description": "Creates and manages locks, a mechanism to provide exclusive access to a shared resource",
"homepage": "https://symfony.com",
"keywords": [
"cas",
@@ -1870,24 +2140,41 @@
"redlock",
"semaphore"
],
"time": "2020-01-04T13:00:46+00:00"
"support": {
"source": "https://github.com/symfony/lock/tree/v4.4.27"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-07-23T15:41:52+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.15.0",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
@@ -1895,7 +2182,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -1928,24 +2219,293 @@
"polyfill",
"portable"
],
"time": "2020-02-27T09:26:54+00:00"
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.15.0",
"name": "symfony/polyfill-intl-grapheme",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Intl\\Grapheme\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's grapheme_* functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"grapheme",
"intl",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "65bd267525e82759e7d8c4e8ceea44f398838e65"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/65bd267525e82759e7d8c4e8ceea44f398838e65",
"reference": "65bd267525e82759e7d8c4e8ceea44f398838e65",
"shasum": ""
},
"require": {
"php": ">=7.1",
"symfony/polyfill-intl-normalizer": "^1.10",
"symfony/polyfill-php72": "^1.10"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Intl\\Idn\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Laurent Bassin",
"email": "laurent@bassin.info"
},
{
"name": "Trevor Rowbotham",
"email": "trevor.rowbotham@pm.me"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"idn",
"intl",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-05-27T09:27:20+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
"reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Intl\\Normalizer\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's Normalizer class and related functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"intl",
"normalizer",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
@@ -1953,7 +2513,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -1987,29 +2551,50 @@
"portable",
"shim"
],
"time": "2020-03-09T19:04:49+00:00"
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.15.0",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "37b0976c78b94856543260ce09b460a7bc852747"
"reference": "9a142215a36a3888e30d0a9eeea9766764e96976"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747",
"reference": "37b0976c78b94856543260ce09b460a7bc852747",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
"reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -2042,29 +2627,50 @@
"portable",
"shim"
],
"time": "2020-02-27T09:26:54+00:00"
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-05-27T09:17:38+00:00"
},
{
"name": "symfony/polyfill-php73",
"version": "v1.15.0",
"version": "v1.23.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
"reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7"
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7",
"reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7",
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
"reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@@ -2100,25 +2706,125 @@
"portable",
"shim"
],
"time": "2020-02-27T09:26:54+00:00"
"support": {
"source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v2.0.1",
"name": "symfony/polyfill-php80",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "144c5e51266b281231e947b51223ba14acf1a749"
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749",
"reference": "144c5e51266b281231e947b51223ba14acf1a749",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
"shasum": ""
},
"require": {
"php": "^7.2.5",
"psr/container": "^1.0"
"php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.23-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
},
"files": [
"bootstrap.php"
],
"classmap": [
"Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-07-28T13:41:28+00:00"
},
{
"name": "symfony/service-contracts",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb",
"reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"psr/container": "^1.1"
},
"suggest": {
"symfony/service-implementation": ""
@@ -2126,7 +2832,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-main": "2.4-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@@ -2158,27 +2868,178 @@
"interoperability",
"standards"
],
"time": "2019-11-18T17:27:11+00:00"
"support": {
"source": "https://github.com/symfony/service-contracts/tree/v2.4.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-04-01T10:43:52+00:00"
},
{
"name": "vlucas/valitron",
"version": "v1.4.7",
"name": "symfony/string",
"version": "v5.3.3",
"source": {
"type": "git",
"url": "https://github.com/vlucas/valitron.git",
"reference": "a03072bed1679660200766d134507a30193eaf6d"
"url": "https://github.com/symfony/string.git",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/a03072bed1679660200766d134507a30193eaf6d",
"reference": "a03072bed1679660200766d134507a30193eaf6d",
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php80": "~1.15"
},
"require-dev": {
"symfony/error-handler": "^4.4|^5.0",
"symfony/http-client": "^4.4|^5.0",
"symfony/translation-contracts": "^1.1|^2",
"symfony/var-exporter": "^4.4|^5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\String\\": ""
},
"files": [
"Resources/functions.php"
],
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
"homepage": "https://symfony.com",
"keywords": [
"grapheme",
"i18n",
"string",
"unicode",
"utf-8",
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.3.3"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2021-06-27T11:44:38+00:00"
},
{
"name": "tysonandre/var_representation_polyfill",
"version": "0.0.2",
"source": {
"type": "git",
"url": "https://github.com/TysonAndre/var_representation_polyfill.git",
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/3f17999ee1f257319ddc6721dd26ebbc5d175f33",
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": "^7.2.0|^8.0.0"
},
"require-dev": {
"phan/phan": "^4.0",
"phpunit/phpunit": "^8.5.0"
},
"type": "library",
"autoload": {
"psr-4": {
"VarRepresentation\\": "src/VarRepresentation"
},
"files": [
"src/var_representation.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tyson Andre"
}
],
"description": "Polyfill for var_representation",
"keywords": [
"var_export",
"var_representation"
],
"support": {
"issues": "https://github.com/TysonAndre/var_representation_polyfill/issues",
"source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.0.2"
},
"time": "2021-06-26T18:55:02+00:00"
},
{
"name": "vlucas/valitron",
"version": "v1.4.10",
"source": {
"type": "git",
"url": "https://github.com/vlucas/valitron.git",
"reference": "5ebd5d7af82cc0a9d798e816a2ecad63f1b59ceb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/5ebd5d7af82cc0a9d798e816a2ecad63f1b59ceb",
"reference": "5ebd5d7af82cc0a9d798e816a2ecad63f1b59ceb",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
"phpunit/phpunit": ">=4.8.35"
},
"suggest": {
"ext-mbstring": "It can support the multiple bytes string length."
@@ -2197,43 +3058,59 @@
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
"homepage": "https://www.vancelucas.com"
}
],
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
"homepage": "http://github.com/vlucas/valitron",
"homepage": "https://github.com/vlucas/valitron",
"keywords": [
"valid",
"validation",
"validator"
],
"time": "2019-08-29T19:49:43+00:00"
"support": {
"issues": "https://github.com/vlucas/valitron/issues",
"source": "https://github.com/vlucas/valitron/tree/v1.4.10"
},
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/valitron",
"type": "tidelift"
}
],
"time": "2021-07-08T16:18:03+00:00"
},
{
"name": "webmozart/assert",
"version": "1.8.0",
"version": "1.10.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
"url": "https://github.com/webmozarts/assert.git",
"reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
"reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0",
"php": "^7.2 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"vimeo/psalm": "<3.9.1"
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<4.6.1 || 4.6.2"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
"phpunit/phpunit": "^8.5.13"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
@@ -2255,7 +3132,11 @@
"check",
"validate"
],
"time": "2020-04-18T12:12:48+00:00"
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/1.10.0"
},
"time": "2021-03-09T10:59:23+00:00"
},
{
"name": "xemlock/htmlpurifier-html5",
@@ -2306,6 +3187,10 @@
"validator",
"xss"
],
"support": {
"issues": "https://github.com/xemlock/htmlpurifier-html5/issues",
"source": "https://github.com/xemlock/htmlpurifier-html5/tree/master"
},
"time": "2019-08-07T17:19:21+00:00"
}
],
@@ -2319,5 +3204,6 @@
"platform-dev": [],
"platform-overrides": {
"php": "7.3"
}
},
"plugin-api-version": "2.0.0"
}
+1 -1
View File
@@ -117,7 +117,7 @@ function logError(string $err, string $errstr, string $errpath, array $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=null)
{
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting, so let it fall
+4
View File
@@ -24,3 +24,7 @@ foreach ($db->queryFirstColumn(
) as $generalNo) {
CheckHall($generalNo);
}
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
$genObj->mergeTotalInheritancePoint();
}
+6 -1
View File
@@ -59,8 +59,13 @@ foreach (getAllNationStaticInfo() as $nation) {
$nationName[$nation['nation']] = $nation['name'];
}
$generalList = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1');
$generalListFromPool = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general JOIN select_pool on general.no = select_pool.general_id where npc=0');
if($generalListFromPool){
$generalList = array_merge($generalListFromPool, $generalList);
}
$sortType = [
1 => ['name', true],
2 => ['nation', true],
+1
View File
@@ -162,6 +162,7 @@ if(!key_exists($citylist, CityConst::all())){
if($userGrade >= 5){
$valid = true;
$showDetailedInfo = true;
}
if(!$valid) {
+131
View File
@@ -0,0 +1,131 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$generalID = $session->generalID;
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$me = General::createGeneralObjFromDB($generalID);
$pointHelpText = [
'sum' => '다음 플레이에서 사용할 수 있는 총 포인트입니다.',
'new' => '이번 플레이에서 얻은 총 포인트입니다.',
'previous' => '이전에 물려받은 포인트입니다.',
'lived_month' => '살아남은 기간입니다. (1개월 단위)',
'max_belong' => '가장 오래 임관했던 국가의 연도입니다.',
'max_domestic_critical' => '성공한 내정 중 최대 연속값입니다.',
'snipe_combat' => '유리한 상성을 가지고 전투했습니다.',
'combat' => '전투 횟수입니다.',
'sabotage' => '계략 성공 횟수입니다.',
'unifier' => '천통에 기여한 포인트입니다. <br>각 국의 군주, 천통 수뇌, 천통 군주가 받습니다.',
'dex' => '총 숙련도합입니다.',
'tournament' => '토너먼트 입상 포인트입니다.',
'betting' => '성공적인 베팅을 했습니다. <br>수익율과 베팅 성공 횟수를 따릅니다.',
];
$items = [];
foreach(array_keys(General::INHERITANCE_KEY) as $key){
$items[$key] = $me->getInheritancePoint($key)??0;
}
?>
<!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=1024" />
<?= WebUtil::printCSS('../e_lib/bootstrap.min.css') ?>
<?= WebUtil::printCSS('../d_shared/common.css') ?>
<?= WebUtil::printCSS('../css/config.css') ?>
<?= WebUtil::printCSS('css/common.css') ?>
<?= WebUtil::printCSS('css/inheritPoint.css') ?>
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
<?= 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/inheritPoint.js') ?>
<script>
var items = <?=Json::encode($items)?>;
var helpText = <?=Json::encode($pointHelpText)?>;
</script>
</head>
<body onload="formStart()">
<table style='width:1000px;margin:auto;' class='tb_layout bg0'>
<tr>
<td style='text-align:left;'>유산 관리<br><?= backButton() ?></td>
</tr>
</table>
<div id="container" class="tb_layout bg0" style="width:1000px;margin:auto;border:solid 1px #888888;">
<div id='inheritance_list'>
<div id="inherit_sum" class='inherit_item'>
<div class="row">
<label id="inherit_sum_head" class='inherit_head col-sm-6 col-form-label'>총 포인트</label>
<div class="col-sm-6">
<input type="text" class="form-control inherit_value" readonly id="inherit_sum_value" value="">
</div>
</div>
<div style="text-align:right">
<small class="form-text text-muted"></small>
</div>
</div>
<div id="inherit_previous" class='inherit_item'>
<div class="row">
<label id="inherit_sum_head" class='inherit_head col-sm-6 col-form-label'>기존 포인트</label>
<div class="col-sm-6">
<input type="text" class="form-control inherit_value" readonly id="inherit_previous_value" value="">
</div>
</div>
<div style="text-align:right">
<small class="form-text text-muted"></small>
</div>
</div>
<div id="inherit_new" class='inherit_item'>
<div class="row">
<label id="inherit_sum_head" class='inherit_head col-sm-6 col-form-label'>신규 포인트</label>
<div class="col-sm-6">
<input type="text" class="form-control inherit_value" readonly id="inherit_new_value" value="">
</div>
</div>
<div style="text-align:right">
<small class="form-text text-muted"></small>
</div>
</div>
<div style="width:100%; padding:0 10px"><hr style="border-top:1px solid #888888;"></div>
<?php foreach (General::INHERITANCE_KEY as $key => [$type, $multiplier, $name]) : ?>
<?php if ($key == 'previous') {
continue;
} ?>
<div id="inherit_<?= $key ?>" class='inherit_item inherit_template_item'>
<div class="row">
<label id="inherit_<?= $key ?>_head" class='inherit_head col-sm-6 col-form-label'><?= $name ?></label>
<div class="col-sm-6">
<input type="text" class="form-control inherit_value" readonly id="inherit_<?= $key ?>_value" value="">
</div>
</div>
<div style="text-align:right">
<small class="form-text text-muted"></small>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</body>
</html>
+1
View File
@@ -91,6 +91,7 @@ $zeroPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['optio
var availableGeneralActionPriorityItems = <?= Json::encode(AutorunGeneralPolicy::$default_priority) ?>;
var btnHelpMessage = {
'불가침제의': '군주가 NPC이고, 타국에서 원조를 받았을 때,<br>세입(금/쌀) 대비 원조량에 따라 불가침제의를 합니다.',
'선전포고': '군주가 NPC이고, 전쟁중이 아닐 때,<br>주변국중 하나를 골라 선포합니다.<br><br>선포 시점은 다음을 참고합니다.<br>- 인구율<br>- 도시내정률<br>- NPC전투장권장 금 충족률<br>- NPC전투장권장 쌀 충족률<br><br>국력이 낮은 국가를 조금 더 선호합니다.',
'천도': '인구가 많은 곳을 찾아 천도를 시도합니다.<br>영토의 가운데를 선호합니다.<br><br>도시 인구가 충분하다면, 굳이 천도하지는 않습니다.',
'유저장긴급포상': '금/쌀이 부족한 유저전투장에게 긴급하게 포상합니다.<br>국고가 권장량보다 적어지더라도 시도합니다.',
+23
View File
@@ -0,0 +1,23 @@
#inheritance_list{
display: flex;
flex-wrap: wrap;
}
.inherit_padding{
width: 33%;
padding: 10px 2px;
}
.inherit_item{
width: 33%;
padding: 10px 2px;
}
.col-form-label{
text-align:right;
padding-right:2ch;
}
.inherit_value{
text-align: right;
}
+57 -16
View File
@@ -1224,7 +1224,7 @@ function updateOnline()
//동접수
$before5Min = TimeUtil::nowAddMinutes(-5);
$onlineUser = $db->query('SELECT no,name,nation FROM general WHERE lastrefresh > %s', $before5Min);
$onlineUser = $db->query('SELECT no,name,nation FROM general WHERE lastrefresh > %s AND npc < 2', $before5Min);
$onlineNum = count($onlineUser);
$onlineNationUsers = Util::arrayGroupBy($onlineUser, 'nation');
@@ -1537,7 +1537,18 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
//일단은 '획득' 시에만 동작하므로 이대로 사용하기로...
$occupiedUnique = [];
$invalidItemType = [];
foreach(array_keys(GameConst::$allItems) as $itemType){
$ownItem = $general->getItems()[$itemType]??null;
if($ownItem !== null && !$ownItem->isBuyable()){
$invalidItemType[$itemType] = true;
}
}
foreach (array_keys(GameConst::$allItems) as $itemType) {
if(key_exists($itemType, $invalidItemType)){
continue;
}
foreach ($db->queryAllLists('SELECT %b, count(*) as cnt FROM general GROUP BY %b', $itemType, $itemType) as [$itemCode, $cnt]) {
$itemClass = buildItemClass($itemCode);
if (!$itemClass) {
@@ -1551,7 +1562,13 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
}
foreach (GameConst::$allItems as $itemType => $itemCategories) {
if(key_exists($itemType, $invalidItemType)){
continue;
}
foreach ($itemCategories as $itemCode => $cnt) {
if($cnt == 0){
continue;
}
if (!key_exists($itemCode, $occupiedUnique)) {
$availableUnique[] = [[$itemType, $itemCode], $cnt];
continue;
@@ -1604,38 +1621,56 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
return false;
}
$itemTypeCnt = count(GameConst::$allItems);
$trialCnt = $itemTypeCnt;
foreach ($general->getItems() as $item) {
if (!$item) {
continue;
}
if (!$item->isBuyable()) {
return false;
$trialCnt -= 1;
}
}
if($trialCnt <= 0){
LogText("{$general->getName()}, {$general->getID()} 모든 아이템", $trialCnt);
return false;
}
$scenario = $gameStor->scenario;
$genCount = $db->queryFirstField('SELECT count(*) FROM general WHERE npc<2');
if ($scenario < 100) {
$prob = 1 / ($genCount * 5); // 5~6개월에 하나씩 등장
$prob = 1 / ($genCount * 3 * $itemTypeCnt); // 3~4개월에 하나씩 등장
} else {
$prob = 1 / $genCount; // 1~2개월에 하나씩 등장
$prob = 1 / ($genCount * $itemTypeCnt); // 1~2개월에 하나씩 등장
}
if ($acquireType == '설문조사') {
$prob = 1 / ($genCount * 0.7 / 3); // 투표율 70%, 설문조사 한번에 2~3개 등장
$prob = 1 / ($genCount * $itemTypeCnt * 0.7 / 3); // 투표율 70%, 설문조사 한번에 2~3개 등장
} else if ($acquireType == '랜덤 임관') {
$prob = 1 / ($genCount / 10 / 2); // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
$prob = 1 / ($genCount * $itemTypeCnt / 10 / 2); // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
} else if ($acquireType == '건국') {
$prob = 1 / ($genCount / 10 / 4); // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
$prob = 1 / ($genCount * $itemTypeCnt / 10 / 4); // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
}
$prob = Util::valueFit($prob, null, 1 / 3);
$prob = Util::valueFit($prob, null, 1 / 4);//최대치 감소
$result = false;
if (!Util::randBool($prob)) {
foreach(Util::range($trialCnt) as $_idx){
if (Util::randBool($prob)) {
$result = true;
break;
}
}
if(!$result){
LogText("{$general->getName()}, {$general->getID()} 유니크 실패 {$trialCnt}", $prob);
return false;
}
LogText("{$general->getName()}, {$general->getID()} 유니크 성공 {$trialCnt}", $prob);
return giveRandomUniqueItem($general, $acquireType);
}
@@ -1672,7 +1707,7 @@ function deleteNation(General $lord, bool $applyDB):array
$nationID,
$lordID
),
['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'aux'], 1
['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'belong', 'aux'], 1
);
$nationGeneralList[$lordID] = $lord;
@@ -1689,6 +1724,12 @@ function deleteNation(General $lord, bool $applyDB):array
// 전 장수 재야로
foreach($nationGeneralList as $general){
$general->setAuxVar('max_belong',
max(
$general->getVar('belong'),
$general->getAuxVar('max_belong')??0
)
);
$general->setVar('belong', 0);
$general->setVar('troop', 0);
$general->setVar('officer_level', 0);
@@ -1736,7 +1777,7 @@ function nextRuler(General $general)
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
[$year, $month, $fiction] = $gameStor->getValuesAsArray(['year', 'month', 'fiction']);
$nation = $general->getStaticNation();
$nationName = $nation['name'];
$nationID = $nation['nation'];
@@ -1744,7 +1785,7 @@ function nextRuler(General $general)
$candidate = null;
//npc or npc유저인 경우 후계 찾기
if ($general->getNPCType() > 0) {
if (!$fiction && $general->getNPCType() > 0) {
$candidate = $db->queryFirstRow(
'SELECT no,name,officer_level,IF(ABS(affinity-%i)>75,150-ABS(affinity-%i),ABS(affinity-%i)) as npcmatch2 from general where nation=%i and officer_level!=12 and 1 <= npc and npc<=3 order by npcmatch2,rand() LIMIT 1',
$general->getVar('affinity'),
+50 -7
View File
@@ -623,30 +623,38 @@ function updateNationState()
$nation['nation'],
$targetKillTurn
);
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong'], 2);
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc'], 2);
$chiefObj = null;
$uniqueLotteryWeightList = [];
foreach ($nationGenList as $nationGen) {
$hasUnique = false;
if ($nationGen->getVar('officer_level') == 12) {
$chiefObj = $nationGen;
}
$trialCnt = count(GameConst::$allItems);
foreach ($nationGen->getItems() as $item) {
if (!$item->isBuyable()) {
$hasUnique = true;
break;
$trialCnt -= 1;
}
}
if ($hasUnique) {
if ($trialCnt <= 0) {
continue;
}
$score = $nationGen->getVar('belong') + 5;
if ($nationGen->getVar('officer_level') == 12) {
$score += 200; //NOTE: 꼬우면 군주하세요.
$score += 100; //NOTE: 꼬우면 군주하세요.
} else if ($nationGen->getVar('officer_level') == 11) {
$score += 70;
$score += 50;
} else if ($nationGen->getVar('officer_level') > 4) {
$score += 35;
}
$score *= $trialCnt;
$uniqueLotteryWeightList[$nationGen->getID()] = [$nationGen, $score];
}
@@ -661,6 +669,10 @@ function updateNationState()
giveRandomUniqueItem($winnerObj, '작위보상');
$winnerObj->applyDB($db);
}
if($chiefObj){
$chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff);
}
}
}
@@ -978,6 +990,15 @@ function checkEmperior()
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
if($genObj->getNationID() == $nationID){
if($genObj->getVar('officer_level') > 4){
$genObj->increaseInheritancePoint('unifier', 2000);
};
}
$genObj->mergeTotalInheritancePoint();
}
$gameStor->isunited = 2;
$gameStor->conlimit = $gameStor->conlimit * 100;
@@ -1128,3 +1149,25 @@ function checkEmperior()
//연감 월결산
LogHistory();
}
function resetInheritanceUser(int $userID){
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
$totalPoint = 0;
foreach($inheritStor->getAll() as [$value,]){
$totalPoint += $value;
}
$totalPoint = Util::toInt($totalPoint);
$inheritStor->resetValues();
$inheritStor->setValue('previous', [$totalPoint, null]);
}
function updateMaxDomesticCritical(General $general, $score){
$maxDomesticCritical = $general->getAuxVar('max_domestic_critical')??0;
$maxDomesticCritical += $score / 2;
$general->setAuxVar('max_domestic_critical', $maxDomesticCritical);
$oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
if($maxDomesticCritical > $oldMaxDomesticCritical){
$general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
}
}
+11 -6
View File
@@ -689,7 +689,8 @@ function setGift($tnmt_type, $tnmt, $phase) {
'grp_no'=>$general['grp_no'],
'reward'=>$cost,
'msg'=>"<span class='ev_highlight'>16강 진출</span>",
'logger'=>$logger
'logger'=>$logger,
'inheritance_point'=>10,
];
}
//8강자 명성 돈
@@ -723,6 +724,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "<span class='ev_highlight'>4강 진출</span>";
General::createGeneralObjFromDB($generalID)->increaseInheritancePoint('tournament', 10);
}
//결승자 명성 돈
$cost = $admin['develcost'] * 6;
@@ -739,6 +741,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "<span class='ev_highlight'>준우승</span>으";
$resultHelper[$generalID]['inheritance_point'] = 50;
if($general['lose'] > 0){
$runnerUp = $general;
}
@@ -761,6 +764,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "<span class='ev_highlight'>우승</span>으";
$resultHelper[$generalID]['inheritance_point'] = 100;
$winner = $general;
}
@@ -775,9 +779,6 @@ function setGift($tnmt_type, $tnmt, $phase) {
$runnerUpLogger = $resultHelper[$runnerUp['no']]['logger'];
$runnerUpLogger->pushGeneralHistoryLog("<C>{$tp}</> 대회에서 준우승");
$winnerRewardText = number_format($resultHelper[$winner['no']]['reward']);
$runnerUpRewardText = number_format($resultHelper[$runnerUp['no']]['reward']);
@@ -786,12 +787,16 @@ function setGift($tnmt_type, $tnmt, $phase) {
$winnerLogger->pushGlobalHistoryLog("<C>{$tp}</> 대회에서 <Y>{$winner['name']}</>{$josaYiWinner} <C>우승</>, <Y>{$runnerUp['name']}</>{$josaYiRunnerUp} <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!", ActionLogger::EVENT_YEAR_MONTH);
$winnerLogger->pushGlobalHistoryLog("<C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$winnerRewardText}</>, <S>준우승자</>에겐 <C>{$runnerUpRewardText}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!", ActionLogger::EVENT_YEAR_MONTH);
foreach($resultHelper as $general){
$generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper));
foreach($resultHelper as $generalID=>$general){
$rewardText = number_format($general['reward']);
/** @var ActionLogger */
$logger = $general['logger'];
$logger->pushGeneralActionLog("<C>{$tp}</> 대회의 {$general['msg']}로 <C>{$rewardText}</>의 <S>상금</>, 약간의 <S>명성</> 획득!", ActionLogger::EVENT_PLAIN);
//TODO: 토너먼트의 다른 값이 모두 sql에 직접 입력하므로 기반을 바꿔야함.
$generalObjList[$generalID]->increaseInheritancePoint('tournament', $general['inheritance_point']);
}
//우승자 번호
+4 -1
View File
@@ -115,7 +115,10 @@ foreach(GameConst::$generalPoolAllowOption as $allowOption){
}
}
$userNick = $ownerInfo['name'];
$builder->setOwner($userID);
$builder->setOwnerName($userNick);
$builder->setKillturn(5);
$builder->setNPCType(0);
$builder->setAuxVar('next_change', TimeUtil::nowAddMinutes(12 * $env['turnterm']));
@@ -135,7 +138,7 @@ $db->update('select_pool',[
'reserved_until'=>null,
], '(owner=%i or reserved_until < %s) AND general_id is NULL', $userID, $now);
$userNick = $ownerInfo['name'];
$josaYi = JosaUtil::pick($userNick, '이');
$generalName = $builder->getGeneralName();
$josaRo = JosaUtil::pick($generalName, '로');
+2
View File
@@ -140,6 +140,7 @@ if(!$v->validate()){
'reason'=>'[출병자]'.$v->errorStr()
]);
}
$rawAttacker['owner'] = 0;
$defenderList = [];
foreach($rawDefenderList as $idx=>$rawDefenderGeneral){
@@ -152,6 +153,7 @@ foreach($rawDefenderList as $idx=>$rawDefenderGeneral){
'reason'=>"[수비자{$idx}]".$v->errorStr()
]);
}
$rawDefenderGeneral['owner'] = 0;
$defenderList[] = new General($rawDefenderGeneral, extractRankVar($rawDefenderGeneral), $rawDefenderCity, $rawAttackerNation, $year, $month, true);
}
+1
View File
@@ -132,6 +132,7 @@ if(key_exists('specialWar', $info)){
$generalObj->setAuxVar('next_change', TimeUtil::nowAddMinutes(12 * $turnterm));
$userNick = $ownerInfo['name'];
$generalObj->setVar('owner_name', $userNick);
$josaYi = JosaUtil::pick($userNick, '이');
$generalName = $info['generalName'];
+4 -2
View File
@@ -185,10 +185,10 @@ if($relYear < 3){
$experience = 0;
}
else{
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 5');
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 4');
$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',
'SELECT experience FROM general WHERE nation != 0 AND npc < 4 ORDER BY experience ASC LIMIT %i, 1',
$targetGenOrder - 1
);
$experience *= 0.8;
@@ -266,6 +266,8 @@ foreach(Util::range(GameConst::$maxTurn) as $turnIdx){
}
$db->insert('general_turn', $turnRows);
resetInheritanceUser($userID);
$rank_data = [];
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
$rank_data[] = [
File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
File diff suppressed because one or more lines are too long
+12 -2
View File
@@ -43,7 +43,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
$iterDefender = new \ArrayIterator($defenderList);
$iterDefender->rewind();
$getNextDefender = function(?WarUnit $prevDefender, bool $reqNext) use ($iterDefender, $rawDefenderNation, $db) {
$getNextDefender = function(?WarUnit $prevDefender, bool $reqNext) use ($iterDefender, $rawDefenderNation, $rawDefenderCity, $db) {
if($prevDefender !== null){
$prevDefender->applyDB($db);
}
@@ -57,6 +57,7 @@ function processWar(General $attackerGeneral, array $rawAttackerNation, array $r
}
$nextDefender = $iterDefender->current();
$nextDefender->setRawCity($rawDefenderCity);
if(extractBattleOrder($nextDefender) <= 0){
return null;
}
@@ -260,6 +261,15 @@ function processWar_NG(
$attacker->addTrain(1);
$defender->addTrain(1);
$attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType());
$defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType());
if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){
$attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
}
if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){
$defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
}
$attackerName = $attacker->getName();
$attackerCrewTypeName = $attacker->getCrewTypeName();
@@ -521,7 +531,7 @@ function ConquerCity(array $admin, General $general, array $city) {
$lord = new General($db->queryFirstRow(
'SELECT %l FROM general WHERE nation = %i AND officer_level = %i LIMIT 1',
Util::formatListOfBackticks(General::mergeQueryColumn(['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'aux'], 1)[0]),
Util::formatListOfBackticks(General::mergeQueryColumn(['npc', 'gold', 'rice', 'experience', 'explevel', 'belong', 'dedication', 'dedlevel', 'aux'], 1)[0]),
$defenderNationID,
12
), null, $city, $loseNation, $year, $month, false);
@@ -6,4 +6,18 @@ use \sammo\General;
class che_명마_07_기주마 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 공격 시 페이즈 +1";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'initWarPhase'){
return $value + 1;
}
return $value;
}
}
@@ -1,9 +1,26 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_퇴각부상무효;
use sammo\WarUnitTriggerCaller;
class che_명마_07_백마 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 전투 종료로 인한 부상 없음";
}
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_퇴각부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM),
);
}
}
@@ -1,9 +1,27 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_퇴각부상무효;
use sammo\WarUnitTriggerCaller;
class che_명마_12_사륜거 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 전투 종료로 인한 부상 없음";
}
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_퇴각부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM),
);
}
}
@@ -2,9 +2,26 @@
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저격발동;
use sammo\WarUnitTrigger\che_저격시도;
use sammo\WarUnitTriggerCaller;
class che_무기_02_단궁 extends \sammo\BaseStatItem{
protected $cost = 3000;
protected $buyable = true;
protected $reqSecu = 2000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 새로운 상대와 전투 시 1% 확률로 저격 발동, 성공 시 사기+10";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM + che_저격시도::TYPE_DEDUP_TYPE_BASE * 102, 0.01, 10, 30),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
}
@@ -2,8 +2,25 @@
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저격발동;
use sammo\WarUnitTrigger\che_저격시도;
use sammo\WarUnitTriggerCaller;
class che_무기_07_맥궁 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 새로운 상대와 전투 시 20% 확률로 저격 발동, 성공 시 사기+10";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM + che_저격시도::TYPE_DEDUP_TYPE_BASE * 107, 0.2, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
}
@@ -2,8 +2,25 @@
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저격발동;
use sammo\WarUnitTrigger\che_저격시도;
use sammo\WarUnitTriggerCaller;
class che_무기_09_동호비궁 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 새로운 상대와 전투 시 20% 확률로 저격 발동, 성공 시 사기+10";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM + che_저격시도::TYPE_DEDUP_TYPE_BASE * 109, 0.15, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
}
@@ -2,8 +2,25 @@
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저격발동;
use sammo\WarUnitTrigger\che_저격시도;
use sammo\WarUnitTriggerCaller;
class che_무기_11_이광궁 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 새로운 상대와 전투 시 10% 확률로 저격 발동, 성공 시 사기+10";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM + che_저격시도::TYPE_DEDUP_TYPE_BASE * 111, 0.10, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
}
@@ -2,8 +2,25 @@
namespace sammo\ActionItem;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_저격발동;
use sammo\WarUnitTrigger\che_저격시도;
use sammo\WarUnitTriggerCaller;
class che_무기_13_양유기궁 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 새로운 상대와 전투 시 10% 확률로 저격 발동, 성공 시 사기+10";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM + che_저격시도::TYPE_DEDUP_TYPE_BASE * 113, 0.05, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
}
@@ -21,8 +21,8 @@ class che_반계_백우선 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'),
new che_반계시도($unit),
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, false, '계략약화'),
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301),
new che_반계발동($unit)
);
}
@@ -21,8 +21,8 @@ class che_반계_파초선 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '계략약화'),
new che_반계시도($unit),
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302, false, '계략약화'),
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
new che_반계발동($unit)
);
}
@@ -7,4 +7,18 @@ class che_서적_01_효경전 extends \sammo\BaseStatItem{
protected $cost = 1000;
protected $buyable = true;
protected $reqSecu = 1000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +1%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.01;
}
return $value;
}
}
@@ -7,4 +7,18 @@ class che_서적_02_회남자 extends \sammo\BaseStatItem{
protected $cost = 3000;
protected $buyable = true;
protected $reqSecu = 2000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +1%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.01;
}
return $value;
}
}
@@ -7,4 +7,18 @@ class che_서적_03_변도론 extends \sammo\BaseStatItem{
protected $cost = 6000;
protected $buyable = true;
protected $reqSecu = 3000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +2%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.02;
}
return $value;
}
}
@@ -7,4 +7,18 @@ class che_서적_04_건상역주 extends \sammo\BaseStatItem{
protected $cost = 10000;
protected $buyable = true;
protected $reqSecu = 4000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +2%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.02;
}
return $value;
}
}
@@ -7,4 +7,18 @@ class che_서적_05_여씨춘추 extends \sammo\BaseStatItem{
protected $cost = 15000;
protected $buyable = true;
protected $reqSecu = 5000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +3%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.03;
}
return $value;
}
}
@@ -7,4 +7,18 @@ class che_서적_06_사민월령 extends \sammo\BaseStatItem{
protected $cost = 21000;
protected $buyable = true;
protected $reqSecu = 6000;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +3%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.03;
}
return $value;
}
}
@@ -1,9 +1,26 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\WarActivateSkills;
use sammo\WarUnitTriggerCaller;
class che_서적_07_논어 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, false, '계략약화')
);
}
}
@@ -1,9 +1,28 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_반계발동;
use sammo\WarUnitTrigger\che_반계시도;
use sammo\WarUnitTriggerCaller;
class che_서적_07_사마법 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, 0.2),
new che_반계발동($unit)
);
}
}
@@ -6,4 +6,18 @@ use \sammo\General;
class che_서적_07_위료자 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 시도 확률 +20%p";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicTrialProb'){
return $value + 0.2;
}
return $value;
}
}
@@ -6,4 +6,18 @@ use \sammo\General;
class che_서적_08_전론 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 계략 성공 시 대미지 +20%";
}
public function onCalcStat(General $general, string $statName, $value, $aux=null){
$value = parent::onCalcStat($general, $statName, $value, $aux);
if($statName === 'warMagicSuccessDamage'){
return $value * 1.2;
}
return $value;
}
}
@@ -1,9 +1,26 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\WarActivateSkills;
use sammo\WarUnitTriggerCaller;
class che_서적_11_춘추전 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*211, false, '계략약화')
);
}
}
@@ -1,9 +1,28 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use sammo\WarUnit;
use sammo\WarUnitTrigger\che_반계발동;
use sammo\WarUnitTrigger\che_반계시도;
use sammo\WarUnitTriggerCaller;
class che_서적_12_산해경 extends \sammo\BaseStatItem{
protected $cost = 200;
protected $buyable = false;
public function __construct()
{
parent::__construct();
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림";
}
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM, 0.2),
new che_반계발동($unit)
);
}
}
@@ -27,7 +27,7 @@ class che_의술_상한잡병론 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM),
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
@@ -27,7 +27,7 @@ class che_의술_청낭서 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM),
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
@@ -27,7 +27,7 @@ class che_의술_태평청령 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
{
return new WarUnitTriggerCaller(
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM),
new che_전투치료시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*303),
new che_전투치료발동($unit, BaseWarUnitTrigger::TYPE_ITEM)
);
@@ -1,5 +1,7 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
@@ -19,7 +21,7 @@ class che_저격_매화수전 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM, 0.5, 20, 40),
new che_저격시도($unit, che_저격시도::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*304, 0.5, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
+3 -1
View File
@@ -1,5 +1,7 @@
<?php
namespace sammo\ActionItem;
use sammo\BaseWarUnitTrigger;
use \sammo\iAction;
use \sammo\General;
use \sammo\SpecialityHelper;
@@ -19,7 +21,7 @@ class che_저격_비도 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller(
new che_저격시도($unit, che_저격시도::TYPE_ITEM, 0.5, 20, 40),
new che_저격시도($unit, che_저격시도::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*305, 0.5, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM)
);
}
@@ -11,7 +11,7 @@ class event_전투특기_무쌍 extends \sammo\BaseItem{
protected $id = 61;
protected $rawName = '비급';
protected $name = '비급(무쌍)';
protected $info = '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대50%)';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
protected $cost = 100;
protected $buyable = true;
protected $consumable = false;
@@ -26,10 +26,10 @@ class event_전투특기_무쌍 extends \sammo\BaseItem{
public function getWarPowerMultiplier(WarUnit $unit):array{
$attackMultiplier = 1.1;
$defenceMultiplier = 1;
$defenceMultiplier = 0.95;
$killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.5);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
return [$attackMultiplier, $defenceMultiplier];
}
}
@@ -10,7 +10,7 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
protected $id = 61;
protected $name = '무쌍';
protected $info = '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대50%)';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
static $selectWeight = 1;
@@ -30,7 +30,7 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
$defenceMultiplier = 1;
$killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.5);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
return [$attackMultiplier, $defenceMultiplier];
}
}
+3 -3
View File
@@ -10,7 +10,7 @@ class che_무쌍 extends \sammo\BaseSpecial{
protected $id = 61;
protected $name = '무쌍';
protected $info = '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대50%)';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)';
static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
static $selectWeight = 1;
@@ -27,10 +27,10 @@ class che_무쌍 extends \sammo\BaseSpecial{
public function getWarPowerMultiplier(WarUnit $unit):array{
$attackMultiplier = 1.1;
$defenceMultiplier = 1;
$defenceMultiplier = 0.95;
$killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.5);
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3);
return [$attackMultiplier, $defenceMultiplier];
}
}
+2
View File
@@ -120,6 +120,7 @@ class AutorunGeneralPolicy{
$priority = [];
foreach($serverPolicy['priority'] as $priorityItem){
if(!property_exists($this, $priorityItem)){
trigger_error ("{$priorityItem}이 없음", E_USER_NOTICE );
continue;
}
$priority[] = $priorityItem;
@@ -133,6 +134,7 @@ class AutorunGeneralPolicy{
$priority = [];
foreach($nationPolicy['priority'] as $priorityItem){
if(!property_exists($this, $priorityItem)){
trigger_error ("{$priorityItem}이 없음", E_USER_NOTICE );
continue;
}
$priority[] = $priorityItem;
+6
View File
@@ -28,6 +28,7 @@ class AutorunNationPolicy {
static $NPC몰수 = 'NPC몰수';
// 군주 행동
static $불가침제의 = '불가침제의';
static $선전포고 = '선전포고';
static $천도 = '천도';
@@ -35,6 +36,7 @@ class AutorunNationPolicy {
//실제 행동
static public $defaultPriority = [
'불가침제의',
'선전포고',
'천도',
@@ -85,6 +87,7 @@ class AutorunNationPolicy {
public $can부대전방발령 = true;
public $can부대후방발령 = true;
public $can부대구출발령 = true;
public $can부대유저장후방발령 = true;
public $can유저장후방발령 = true;
@@ -105,6 +108,7 @@ class AutorunNationPolicy {
public $canNPC포상 = true;
public $canNPC몰수 = true;
public $can불가침제의 = true;
public $can선전포고 = true;
public $can천도 = true;
@@ -180,6 +184,7 @@ class AutorunNationPolicy {
if($serverPolicy){
foreach($serverPolicy['values']??[] as $policy=>$value){
if(!property_exists($this, $policy)){
trigger_error ("{$policy}이 없음", E_USER_NOTICE );
continue;
}
$this->{$policy} = $value;
@@ -194,6 +199,7 @@ class AutorunNationPolicy {
if($nationPolicy){
foreach($nationPolicy['values']??[] as $policy=>$value){
if(!property_exists($this, $policy)){
trigger_error ("{$policy}이 없음", E_USER_NOTICE );
continue;
}
$this->{$policy} = $value;
+1
View File
@@ -7,6 +7,7 @@ abstract class BaseWarUnitTrigger extends ObjectTrigger{
const TYPE_NONE = 0;
const TYPE_ITEM = 1;
const TYPE_CONSUMABLE_ITEM = 1 | 2;
const TYPE_DEDUP_TYPE_BASE = 1024;
protected $raiseType = self::TYPE_NONE;
@@ -14,7 +14,8 @@ use function sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
tryUniqueItemLottery
tryUniqueItemLottery,
updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -93,6 +94,13 @@ class che_기술연구 extends che_상업투자{
$exp = $score * 0.7;
$ded = $score * 1.0;
if($pick == 'success'){
updateMaxDomesticCritical($general, $score);
}
else{
$general->setAuxVar('max_domestic_critical', 0);
}
$scoreText = number_format($score, 0);
$josaUl = JosaUtil::pick(static::$actionName, '을');
+86 -81
View File
@@ -1,21 +1,22 @@
<?php
namespace sammo\Command\General;
use \sammo\{
DB, Util, JosaUtil, TimeUtil, Json,
General,
ActionLogger,
GameConst, GameUnitConst,
LastTurn,
Command
};
use \sammo\DB;
use \sammo\Util;
use \sammo\JosaUtil;
use \sammo\TimeUtil;
use \sammo\Json;
use \sammo\General;
use \sammo\ActionLogger;
use \sammo\GameConst;
use \sammo\GameUnitConst;
use \sammo\LastTurn;
use \sammo\Command;
use function \sammo\{
tryUniqueItemLottery,
getInvitationList,
getNationStaticInfo
};
use function \sammo\tryUniqueItemLottery;
use function \sammo\getInvitationList;
use function \sammo\getNationStaticInfo;
use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
@@ -24,10 +25,12 @@ use sammo\MustNotBeReachedException;
class che_랜덤임관 extends Command\GeneralCommand{
class che_랜덤임관 extends Command\GeneralCommand
{
static protected $actionName = '랜덤임관';
protected function argTest():bool{
protected function argTest(): bool
{
$this->arg = null;
return true;
@@ -71,7 +74,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
$relYear = $env['year'] - $env['startyear'];
$this->fullConditionConstraints=[
$this->fullConditionConstraints = [
ConstraintHelper::BeNeutral(),
ConstraintHelper::AllowJoinAction(),
];
@@ -83,28 +86,34 @@ class che_랜덤임관 extends Command\GeneralCommand{
*/
}
public function getCommandDetailTitle():string{
public function getCommandDetailTitle(): string
{
return '무작위 국가로 임관';
}
public function getBrief():string{
public function getBrief(): string
{
return '무작위 국가로 임관';
}
public function getCost():array{
public function getCost(): array
{
return [0, 0];
}
public function getPreReqTurn():int{
public function getPreReqTurn(): int
{
return 0;
}
public function getPostReqTurn():int{
public function getPostReqTurn(): int
{
return 0;
}
public function run():bool{
if(!$this->hasFullConditionMet()){
public function run(): bool
{
if (!$this->hasFullConditionMet()) {
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}
@@ -126,108 +135,107 @@ class che_랜덤임관 extends Command\GeneralCommand{
$destNation = null;
if ($general->getNPCType() >= 2 && !$env['fiction'] && 1000 <= $env['scenario'] && $env['scenario'] < 2000) {
if($notIn){
if ($notIn) {
$nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i and nation.nation not in %li',
$relYear<3?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral,
$relYear < 3 ? GameConst::$initialNationGenLimit : GameConst::$defaultMaxGeneral,
$notIn
);
}
else{
} else {
$nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i',
$relYear<3?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
$relYear < 3 ? GameConst::$initialNationGenLimit : GameConst::$defaultMaxGeneral
);
}
shuffle($nations);
$allGen = Util::arraySum($nations, 'gennum');
$maxScore = 1<<30;
$maxScore = 1 << 30;
$affinity = $general->getVar('affinity');
foreach($nations as $testNation){
foreach ($nations as $testNation) {
$affinity = abs($affinity - $testNation['affinity']);
$affinity = min($affinity, abs($affinity - 150));
$score = log($affinity + 1, 2);//0~
$score = log($affinity + 1, 2); //0~
//쉐킷쉐킷
$score += Util::randF();
$score += sqrt($testNation['gennum']/$allGen);
if($score < $maxScore){
$score += sqrt($testNation['gennum'] / $allGen);
if ($score < $maxScore) {
$maxScore = $score;
$destNation = $testNation;
}
}
}
else{
} else {
$onlyRandom = $env['join_mode'] == 'onlyRandom';
$genLimit = GameConst::$defaultMaxGeneral;
if($onlyRandom && TimeUtil::IsRangeMonth($env['init_year'], $env['init_month'], 1, $env['year'], $env['month'])){
if ($onlyRandom && TimeUtil::IsRangeMonth($env['init_year'], $env['init_month'], 1, $env['year'], $env['month'])) {
$genLimit = GameConst::$initialNationGenLimitForRandInit;
}
else if($relYear < 3){
} else if ($relYear < 3) {
$genLimit = GameConst::$initialNationGenLimit;
}
$generalsCnt = [];
if($notIn){
if ($notIn) {
$rawGeneralsCnt = $db->query(
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc < 5 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc',
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc',
$genLimit,
$notIn
);
}
else{
} else {
$rawGeneralsCnt = $db->query(
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc < 5 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc',
'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc',
$genLimit
);
}
foreach($rawGeneralsCnt as $nation){
foreach ($rawGeneralsCnt as $nation) {
$nationID = $nation['nation'];
if(!\key_exists($nationID, $generalsCnt)){
if (!\key_exists($nationID, $generalsCnt)) {
$generalsCnt[$nationID] = [
'nation'=>$nationID,
'gennum'=>$nation['gennum'],
'name'=>$nation['name'],
'cnt'=>0,
'nation' => $nationID,
'gennum' => $nation['gennum'],
'name' => $nation['name'],
'cnt' => 0,
];
$generalsCnt[$nationID]['cnt'] = 0;
}
if($nation['npc'] <= 2){
if ($nation['npc'] <= 2) {
$calcCnt = $nation['cnt'];
}
else{
} else {
$calcCnt = $nation['cnt'] / 2;
}
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
$calcCnt *= 100;
}
$generalsCnt[$nationID]['cnt'] += $calcCnt;
}
$randVals = [];
foreach($generalsCnt as $testNation){
$randVals[] = [$testNation, 1/$testNation['cnt']];
foreach ($generalsCnt as $testNation) {
$randVals[] = [$testNation, 1 / $testNation['cnt']];
}
if($randVals){
if ($randVals) {
$destNation = Util::choiceRandomUsingWeightPair($randVals);
}
}
$logger = $general->getLogger();
if(!$destNation){
if (!$destNation) {
//임관 가능한 국가가 없다!
$logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date</>");
$logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date</>");
$this->alternative = new che_요양($general, $this->env, null);
return false;
}
@@ -236,7 +244,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
$destNationID = $destNation['nation'];
$destNationName = $destNation['name'];
$talkList = [
'어쩌다 보니',
@@ -257,10 +265,9 @@ class che_랜덤임관 extends Command\GeneralCommand{
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>에 랜덤 임관");
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} {$randomTalk} <D><b>{$destNationName}</b></>에 <S>임관</>했습니다.");
if($gennum < GameConst::$initialNationGenLimit) {
if ($gennum < GameConst::$initialNationGenLimit) {
$exp = 700;
}
else {
} else {
$exp = 100;
}
@@ -268,22 +275,21 @@ class che_랜덤임관 extends Command\GeneralCommand{
$general->setVar('officer_level', 1);
$general->setVar('officer_city', 0);
$general->setVar('belong', 1);
if($this->destGeneralObj !== null){
if ($this->destGeneralObj !== null) {
$general->setVar('city', $this->destGeneralObj->getCityID());
}
else{
} else {
$targetCityID = $db->queryFirstField('SELECT city FROM general WHERE nation = %i AND officer_level=12', $destNationID);
$general->setVar('city', $targetCityID);
}
$db->update('nation', [
'gennum'=>$db->sqleval('gennum + 1')
'gennum' => $db->sqleval('gennum + 1')
], 'nation=%i', $destNationID);
$relYear = $env['year'] - $env['startyear'];
if($general->getNPCType() == 1 || $relYear >= 3){
$joinedNations = $general->getAuxVar('joinedNations')??[];
if ($general->getNPCType() == 1 || $relYear >= 3) {
$joinedNations = $general->getAuxVar('joinedNations') ?? [];
$joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations);
}
@@ -296,5 +302,4 @@ class che_랜덤임관 extends Command\GeneralCommand{
return true;
}
}
}
@@ -81,7 +81,7 @@ class che_모반시도 extends Command\GeneralCommand{
$nationName = $this->nation['name'];
$logger = $general->getLogger();
$lordLogger = $this->destGeneralObj->getLogger();
$lordLogger = $lordGeneral->getLogger();
$general->setVar('officer_level', 12);
$general->setVar('officer_city', 0);
@@ -15,7 +15,8 @@ use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
tryUniqueItemLottery
tryUniqueItemLottery,
updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -165,6 +166,13 @@ class che_상업투자 extends Command\GeneralCommand{
$exp = $score * 0.7;
$ded = $score * 1.0;
if($pick == 'success'){
updateMaxDomesticCritical($general, $score);
}
else{
$general->setAuxVar('max_domestic_critical', 0);
}
$scoreText = number_format($score, 0);
$josaUl = JosaUtil::pick(static::$actionName, '을');
@@ -203,6 +211,4 @@ class che_상업투자 extends Command\GeneralCommand{
return true;
}
}
@@ -178,7 +178,7 @@ class che_인재탐색 extends Command\GeneralCommand
$avgGen = $db->queryFirstRow(
'SELECT avg(dedication) as ded,avg(experience) as exp,
avg(dex1+dex2+dex3+dex4) as dex_t, avg(age) as age, avg(dex5) as dex5
from general where npc < 5'
from general where npc < 4'
);
$pickTypeList = ['무' => 6, '지' => 6, '무지' => 3];
+6 -1
View File
@@ -202,6 +202,8 @@ class che_임관 extends Command\GeneralCommand{
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
}
$hiddenItems = [];
foreach($nationList as &$nation){
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
$nation['availableJoin'] = false;
@@ -217,7 +219,9 @@ class che_임관 extends Command\GeneralCommand{
$nation['availableJoin'] = false;
}
if(Util::starts_with($nation['name'], 'ⓤ')){
$hiddenItems[$nation['nation']] = $nation['nation'];
}
}
unset($nation);
ob_start();
@@ -228,6 +232,7 @@ class che_임관 extends Command\GeneralCommand{
임관할 국가를 목록에서 선택하세요.<br>
<select class='formInput' name="destNationID" id="destNationID" size='1' style='color:white;background-color:black;'>
<?php foreach($nationList as $nation): ?>
<?php if(key_exists($nation['nation'], $hiddenItems)){ continue; } ?>
<option
value='<?=$nation['nation']?>'
style='<?=$nation['availableJoin']?'':'background-color:red;'?>'
@@ -209,7 +209,10 @@ class che_장수대상임관 extends Command\GeneralCommand{
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
}
$hiddenItems = [];
foreach($nationList as &$nation){
$nation['hideen'] = false;
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
$nation['availableJoin'] = false;
}
@@ -224,7 +227,9 @@ class che_장수대상임관 extends Command\GeneralCommand{
$nation['availableJoin'] = false;
}
if(Util::starts_with($nation['name'], 'ⓤ')){
$hiddenItems[$nation['nation']] = $nation['nation'];
}
}
unset($nation);
ob_start();
@@ -235,6 +240,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
임관할 국가를 목록에서 선택하세요.<br>
<select class='formInput' name="destGeneralID" id="destGeneralID" size='1' style='color:white;background-color:black;'>
<?php foreach($generalList as $targetGeneral): ?>
<?php if(key_exists($targetGeneral['nation'], $hiddenItems)){ continue; } ?>
<option value='<?=$targetGeneral['no']?>'><?=getColoredName($targetGeneral['name'],$targetGeneral['npc'])?>【<?=getNationStaticInfo($targetGeneral['nation'])['name']??'재야'?>】</option>
<?php endforeach; ?>
</select>
+10 -2
View File
@@ -15,7 +15,8 @@ use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
tryUniqueItemLottery
tryUniqueItemLottery,
updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -150,6 +151,13 @@ class che_정착장려 extends Command\GeneralCommand{
$exp = $score * 0.7;
$ded = $score * 1.0;
if($pick == 'success'){
updateMaxDomesticCritical($general, $score);
}
else{
$general->setAuxVar('max_domestic_critical', 0);
}
$score *= 10;
$scoreText = number_format($score, 0);
@@ -187,5 +195,5 @@ class che_정착장려 extends Command\GeneralCommand{
return true;
}
}
@@ -15,7 +15,8 @@ use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
tryUniqueItemLottery
tryUniqueItemLottery,
updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -150,6 +151,13 @@ class che_주민선정 extends Command\GeneralCommand{
$exp = $score * 0.7;
$ded = $score * 1.0;
if($pick == 'success'){
updateMaxDomesticCritical($general, $score);
}
else{
$general->setAuxVar('max_domestic_critical', 0);
}
$score /= 10;
$scoreText = number_format($score, 1);
+12 -8
View File
@@ -9,16 +9,17 @@ use \sammo\{
LastTurn,
GameUnitConst,
Command,
Json,
KVStorage,
StringUtil
};
use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
getAllNationStaticInfo,
getNationStaticInfo
};
use function \sammo\getDomesticExpLevelBonus;
use function \sammo\CriticalRatioDomestic;
use function \sammo\CriticalScoreEx;
use function \sammo\getAllNationStaticInfo;
use function \sammo\getNationStaticInfo;
use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
@@ -223,7 +224,10 @@ class che_물자원조 extends Command\NationCommand{
$destNationLogger = new ActionLogger(0, $destChiefID, $year, $month);
$destNationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$riceAmountText}</>을 지원 받음");
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
$destRecvAssist = $destNationStor->getValue('recv_assist')??[];
$destRecvAssist["n{$nationID}"] = [$nationID, ($destRecvAssist["n{$nationID}"][1]??0) + $goldAmount + $riceAmount];
$destNationStor->setValue('recv_assist', $destRecvAssist);
$db->update('nation', [
'gold'=>$db->sqleval('gold - %i', $goldAmount),
@@ -2,33 +2,31 @@
namespace sammo\Command\Nation;
use\sammo\{
DB,
Util,
JosaUtil,
General,
DummyGeneral,
ActionLogger,
GameConst,
LastTurn,
GameUnitConst,
Command,
MessageTarget,
DiplomaticMessage,
Message,
};
use \sammo\DB;
use \sammo\Util;
use \sammo\JosaUtil;
use \sammo\General;
use \sammo\DummyGeneral;
use \sammo\ActionLogger;
use \sammo\GameConst;
use \sammo\LastTurn;
use \sammo\GameUnitConst;
use \sammo\Command;
use \sammo\MessageTarget;
use \sammo\DiplomaticMessage;
use \sammo\Message;
use function\sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
getAllNationStaticInfo,
getNationStaticInfo,
GetImageURL
};
use function \sammo\getDomesticExpLevelBonus;
use function \sammo\CriticalRatioDomestic;
use function \sammo\CriticalScoreEx;
use function \sammo\getAllNationStaticInfo;
use function \sammo\getNationStaticInfo;
use function \sammo\GetImageUR;
use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper;
use sammo\Json;
use sammo\KVStorage;
class che_불가침수락 extends Command\NationCommand
{
@@ -191,6 +189,13 @@ class che_불가침수락 extends Command\NationCommand
$destNationID = $destNation['nation'];
$destNationName = $destNation['name'];
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
$destRecvAssist = $destNationStor->getValue('recv_assist')??[];
$destRespAssist = $destNationStor->getValue('resp_assist')??[];
$destRespAssist["n{$nationID}"] = [$nationID, $destRecvAssist["n{$nationID}"][1]??0];
$destNationStor->setValue('resp_assist', $destRespAssist);
$year = $this->arg['year'];
$month = $this->arg['month'];
@@ -95,6 +95,7 @@ class che_선전포고 extends Command\NationCommand
ConstraintHelper::DisallowDiplomacyBetweenStatus([
0 => '아국과 이미 교전중입니다.',
1 => '아국과 이미 선포중입니다.',
7 => '불가침국입니다.'
]),
];
}
@@ -50,6 +50,11 @@ class AllowJoinDestNation extends Constraint{
return false;
}
if($this->general['npc']??2 < 2 && \sammo\Util::starts_with($this->destNation['name'], 'ⓤ')){
$this->reason = "유저장은 태수국에 임관할 수 없습니다.";
return false;
}
$joinedNations = $this->general['auxVar']['joinedNations']??[];
if(in_array($this->destNation['nation'], $joinedNations)){
$this->reason = "이미 임관했었던 국가입니다.";
+1 -1
View File
@@ -3,7 +3,7 @@ namespace sammo\Event;
abstract class Action{
//public abstract function __construct(...$args);
public abstract function run($env=null);
public abstract function run(array $env);
public static function build($actionArgs):Action{
if(!is_array($actionArgs)){
@@ -0,0 +1,46 @@
<?php
namespace sammo\Event\Action;
use function sammo\getNationStaticInfo;
use sammo\DB;
use sammo\Util;
class AutoDeleteInvader extends \sammo\Event\Action{
private $nationID;
public function __construct(int $nationID){
$this->nationID = $nationID;
}
public function run(array $env){
$db = DB::db();
if(getNationStaticInfo($this->nationID)===null){
$db->update('general', [
'killturn'=>5
], 'nation = 0 AND npc = 9');
$eventID = Util::array_get($env['currentEventID']);
$db->delete('event', 'id = %i', $eventID);
return [__CLASS__, "Not Exists"];
}
$db = DB::db();
$onWar = $db->queryFirstField('SELECT count(*) FROM diplomacy WHERE me = %i AND state IN %li', $this->nationID, [0, 1]);
if($onWar){
return [__CLASS__, "On War"];
}
$rulerID = $db->queryFirstField('SELECT no FROM general WHERE nation = %i AND officer_level = 12', $this->nationID);
$db->update('general_turn', [
'action'=>'che_방랑',
'arg'=>'[]',
'brief'=>"이민족 방랑"
], 'general_id = %i', $rulerID);
$db->update('general', [
'killturn'=>5
], 'nation = %i', $this->nationID);
$eventID = Util::array_get($env['currentEventID']);
$db->delete('event', 'id = %i', $eventID);
return [__CLASS__, 'Deleted'];
}
}
+1 -1
View File
@@ -161,7 +161,7 @@ class ChangeCity extends \sammo\Event\Action{
throw new \InvalidArgumentException('올바르지 않은 cond 입니다.');
}
public function run($env=null){
public function run(array $env){
$cities = $this->getTargetCities($env);
DB::db()->update('city',
+1 -1
View File
@@ -7,7 +7,7 @@ class CreateAdminNPC extends \sammo\Event\Action{
}
public function run($env=null){
public function run(array $env){
return [__CLASS__, 'NYI'];
}
+1 -1
View File
@@ -43,7 +43,7 @@ class CreateManyNPC extends \sammo\Event\Action{
}
public function run($env=null){
public function run(array $env){
if($this->npcCount <= 0){
return [__CLASS__, []];
}
+1 -1
View File
@@ -7,7 +7,7 @@ class DeleteEvent extends \sammo\Event\Action{
public function __construct(){
}
public function run($env=null){
public function run(array $env){
$eventID = \sammo\Util::array_get($env['currentEventID']);
if(!$eventID){
+61
View File
@@ -0,0 +1,61 @@
<?php
namespace sammo\Event\Action;
use function sammo\getNationStaticInfo;
use sammo\ActionLogger;
use sammo\CityConst;
use sammo\DB;
use sammo\KVStorage;
use sammo\Util;
class InvaderEnding extends \sammo\Event\Action{
public function __construct(){
}
public function run(array $env){
//FIXME: 조건 체크를 여기서 하지 말라.
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
$isunited = $gameStor->isunited;
if(in_array($isunited, [0, 2])){
return [__CLASS__, "No Invader"];
}
$nationCnt = $db->queryFirstField('SELECT count(*) FROM nation');
if($nationCnt >= 2){
return [__CLASS__, "On Event"];
}
$gameStor = KVStorage::getStorage($db, 'game_env');
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
$cityCnt = $db->queryFirstField('SELECT count(*) FROM city WHERE nation = 0');
if($cityCnt == 0){
//천통 엔딩
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>이민족을 모두 소탕했습니다!");
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>중원은 당분간 태평성대를 누릴 것입니다.");
}
else if($cityCnt == count(CityConst::all())){
//이민족 엔딩
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>중원은 이민족에 의해 혼란에 빠졌습니다.");
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>백성은 언젠가 영웅이 나타나길 기다립니다.");
}
else{
return [__CLASS__, "On Event"];
}
$gameStor->setValue('isunited', 3);
$logger->flush();
$gameStor->conlimit = $gameStor->conlimit * 100;
$eventID = Util::array_get($env['currentEventID']);
$db->delete('event', 'id = %i', $eventID);
return [__CLASS__, 'Deleted'];
}
}
+198 -57
View File
@@ -1,116 +1,257 @@
<?php
namespace sammo\Event\Action;
use sammo\ActionLogger;
use sammo\CityConst;
use sammo\DB;
use sammo\Json;
use sammo\KVStorage;
use sammo\Scenario\GeneralBuilder;
use sammo\Scenario\Nation;
use sammo\UniqueConst;
use sammo\Util;
use function sammo\getNationStaticInfo;
use function sammo\refreshNationStaticInfo;
/**
* 이민족 침입을 모사
*
* 양수 : 정해진 값. [절대값]
* 음수 : 합산(장수 등), 혹은 평균(기술 등)을 나누어 적용한 값 [상대값]
* 음수 : 합산(장수 등), 혹은 평균(기술 등)을 곱해 적용한 값 [상대값]
*
* event_1.php, 센 이민족 : npcEachCount = -0.5, specAvg = 195, specDist = 5, tech = 15000, dex = 450000
* event_2.php, 약한 이민족 : npcEachCount = -0.5, specAvg = 150, specDist = 20, tech = -1, dex = 0
* event_3.php, 엄청 약한 이민족 : npcEachCount = 100, specAvg = 50, specDist = 5, tech = 0, dex = 0
* event_1.php, 센 이민족 : npcEachCount = -0.5, specAvg = 195, tech = 15000, dex = 450000
* event_2.php, 약한 이민족 : npcEachCount = -0.5, specAvg = 150, tech = -1, dex = 0
* event_3.php, 엄청 약한 이민족 : npcEachCount = 100, specAvg = 50, tech = 0, dex = 0
*/
class RaiseInvader extends \sammo\Event\Action{
class RaiseInvader extends \sammo\Event\Action
{
private $npcEachCount;
private $specAvg;
private $specDist;
private $tech;
private $dex;
const INVADER_LIST = [
'강'=>63,
'저'=>64,
'흉노'=>65,
'남만'=>66,
'산월'=>67,
'오환'=>68,
'왜'=>69
];
public function __construct(
$npcEachCount = -0.5,
int $specAvg = 150,
int $specDist = 20,
int $tech = -1,
int $dex = 0
){
$npcEachCount = -3,
$specAvg = -1.2,
$tech = -1.2,
$dex = -1
) {
$this->npcEachCount = $npcEachCount;
$this->specAvg = $specAvg;
$this->specDist = $specDist;
$this->tech = $tech;
$this->dex = $dex;
if($specDist < 0){
throw new \InvalidArgumentException('specDist는 음수를 지원하지 않습니다.');
}
}
private function moveCapital(){
$cities = array_map(function ($value) {
return $value;
}, static::INVADER_LIST);
private function moveCapital()
{
$cities = [];
foreach (CityConst::all() as $cityObj) {
if ($cityObj->level != 4) {
continue;
}
$cities[] = $cityObj->id;
}
if (count($cities) == 0) {
return [__CLASS__, 0];
}
$db = DB::db();
foreach($db->queryFirstColumn('SELECT capital, nation from nation WHERE capital in %li', $cities) as $row){
foreach ($db->queryFirstColumn('SELECT capital, nation from nation WHERE capital in %li', $cities) as $row) {
list($oldCapital, $nation) = $row;
$newCapital = $db->queryFirstRow('SELECT city from city where nation=%i and city !=%i \
order by rand() limit 1', $nation, $oldCapital);
$db->update('nation', ['capital'=>$newCapital], 'nation=%i', $nation);
$db->update('nation', ['capital' => $newCapital], 'nation=%i', $nation);
$db->update('general', ['city'=>$newCapital], 'nation=%i and city=%i', $nation, $oldCapital);
$db->update('general', ['city' => $newCapital], 'nation=%i and city=%i', $nation, $oldCapital);
}
$db->update('general', [
'officer_level'=>1,
'officer_city'=>0
'officer_level' => 1,
'officer_city' => 0
], 'officer_city in %li', $cities);
$db->update('city', [
'nation'=>0
'nation' => 0,
'front' => 0,
'supply' => 1,
], 'city in %li', $cities);
}
public function run($env=null){
public function run(array $env)
{
$db = DB::db();
$npcEachCount = $this->npcEachCount;
if($npcEachCount < 0){
$npcEachCount =
$db->queryFirstField('SELECT count(no) from general where npc < 9') / count(self::INVADER_LIST);
$npcEachCount /= -1 * $this->npcEachCount;
/** @var \sammo\CityInitDetail[] */
$cities = [];
foreach (CityConst::all() as $cityObj) {
if ($cityObj->level != 4) {
continue;
}
$cities[] = $cityObj;
}
if ($npcEachCount < 0) {
$npcEachCount =
$db->queryFirstField('SELECT count(no) from general where npc < 4') / count($cities);
$npcEachCount *= -1 * $this->npcEachCount;
}
$npcEachCount = max(10, Util::toInt($npcEachCount));
$specAvg = $this->specAvg;
if($specAvg < 0){
$specAvg = $db->queryFirstField('SELECT avg(sum(`leadership` + `strength` + `intel`)) from general where npc < 9');
$specAvg /= -1 * $this->specAvg;
if ($specAvg < 0) {
$specAvg = $db->queryFirstField('SELECT avg((`leadership` + `strength` + `intel`)/3) from general where npc < 4');
$specAvg *= -1 * $this->specAvg;
}
$specAvg = Util::toInt($specAvg);
$tech = $this->tech;
if($tech < 0){
if ($tech < 0) {
$tech = $db->queryFirstField("SELECT avg(tech) from nation where `level`>0");
$tech /= -1 * $this->tech;
$tech *= -1 * $this->tech;
}
$dex = $this->dex;
if($dex < 0){
$dex = $db->queryFirstField("SELECT avg(dex1 + dex2 + dex3 + dex4 + dex5)/5 from nation where `level`>0");
$dex /= -1 * $this->dex;
if ($dex < 0) {
$dex = $db->queryFirstField("SELECT avg((dex1 + dex2 + dex3 + dex4 + dex5)/5) from general where npc < 4");
$dex *= -1 * $this->dex;
}
$dex = Util::toInt($dex);
$this->moveCapital();
//TODO:국가를 만들고
//TODO:장수를 세팅하고
//TODO:외교를 설정한다.
$serverID = UniqueConst::$serverID;
$existNations = $db->queryFirstColumn("SELECT nation FROM `nation`");
$lastNationID = max(
max($existNations),
$db->queryFirstField("SELECT max(`nation`) FROM `ng_old_nations` WHERE server_id = %s", $serverID),
);
//TODO: 시나리오 구현 후 마무리.
//TODO: 임관 모드가 '랜임모드'인 경우 오랑캐와 충돌하므로 해제해야함.
return [__CLASS__, 'NYI'];
$db->update('general', [
'gold' => 999999,
'rice' => 999999,
], true);
$year = $env['year'];
$invaderNationIDList = [];
refreshNationStaticInfo();
foreach ($cities as $cityObj) {
if ($cityObj->level != 4) {
continue;
}
$lastNationID += 1;
$invaderNationID = $lastNationID;
$invaderNationIDList[] = $invaderNationID;
$invaderName = $cityObj->name;
$nationName = "{$invaderName}";
$nationObj = new Nation($invaderNationID, $nationName, '#800080', 9999999, 9999999, "중원의 부패를 물리쳐라! 이민족 침범!", $tech, "che_병가", 2, [$cityObj->name]);
$nationObj->build($env);
$ruler = (new GeneralBuilder("{$invaderName}대왕", false, null, $lastNationID))
->setEgo('che_패권')
->setSpecial('che_인덕', 'che_척사')
->setLifeSpan($year - 20, $year + 20)
->setCityID($cityObj->id)
->setNPCType(9)
->setStat(Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.8), Util::toInt($specAvg * 1.2))
->setAffinity(999)
->setGoldRice(99999, 99999);
$ruler->build($env);
$nationObj->addGeneral($ruler);
foreach (Util::range(1, $npcEachCount) as $invaderGenIdx) {
$gen = (new GeneralBuilder("{$invaderName}장수{$invaderGenIdx}", false, null, $invaderNationID))
->setEgo('che_패권')
->setSpecial('che_인덕', 'che_척사')
->setLifeSpan($year - 20, $year + 20)
->setCityID($cityObj->id)
->setNPCType(9)
->setAffinity(999)
->setGoldRice(99999, 99999);
$leadership = Util::randRangeInt(Util::toInt($specAvg * 1.2), Util::toInt($specAvg * 1.4));
$mainStat = Util::randRangeInt(Util::toInt($specAvg * 1.2), Util::toInt($specAvg * 1.4));
$subStat = $specAvg * 3 - $leadership - $mainStat;
if (Util::randBool()) {
//무장
$dexTable = [$dex * 2, $dex, $dex];
shuffle($dexTable);
$gen->setStat($leadership, $mainStat, $subStat)
->setDex($dexTable[0], $dexTable[1], $dexTable[2], $dex, 0);
} else {
//지장
$gen->setStat($leadership, $subStat, $mainStat)
->setDex($dex, $dex, $dex, $dex * 2, 0);
}
$gen->build($env);
$nationObj->addGeneral($gen);
}
$nationObj->postBuild($env);
refreshNationStaticInfo();
$db->insert('event', [
'condition' => Json::encode(true),
'action' => Json::encode([["AutoDeleteInvader", $invaderNationID]]),
]);
}
$db->insert('event', [
'condition' => Json::encode(true),
'action' => Json::encode([["InvaderEnding"]]),
]);
$db->update('nation', [
'scout' => 1
], 'nation IN %li', $invaderNationIDList);
$db->update('diplomacy', [
'state' => 1,
'term' => 24,
], '(me IN %li AND you IN %li) OR (me IN %li AND you IN %li)', $existNations, $invaderNationIDList, $invaderNationIDList, $existNations);
$db->update('diplomacy', [
'state' => 7,
'term' => 480,
], '(me IN %li AND you IN %li)', $invaderNationIDList, $invaderNationIDList);
$cityMaxPop = $specAvg * $npcEachCount * 100 * 4;
$db->update('city', [
'pop_max' => $cityMaxPop,
'def_max' => 100000,
'wall_max' => 10000,
], 'nation IN %li', $invaderNationIDList);
$db->update('city', [
'pop' => $db->sqleval('pop_max'),
'agri' => $db->sqleval('agri_max'),
'comm' => $db->sqleval('comm_max'),
'secu' => $db->sqleval('secu_max'),
], true);
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->setValue('isunited', 1);
refreshNationStaticInfo();
$logger = new ActionLogger(0, 0, $year, $env['month']);
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>각지의 이민족들이 <M>궐기</>합니다!");
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!");
$logger->pushGlobalHistoryLog("<L><b>【이벤트】</b></>이민족의 기세는 그 누구도 막을 수 없을듯 합니다!");
$logger->flush();
$db->update('plock', [
'plock' => 0
], true);
return [__CLASS__, count($invaderNationIDList)];
}
}
}
+282
View File
@@ -0,0 +1,282 @@
<?php
namespace sammo\Event\Action;
use InvalidArgumentException;
use sammo\ActionLogger;
use sammo\CityConst;
use sammo\DB;
use sammo\GameConst;
use sammo\Json;
use sammo\KVStorage;
use sammo\Scenario\GeneralBuilder;
use sammo\Scenario\Nation;
use sammo\UniqueConst;
use sammo\Util;
use function sammo\GetNationColors;
use function sammo\getNationStaticInfo;
use function sammo\pickGeneralFromPool;
use function sammo\refreshNationStaticInfo;
class RaiseNPCNation extends \sammo\Event\Action
{
public function __construct()
{
}
const CITY_KEYS = ['pop', 'agri', 'comm', 'secu', 'def', 'wall'];
const MIN_DIST_USERNATION = 4;
const MIN_DIST_NPCNATION = 2;
private function calcAvgNationCity(array $cities)
{
if (count($cities) == 0) {
throw new InvalidArgumentException();
}
$targetCities = [];
foreach ($cities as $city) {
if ($city['nation'] == 0) {
continue;
}
$citySum = 0;
foreach (static::CITY_KEYS as $key) {
if ($key === 'pop') {
continue;
}
$citySum += $city[$key];
}
$city['sum'] = $citySum;
$targetCities[] = $city;
}
$cityCnt = count($targetCities);
if ($cityCnt == 0) {
$target = Util::choiceRandom($cities);
$randCity = [];
foreach (static::CITY_KEYS as $key) {
$randCity[$key] = $target["{$key}_max"];
}
return $randCity;
}
usort($targetCities, function (array $lhs, array $rhs) {
return $lhs['sum'] <=> $rhs['sum'];
});
//최소, 최대 도시 몇개를 뺀다. 정렬은 신경쓰지 않는다.
if ($cityCnt >= 3) {
$reduceCnt = Util::valueFit(Util::round($cityCnt / 6, 0), 1);
foreach (Util::range($reduceCnt) as $_idx) {
array_pop($targetCities);
}
foreach (Util::range($reduceCnt) as $idx) {
$targetCities[$idx] = array_pop($targetCities);
}
$cityCnt -= $reduceCnt * 2;
}
$avgCity = [];
foreach ($targetCities as $city) {
foreach (static::CITY_KEYS as $key) {
$avgCity[$key] = ($avgCity[$key] ?? 0) + $city[$key];
}
}
foreach (static::CITY_KEYS as $key) {
$avgCity[$key] = Util::toInt($avgCity[$key] / $cityCnt);
}
return $avgCity;
}
public function calcAvgNationGeneralCnt(): int
{
$nationUsers = [];
foreach (\sammo\getAllNationStaticInfo() as $nation) {
if ($nation['level'] == 0) {
continue;
}
$nationUsers[] = $nation['gennum'];
}
$nationCnt = count($nationUsers);
if ($nationCnt == 0) {
return GameConst::$initialNationGenLimit;
}
sort($nationUsers);
if ($nationCnt >= 3) {
$reduceCnt = Util::valueFit(Util::round($nationCnt / 6, 0), 1);
foreach (Util::range($reduceCnt) as $_idx) {
array_pop($nationUsers);
}
foreach (Util::range($reduceCnt) as $idx) {
$nationUsers[$idx] = array_pop($nationUsers);
}
$nationCnt -= $reduceCnt * 2;
}
return Util::round(array_sum($nationUsers) / $nationCnt);
}
public function calcAvgTech(): int
{
$techSum = 0;
$nationCnt = 0;
foreach (\sammo\getAllNationStaticInfo() as $nation) {
if ($nation['level'] == 0) {
continue;
}
$techSum += $nation['tech'];
$nationCnt += 1;
}
if ($nationCnt == 0) {
return 0;
}
return Util::toInt($techSum / $nationCnt);
}
private function buildNation(int $nationID, int $tech, array $baseCity, array $avgCity, int $genCnt, $env)
{
$db = DB::db();
$targetCity = [
'trust' => 100
];
foreach (static::CITY_KEYS as $key) {
$targetCity[$key] = min($baseCity["{$key}_max"], $avgCity[$key]);
}
$pickTypeList = ['무' => 1, '지' => 1];
$cityID = $baseCity['city'];
$cityName = $baseCity['name'];
$nationName = "{$cityName}";
$color = Util::choiceRandom(GetNationColors());
$nationObj = new Nation($nationID, $nationName, $color, 0, 2000, "우리도 할 수 있다! {$cityName}", $tech, null, 2, [$cityName]);
$nationObj->build($env);
$ruler = (new GeneralBuilder("{$cityName}태수", false, null, $nationID))
->setOfficerLevel(12)
->setCityID($cityID)
->setNPCType(6)
->setGoldRice(1000, 1000)
->fillRandomStat($pickTypeList)
->setKillturn(240)
->fillRemainSpecAsZero($env);
$ruler->build($env);
$nationObj->addGeneral($ruler);
$birthYear = $env['year'] - 20;
$deadYearMin = $env['year'] + 10;
foreach (pickGeneralFromPool(DB::db(), 0, $genCnt - 1) as $pickedNPC) {
//대충 10년후부터 6년마다 절반?
$deadYear = $deadYearMin + Util::toInt(60 * (1 - log(Util::randRange(1, 1024), 2)/10));
$newNPC = $pickedNPC->getGeneralBuilder();
$newNPC->setNationID($nationID)
->setCityID($cityID)
->setNPCType(6)
->setGoldRice(1000, 1000)
->setLifeSpan($birthYear, $deadYear)
->fillRandomStat($pickTypeList)
->fillRemainSpecAsZero($env);
$newNPC->build($env);
$pickedNPC->occupyGeneralName();
$nationObj->addGeneral($newNPC);
}
$nationObj->postBuild($env);
$db->update('city', $targetCity, 'city = %i', $cityID);
refreshNationStaticInfo();
}
public function run(array $env)
{
$db = DB::db();
$allCities = $db->query('SELECT * FROM city WHERE 5 <= level AND level <= 6'); //소, 중 성만 선택
$emptyCities = [];
$occupiedCities = [];
$npcCities = [];
$avgCity = $this->calcAvgNationCity($allCities);
foreach ($allCities as $city) {
if ($city['nation'] == 0) {
$emptyCities[$city['city']] = $city;
} else {
$occupiedCities[$city['city']] = $city;
}
}
$avgGenCnt = $this->calcAvgNationGeneralCnt();
$serverID = UniqueConst::$serverID;
$lastNationID = max(
$db->queryFirstField("SELECT max(`nation`) FROM `nation`"),
$db->queryFirstField("SELECT max(`nation`) FROM `ng_old_nations` WHERE server_id = %s", $serverID),
);
$avgTech = $this->calcAvgTech();
Util::shuffle_assoc($emptyCities);
$occupiedCitiesID = array_keys($occupiedCities);
$npcCitiesID = [];
refreshNationStaticInfo();
foreach ($emptyCities as $emptyCity) {
$cityID = $emptyCity['city'];
$minDistance = 999;
foreach ($occupiedCitiesID as $targetCityID) {
$minDistance = min(\sammo\calcCityDistance($cityID, $targetCityID, null), $minDistance);
if ($minDistance < static::MIN_DIST_USERNATION) {
break;
}
}
if ($minDistance < static::MIN_DIST_USERNATION) {
continue;
}
$minDistance = 999;
foreach ($npcCitiesID as $targetCityID) {
$minDistance = min(\sammo\calcCityDistance($cityID, $targetCityID, null), $minDistance);
if ($minDistance < static::MIN_DIST_NPCNATION) {
break;
}
}
if ($minDistance < static::MIN_DIST_NPCNATION) {
continue;
}
//TODO: 거리 측정
$lastNationID += 1;
$this->buildNation($lastNationID, $avgTech, $emptyCity, $avgCity, $avgGenCnt, $env);
$npcCities[$cityID] = $emptyCity;
$npcCitiesID[] = $cityID;
}
if (count($npcCities) > 0) {
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
$logger->pushGlobalHistoryLog("<L><b>【공지】</b></>공백지에 임의의 국가가 생성되었습니다.");
$logger->flush();
}
return [__CLASS__, count($npcCities)];
}
}
+7 -5
View File
@@ -3,6 +3,7 @@ namespace sammo\Event\Action;
//이전 RegNPC 함수를 EventAction으로 재구성
class RegNPC extends \sammo\Event\Action{
/** @var \sammo\Scenario\GeneralBuilder */
private $npc;
public function __construct(
@@ -14,6 +15,7 @@ class RegNPC extends \sammo\Event\Action{
int $leadership,
int $strength,
int $intel,
int $officerLevel,
int $birth = 160,
int $death = 300,
$ego = null,
@@ -21,7 +23,7 @@ class RegNPC extends \sammo\Event\Action{
$text = ''
){
return (new \sammo\Scenario\GeneralBuilder(
$this->npc=(new \sammo\Scenario\GeneralBuilder(
$name,
0,
$picturePath,
@@ -29,16 +31,16 @@ class RegNPC extends \sammo\Event\Action{
))
->setCity($locatedCity)
->setStat($leadership, $strength, $intel)
->setOfficerLevel($officerLevel)
->setEgo($ego)
->setSpecialSingle($char)
->setNPCText($text?:'')
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->fillRemainSpecAsZero();
->setLifeSpan($birth, $death);
}
public function run($env=null){
$result = $this->npc->build($env);
public function run(array $env){
$result = $this->npc->fillRemainSpecAsZero($env)->build($env);
return [__CLASS__, $result];
}
+5 -5
View File
@@ -3,6 +3,7 @@ namespace sammo\Event\Action;
class RegNeutralNPC extends \sammo\Event\Action{
/** @var \sammo\Scenario\GeneralBuilder */
private $npc;
public function __construct(
@@ -20,7 +21,7 @@ class RegNeutralNPC extends \sammo\Event\Action{
$char = '',
$text = ''
){
return (new \sammo\Scenario\GeneralBuilder(
$this->npc=(new \sammo\Scenario\GeneralBuilder(
$name,
0,
$picturePath,
@@ -33,12 +34,11 @@ class RegNeutralNPC extends \sammo\Event\Action{
->setNPCText($text?:'')
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->setNPCType(6)
->fillRemainSpecAsZero();
->setNPCType(6);
}
public function run($env=null){
$result = $this->npc->build($env);
public function run(array $env){
$result = $this->npc->fillRemainSpecAsZero($env)->build($env);
return [__CLASS__, $result];
}
+5 -1
View File
@@ -1,6 +1,8 @@
<?php
namespace sammo\Event\Condition;
use sammo\Event\Condition;
class Logic extends \sammo\Event\Condition{
private $mode = 'and';
@@ -24,7 +26,9 @@ class Logic extends \sammo\Event\Condition{
}
$this->mode = $mode;
$this->conditions = $conditions;
$this->conditions = array_map(function($condition){
return Condition::build($condition);
}, $conditions);
}
public function eval($env=null){
+1 -1
View File
@@ -14,7 +14,7 @@ class EventHandler{
}
public function tryRunEvent(array $env=null){
public function tryRunEvent(array $env){
$result = $this->condition->eval($env);
if(!$result['value']){
+207 -3
View File
@@ -50,6 +50,20 @@ class General implements iAction{
'occupied'=>1,
];
const INHERITANCE_KEY = [
'previous'=>[true, 1, '기존 포인트'],
'lived_month'=>[true, 1, '생존'],
'max_belong'=>[false, 10, '최대 임관년 수'],
'max_domestic_critical'=>[true, 1, '최대 연속 내정 성공'],
'snipe_combat'=>[true, 10, '병종 상성 우위 횟수'],
'combat'=>[['rank', 'warnum'], 5, '전투 횟수'],
'sabotage'=>[['rank', 'firenum'], 20, '계략 성공 횟수'],
'unifier'=>[true, 1, '천통 기여'],
'dex'=>[false, 0.001, '숙련도'],
'tournament'=>[true, 1, '토너먼트'],
'betting'=>[false, 10, '베팅 당첨'],
];
const TURNTIME_FULL_MS = -1;
const TURNTIME_FULL = 0;
const TURNTIME_HMS = 1;
@@ -539,6 +553,8 @@ class General implements iAction{
$generalName = $this->getName();
$this->mergeTotalInheritancePoint();
// 군주였으면 유지 이음
$officerLevel = $this->getVar('officer_level');
if($officerLevel == 12) {
@@ -592,6 +608,12 @@ class General implements iAction{
$generalName = $this->getName();
$ownerID = $this->getVar('owner');
if($ownerID){
$this->mergeTotalInheritancePoint();
resetInheritanceUser($ownerID);
}
$this->multiplyVarWithLimit('leadership', 0.85, 10);
$this->multiplyVarWithLimit('strength', 0.85, 10);
$this->multiplyVarWithLimit('intel', 0.85, 10);
@@ -919,19 +941,19 @@ class General implements iAction{
static public function mergeQueryColumn(?array $reqColumns=null, int $constructMode=2):array{
$minimumColumn = ['no', 'name', 'city', 'nation', 'officer_level', 'officer_city'];
$defaultEventColumn = [
'no', 'name', 'city', 'nation', 'officer_level', 'officer_city',
'no', 'name', 'owner', 'city', 'nation', 'officer_level', 'officer_city',
'special', 'special2', 'personal',
'horse', 'weapon', 'book', 'item', 'last_turn'
];
$fullColumn = [
'no', 'name', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity',
'no', 'name', 'owner', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity',
'leadership', 'leadership_exp', 'strength', 'strength_exp', 'intel', 'intel_exp', 'weapon', 'book', 'horse', 'item',
'experience', 'dedication', 'officer_level', 'officer_city', 'gold', 'rice', 'crew', 'crewtype', 'train', 'atmos', 'turntime',
'makelimit', 'killturn', 'block', 'dedlevel', 'explevel', 'age', 'startage', 'belong',
'personal', 'special', 'special2', 'defence_train', 'tnmt', 'npc', 'npc_org', 'deadyear', 'npcmsg',
'dex1', 'dex2', 'dex3', 'dex4', 'dex5', 'betray',
'recent_war', 'last_turn', 'myset',
'specage', 'specage2', 'con', 'connect', 'owner', 'aux', 'lastrefresh',
'specage', 'specage2', 'con', 'connect', 'aux', 'lastrefresh',
];
if($reqColumns === null){
@@ -1141,4 +1163,186 @@ class General implements iAction{
}
return $result;
}
/**
* @return int|float
*/
public function getInheritancePoint(string $key, &$aux=null, bool $forceCalc=false){
$inheritType = static::INHERITANCE_KEY[$key]??null;
if($inheritType === null){
throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
}
$ownerID = $this->getVar('owner');
if(!$ownerID){
return 0;
}
if($this->getVar('npc') != 0){
return 0;
}
[$storeType, $multiplier, ] = $inheritType;
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
if($storeType === true || ($gameStor->isunited != 0 && !$forceCalc)){
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
[$value, $aux] = $inheritStor->getValue($key);
return $value;
}
if(is_array($storeType)){
[$storSubType, $storSubKey] = $storeType;
if($storSubType === 'rank'){
return $this->getRankVar($storSubKey) * $multiplier;
}
if($storSubType === 'raw'){
return $this->getVar($storSubKey) * $multiplier;
}
if($storSubType === 'aux'){
return ($this->getAuxVar($storSubKey)??0) * $multiplier;
}
throw new \InvalidArgumentException("{$storSubType}은 참조 할 수 없는 유산 세부키임");
}
if($storeType !== false){
throw new \InvalidArgumentException("{$storeType}은 올바르지 않은 유산 키임");
}
$extractFn = function(){ return [0, null];};
switch($key){
case 'dex':
$extractFn = function() use ($multiplier){
$totalDex = 0;
foreach(array_keys(GameUnitConst::allType()) as $armType){
$totalDex += $this->getVar("dex{$armType}");
}
return [$totalDex * $multiplier, null];
};
break;
case 'betting':
$extractFn = function() use ($multiplier){
$betWin = $this->getRankVar('betwin');
$betWinRate = $this->getRankVar('betwingold')/max(1, $this->getRankVar('betgold'));
return [$betWin * $multiplier * pow($betWinRate, 2), null];
};
break;
case 'max_belong':
$extractFn = function() use ($multiplier){
$maxBelong = max($this->getVar('belong'), $this->getAuxVar('max_belong')??0);
return [$maxBelong * $multiplier, null];
};
break;
default:
throw new \InvalidArgumentException("{$key}는 유산 추출기를 보유하고 있지 않음");
}
[$value, $aux] = ($extractFn)();
return $value;
}
public function setInheritancePoint(string $key, $value, $aux=null){
if(!is_int($value) && !is_float($value)){
throw new \InvalidArgumentException("{$value}는 숫자가 아님");
}
$inheritType = static::INHERITANCE_KEY[$key]??null;
if($inheritType === null){
throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
}
[$storeType, $multiplier, ] = $inheritType;
if($storeType !== true){
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
}
if($multiplier != 1 && $value != 0){
throw new \InvalidArgumentException("{$key}는 1:1 유산 포인트가 아님");
}
$ownerID = $this->getVar('owner');
if(!$ownerID){
return;
}
if($this->getVar('npc') != 0){
return;
}
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
if($gameStor->isunited != 0){
return;
}
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
$inheritStor->setValue($key, [$value, $aux]);
}
public function increaseInheritancePoint(string $key, $value, $aux=null){
if(!is_int($value) && !is_float($value)){
throw new \InvalidArgumentException("{$value}는 숫자가 아님");
}
$inheritType = static::INHERITANCE_KEY[$key]??null;
if($inheritType === null){
throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
}
[$storeType, $multiplier, ] = $inheritType;
if($storeType !== true){
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
}
$ownerID = $this->getVar('owner');
if(!$ownerID){
return;
}
if($this->getVar('npc') != 0){
return;
}
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
if($gameStor->isunited != 0){
return;
}
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
[$oldValue, $oldAux] = $inheritStor->getValue($key)??[0, null];
if($oldAux !== $aux){
$oldValue = 0;
}
$newValue = $oldValue + $value * $multiplier;
$inheritStor->setValue($key, [$newValue, $aux]);
}
public function mergeTotalInheritancePoint(){
$ownerID = $this->getVar('owner');
if(!$ownerID){
return;
}
if($this->getVar('npc') != 0){
return;
}
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
$inheritStor->cacheAll();
foreach(static::INHERITANCE_KEY as $key=>[$storType, ,]){
$aux = null;
$point = $this->getInheritancePoint($key, $aux, true);
if($storType === true){
continue;
}
$inheritStor->setValue($key, [$point, $aux]);
}
$oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result");
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
$serverID = UniqueConst::$serverID;
$year = $gameStor->year;
$month = $gameStor->month;
$oldInheritStor->setValue("{$serverID}_{$ownerID}_{$this->getID()}_{$year}_{$month}", $inheritStor->getAll(true));
}
}
+214 -33
View File
@@ -657,29 +657,62 @@ class GeneralAI
return null;
}
$cityCandidates = [];
if($this->backupCities){
$cities = $this->backupCities;
}
else{
$cities = $this->supplyCities;
/** @var General */
$pickedGeneral = Util::choiceRandom($generalCadidates);
$minRecruitPop = $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop;
if(!$this->generalPolicy->can한계징병){
$minRecruitPop = max($minRecruitPop, $this->fullLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation);
}
foreach($cities as $city){
if($city['pop'] / $city['pop_max'] < $this->nationPolicy->safeRecruitCityPopulationRatio){
$recruitableCityList = [];
foreach($this->backupCities as $candidateCity){
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if($candidateCity['city'] == $this->city['city']){
continue;
}
$cityCandidates[] = $city;
if($candidateCity['pop'] < $minRecruitPop){
continue;
}
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
$pop_ratio /= 4;
}
$recruitableCityList[$cityID] = $pop_ratio;
}
if(!$cityCandidates){
if(!$recruitableCityList){
foreach($this->supplyCities as $candidateCity){
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if($candidateCity['city'] == $this->city['city']){
continue;
}
if($candidateCity['pop'] <= $minRecruitPop){
continue;
}
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
$pop_ratio /= 2;
}
if(key_exists($cityID, $this->frontCities)){
$pop_ratio / 2;
}
$recruitableCityList[$cityID] = $pop_ratio;
}
}
if(!$recruitableCityList){
return null;
}
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, [
'destGeneralID'=>Util::choiceRandom($generalCadidates)->getID(),
'destCityID'=>Util::choiceRandom($cityCandidates)['city']
'destGeneralID'=>$pickedGeneral->getID(),
'destCityID'=>Util::choiceRandomUsingWeight($recruitableCityList)
]);
if(!$cmd->hasFullConditionMet()){
@@ -923,29 +956,66 @@ class GeneralAI
return null;
}
$cityCandidates = [];
if($this->backupCities){
$cities = $this->backupCities;
}
else{
$cities = $this->supplyCities;
/** @var General */
$pickedGeneral = Util::choiceRandom($generalCadidates);
$minRecruitPop = $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop;
if(!$this->generalPolicy->can한계징병){
$minRecruitPop = max($minRecruitPop, $this->fullLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation);
}
foreach($cities as $city){
if($city['pop'] / $city['pop_max'] < $this->nationPolicy->safeRecruitCityPopulationRatio){
$recruitableCityList = [];
foreach($this->backupCities as $candidateCity){
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if($candidateCity['city'] == $this->city['city']){
continue;
}
$cityCandidates[] = $city;
if($candidateCity['pop'] < $this->nationPolicy->minNPCRecruitCityPopulation){
continue;
}
if($candidateCity['pop'] < $minRecruitPop){
continue;
}
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
continue;
}
$recruitableCityList[$cityID] = $pop_ratio;
}
if(!$cityCandidates){
if(!$recruitableCityList){
foreach($this->supplyCities as $candidateCity){
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if($candidateCity['city'] == $this->city['city']){
continue;
}
if($candidateCity['pop'] < $this->nationPolicy->minNPCRecruitCityPopulation){
continue;
}
if($candidateCity['pop'] <= $minRecruitPop){
continue;
}
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
continue;
}
if(key_exists($cityID, $this->frontCities)){
$pop_ratio / 2;
}
$recruitableCityList[$cityID] = $pop_ratio;
}
}
if(!$recruitableCityList){
return null;
}
$cmd = buildNationCommandClass('che_발령', $this->general, $this->env, $lastTurn, [
'destGeneralID'=>Util::choiceRandom($generalCadidates)->getID(),
'destCityID'=>Util::choiceRandom($cityCandidates)['city']
'destGeneralID'=>$pickedGeneral->getID(),
'destCityID'=>Util::choiceRandomUsingWeight($recruitableCityList)
]);
if(!$cmd->hasFullConditionMet()){
@@ -1642,6 +1712,88 @@ class GeneralAI
return $cmd;
}
// 군주 행동
protected function do불가침제의(LastTurn $lastTurn): ?NationCommand
{
$general = $this->general;
if($general->getVar('officer_level') < 12){
return null;
}
$nation = $this->nation;
$nationID = $nation['nation'];
$nationStor = KVStorage::getStorage(DB::db(), $nationID, 'nation_env');
$recvAssist = $nationStor->getValue('recv_assist')??[];
$respAssist = $nationStor->getValue('resp_assist')??[];
$respAssistTry = $nationStor->getValue('resp_assist_try')??[];
$yearMonth = Util::joinYearMonth($this->env['year'], $this->env['month']);
$candidateList = [];
foreach($recvAssist as [$candNationID, $amount]){
$amount -= $respAssist["n{$candNationID}"][1]??0;
if($amount <= 0){
continue;
}
if(key_exists($candNationID, $this->warTargetNation)){
continue;
}
if(($respAssistTry["n{$candNationID}"][1]??0) >= $yearMonth - 8){
continue;
}
$candidateList[$candNationID] = $amount;
}
if(!$candidateList){
return null;
}
$cityList = $this->supplyCities;
if (!$cityList) {
return null;
}
$goldIncome = getGoldIncome($nation['nation'], $nation['level'], 15, $nation['capital'], $nation['type'], $cityList);
$riceIncome = getRiceIncome($nation['nation'], $nation['level'], 15, $nation['capital'], $nation['type'], $cityList);
$wallIncome = getWallIncome($nation['nation'], $nation['level'], 15, $nation['capital'], $nation['type'], $cityList);
$income = $goldIncome + $riceIncome + $wallIncome;
arsort($candidateList);
$destNationID = null;
$diplomatMonth = 0;
foreach($candidateList as $candNationID => $amount){
if($amount * 4 < $income){
break;
}
$destNationID = $candNationID;
$diplomatMonth = 24 * $amount / $income;
break;
}
if($destNationID === null){
return null;
}
[$targetYear, $targetMonth] = Util::parseYearMonth($yearMonth + $diplomatMonth);
$cmd = buildNationCommandClass('che_불가침제의', $this->general, $this->env, $lastTurn, [
'destNationID' => $destNationID,
'year' => $targetYear,
'month' => $targetMonth,
]);
if(!$cmd->hasFullConditionMet()){
return null;
}
$respAssistTry["n{$destNationID}"] = [$destNationID, $yearMonth];
$nationStor->setValue('resp_assist_try', $respAssistTry);
return $cmd;
}
// 군주 행동
protected function do선전포고(LastTurn $lastTurn): ?NationCommand
@@ -2669,31 +2821,42 @@ class GeneralAI
protected function do후방워프(): ?GeneralCommand
{
$minRecruitPop = $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop;
if(!$this->generalPolicy->can한계징병){
$minRecruitPop = max($minRecruitPop, $this->fullLeadership * 100 + $this->nationPolicy->minNPCRecruitCityPopulation);
}
if (in_array($this->dipState, [self::d평화, self::d선포])) {
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 외교 상태", $this->dipState);
return null;
}
if(!$this->generalPolicy->can징병){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 징병 금지", '');
return null;
}
if(!($this->genType & self::t통솔장)){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 통솔장", [$this->genType, $this->general->getLeadership(false)]);
return null;
}
if($this->general->getVar('crew') >= $this->nationPolicy->minWarCrew){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 병력 충분", [$this->general->getVar('crew'), $this->nationPolicy->minWarCrew]);
return null;
}
$city = $this->city;
if($this->generalPolicy->can한계징병){
if($city['pop'] >= $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop){
if($city['pop'] >= $minRecruitPop){
return null;
}
}
else{
if($city['pop']/$city['pop_max'] >= $this->nationPolicy->safeRecruitCityPopulationRatio){
return null;
if($city['pop'] >= $this->nationPolicy->minNPCRecruitCityPopulation && $city['pop'] >= $minRecruitPop){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 인구 충분", [$city['pop']/$city['pop_max'], $this->nationPolicy->safeRecruitCityPopulationRatio]);
return null;
}
}
}
@@ -2710,19 +2873,31 @@ class GeneralAI
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
continue;
}
if($candidateCity['pop'] < $this->nationPolicy->minNPCRecruitCityPopulation){
continue;
}
if($candidateCity['pop'] < $minRecruitPop){
continue;
}
$recruitableCityList[$cityID] = $pop_ratio;
}
if(!$recruitableCityList){
foreach($this->supplyCities as $candidateCity){
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if($candidateCity['city'] == $this->city['city']){
continue;
}
if($candidateCity['pop'] <= $this->fullLeadership * 100 + GameConst::$minAvailableRecruitPop){
if($candidateCity['pop'] < $this->nationPolicy->minNPCRecruitCityPopulation){
continue;
}
if($candidateCity['pop'] <= $minRecruitPop){
continue;
}
if($pop_ratio < $this->nationPolicy->safeRecruitCityPopulationRatio){
continue;
}
$pop_ratio = $candidateCity['pop']/$candidateCity['pop_max'];
$cityID = $candidateCity['city'];
if(key_exists($cityID, $this->frontCities)){
$recruitableCityList[$cityID] = $pop_ratio / 2;
}
@@ -2733,6 +2908,7 @@ class GeneralAI
}
if(!$recruitableCityList){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 배후 도시", [count($this->backupCities), count($this->supplyCities)]);
return null;
}
@@ -2744,6 +2920,7 @@ class GeneralAI
if(!$cmd->hasFullConditionMet()){
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 조건 불충족", $cmd->getArg());
return null;
}
@@ -2972,6 +3149,9 @@ class GeneralAI
if($general->getVar('makelimit')){
return null;
}
if($general->getNPCType() > 2){
return null;
}
if(!$this->generalPolicy->can건국){
return null;
}
@@ -3072,8 +3252,7 @@ class GeneralAI
return null;
}
if (Util::randBool(pow(1 / $nationCnt / pow($notFullNationCnt, 3), 1 / 4))) {
//국가가 1개일 경우에는 '임관하지 않음'
if (Util::randBool(pow(1 / ($nationCnt + 1) / pow($notFullNationCnt, 3), 1 / 4))) {
return null;
}
}
@@ -3364,6 +3543,7 @@ class GeneralAI
foreach($this->nationPolicy->priority as $actionName){
if(!property_exists($this->nationPolicy, 'can'.$actionName)){
trigger_error ("can{$actionName}이 없음", E_USER_NOTICE );
continue;
}
if(!$this->nationPolicy->{'can'.$actionName}){
@@ -3517,6 +3697,7 @@ class GeneralAI
foreach($this->generalPolicy->priority as $actionName){
if(!property_exists($this->generalPolicy, 'can'.$actionName)){
trigger_error ("can{$actionName}이 없음", E_USER_NOTICE );
continue;
}
if(!($this->generalPolicy->{'can'.$actionName})){
+1 -1
View File
@@ -26,7 +26,7 @@ class RandomNameGeneral extends AbsGeneralPool{
return $db->affectedRows()!=0;
}
public function giveGeneralSpec(array $pickTypeList, array $avgGen, array $env=[]){
public function giveGeneralSpec(array $pickTypeList, array $avgGen, array $env){
//do Nothing
$dexTotal = $avgGen['dex_t'];
+116 -119
View File
@@ -1,6 +1,8 @@
<?php
namespace sammo;
use sammo\Scenario\GeneralBuilder;
class Scenario{
const SCENARIO_PATH = __DIR__.'/../scenario';
@@ -37,10 +39,115 @@ class Scenario{
private $initialEvents;
private $events;
private $initBasic = false;
private $initOK = false;
private $gameConf = null;
public function generateGeneral($rawGeneral, $initFull, $npcType=2): GeneralBuilder{
while(count($rawGeneral) < 14){
$rawGeneral[] = null;
}
list(
$affinity, $name, $picturePath, $nationName, $locatedCity,
$leadership, $strength, $intel, $officerLevel, $birth, $death, $ego,
$char, $text
) = $rawGeneral;
if(key_exists($nationName, $this->nationsInv)){
$nationID = $this->nationsInv[$nationName]->getID();
}
else if(key_exists($nationName, $this->nations)){
$nationID = (int)$nationName;
}
else{
$nationID = 0;
}
$this->tmpGeneralQueue[$name] = $rawGeneral;
$obj = (new Scenario\GeneralBuilder(
$name,
false,
$picturePath,
$nationID
));
if(!$initFull){
return $obj;
}
return $obj
->setCity($locatedCity, true)
->setStat($leadership, $strength, $intel)
->setOfficerLevel($officerLevel)
->setEgo($ego)
->setSpecialSingle($char)
->setNPCText($text)
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->setNPCType($npcType)
->fillRemainSpecAsZero($this->tmpEnv);
}
public function initLite(){
if($this->initOK){
return;
}
if($this->initBasic){
return;
}
$data = $this->data;
$this->tmpEnv = [
'startyear'=>$this->year,
'year'=>$this->year,
'month'=>0 //포인트
];
$neutralNation = new Scenario\Nation(0, '재야', '#000000', 0, 0);
$this->nations = [];
$this->nations[0] = $neutralNation;
$this->nationsInv = [$neutralNation->getName() => $neutralNation];
foreach (Util::array_get($data['nation'],[]) as $idx=>$rawNation) {
list($name, $color, $gold, $rice, $infoText, $tech, $type, $nationLevel, $cities) = $rawNation;
$nationID = $idx+1;
$nation = new Scenario\Nation(
$nationID,
$name,
$color,
$gold,
$rice,
$infoText,
$tech,
$type,
$nationLevel,
$cities
);
$this->nations[$nationID] = $nation;
$this->nationsInv[$nation->getName()] = $nation;
}
$this->diplomacy = Util::array_get($data['diplomacy'], []);
$this->generals = array_map(function($rawGeneral){
return $this->generateGeneral($rawGeneral, false, 2);
}, Util::array_get($data['general'], []));
$this->generalsEx = array_map(function($rawGeneral){
return $this->generateGeneral($rawGeneral, false, 2);
}, Util::array_get($data['general_ex'], []));
$this->generalsNeutral = array_map(function($rawGeneral){
return $this->generateGeneral($rawGeneral, false, 6);
}, Util::array_get($data['general_neutral'], []));
$this->initBasic = true;
}
public function initFull(){
if($this->initOK){
return;
@@ -83,125 +190,15 @@ class Scenario{
$this->generals = array_map(function($rawGeneral){
while(count($rawGeneral) < 14){
$rawGeneral[] = null;
}
list(
$affinity, $name, $picturePath, $nationName, $locatedCity,
$leadership, $strength, $intel, $officerLevel, $birth, $death, $ego,
$char, $text
) = $rawGeneral;
if(key_exists($nationName, $this->nationsInv)){
$nationID = $this->nationsInv[$nationName]->getID();
}
else if(key_exists($nationName, $this->nations)){
$nationID = (int)$nationName;
}
else{
$nationID = 0;
}
$this->tmpGeneralQueue[$name] = $rawGeneral;
return (new Scenario\GeneralBuilder(
$name,
false,
$picturePath,
$nationID
))
->setCity($locatedCity)
->setStat($leadership, $strength, $intel)
->setOfficerLevel($officerLevel)
->setEgo($ego)
->setSpecialSingle($char)
->setNPCText($text)
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->fillRemainSpecAsZero($this->tmpEnv);
return $this->generateGeneral($rawGeneral, true, 2);
}, Util::array_get($data['general'], []));
$this->generalsEx = array_map(function($rawGeneral){
while(count($rawGeneral) < 14){
$rawGeneral[] = null;
}
list(
$affinity, $name, $picturePath, $nationName, $locatedCity,
$leadership, $strength, $intel, $officerLevel, $birth, $death, $ego,
$char, $text
) = $rawGeneral;
if(key_exists($nationName, $this->nationsInv)){
$nationID = $this->nationsInv[$nationName]->getID();
}
else if(key_exists($nationName, $this->nations)){
$nationID = (int)$nationName;
}
else{
$nationID = 0;
}
$this->tmpGeneralQueue[$name] = $rawGeneral;
return (new Scenario\GeneralBuilder(
$name,
false,
$picturePath,
$nationID
))
->setCity($locatedCity, true)
->setStat($leadership, $strength, $intel)
->setOfficerLevel($officerLevel)
->setEgo($ego)
->setSpecialSingle($char)
->setNPCText($text)
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->fillRemainSpecAsZero($this->tmpEnv);
return $this->generateGeneral($rawGeneral, true, 2);
}, Util::array_get($data['general_ex'], []));
$this->generalsNeutral = array_map(function($rawGeneral){
while(count($rawGeneral) < 14){
$rawGeneral[] = null;
}
list(
$affinity, $name, $picturePath, $nationName, $locatedCity,
$leadership, $strength, $intel, $officerLevel, $birth, $death, $ego,
$char, $text
) = $rawGeneral;
if(key_exists($nationName, $this->nationsInv)){
$nationID = $this->nationsInv[$nationName]->getID();
}
else if(key_exists($nationName, $this->nations)){
$nationID = (int)$nationName;
}
else{
$nationID = 0;
}
$this->tmpGeneralQueue[$name] = $rawGeneral;
return (new Scenario\GeneralBuilder(
$name,
false,
$picturePath,
$nationID
))
->setCity($locatedCity, true)
->setStat($leadership, $strength, $intel)
->setOfficerLevel($officerLevel)
->setEgo($ego)
->setSpecialSingle($char)
->setNPCText($text)
->setAffinity($affinity)
->setLifeSpan($birth, $death)
->setNPCType(6)
->fillRemainSpecAsZero($this->tmpEnv);
return $this->generateGeneral($rawGeneral, true, 6);
}, Util::array_get($data['general_neutral'], []));
$this->initialEvents = array_map(function($rawEvent){
@@ -293,22 +290,22 @@ class Scenario{
}
public function getNPC(){
$this->initFull();
$this->initLite();
return $this->generals;
}
public function getNPCex(){
$this->initFull();
$this->initLite();
return $this->generalsEx;
}
public function getNPCneutral(){
$this->initFull();
$this->initLite();
return $this->generalsNeutral;
}
public function getNation(){
$this->initFull();
$this->initLite();
return $this->nations;
}
@@ -321,7 +318,7 @@ class Scenario{
}
public function getScenarioBrief(){
$this->initFull();
$this->initLite();
$nations = [];
$nationGeneralCnt = [];
@@ -485,7 +482,7 @@ class Scenario{
copy("$unitPath/$unitSet.php", $path.'/GameUnitConst.php');
}
public function build($env=[]){
public function build($env){
$db = DB::db();
getGeneralPoolClass(GameConst::$targetGeneralPool)::initPool($db);
+3 -3
View File
@@ -337,7 +337,7 @@ class GeneralBuilder{
return $this;
}
public function fillRemainSpecAsZero(array $env=[]):self{
public function fillRemainSpecAsZero(array $env):self{
if($this->leadership===null){
throw new \RuntimeException('stat이 설정되어 있지 않음');
}
@@ -390,7 +390,7 @@ class GeneralBuilder{
return $this;
}
public function fillRemainSpecAsRandom(array $pickTypeList, array $avgGen, array $env=[]):self{
public function fillRemainSpecAsRandom(array $pickTypeList, array $avgGen, array $env):self{
$isFictionMode = (Util::array_get($env['fiction'], 0)!=0);
@@ -532,7 +532,7 @@ class GeneralBuilder{
return $this->death;
}
public function build($env=[]){
public function build($env){
//scenario에 life==1인 경우 수명 제한이 없어지는 모양.
+6 -3
View File
@@ -64,7 +64,7 @@ class Nation{
return $this->name;
}
public function build($env=[]){
public function build($env){
//NOTE: NPC의 숫자는 아직 확정된 것이 아니다.
$cities = array_map(function($cityName){
return \sammo\CityHelper::getCityByName($cityName)['id'];
@@ -76,7 +76,10 @@ class Nation{
$capital = 0;
}
if(strpos($this->type, '_') === FALSE){
if($this->type === null){
$type = Util::choiceRandom(GameConst::$availableNationType);
}
else if(strpos($this->type, '_') === FALSE){
$type = 'che_'.$this->type;
}
else{
@@ -147,7 +150,7 @@ class Nation{
$this->generals[] = $general;
}
public function postBuild($env=[]){
public function postBuild($env){
$npc_cnt = count($this->generals);
$db = DB::db();
+14 -3
View File
@@ -186,7 +186,7 @@ class TurnExecutionHelper
$general->setVar('killturn', ($general->getVar('deadyear') - $gameStor->year) * 12);
$general->setVar('npc', $general->getVar('npc_org'));
$general->setVar('owner', 1);
$general->setVar('owner', 0);
$general->setVar('defence_train', 80);
$general->setVar('owner_name', null);
}
@@ -257,6 +257,8 @@ class TurnExecutionHelper
$autorunMode = false;
$ai = null;
$general->increaseInheritancePoint('lived_month', 1);
$turnObj->preprocessCommand($env);
$generalCommandObj = $general->getReservedTurn(0, $env);
@@ -321,7 +323,7 @@ class TurnExecutionHelper
return;
}
if ($gameStor->isunited == 2) {
if ($gameStor->isunited == 2 || $gameStor->isunited == 3) {
//천통시에는 동결
return;
}
@@ -407,13 +409,22 @@ class TurnExecutionHelper
}
// 이벤트 핸들러 동작
$e_env = null;
foreach (DB::db()->query('SELECT * from event') as $rawEvent) {
if($e_env === null){
$e_env = $gameStor->getAll(false);
}
$eventID = $rawEvent['id'];
$cond = Json::decode($rawEvent['condition']);
$action = Json::decode($rawEvent['action']);
$event = new Event\EventHandler($cond, $action);
$e_env['currentEventID'] = $eventID;
$event->tryRunEvent(['currentEventID'=>$eventID] + $gameStor->getAll(true));
$event->tryRunEvent($e_env);
}
if($e_env !== null){
$gameStor->resetCache(true);
}
postUpdateMonthly();
+3
View File
@@ -270,6 +270,9 @@ class WarUnitGeneral extends WarUnit{
if($this->hasActivatedSkillOnLog('부상무효')){
return false;
}
if($this->hasActivatedSkillOnLog('퇴각부상무효')){
return false;
}
if(!Util::randBool(0.05)){
return false;
}
@@ -10,13 +10,19 @@ use sammo\ObjectTrigger;
class che_반계시도 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BODY + 300;
protected $prob;
public function __construct(WarUnit $unit, int $raiseType = 0, float $prob = 0.4){
$this->object = $unit;
$this->prob = $prob;
}
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
if(!$oppose->hasActivatedSkill('계략')){
return true;
}
if(!Util::randBool(0.4)){
if(!Util::randBool($this->prob)){
return true;
}
@@ -0,0 +1,19 @@
<?php
namespace sammo\WarUnitTrigger;
use sammo\BaseWarUnitTrigger;
use sammo\WarUnitGeneral;
use sammo\WarUnitCity;
use sammo\WarUnit;
use sammo\GameUnitDetail;
use sammo\ObjectTrigger;
class che_퇴각부상무효 extends BaseWarUnitTrigger{
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 300;
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
$self->activateSkill('퇴각부상무효');
return true;
}
}
+13 -1
View File
@@ -5,5 +5,17 @@
],
"const": {
"joinRuinedNPCProp":0
}
},
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["DeleteEvent"]
],
[
["Date", "==", 181, 1],
["RaiseNPCNation"],
["DeleteEvent"]
]
]
}
+13 -1
View File
@@ -8,5 +8,17 @@
],
"const": {
"joinRuinedNPCProp":0
}
},
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["DeleteEvent"]
],
[
["Date", "==", 181, 1],
["RaiseNPCNation"],
["DeleteEvent"]
]
]
}
+7 -2
View File
@@ -15,8 +15,13 @@
},
"events":[
[
["Date", "==", null, 12],
["CreateManyNPC", 10],
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30],
["DeleteEvent"]
],
[
["Date", "==", 181, 1],
["RaiseNPCNation"],
["DeleteEvent"]
]
]
+1 -1
View File
@@ -60,7 +60,7 @@
"events":[
[
["Date", "==", null, 12],
["CreateManyNPC", 10],
["CreateManyNPC", 30],
["DeleteEvent"]
],
[
+1 -1
View File
@@ -16,7 +16,7 @@
<a href='b_diplomacy.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>중원 정보</button></a>
<a href='b_currentCity.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>현재 도시</button></a>
<a href='b_battleCenter.php' target='_blank'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>감 찰 부</button></a>
<button type="button" style="visibility:hidden;" class='commandButton'>빈칸</button>
<a href='b_inheritPoint.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>유산 관리</button></a>
<a href='b_myPage.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 정보&amp;설정</button></a>
<a href='b_auction.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>거 래 장</button></a>
<a href='b_betting.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>베 팅 장</button></a>
+38
View File
@@ -0,0 +1,38 @@
import { sum } from "lodash";
import { unwrap } from "./util";
declare global {
interface Window {
formStart: ()=>void;
items: {[name: string]:number};
helpText: {[name: string]:string};
}
}
export {}
function formStart() {
const dSum = unwrap(document.querySelector('#inherit_sum_value')) as HTMLInputElement ;
const dOld = unwrap(document.querySelector('#inherit_previous_value')) as HTMLInputElement;
const dNew = unwrap(document.querySelector('#inherit_new_value')) as HTMLInputElement;
const sumPoint = Math.floor(sum(Object.values(window.items)));
const oldPoint = Math.floor(window.items['previous']);
const sumNewPoint = sumPoint - oldPoint;
dSum.value = sumPoint.toLocaleString();
dOld.value = oldPoint.toLocaleString();
dNew.value = sumNewPoint.toLocaleString();
for(const [key, val] of Object.entries(window.items)){
const dItem = unwrap(document.querySelector(`#inherit_${key}_value`)) as HTMLInputElement ;
dItem.value = Math.floor(val).toLocaleString();
}
for(const [key, text] of Object.entries(window.helpText)){
const dText = unwrap(document.querySelector(`#inherit_${key} small.form-text`)) as HTMLElement;
dText.innerHTML = text;
}
}
window.formStart = formStart;
+35
View File
@@ -0,0 +1,35 @@
type ErrType<T> = { new(msg?: string): T }
type Nullable<T> = T | null | undefined
export class RuntimeError extends Error {
public name = 'RuntimeError';
constructor(public message: string = '') {
super(message);
}
toString(): string {
if (this.message) {
return this.name + ': ' + this.message;
}
else {
return this.name;
}
}
}
export class NotNullExpected extends RuntimeError {
public name = 'NotNullExpected';
}
export function unwrap<T>(result: Nullable<T>): T {
if (result === null || result === undefined) {
throw new NotNullExpected();
}
return result;
}
export function unwrap_err<T, ErrT extends Error>(result: Nullable<T>, errType: ErrType<ErrT>, errMsg?: string): T {
if (result === null || result === undefined) {
throw new errType(errMsg);
}
return result;
}

Some files were not shown because too many files have changed in this diff Show More