Compare commits

...
85 Commits
Author SHA1 Message Date
Hide_D 6282445f7d feat: 토너먼트 베팅에서 모든 NPC가 10원씩 베팅함
- 추가로 베팅 공지
2021-11-16 23:12:32 +09:00
Hide_D bf244533f7 game: 국력, 랜임 계산식에서 유저장 전투력 계수를 NPC의 1.5로 설정 2021-11-16 22:40:47 +09:00
Hide_D 5ebfaf24ee feat: 토너먼트 비중을 강제로 조정 2021-11-16 22:18:29 +09:00
Hide_D 0c0283dc02 feat: '능동 행동 수' 유산 포인트 추가
- 거병, 건국, 방량, 선양, 모반
- 임관, 랜덤임관, 장수대상임관, 등용수락, 하야
- 출병(500명 이상, 훈사 7070 초과)
- 인재탐색 성공(난도에 따라 추가 보정)
- 첩보(예외, 0.5)
- 증축, 감축, 국기변경, 국호변경, 천도성공
2021-11-16 21:38:55 +09:00
Hide_D 375b08be87 feat: NPC정책 최대 포상량 지정 2021-11-16 20:45:16 +09:00
Hide_D cbc8f94b0a game: 국고가 2000 밑으로 가더라도 무조건 물자조달만 하지는 않게 수정정 2021-11-16 20:01:50 +09:00
Hide_D bdac8d163d game: 전특 요구 포인트 감소, 버프 요구 포인트 감소 2021-11-16 19:37:16 +09:00
Hide_D 1f61f37841 fix: 토큰 갱신 시 UserID가 잘못된 버그 수정정 2021-11-14 22:55:37 +09:00
Hide_D 51d523ae72 game: 국력 계산식에 랜덤임관 계산식 일부를 반영 2021-11-14 18:45:28 +09:00
Hide_D 3f9e4962e6 fix: 서버 정지로 의심되는 opcache_reset 해제
- 현재 validate timestamp를 켜서 사용하도록 유도
2021-11-14 13:31:30 +09:00
Hide_D f8fc4fe56b misc: 미활용 함수/상수 제거 2021-11-14 13:20:19 +09:00
Hide_D fb64b7e412 feat: NPC 거병, 이동 로직 대폭 개선
- 근처에 세울 도시를 보고 거병
- 원하는 도시를 정하고 그 도시를 향해 이동
2021-11-14 05:06:39 +09:00
Hide_D 3209cfbc45 fix: warning 제거거 2021-11-14 04:15:04 +09:00
Hide_D 8a99476136 game: 랜덤임관 평가 기준 변경
- 전투 기준을 총 전투 대신 대인 전투로
- 내정 능력에 무력, 지력 비율 반영영
2021-11-14 02:51:40 +09:00
Hide_D eb80f8d111 feat: 자율행동 표기를 휴식(자율행동)으로 변경 2021-11-14 02:47:53 +09:00
Hide_D afde3ce54d game: 랜덤임관 가중치 변경 2021-11-14 02:39:09 +09:00
Hide_D c4b61fec17 game: 작위 보상에도 최대 보유 유니크 수 적용 2021-11-14 00:50:09 +09:00
Hide_D 0b74abf300 game: 랜덤임관 로직에 전투력과 내정능력을 적극적으로 반영영 2021-11-14 00:46:46 +09:00
Hide_D e6c3c9f1d4 fix: 자율턴에서 '월' 표기 빠짐 2021-11-13 16:48:49 +09:00
Hide_D 4e7560b4ed feat: 자율행동 휴식을 명시적으로 자율행동으로 표기 2021-11-13 16:37:47 +09:00
Hide_D 542491b278 feat: 자율턴 한계 표기 2021-11-13 16:33:11 +09:00
Hide_D d36439355d fix: 자율행동턴 시간 제한이 동작하지 않던 버그 수정 2021-11-13 16:05:03 +09:00
Hide_D 4a80815b39 game: 기간별 최대 유니크 획득 수 변경경 2021-11-13 02:25:52 +09:00
Hide_D 6dc57f2566 fix: 자동로그인 과정 버그 수정정 2021-11-11 00:37:29 +09:00
Hide_D 07e8511ce1 game: snipe_combat 제거거 2021-11-08 23:31:56 +09:00
Hide_D 8e927831f5 fix: dummySession 인자 수정정 2021-11-08 23:27:37 +09:00
Hide_D 2c533d2ab3 dep: package update 2021-11-08 16:10:01 +09:00
Hide_D 38208750e7 game: 수비자는 전멸 시 증가하는 사기량을 50%만 적용 2021-11-08 15:20:23 +09:00
Hide_D df14d7c306 game: 반계 효과 유니크 시도 확률 반감 2021-11-08 15:16:15 +09:00
Hide_D b3612db7d2 game: 피장파장 턴을 60턴 기준으로 변경(72턴 동일) 2021-11-08 15:11:24 +09:00
Hide_D 8d90da659e game: 피장파장 딜레이를 최소 72턴으로로 2021-11-08 15:10:45 +09:00
Hide_D f8ddbc0622 game: 종횡가 전략 딜레이를 1/2에서 3/4으로로 2021-11-08 15:08:21 +09:00
Hide_D 673b7054aa 자동 로그인 (#196)
자동 로그인 구현

- login_token 테이블
- reqNonce -> loginByToken
- sha512(token + nonce)

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/196
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
2021-11-08 04:23:07 +09:00
Hide_D 1472cbf257 game: 장비매매 시 도구 유니크 덮어지지 않게 2021-10-29 02:21:53 +09:00
Hide_D d806935c58 fix: 작위 보상이 군주인 경우 반영이 안되는 버그 수정 2021-10-27 02:04:10 +09:00
Hide_D 6b56eb79e1 fix: 403 페이지 redirect 버그 수정 2021-10-27 01:29:19 +09:00
Hide_D d2aea16744 balance: 초기 +5%, -2% 추가가 2021-10-16 21:50:41 +09:00
Hide_D bb800f032e balance: 쌍무쌍 적용 불가, 무쌍 중반 이후 대폭 너프프 2021-10-16 21:22:28 +09:00
Hide_D 64b9f9443e fix: 랜덤 임관 비중 계산식에서 u장 포함 2021-10-14 02:01:12 +09:00
Hide_D fd2d3a0e06 fix: 창 닫기가 필요한 창은 window.open으로 열어야함 2021-10-14 01:12:21 +09:00
Hide_D 08d678bdb8 fix: CreateManyNPC에서 npcCount가 0이면 fillCnt가 무시 2021-10-14 00:37:08 +09:00
Hide_D 418007e572 balance: 초반 NPC 생성 시 모든 국가를 채울 수 있을 정도로는 제공 2021-10-14 00:36:06 +09:00
Hide_D 4a1bccdf75 balance: 탈취량을 도시 내정치에 기반하도록 변경 2021-10-14 00:16:44 +09:00
Hide_D 00c0b59e9d balance: 랜임 시 의병장, 집합장 카운트는 제외 2021-10-13 02:05:04 +09:00
Hide_D ac82c8ff0b fix(misc): 상대가 치료시 '붉게' 표기 2021-10-13 02:01:41 +09:00
Hide_D f4bef8a090 fix: 인탐, 의병에서 숙련도가 지정되지 않는 버그 수정 2021-10-13 01:56:06 +09:00
Hide_D d8a1055bff fix: DummyGeneral에 유산 관련 포인트 함수가 누락된 부분 수정 2021-10-12 02:25:24 +09:00
Hide_D d672ce4d80 fix: set_error_handler를 못잡는 문제 해결
기타 소소한 버그
- 피장파장 입력시 warning을 계속 일으키는 버그(동작 문제는 없음)
- 토너먼트에서 승리,패배,무승부 외에 MustNotBeReachedException이 throw되지 않음(동작 문제는 없음)
2021-10-12 01:43:54 +09:00
Hide_D 43ec361d03 dep: update phan 2021-10-12 01:36:02 +09:00
Hide_D c3c99c5f76 fix: 공격자 전투력 판정 문제 수정 2021-10-12 01:31:16 +09:00
Hide_D eb1e1421ab fix(misc): phan 2021-10-12 01:30:37 +09:00
Hide_D e8a1d87919 Merge pull request 'balance: 무쌍 너프, NPC 출병 금지 불가' (#195) from balance_210923 into devel
Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/195
2021-10-10 13:30:01 +09:00
Hide_D 921ba6811d balance: 무쌍 너프, NPC 출병 금지 불가 2021-09-23 03:59:08 +09:00
Hide_D 906dd241b4 fix: RootDB template 2021-09-23 03:08:49 +09:00
Hide_D 3f0cd2ad64 fix: illuminate 2021-09-21 03:13:07 +09:00
Hide_D 41420d1954 Illuminate: ready. (critical)
- DB에서 illuminate를 가져올 수 있도록 설정
- 업그레이듵 불가, RootDB, DB를 직접 수정해야함
2021-09-21 03:06:42 +09:00
Hide_D 6e5a72b170 fix: 자동 사령턴 조정이 되지 않는 버그 2021-09-19 15:44:49 +09:00
Hide_D 4b19e6aec8 fix: 명예의 전당 검색 2021-09-19 13:38:40 +09:00
Hide_D 58572cbc36 scenario: 쿠키런 킹덤 임시 구현 2021-09-19 03:03:05 +09:00
Hide_D 096d5766bf conf: vue-style-loader에 esbuild-loader적용 2021-09-18 04:53:26 +09:00
Hide_D f5c5b56492 dep: babel-loader + ts-loader => esbuild-loader 2021-09-18 04:31:31 +09:00
Hide_D 69c69d63e6 dep: package upgrade 2021-09-18 03:52:27 +09:00
Hide_D 3fd8b21867 misc: lint warning, 불필요 파일 정리 2021-09-18 03:49:04 +09:00
Hide_D 8660e8cd85 fix: NPC포상 설정 메시지 수정 2021-09-18 03:42:20 +09:00
Hide_D 8458f725f2 fix: 사망 시 유산 포인트 관련 환불/초기화가 없는 문제 2021-09-18 03:36:08 +09:00
Hide_D 366678c965 fix: 장수 생성창 보이기/숨기기, 턴 시간 고정 표기 수정 2021-09-18 02:49:47 +09:00
Hide_D 336b5668db fix & inheritAction: 랜덤 유니크 습득시 환불 가능하게 수정 2021-09-18 00:15:00 +09:00
Hide_D 55886269ea inheritAction: 설문조사에서는 특정 유니크 구입 기능 해제 2021-09-18 00:06:20 +09:00
Hide_D 0b3698595b fix: hash -> gitHash 2021-09-17 23:40:47 +09:00
Hide_D 05e43a39db fix: 턴 초기화, 전특 초기화 표기 방식 변경 2021-09-17 23:37:53 +09:00
Hide_D 5737ad3db2 fix: 턴 초기화, 특기 초기화 포인트 안내가 1스텝 늦음 2021-09-17 23:34:33 +09:00
Hide_D 4ac174eb9a fix: 반계시도에는 구분 코드가 동작하지 않았음 2021-09-17 23:17:13 +09:00
Hide_D 895eec10b4 fix: 비급 반계가 전특 반계와 같이 동작하지 않는 버그 수정 2021-09-17 23:07:45 +09:00
Hide_D e0d891e89a fix: 재야일 때에는 임관 년도 증가하지 않도록 2021-09-17 03:14:14 +09:00
Hide_D adf7734b85 fix: 생성하자마자 임관 1년차로 나오는 문제 수정 2021-09-17 03:12:38 +09:00
Hide_D 5362be9c21 inheritPoint: 로그 기록 2021-09-17 02:39:11 +09:00
Hide_D 847ece52f2 fix: summernote.css 2021-09-16 22:39:19 +09:00
Hide_D 851c59d22c fix: 유저전투장 긴급포상 쌀 2021-09-16 22:37:31 +09:00
Hide_D 0669534bba fix: 궁 유니크 저격 계수 2021-09-16 22:24:29 +09:00
Hide_D 05db47e62a fix: 설문조사에서 환불 불가능한 문제 수정 2021-09-16 22:06:57 +09:00
Hide_D 4a0e608d1c fix: itemTrials 삭제 후 통째로 array가 비면 array도 마저 삭제 2021-09-16 22:00:35 +09:00
Hide_D 45fe73af86 fix: eventColumn에 aux 추가 2021-09-16 21:47:32 +09:00
Hide_D 4d9fcd657f fix: vote에서 aux 2021-09-16 21:43:37 +09:00
Hide_D a057deb0fe fix: 유니크를 얻는 턴이 아니더라도 환불은 하도록 수정 2021-09-16 21:38:43 +09:00
Hide_D 4766210a7d 랜임 실패시 실행 턴. 요양 -> 인탐 2021-09-16 21:24:52 +09:00
2148 changed files with 158464 additions and 24903 deletions
+32 -26
View File
@@ -15,20 +15,34 @@ return [
// Note that the **only** effect of choosing `'5.6'` is to infer // Note that the **only** effect of choosing `'5.6'` is to infer
// that functions removed in php 7.0 exist. // that functions removed in php 7.0 exist.
// (See `backward_compatibility_checks` for additional options) // (See `backward_compatibility_checks` for additional options)
"target_php_version" => '7.4', "target_php_version" => '8.0',
'backward_compatibility_checks ' => true, 'backward_compatibility_checks ' => true,
'minimum_severity'=>\Phan\Issue::SEVERITY_CRITICAL, 'minimum_severity' => \Phan\Issue::SEVERITY_NORMAL,
'file_list' => [ 'file_list' => [
'f_config/config.php', 'f_config/config.php',
'hwe/_119_b.php',
'hwe/_119.php',
'hwe/a_bestGeneral.php', 'hwe/a_bestGeneral.php',
'hwe/a_emperior.php', 'hwe/_admin1.php',
'hwe/_admin1_submit.php',
'hwe/_admin2.php',
'hwe/_admin2_submit.php',
'hwe/_admin4.php',
'hwe/_admin4_submit.php',
'hwe/_admin5.php',
'hwe/_admin5_submit.php',
'hwe/_admin7.php',
'hwe/_admin8.php',
'hwe/_admin_force_rehall.php',
'hwe/a_emperior_detail.php', 'hwe/a_emperior_detail.php',
'hwe/a_emperior.php',
'hwe/a_genList.php', 'hwe/a_genList.php',
'hwe/a_hallOfFame.php', 'hwe/a_hallOfFame.php',
'hwe/a_history.php', 'hwe/a_history.php',
'hwe/a_kingdomList.php', 'hwe/a_kingdomList.php',
'hwe/a_npcList.php', 'hwe/a_npcList.php',
'hwe/api.php',
'hwe/a_status.php', 'hwe/a_status.php',
'hwe/a_traffic.php', 'hwe/a_traffic.php',
'hwe/a_vote.php', 'hwe/a_vote.php',
@@ -41,13 +55,11 @@ return [
'hwe/b_dipcenter.php', 'hwe/b_dipcenter.php',
'hwe/b_diplomacy.php', 'hwe/b_diplomacy.php',
'hwe/b_genList.php', 'hwe/b_genList.php',
'hwe/v_inheritPoint.php',
'hwe/b_myBossInfo.php', 'hwe/b_myBossInfo.php',
'hwe/b_myCityInfo.php', 'hwe/b_myCityInfo.php',
'hwe/b_myGenInfo.php', 'hwe/b_myGenInfo.php',
'hwe/b_myKingdomInfo.php', 'hwe/b_myKingdomInfo.php',
'hwe/b_myPage.php', 'hwe/b_myPage.php',
'hwe/b_npc_control.php',
'hwe/b_processing.php', 'hwe/b_processing.php',
'hwe/b_tournament.php', 'hwe/b_tournament.php',
'hwe/b_troop.php', 'hwe/b_troop.php',
@@ -55,7 +67,6 @@ return [
'hwe/c_dipcenter.php', 'hwe/c_dipcenter.php',
'hwe/c_tournament.php', 'hwe/c_tournament.php',
'hwe/c_vote.php', 'hwe/c_vote.php',
'hwe/func.php',
'hwe/func_auction.php', 'hwe/func_auction.php',
'hwe/func_command.php', 'hwe/func_command.php',
'hwe/func_converter.php', 'hwe/func_converter.php',
@@ -64,16 +75,15 @@ return [
'hwe/func_legacy.php', 'hwe/func_legacy.php',
'hwe/func_map.php', 'hwe/func_map.php',
'hwe/func_message.php', 'hwe/func_message.php',
'hwe/func.php',
'hwe/func_process.php', 'hwe/func_process.php',
'hwe/func_string.php', 'hwe/func_string.php',
'hwe/func_template.php', 'hwe/func_template.php',
'hwe/func_time_event.php', 'hwe/func_time_event.php',
'hwe/func_tournament.php', 'hwe/func_tournament.php',
'hwe/index.php', 'hwe/index.php',
'hwe/install.php',
'hwe/install_db.php', 'hwe/install_db.php',
'hwe/join.php', 'hwe/install.php',
'hwe/join_post.php',
'hwe/j_adjust_icon.php', 'hwe/j_adjust_icon.php',
'hwe/j_autoreset.php', 'hwe/j_autoreset.php',
'hwe/j_basic_info.php', 'hwe/j_basic_info.php',
@@ -92,8 +102,8 @@ return [
'hwe/j_general_log_old.php', 'hwe/j_general_log_old.php',
'hwe/j_general_set_permission.php', 'hwe/j_general_set_permission.php',
'hwe/j_general_turn.php', 'hwe/j_general_turn.php',
'hwe/j_getChiefTurn.php',
'hwe/j_get_basic_general_list.php', 'hwe/j_get_basic_general_list.php',
'hwe/j_getChiefTurn.php',
'hwe/j_get_city_list.php', 'hwe/j_get_city_list.php',
'hwe/j_get_general_list.php', 'hwe/j_get_general_list.php',
'hwe/j_get_nation_general_list.php', 'hwe/j_get_nation_general_list.php',
@@ -101,11 +111,12 @@ return [
'hwe/j_get_select_npc_token.php', 'hwe/j_get_select_npc_token.php',
'hwe/j_get_select_pool.php', 'hwe/j_get_select_pool.php',
'hwe/j_image_upload.php', 'hwe/j_image_upload.php',
'hwe/j_install.php',
'hwe/j_install_db.php', 'hwe/j_install_db.php',
'hwe/j_install.php',
'hwe/j_load_scenarios.php', 'hwe/j_load_scenarios.php',
'hwe/j_map.php',
'hwe/j_map_history.php', 'hwe/j_map_history.php',
'hwe/j_map.php',
'hwe/j_map_recent.php',
'hwe/j_msg_contact_list.php', 'hwe/j_msg_contact_list.php',
'hwe/j_msg_decide_opt.php', 'hwe/j_msg_decide_opt.php',
'hwe/j_msg_delete.php', 'hwe/j_msg_delete.php',
@@ -123,26 +134,20 @@ return [
'hwe/j_set_npc_control.php', 'hwe/j_set_npc_control.php',
'hwe/j_simulate_battle.php', 'hwe/j_simulate_battle.php',
'hwe/j_troop.php', 'hwe/j_troop.php',
'hwe/j_update_picked_general.php',
'hwe/j_vacation.php', 'hwe/j_vacation.php',
'hwe/lib.php', 'hwe/lib.php',
'hwe/process_war.php', 'hwe/process_war.php',
'hwe/proc.php',
'hwe/readme.php',
'hwe/recent_map.php',
'hwe/select_general_from_pool.php', 'hwe/select_general_from_pool.php',
'hwe/select_npc.php', 'hwe/select_npc.php',
'hwe/t_board.php',
'hwe/t_diplomacy.php', 'hwe/t_diplomacy.php',
'hwe/_119.php', 'hwe/v_board.php',
'hwe/_119_b.php', 'hwe/v_inheritPoint.php',
'hwe/_admin1.php', 'hwe/v_join.php',
'hwe/_admin1_submit.php', 'hwe/v_NPCControl.php',
'hwe/_admin2.php',
'hwe/_admin2_submit.php',
'hwe/_admin4.php',
'hwe/_admin4_submit.php',
'hwe/_admin5.php',
'hwe/_admin5_submit.php',
'hwe/_admin7.php',
'hwe/_admin8.php',
'hwe/_admin_force_rehall.php',
], ],
// A list of directories that should be parsed for class and // A list of directories that should be parsed for class and
@@ -179,6 +184,7 @@ return [
'suppress_issue_types' => [ 'suppress_issue_types' => [
'PhanUnreferencedUseNormal', 'PhanUnreferencedUseNormal',
'PhanTypeArraySuspiciousNullable',
], ],
// A list of plugin files to execute. // A list of plugin files to execute.
+1 -1
View File
@@ -5,7 +5,7 @@
<title>닫혀 있습니다.</title> <title>닫혀 있습니다.</title>
<script> <script>
setTimeout(function(){ setTimeout(function(){
window.location = window.location+'/../'; window.location.href = '../';
}, 5000); }, 5000);
</script> </script>
<style> <style>
+6 -2
View File
@@ -2,7 +2,11 @@
namespace sammo; namespace sammo;
include "lib.php"; require(__DIR__ . '/vendor/autoload.php');
include "func.php";
if (!class_exists('\\sammo\\RootDB')) {
Json::dieWithReason('No DB');
}
APIHelper::launch(dirname(__FILE__)); APIHelper::launch(dirname(__FILE__));
+4 -3
View File
@@ -8,7 +8,7 @@
], ],
"config": { "config": {
"platform": { "platform": {
"php": "7.4" "php": "8.0"
} }
}, },
"require": { "require": {
@@ -16,7 +16,6 @@
"sergeytsalkov/meekrodb": "^2.3", "sergeytsalkov/meekrodb": "^2.3",
"league/plates": "^3.3", "league/plates": "^3.3",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
"scssphp/scssphp": "^1.0",
"monolog/monolog": "^1.23", "monolog/monolog": "^1.23",
"firephp/firephp-core": "^0.4.0", "firephp/firephp-core": "^0.4.0",
"vlucas/valitron": "^1.4", "vlucas/valitron": "^1.4",
@@ -28,7 +27,9 @@
"catfan/medoo": "^1.5", "catfan/medoo": "^1.5",
"phan/phan": "*", "phan/phan": "*",
"erusev/parsedown-extra": "^0.8.1", "erusev/parsedown-extra": "^0.8.1",
"nette/caching": "^3.0" "nette/caching": "^3.0",
"illuminate/database": "^8.61",
"illuminate/events": "^8.61"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
Generated
+1133 -162
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "2aeb036fc53a6fdc343bd2707d4697ee", "content-hash": "94cfbcb22b9f475e421ad5009391006f",
"packages": [ "packages": [
{ {
"name": "brandonwamboldt/utilphp", "name": "brandonwamboldt/utilphp",
@@ -122,16 +122,16 @@
}, },
{ {
"name": "composer/semver", "name": "composer/semver",
"version": "3.2.5", "version": "3.2.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/semver.git", "url": "https://github.com/composer/semver.git",
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" "reference": "83e511e247de329283478496f7a1e114c9517506"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506",
"reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", "reference": "83e511e247de329283478496f7a1e114c9517506",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -183,7 +183,7 @@
"support": { "support": {
"irc": "irc://irc.freenode.org/composer", "irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/semver/issues", "issues": "https://github.com/composer/semver/issues",
"source": "https://github.com/composer/semver/tree/3.2.5" "source": "https://github.com/composer/semver/tree/3.2.6"
}, },
"funding": [ "funding": [
{ {
@@ -199,7 +199,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-05-24T12:41:47+00:00" "time": "2021-10-25T11:34:17+00:00"
}, },
{ {
"name": "composer/xdebug-handler", "name": "composer/xdebug-handler",
@@ -265,6 +265,97 @@
], ],
"time": "2021-07-31T17:03:58+00:00" "time": "2021-07-31T17:03:58+00:00"
}, },
{
"name": "doctrine/inflector",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89",
"reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^8.2",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"vimeo/psalm": "^4.10"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Inflector\\": "lib/Doctrine/Inflector"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.",
"homepage": "https://www.doctrine-project.org/projects/inflector.html",
"keywords": [
"inflection",
"inflector",
"lowercase",
"manipulation",
"php",
"plural",
"singular",
"strings",
"uppercase",
"words"
],
"support": {
"issues": "https://github.com/doctrine/inflector/issues",
"source": "https://github.com/doctrine/inflector/tree/2.0.4"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2021-10-22T20:16:43+00:00"
},
{ {
"name": "erusev/parsedown", "name": "erusev/parsedown",
"version": "1.7.4", "version": "1.7.4",
@@ -579,16 +670,16 @@
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "1.4.1", "version": "1.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
"reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -600,7 +691,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.4-dev" "dev-master": "1.5-dev"
} }
}, },
"autoload": { "autoload": {
@@ -616,10 +707,25 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{ {
"name": "Michael Dowling", "name": "Michael Dowling",
"email": "mtdowling@gmail.com", "email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling" "homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
} }
], ],
"description": "Guzzle promises library", "description": "Guzzle promises library",
@@ -628,22 +734,36 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/1.4.1" "source": "https://github.com/guzzle/promises/tree/1.5.1"
}, },
"time": "2021-03-07T09:25:29+00:00" "funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
"type": "tidelift"
}
],
"time": "2021-10-22T20:56:57+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "1.8.2", "version": "1.8.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91" "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", "url": "https://api.github.com/repos/guzzle/psr7/zipball/1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
"reference": "dc960a912984efb74d0a90222870c72c87f10c91", "reference": "1afdd860a2566ed3c2b0b4a3de6e23434a79ec85",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -680,13 +800,34 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{ {
"name": "Michael Dowling", "name": "Michael Dowling",
"email": "mtdowling@gmail.com", "email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling" "homepage": "https://github.com/mtdowling"
}, },
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{ {
"name": "Tobias Schultze", "name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion" "homepage": "https://github.com/Tobion"
} }
], ],
@@ -703,9 +844,514 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/1.8.2" "source": "https://github.com/guzzle/psr7/tree/1.8.3"
}, },
"time": "2021-04-26T09:17:50+00:00" "funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
"type": "tidelift"
}
],
"time": "2021-10-05T13:56:00+00:00"
},
{
"name": "illuminate/bus",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/bus.git",
"reference": "be400399687b97d5558a224e970060fd5d5f2735"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/bus/zipball/be400399687b97d5558a224e970060fd5d5f2735",
"reference": "be400399687b97d5558a224e970060fd5d5f2735",
"shasum": ""
},
"require": {
"illuminate/collections": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/pipeline": "^8.0",
"illuminate/support": "^8.0",
"php": "^7.3|^8.0"
},
"suggest": {
"illuminate/queue": "Required to use closures when chaining jobs (^7.0)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Bus\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Bus package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-21T19:19:36+00:00"
},
{
"name": "illuminate/collections",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/collections.git",
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/05f286ec5fd2dd286e8384577047efc375c8954c",
"reference": "05f286ec5fd2dd286e8384577047efc375c8954c",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0",
"illuminate/macroable": "^8.0",
"php": "^7.3|^8.0"
},
"suggest": {
"symfony/var-dumper": "Required to use the dump method (^5.1.4)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Support\\": ""
},
"files": [
"helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Collections package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-22T18:01:46+00:00"
},
{
"name": "illuminate/container",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/container.git",
"reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/container/zipball/ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d",
"reference": "ef73feb5216ef97ab7023cf59c0c8dbbd5505a9d",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0",
"php": "^7.3|^8.0",
"psr/container": "^1.0"
},
"provide": {
"psr/container-implementation": "1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Container\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Container package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-09-15T14:32:50+00:00"
},
{
"name": "illuminate/contracts",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
"reference": "e76f4bce73a2a1656add24bd5210ebc4b8af49c0",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0",
"psr/container": "^1.0",
"psr/simple-cache": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Contracts\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Contracts package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-22T18:01:46+00:00"
},
{
"name": "illuminate/database",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/database.git",
"reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/database/zipball/43c7ffb6299ae55b000b286cf1278afd268ef29f",
"reference": "43c7ffb6299ae55b000b286cf1278afd268ef29f",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/collections": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/macroable": "^8.0",
"illuminate/support": "^8.0",
"php": "^7.3|^8.0",
"symfony/console": "^5.1.4"
},
"suggest": {
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
"illuminate/console": "Required to use the database commands (^8.0).",
"illuminate/events": "Required to use the observers with Eloquent (^8.0).",
"illuminate/filesystem": "Required to use the migrations (^8.0).",
"illuminate/pagination": "Required to paginate the result set (^8.0).",
"symfony/finder": "Required to use Eloquent model factories (^5.1.4)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Database\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Database package.",
"homepage": "https://laravel.com",
"keywords": [
"database",
"laravel",
"orm",
"sql"
],
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-29T19:46:53+00:00"
},
{
"name": "illuminate/events",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/events.git",
"reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d",
"reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d",
"shasum": ""
},
"require": {
"illuminate/bus": "^8.0",
"illuminate/collections": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/macroable": "^8.0",
"illuminate/support": "^8.0",
"php": "^7.3|^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Events\\": ""
},
"files": [
"functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Events package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-09-15T14:32:50+00:00"
},
{
"name": "illuminate/macroable",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/macroable.git",
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05",
"reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Support\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Macroable package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2020-10-27T15:20:30+00:00"
},
{
"name": "illuminate/pipeline",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/pipeline.git",
"reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2",
"reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0",
"illuminate/support": "^8.0",
"php": "^7.3|^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Pipeline\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Pipeline package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-03-26T18:39:16+00:00"
},
{
"name": "illuminate/support",
"version": "v8.69.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/support.git",
"reference": "a8851b7001530d3c11626a81449ed9b63dd10db7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/support/zipball/a8851b7001530d3c11626a81449ed9b63dd10db7",
"reference": "a8851b7001530d3c11626a81449ed9b63dd10db7",
"shasum": ""
},
"require": {
"doctrine/inflector": "^1.4|^2.0",
"ext-json": "*",
"ext-mbstring": "*",
"illuminate/collections": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/macroable": "^8.0",
"nesbot/carbon": "^2.53.1",
"php": "^7.3|^8.0",
"voku/portable-ascii": "^1.4.8"
},
"conflict": {
"tightenco/collect": "<5.5.33"
},
"suggest": {
"illuminate/filesystem": "Required to use the composer class (^8.0).",
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).",
"ramsey/uuid": "Required to use Str::uuid() (^4.2.2).",
"symfony/process": "Required to use the composer class (^5.1.4).",
"symfony/var-dumper": "Required to use the dd function (^5.1.4).",
"vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Support\\": ""
},
"files": [
"helpers.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Support package.",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-10-29T13:34:03+00:00"
}, },
{ {
"name": "league/plates", "name": "league/plates",
@@ -902,6 +1548,101 @@
], ],
"time": "2021-05-28T08:32:12+00:00" "time": "2021-05-28T08:32:12+00:00"
}, },
{
"name": "nesbot/carbon",
"version": "2.54.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/eed83939f1aed3eee517d03a33f5ec587ac529b5",
"reference": "eed83939f1aed3eee517d03a33f5ec587ac529b5",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.1.8 || ^8.0",
"symfony/polyfill-mbstring": "^1.0",
"symfony/polyfill-php80": "^1.16",
"symfony/translation": "^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"doctrine/dbal": "^2.0 || ^3.0",
"doctrine/orm": "^2.7",
"friendsofphp/php-cs-fixer": "^3.0",
"kylekatarnls/multi-tester": "^2.0",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.54",
"phpunit/phpunit": "^7.5.20 || ^8.5.14",
"squizlabs/php_codesniffer": "^3.4"
},
"bin": [
"bin/carbon"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-3.x": "3.x-dev",
"dev-master": "2.x-dev"
},
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
]
},
"phpstan": {
"includes": [
"extension.neon"
]
}
},
"autoload": {
"psr-4": {
"Carbon\\": "src/Carbon/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "https://markido.com"
},
{
"name": "kylekatarnls",
"homepage": "https://github.com/kylekatarnls"
}
],
"description": "An API extension for DateTime that supports 281 different languages.",
"homepage": "https://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
],
"support": {
"issues": "https://github.com/briannesbitt/Carbon/issues",
"source": "https://github.com/briannesbitt/Carbon"
},
"funding": [
{
"url": "https://opencollective.com/Carbon",
"type": "open_collective"
},
{
"url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
"type": "tidelift"
}
],
"time": "2021-11-01T21:22:20+00:00"
},
{ {
"name": "netresearch/jsonmapper", "name": "netresearch/jsonmapper",
"version": "v4.0.0", "version": "v4.0.0",
@@ -1093,20 +1834,20 @@
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
"version": "v3.2.2", "version": "v3.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/utils.git", "url": "https://github.com/nette/utils.git",
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c" "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/967cfc4f9a1acd5f1058d76715a424c53343c20c", "url": "https://api.github.com/repos/nette/utils/zipball/9cd80396ca58d7969ab44fc7afcf03624dfa526e",
"reference": "967cfc4f9a1acd5f1058d76715a424c53343c20c", "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2 <8.1" "php": ">=7.2 <8.2"
}, },
"conflict": { "conflict": {
"nette/di": "<3.0.6" "nette/di": "<3.0.6"
@@ -1172,9 +1913,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/utils/issues", "issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v3.2.2" "source": "https://github.com/nette/utils/tree/v3.2.5"
}, },
"time": "2021-03-03T22:53:25+00:00" "time": "2021-09-20T10:50:11+00:00"
}, },
{ {
"name": "pguardiario/phpuri", "name": "pguardiario/phpuri",
@@ -1206,16 +1947,16 @@
}, },
{ {
"name": "phan/phan", "name": "phan/phan",
"version": "5.0.0", "version": "5.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phan/phan.git", "url": "https://github.com/phan/phan.git",
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90" "reference": "d724bbb8fc3ba89179868bb5220ecdf6a9c1636b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phan/phan/zipball/f36b6b9a2f4143a25f35ce94d712ceb0527e9d90", "url": "https://api.github.com/repos/phan/phan/zipball/d724bbb8fc3ba89179868bb5220ecdf6a9c1636b",
"reference": "f36b6b9a2f4143a25f35ce94d712ceb0527e9d90", "reference": "d724bbb8fc3ba89179868bb5220ecdf6a9c1636b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1232,7 +1973,7 @@
"symfony/console": "^3.2|^4.0|^5.0", "symfony/console": "^3.2|^4.0|^5.0",
"symfony/polyfill-mbstring": "^1.11.0", "symfony/polyfill-mbstring": "^1.11.0",
"symfony/polyfill-php80": "^1.20.0", "symfony/polyfill-php80": "^1.20.0",
"tysonandre/var_representation_polyfill": "^0.0.2" "tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^8.5.0" "phpunit/phpunit": "^8.5.0"
@@ -1279,9 +2020,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/phan/phan/issues", "issues": "https://github.com/phan/phan/issues",
"source": "https://github.com/phan/phan/tree/5.0.0" "source": "https://github.com/phan/phan/tree/5.2.1"
}, },
"time": "2021-08-01T18:17:28+00:00" "time": "2021-09-15T00:08:40+00:00"
}, },
{ {
"name": "php-extended/php-system", "name": "php-extended/php-system",
@@ -1430,16 +2171,16 @@
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "5.2.2", "version": "5.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1450,7 +2191,8 @@
"webmozart/assert": "^1.9.1" "webmozart/assert": "^1.9.1"
}, },
"require-dev": { "require-dev": {
"mockery/mockery": "~1.3.2" "mockery/mockery": "~1.3.2",
"psalm/phar": "^4.8"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1480,22 +2222,22 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": { "support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
}, },
"time": "2020-09-03T19:13:55+00:00" "time": "2021-10-19T17:43:47+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "1.4.0", "version": "1.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1503,7 +2245,8 @@
"phpdocumentor/reflection-common": "^2.0" "phpdocumentor/reflection-common": "^2.0"
}, },
"require-dev": { "require-dev": {
"ext-tokenizer": "*" "ext-tokenizer": "*",
"psalm/phar": "^4.8"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -1529,26 +2272,26 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": { "support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues", "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
}, },
"time": "2020-09-17T18:55:26+00:00" "time": "2021-10-02T14:08:47+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
"version": "1.1.1", "version": "1.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/container.git", "url": "https://github.com/php-fig/container.git",
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.0" "php": ">=7.4.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -1577,9 +2320,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/php-fig/container/issues", "issues": "https://github.com/php-fig/container/issues",
"source": "https://github.com/php-fig/container/tree/1.1.1" "source": "https://github.com/php-fig/container/tree/1.1.2"
}, },
"time": "2021-03-05T17:36:06+00:00" "time": "2021-11-05T16:50:12+00:00"
}, },
{ {
"name": "psr/http-message", "name": "psr/http-message",
@@ -1684,6 +2427,57 @@
}, },
"time": "2021-05-03T11:20:27+00:00" "time": "2021-05-03T11:20:27+00:00"
}, },
{
"name": "psr/simple-cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"support": {
"source": "https://github.com/php-fig/simple-cache/tree/master"
},
"time": "2017-10-23T01:57:42+00:00"
},
{ {
"name": "ralouphie/getallheaders", "name": "ralouphie/getallheaders",
"version": "3.0.3", "version": "3.0.3",
@@ -1730,23 +2524,23 @@
}, },
{ {
"name": "sabre/event", "name": "sabre/event",
"version": "5.1.2", "version": "5.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sabre-io/event.git", "url": "https://github.com/sabre-io/event.git",
"reference": "c120bec57c17b6251a496efc82b732418b49d50a" "reference": "d7da22897125d34d7eddf7977758191c06a74497"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sabre-io/event/zipball/c120bec57c17b6251a496efc82b732418b49d50a", "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497",
"reference": "c120bec57c17b6251a496efc82b732418b49d50a", "reference": "d7da22897125d34d7eddf7977758191c06a74497",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1 || ^8.0" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "~2.16.1", "friendsofphp/php-cs-fixer": "~2.17.1",
"phpstan/phpstan": "^0.12", "phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
}, },
@@ -1792,80 +2586,7 @@
"issues": "https://github.com/sabre-io/event/issues", "issues": "https://github.com/sabre-io/event/issues",
"source": "https://github.com/fruux/sabre-event" "source": "https://github.com/fruux/sabre-event"
}, },
"time": "2020-10-03T11:02:22+00:00" "time": "2021-11-04T06:51:17+00:00"
},
{
"name": "scssphp/scssphp",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/b83594e2323c5d6e80785df3f91b9d1d32aad530",
"reference": "b83594e2323c5d6e80785df3f91b9d1d32aad530",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-json": "*",
"php": ">=5.6.0"
},
"require-dev": {
"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"
],
"type": "library",
"autoload": {
"psr-4": {
"ScssPhp\\ScssPhp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthon Pang",
"email": "apang@softwaredevelopment.ca",
"homepage": "https://github.com/robocoder"
},
{
"name": "Cédric Morin",
"email": "cedric@yterium.com",
"homepage": "https://github.com/Cerdic"
}
],
"description": "scssphp is a compiler for SCSS written in PHP.",
"homepage": "http://scssphp.github.io/scssphp/",
"keywords": [
"css",
"less",
"sass",
"scss",
"stylesheet"
],
"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", "name": "sergeytsalkov/meekrodb",
@@ -1917,16 +2638,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.3.6", "version": "v5.3.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
"reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1996,7 +2717,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v5.3.6" "source": "https://github.com/symfony/console/tree/v5.3.10"
}, },
"funding": [ "funding": [
{ {
@@ -2012,7 +2733,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-07-27T19:10:22+00:00" "time": "2021-10-26T09:30:15+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@@ -2083,16 +2804,16 @@
}, },
{ {
"name": "symfony/lock", "name": "symfony/lock",
"version": "v4.4.27", "version": "v4.4.33",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/lock.git", "url": "https://github.com/symfony/lock.git",
"reference": "6ca476d4ac992802f2a4043929f68f1818449486" "reference": "567d29b1bc6e3937652054dafc069151d17824a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/lock/zipball/6ca476d4ac992802f2a4043929f68f1818449486", "url": "https://api.github.com/repos/symfony/lock/zipball/567d29b1bc6e3937652054dafc069151d17824a9",
"reference": "6ca476d4ac992802f2a4043929f68f1818449486", "reference": "567d29b1bc6e3937652054dafc069151d17824a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2141,7 +2862,7 @@
"semaphore" "semaphore"
], ],
"support": { "support": {
"source": "https://github.com/symfony/lock/tree/v4.4.27" "source": "https://github.com/symfony/lock/tree/v4.4.33"
}, },
"funding": [ "funding": [
{ {
@@ -2157,7 +2878,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-07-23T15:41:52+00:00" "time": "2021-10-05T20:27:01+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@@ -2889,16 +3610,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.3.3", "version": "v5.3.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2952,7 +3673,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v5.3.3" "source": "https://github.com/symfony/string/tree/v5.3.10"
}, },
"funding": [ "funding": [
{ {
@@ -2968,20 +3689,193 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-06-27T11:44:38+00:00" "time": "2021-10-27T18:21:46+00:00"
}, },
{ {
"name": "tysonandre/var_representation_polyfill", "name": "symfony/translation",
"version": "0.0.2", "version": "v5.3.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/TysonAndre/var_representation_polyfill.git", "url": "https://github.com/symfony/translation.git",
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33" "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/3f17999ee1f257319ddc6721dd26ebbc5d175f33", "url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa",
"reference": "3f17999ee1f257319ddc6721dd26ebbc5d175f33", "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php80": "^1.16",
"symfony/translation-contracts": "^2.3"
},
"conflict": {
"symfony/config": "<4.4",
"symfony/dependency-injection": "<5.0",
"symfony/http-kernel": "<5.0",
"symfony/twig-bundle": "<5.0",
"symfony/yaml": "<4.4"
},
"provide": {
"symfony/translation-implementation": "2.3"
},
"require-dev": {
"psr/log": "^1|^2|^3",
"symfony/config": "^4.4|^5.0",
"symfony/console": "^4.4|^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/finder": "^4.4|^5.0",
"symfony/http-kernel": "^5.0",
"symfony/intl": "^4.4|^5.0",
"symfony/polyfill-intl-icu": "^1.21",
"symfony/service-contracts": "^1.1.2|^2",
"symfony/yaml": "^4.4|^5.0"
},
"suggest": {
"psr/log-implementation": "To use logging capability in translator",
"symfony/config": "",
"symfony/yaml": ""
},
"type": "library",
"autoload": {
"files": [
"Resources/functions.php"
],
"psr-4": {
"Symfony\\Component\\Translation\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v5.3.10"
},
"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-10-10T06:43:24+00:00"
},
{
"name": "symfony/translation-contracts",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
"reference": "95c812666f3e91db75385749fe219c5e494c7f95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95",
"reference": "95c812666f3e91db75385749fe219c5e494c7f95",
"shasum": ""
},
"require": {
"php": ">=7.2.5"
},
"suggest": {
"symfony/translation-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.4-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Translation\\": ""
}
},
"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": "Generic abstractions related to translation",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"support": {
"source": "https://github.com/symfony/translation-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": "tysonandre/var_representation_polyfill",
"version": "0.1.1",
"source": {
"type": "git",
"url": "https://github.com/TysonAndre/var_representation_polyfill.git",
"reference": "0a942e74e18af5514749895507bc6ca7ab96399a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/0a942e74e18af5514749895507bc6ca7ab96399a",
"reference": "0a942e74e18af5514749895507bc6ca7ab96399a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2992,6 +3886,9 @@
"phan/phan": "^4.0", "phan/phan": "^4.0",
"phpunit/phpunit": "^8.5.0" "phpunit/phpunit": "^8.5.0"
}, },
"suggest": {
"ext-var_representation": "*"
},
"type": "library", "type": "library",
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -3010,16 +3907,16 @@
"name": "Tyson Andre" "name": "Tyson Andre"
} }
], ],
"description": "Polyfill for var_representation", "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export",
"keywords": [ "keywords": [
"var_export", "var_export",
"var_representation" "var_representation"
], ],
"support": { "support": {
"issues": "https://github.com/TysonAndre/var_representation_polyfill/issues", "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues",
"source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.0.2" "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.1"
}, },
"time": "2021-06-26T18:55:02+00:00" "time": "2021-08-16T00:12:50+00:00"
}, },
{ {
"name": "vlucas/valitron", "name": "vlucas/valitron",
@@ -3080,6 +3977,80 @@
], ],
"time": "2021-07-08T16:18:03+00:00" "time": "2021-07-08T16:18:03+00:00"
}, },
{
"name": "voku/portable-ascii",
"version": "1.5.6",
"source": {
"type": "git",
"url": "https://github.com/voku/portable-ascii.git",
"reference": "80953678b19901e5165c56752d087fc11526017c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c",
"reference": "80953678b19901e5165c56752d087fc11526017c",
"shasum": ""
},
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": "~6.0 || ~7.0 || ~9.0"
},
"suggest": {
"ext-intl": "Use Intl for transliterator_transliterate() support"
},
"type": "library",
"autoload": {
"psr-4": {
"voku\\": "src/voku/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Lars Moelleken",
"homepage": "http://www.moelleken.org/"
}
],
"description": "Portable ASCII library - performance optimized (ascii) string functions for php.",
"homepage": "https://github.com/voku/portable-ascii",
"keywords": [
"ascii",
"clean",
"php"
],
"support": {
"issues": "https://github.com/voku/portable-ascii/issues",
"source": "https://github.com/voku/portable-ascii/tree/1.5.6"
},
"funding": [
{
"url": "https://www.paypal.me/moelleken",
"type": "custom"
},
{
"url": "https://github.com/voku",
"type": "github"
},
{
"url": "https://opencollective.com/portable-ascii",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/voku",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii",
"type": "tidelift"
}
],
"time": "2020-11-12T00:07:28+00:00"
},
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.10.0", "version": "1.10.0",
@@ -3203,7 +4174,7 @@
"platform": [], "platform": [],
"platform-dev": [], "platform-dev": [],
"platform-overrides": { "platform-overrides": {
"php": "7.3" "php": "8.0"
}, },
"plugin-api-version": "2.0.0" "plugin-api-version": "2.0.0"
} }
+26 -1
View File
@@ -134,7 +134,7 @@ function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, in
getExceptionTraceAsString($e) getExceptionTraceAsString($e)
); );
} }
set_error_handler("\sammo\logErrorByCustomHandler"); set_error_handler("\\sammo\\logErrorByCustomHandler");
function logExceptionByCustomHandler(\Throwable $e) function logExceptionByCustomHandler(\Throwable $e)
@@ -151,3 +151,28 @@ function logExceptionByCustomHandler(\Throwable $e)
throw $e; throw $e;
} }
set_exception_handler('\\sammo\\logExceptionByCustomHandler'); set_exception_handler('\\sammo\\logExceptionByCustomHandler');
function getAPIExecutorClass($path){
static $basePath = __NAMESPACE__.'\\API\\';
if(is_string($path)){
}
else if(is_array($path)){
$path = join('\\', $path);
}
else{
throw new \InvalidArgumentException("{$path}는 올바른 API 지시자가 아님");
}
$classPath = str_replace('/', '\\', $basePath.$path);
if(class_exists($classPath)){
return $classPath;
}
throw new \InvalidArgumentException("{$path}는 올바른 API 경로가 아님");
}
function buildAPIExecutorClass($type, string $rootPath, array $args):\sammo\BaseAPI{
$class = getAPIExecutorClass($type);
return new $class($rootPath, $args);
}
+17 -2
View File
@@ -58,7 +58,7 @@ CREATE TABLE `member_log` (
INDEX `action` (`member_no`, `action_type`, `date`), INDEX `action` (`member_no`, `action_type`, `date`),
INDEX `member` (`member_no`, `date`) INDEX `member` (`member_no`, `date`)
) )
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4; ENGINE=Aria DEFAULT CHARSET=utf8mb4;
################### ###################
# KV storage # KV storage
@@ -72,4 +72,19 @@ CREATE TABLE if not exists `storage` (
UNIQUE INDEX `key` (`namespace`, `key`) UNIQUE INDEX `key` (`namespace`, `key`)
) )
COLLATE='utf8mb4_general_ci' COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM ENGINE=Aria;
CREATE TABLE `login_token` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`user_id` INT(11) NOT NULL,
`base_token` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_ip` VARCHAR(40) NOT NULL COLLATE 'utf8mb4_general_ci',
`reg_date` DATETIME NOT NULL,
`expire_date` DATETIME NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `by_token` (`base_token`),
INDEX `by_date` (`user_id`, `expire_date`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=Aria
;
+31
View File
@@ -2,9 +2,15 @@
namespace sammo; namespace sammo;
//https://hub.packtpub.com/eloquent-without-laravel/
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
class RootDB class RootDB
{ {
private static $uDB = null; private static $uDB = null;
private static ?Capsule $uIlluminate = null;
private static $host = '_tK_host_'; private static $host = '_tK_host_';
private static $user = '_tK_user_'; private static $user = '_tK_user_';
@@ -12,6 +18,8 @@ class RootDB
private static $dbName = '_tK_dbName_'; private static $dbName = '_tK_dbName_';
private static $port = _tK_port_; private static $port = _tK_port_;
private static $encoding = 'utf8mb4'; private static $encoding = 'utf8mb4';
private static $collation = 'utf8mb4_general_ci';
private static $globalSalt = '_tK_globalSalt_'; private static $globalSalt = '_tK_globalSalt_';
@@ -19,6 +27,29 @@ class RootDB
{ {
} }
public static function illuminate(): Capsule
{
if(self::$uIlluminate !== null){
return self::$uIlluminate;
}
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => self::$host,
'database' => self::$dbName,
'username' => self::$user,
'password' => self::$password,
'charset' => self::$encoding,
'collation' => self::$collation,
], 'root');
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->bootEloquent();
self::$uIlluminate = $capsule;
return $capsule;
}
/** /**
* DB 객체 생성 * DB 객체 생성
* *
+1
View File
@@ -342,6 +342,7 @@ switch ($btn) {
} }
break; break;
case "랜덤턴": case "랜덤턴":
$turnterm = $gameStor->turnterm;
foreach ($genlist as $generalID) { foreach ($genlist as $generalID) {
$turntime = getRandTurn($turnterm); $turntime = getRandTurn($turnterm);
$db->update('general', [ $db->update('general', [
+1 -1
View File
@@ -28,7 +28,7 @@ $scenarioList = (function(){
if($scenarioIdx !== null && key_exists($scenarioIdx, $scenarioList)){ if($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx]??[])){
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name']; $searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx); $searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
} }
+1
View File
@@ -64,6 +64,7 @@ var storedData = <?=Json::encode([
<?=WebUtil::printJS('dist_js/vendors.js')?> <?=WebUtil::printJS('dist_js/vendors.js')?>
<?=WebUtil::printJS('dist_js/dipcenter.js')?> <?=WebUtil::printJS('dist_js/dipcenter.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?> <?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../e_lib/summernote/summernote-bs4.css')?>
<?=WebUtil::printCSS('dist_css/vendors.css')?> <?=WebUtil::printCSS('dist_css/vendors.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?> <?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?> <?=WebUtil::printCSS('css/common.css')?>
+1 -1
View File
@@ -24,7 +24,7 @@ $admin = $gameStor->getValues(['develcost', 'cost', 'vote_title', 'vote', 'votec
$generalID = Session::getGeneralID(); $generalID = Session::getGeneralID();
$general = General::createGeneralObjFromDB($generalID, ['vote','horse','weapon','book','item','npc'], 2); $general = General::createGeneralObjFromDB($generalID, ['vote','horse','weapon','book','item','npc','imgsvr','picture','aux'], 2);
if($btn == "투표" && $general->getVar('vote') == 0 && $sel > 0) { if($btn == "투표" && $general->getVar('vote') == 0 && $sel > 0) {
$develcost = $admin['develcost'] * 5; $develcost = $admin['develcost'] * 5;
+39 -4
View File
@@ -1,8 +1,16 @@
<?php <?php
namespace sammo; namespace sammo;
class DB{ //https://hub.packtpub.com/eloquent-without-laravel/
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
class DB
{
private static $uDB = null; private static $uDB = null;
private static ?Capsule $uIlluminate = null;
private static $host = '_tK_host_'; private static $host = '_tK_host_';
private static $user = '_tK_user_'; private static $user = '_tK_user_';
@@ -10,11 +18,36 @@ class DB{
private static $dbName = '_tK_dbName_'; private static $dbName = '_tK_dbName_';
private static $port = _tK_port_; private static $port = _tK_port_;
private static $encoding = 'utf8mb4'; private static $encoding = 'utf8mb4';
private static $collation = 'utf8mb4_general_ci';
private static $prefix = '_tK_prefix_'; private static $prefix = '_tK_prefix_';
private function __construct(){ private function __construct()
{
}
public static function illuminate(): Capsule
{
if(self::$uIlluminate !== null){
return self::$uIlluminate;
}
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => self::$host,
'database' => self::$dbName,
'username' => self::$user,
'password' => self::$password,
'charset' => self::$encoding,
'collation' => self::$collation,
]);
$capsule->setEventDispatcher(new Dispatcher(new Container));
$capsule->setAsGlobal();
$capsule->bootEloquent();
self::$uIlluminate = $capsule;
return $capsule;
} }
/** /**
@@ -23,12 +56,14 @@ class DB{
* @return \MeekroDB * @return \MeekroDB
* @suppress PhanTypeMismatchProperty * @suppress PhanTypeMismatchProperty
*/ */
public static function db(){ public static function db()
{
if (self::$uDB === null) { if (self::$uDB === null) {
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding); self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true; self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
self::$uDB->error_handler= function(){}; self::$uDB->error_handler = function () {
};
self::$uDB->throw_exception_on_error = true; self::$uDB->throw_exception_on_error = true;
self::$uDB->throw_exception_on_nonsql_error = true; self::$uDB->throw_exception_on_nonsql_error = true;
} }
+16 -16
View File
@@ -1,22 +1,22 @@
<div class="buttonPlate bg1"> <div class="buttonPlate bg1">
<div> <div>
<a href="a_status.php" target="_blank"><button class="toolbarButton">세력도</button></a> <a href="a_status.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력도</button></a>
<a href="a_kingdomList.php" target="_blank"><button class="toolbarButton">세력일람</button></a> <a href="a_kingdomList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력일람</button></a>
<a href="a_genList.php" target="_blank"><button class="toolbarButton">장수일람</button></a> <a href="a_genList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">장수일람</button></a>
<a href="a_bestGeneral.php" target="_blank"><button class="toolbarButton">명장일람</button></a> <a href="a_bestGeneral.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명장일람</button></a>
<a href="a_history.php" target="_blank"><button class="toolbarButton">연감</button></a> <a href="a_history.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">연감</button></a>
<a href="a_hallOfFame.php" target="_blank"><button class="toolbarButton">명예의전당</button></a> <a href="a_hallOfFame.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명예의전당</button></a>
<a href="a_emperior.php" target="_blank"><button class="toolbarButton">왕조일람</button></a> <a href="a_emperior.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">왕조일람</button></a>
<a href="a_traffic.php" target="_blank"><button class="toolbarButton">접속량정보</button></a> <a href="a_traffic.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">접속량정보</button></a>
</div> </div>
<div> <div>
<a href="/bbs/board" target="_blank"><button class="toolbarButton2">삼모게시판</button></a> <a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a>
<a href="/bbs/tip" target="_blank"><button class="toolbarButton">팁/강좌</button></a> <a href="/bbs/tip" target="_blank"><button type="button" class="toolbarButton">팁/강좌</button></a>
<a href="/bbs/news" target="_blank"><button class="toolbarButton">삼국 일보</button></a> <a href="/bbs/news" target="_blank"><button type="button" class="toolbarButton">삼국 일보</button></a>
<a href="/bbs/history2" target="_blank"><button class="toolbarButton">개인 열전</button></a> <a href="/bbs/history2" target="_blank"><button type="button" class="toolbarButton">개인 열전</button></a>
<a href="/bbs/history3" target="_blank"><button class="toolbarButton">국가 열전</button></a> <a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a>
<a href="/bbs/patch" target="_blank"><button class="toolbarButton">패치 내역</button></a> <a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a>
<a href="../i_other/help.php" target="_blank"><button class="toolbarButton">튜토리얼</button></a> <a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a>
<a href="<?=$site?>" target="_blank"><button class="toolbarButton"><?=$call?></button></a> <a href="<?=$site?>" target="_blank" class="open-window"><button type="button" class="toolbarButton"><?=$call?></button></a>
</div> </div>
</div> </div>
+83 -28
View File
@@ -1256,9 +1256,12 @@ function addAge()
//나이와 호봉 증가 //나이와 호봉 증가
$db->update('general', [ $db->update('general', [
'age' => $db->sqleval('age+1'), 'age' => $db->sqleval('age+1'),
'belong' => $db->sqleval('belong+1')
], true); ], true);
$db->update('general', [
'belong' => $db->sqleval('belong+1')
], 'nation != 0');
[$startYear, $year, $month] = $gameStor->getValuesAsArray(['startyear', 'year', 'month']); [$startYear, $year, $month] = $gameStor->getValuesAsArray(['startyear', 'year', 'month']);
if ($year >= $startYear + 3) { if ($year >= $startYear + 3) {
@@ -1290,8 +1293,7 @@ function addAge()
$special2 = $generalAux['inheritSpecificSpecialWar']; $special2 = $generalAux['inheritSpecificSpecialWar'];
unset($generalAux['inheritSpecificSpecialWar']); unset($generalAux['inheritSpecificSpecialWar']);
$updateVars['aux'] = Json::encode($generalAux); $updateVars['aux'] = Json::encode($generalAux);
} } else {
else{
$special2 = SpecialityHelper::pickSpecialWar( $special2 = SpecialityHelper::pickSpecialWar(
$general, $general,
($generalAux['prev_types_special2']) ?? [] ($generalAux['prev_types_special2']) ?? []
@@ -1346,17 +1348,29 @@ function triggerTournament()
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$admin = $gameStor->getValues(['tournament', 'tnmt_trig']); [$tournament, $tnmt_trig, $tnmt_pattern] = $gameStor->getValuesAsArray(['tournament', 'tnmt_trig', 'tnmt_pattern']);
//현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률 //현재 토너먼트 없고, 자동개시 걸려있을때, 40%확률
if ($admin['tournament'] == 0 && $admin['tnmt_trig'] > 0 && rand() % 100 < 40) { if($tournament != 0){
$type = rand() % 5; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전 return;
}
if($tnmt_trig == 0){
return;
}
if(!Util::randBool(0.4)){
return;
}
if(!$tnmt_pattern){
// 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
//전력전 40%, 통, 일, 설 각 20% //전력전 40%, 통, 일, 설 각 20%
if ($type > 3) { $tnmt_pattern = [0, 0, 1, 2, 3];
$type = 0; shuffle($tnmt_pattern);
}
startTournament($admin['tnmt_trig'], $type);
} }
$tnmt_type = array_pop($tnmt_pattern);
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
startTournament($tnmt_trig, $tnmt_type);
} }
function CheckHall($no) function CheckHall($no)
@@ -1592,9 +1606,19 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
} }
if (!$availableUnique) { if (!$availableUnique) {
if ($general->getAuxVar('inheritRandomUnique')) {
$general->setAuxVar('inheritRandomUnique', null);
$general->increaseInheritancePoint('previous', GameConst::$inheritItemRandomPoint);
$userLogger = new UserLogger($general->getVar('owner'));
$userLogger->push(sprintf("얻을 유니크가 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
}
return false; return false;
} }
if ($general->getAuxVar('inheritRandomUnique')) {
$general->setAuxVar('inheritRandomUnique', null);
}
[$itemType, $itemCode] = Util::choiceRandomUsingWeightPair($availableUnique); [$itemType, $itemCode] = Util::choiceRandomUsingWeightPair($availableUnique);
$nationName = $general->getStaticNation()['name']; $nationName = $general->getStaticNation()['name'];
@@ -1628,22 +1652,29 @@ function rollbackInheritUniqueTrial(General $general, string $itemKey, string $r
$itemTrials = $general->getAuxVar('inheritUniqueTrial'); $itemTrials = $general->getAuxVar('inheritUniqueTrial');
LogText("선택유니크 롤백:{$ownerID}", [$itemKey, $itemTrials]); LogText("선택유니크 롤백:{$ownerID}", [$itemKey, $itemTrials]);
unset($itemTrials[$itemKey]); unset($itemTrials[$itemKey]);
if(count($itemTrials) == 0){
$itemTrials = null;
}
$general->setAuxVar('inheritUniqueTrial', $itemTrials); $general->setAuxVar('inheritUniqueTrial', $itemTrials);
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}"); $trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
$ownTrial = $trialStor->getValue("u{$ownerID}"); $ownTrial = $trialStor->getValue("u{$ownerID}");
$itemObj = buildItemClass($itemKey);
$itemName = $itemObj->getName();
if ($ownTrial) { if ($ownTrial) {
//두 값이 general, KVStorage 둘다 있고, 이중에선 KVStorage 값을 기준으로 하자 따르자 //두 값이 general, KVStorage 둘다 있고, 이중에선 KVStorage 값을 기준으로 하자 따르자
[,, $amount] = $ownTrial; [,, $amount] = $ownTrial;
$trialStor->deleteValue("u{$ownerID}"); $trialStor->deleteValue("u{$ownerID}");
$general->increaseInheritancePoint('previous', $amount); $general->increaseInheritancePoint('previous', $amount);
LogText("선택유니크 롤백포인트:{$ownerID}", $amount); LogText("선택유니크 롤백포인트:{$ownerID}", $amount);
$userLogger = new UserLogger($ownerID);
$userLogger->push("{$itemName} 입찰에 사용한 {$amount} 포인트 반환", "inheritPoint");
} }
$itemObj = buildItemClass($itemKey);
$itemName = $itemObj->getName();
//메시지 //메시지
$staticNation = $general->getStaticNation(); $staticNation = $general->getStaticNation();
@@ -1662,11 +1693,16 @@ function rollbackInheritUniqueTrial(General $general, string $itemKey, string $r
[] []
); );
$msg->send(true);
$general->applyDB($db); $general->applyDB($db);
$msg->send(true);
} }
function tryInheritUniqueItem(General $general, string $acquireType = '아이템'): bool function tryRollbackInheritUniqueItem(General $general): void
{
tryInheritUniqueItem($general, 'Rollback', true);
}
function tryInheritUniqueItem(General $general, string $acquireType = '아이템', bool $justRollback = false): bool
{ {
$ownerID = $general->getVar('owner'); $ownerID = $general->getVar('owner');
if (!$ownerID) { if (!$ownerID) {
@@ -1769,6 +1805,9 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템
if ($ownTarget === null) { if ($ownTarget === null) {
return false; return false;
} }
if ($justRollback) {
return false;
}
LogText("선택유니크획득{$ownerID}", $ownTarget); LogText("선택유니크획득{$ownerID}", $ownTarget);
@@ -1813,30 +1852,48 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
return false; return false;
} }
$inheritUnique = $general->getAuxVar('inheritUniqueTrial'); $itemTypeCnt = count(GameConst::$allItems);
if ($inheritUnique && count($inheritUnique)) {
LogText("유니크 준비?? {$general->getID()}", $inheritUnique); [$startYear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
$trialResult = tryInheritUniqueItem($general, $acquireType); $relYear = $year - $startYear;
if ($trialResult) { $maxTrialCountByYear = 1;
return true; foreach(GameConst::$maxUniqueItemLimit as $tmpVals){
[$targetYear, $targetTrialCnt] = $tmpVals;
if($relYear < $targetYear){
break;
} }
$maxTrialCountByYear = $targetTrialCnt;
} }
$itemTypeCnt = count(GameConst::$allItems); $trialCnt = Util::valueFit($itemTypeCnt, null, $maxTrialCountByYear);
$trialCnt = $itemTypeCnt; $maxCnt = $itemTypeCnt;
foreach ($general->getItems() as $item) { foreach ($general->getItems() as $item) {
if (!$item->isBuyable()) { if (!$item->isBuyable()) {
$trialCnt -= 1; $trialCnt -= 1;
$maxCnt -= 1;
} }
} }
if ($trialCnt <= 0) { if ($trialCnt <= 0) {
LogText("{$general->getName()}, {$general->getID()} 모든 아이템", $trialCnt); LogText("{$general->getName()}, {$general->getID()} 모든 아이템", $trialCnt);
if ($general->getAuxVar('inheritRandomUnique')) {
$general->setAuxVar('inheritRandomUnique', null);
$general->increaseInheritancePoint('previous', GameConst::$inheritItemRandomPoint);
$userLogger = new UserLogger($general->getVar('owner'));
$userLogger->push(sprintf("유니크를 얻을 공간이 없어 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
}
tryRollbackInheritUniqueItem($general);
return false; return false;
} }
$inheritUnique = $general->getAuxVar('inheritUniqueTrial');
if ($acquireType != '설문조사' && $inheritUnique && count($inheritUnique)) {
$trialResult = tryInheritUniqueItem($general, $acquireType);
if ($trialResult) {
return true;
}
}
$scenario = $gameStor->scenario; $scenario = $gameStor->scenario;
$genCount = $db->queryFirstField('SELECT count(*) FROM general WHERE npc<2'); $genCount = $db->queryFirstField('SELECT count(*) FROM general WHERE npc<2');
@@ -1864,11 +1921,9 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
if ($general->getAuxVar('inheritRandomUnique')) { if ($general->getAuxVar('inheritRandomUnique')) {
//포인트로 랜덤 유니크 획득 //포인트로 랜덤 유니크 획득
$prob = 1; $prob = 1;
LogText("{$general->getName()}, {$general->getID()} 유산 포인트 유니크", $prob);
$general->setAuxVar('inheritRandomUnique', null);
} }
foreach (Util::range($trialCnt) as $_idx) { foreach (Util::range($maxCnt) as $_idx) {
if (Util::randBool($prob)) { if (Util::randBool($prob)) {
$result = true; $result = true;
break; break;
@@ -1876,10 +1931,10 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
$prob *= $moreProb; $prob *= $moreProb;
} }
if (!$result) { if (!$result) {
LogText("{$general->getName()}, {$general->getID()} 유니크 실패 {$trialCnt}", $prob); LogText("{$general->getName()}, {$general->getID()} 유니크 실패 {$maxCnt}", $prob);
return false; return false;
} }
LogText("{$general->getName()}, {$general->getID()} 유니크 성공 {$trialCnt}", $prob); LogText("{$general->getName()}, {$general->getID()} 유니크 성공 {$maxCnt}", $prob);
return giveRandomUniqueItem($general, $acquireType); return giveRandomUniqueItem($general, $acquireType);
} }
-25
View File
@@ -357,31 +357,6 @@ function buildNationCommandClass(?string $type, General $generalObj, array $env,
return new $class($generalObj, $env, $lastTurn, $arg); return new $class($generalObj, $env, $lastTurn, $arg);
} }
function getAPIExecutorClass($path){
static $basePath = __NAMESPACE__.'\\API\\';
if(is_string($path)){
}
else if(is_array($path)){
$path = join('\\', $path);
}
else{
throw new \InvalidArgumentException("{$path}는 올바른 API 지시자가 아님");
}
$classPath = str_replace('/', '\\', $basePath.$path);
if(class_exists($classPath)){
return $classPath;
}
throw new \InvalidArgumentException("{$path}는 올바른 API 경로가 아님");
}
function buildAPIExecutorClass($type, string $rootPath, array $args):\sammo\BaseAPI{
$class = getAPIExecutorClass($type);
return new $class($rootPath, $args);
}
function getWarUnitTriggerClass(string $type){ function getWarUnitTriggerClass(string $type){
static $basePath = __NAMESPACE__.'\\WarUnitTrigger\\'; static $basePath = __NAMESPACE__.'\\WarUnitTrigger\\';
$classPath = ($basePath.$type); $classPath = ($basePath.$type);
+39 -10
View File
@@ -167,7 +167,8 @@ function checkSupply()
} }
} }
function updateGeneralNumber(){ function updateGeneralNumber()
{
$db = DB::db(); $db = DB::db();
foreach ($db->queryAllLists('SELECT nation, count(*) FROM general WHERE npc != 5 GROUP BY nation') as [$nationID, $gennum]) { foreach ($db->queryAllLists('SELECT nation, count(*) FROM general WHERE npc != 5 GROUP BY nation') as [$nationID, $gennum]) {
if ($nationID === 0) { if ($nationID === 0) {
@@ -370,7 +371,11 @@ function postUpdateMonthly()
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop_max+agri_max+comm_max+secu_max+wall_max+def_max)/100 sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop_max+agri_max+comm_max+secu_max+wall_max+def_max)/100
) from city where nation=A.nation and supply=1 ) from city where nation=A.nation and supply=1
)) ))
+(select sum(leadership+strength+intel) from general where nation=A.nation) +(select SUM((ra.value + 1000)/(rb.value + 1000)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)*2 + (SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/2)
FROM general AS g
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = \'killcrew_person\'
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = \'deathcrew_person\'
WHERE g.nation = A.nation)
+(select round(sum(dex1+dex2+dex3+dex4+dex5)/1000) from general where nation=A.nation) +(select round(sum(dex1+dex2+dex3+dex4+dex5)/1000) from general where nation=A.nation)
+(select round(sum(experience+dedication)/100) from general where nation=A.nation) +(select round(sum(experience+dedication)/100) from general where nation=A.nation)
+(select round(avg(connect)) from general where nation=A.nation) +(select round(avg(connect)) from general where nation=A.nation)
@@ -435,8 +440,7 @@ function postUpdateMonthly()
foreach ($db->queryAllLists('SELECT me,you FROM diplomacy WHERE state=0 AND term <= 1 ORDER BY me desc, you desc') as [$me, $you]) { foreach ($db->queryAllLists('SELECT me,you FROM diplomacy WHERE state=0 AND term <= 1 ORDER BY me desc, you desc') as [$me, $you]) {
if ($me < $you) { if ($me < $you) {
$key = "{$me}_{$you}"; $key = "{$me}_{$you}";
} } else {
else{
$key = "{$you}_{$me}"; $key = "{$you}_{$me}";
} }
if (!key_exists($key, $stopWarList)) { if (!key_exists($key, $stopWarList)) {
@@ -624,14 +628,25 @@ function updateNationState()
$targetKillTurn $targetKillTurn
); );
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc', 'aux'], 2); $nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc', 'aux'], 2);
$chiefObj = null; $chiefID = null;
$uniqueLotteryWeightList = []; $uniqueLotteryWeightList = [];
[$startYear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
$relYear = $year - $startYear;
$maxTrialCountByYear = 1;
foreach (GameConst::$maxUniqueItemLimit as $tmpVals) {
[$targetYear, $targetTrialCnt] = $tmpVals;
if ($relYear < $targetYear) {
break;
}
$maxTrialCountByYear = $targetTrialCnt;
}
foreach ($nationGenList as $nationGen) { foreach ($nationGenList as $nationGen) {
if ($nationGen->getVar('officer_level') == 12) { if ($nationGen->getVar('officer_level') == 12) {
$chiefObj = $nationGen; $chiefID = $nationGen->getID();
} }
$trialCnt = count(GameConst::$allItems); $trialCnt = min($maxTrialCountByYear, count(GameConst::$allItems));
foreach ($nationGen->getItems() as $item) { foreach ($nationGen->getItems() as $item) {
if (!$item->isBuyable()) { if (!$item->isBuyable()) {
@@ -670,8 +685,10 @@ function updateNationState()
$winnerObj->applyDB($db); $winnerObj->applyDB($db);
} }
if($chiefObj){ if ($chiefID) {
$chiefObj = General::createGeneralObjFromDB($chiefID, ['belong', 'npc', 'aux'], 2);
$chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff); $chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff);
$chiefObj->applyDB($db);
} }
} }
} }
@@ -1150,7 +1167,8 @@ function checkEmperior()
LogHistory(); LogHistory();
} }
function resetInheritanceUser(int $userID, bool $isRebirth=false):float{ function resetInheritanceUser(int $userID, bool $isRebirth = false): float
{
$rebirthDegraded = [ $rebirthDegraded = [
'dex' => 0.5, 'dex' => 0.5,
]; ];
@@ -1166,19 +1184,30 @@ function resetInheritanceUser(int $userID, bool $isRebirth=false):float{
//이미 리셋되었으므로 리셋 안함 //이미 리셋되었으므로 리셋 안함
return $allPoints['previous'][0]; return $allPoints['previous'][0];
} }
$userLogger = new UserLogger($userID);
$previousPoint = ($allPoints['previous'] ?? [0, 0])[0];
foreach ($allPoints as $key => [$value,]) { foreach ($allPoints as $key => [$value,]) {
if ($isRebirth && key_exists($key, $rebirthDegraded)) { if ($isRebirth && key_exists($key, $rebirthDegraded)) {
$value *= $rebirthDegraded[$key]; $value *= $rebirthDegraded[$key];
} }
$keyText = General::INHERITANCE_KEY[$key][2];
$userLogger->push("{$keyText} 포인트 {$value} 증가", "inheritPoint");
$totalPoint += $value; $totalPoint += $value;
} }
$totalPoint = Util::toInt($totalPoint); $totalPoint = Util::toInt($totalPoint);
$userLogger->push("포인트 {$previousPoint} => {$totalPoint}", "inheritPoint");
$userLogger->flush();
$inheritStor->resetValues(); $inheritStor->resetValues();
$inheritStor->setValue('previous', [$totalPoint, null]); $inheritStor->setValue('previous', [$totalPoint, null]);
return $totalPoint; return $totalPoint;
} }
function updateMaxDomesticCritical(General $general, $score){ function updateMaxDomesticCritical(General $general, $score)
{
$maxDomesticCritical = $general->getAuxVar('max_domestic_critical') ?? 0; $maxDomesticCritical = $general->getAuxVar('max_domestic_critical') ?? 0;
$maxDomesticCritical += $score / 2; $maxDomesticCritical += $score / 2;
$general->setAuxVar('max_domestic_critical', $maxDomesticCritical); $general->setAuxVar('max_domestic_critical', $maxDomesticCritical);
-11
View File
@@ -77,12 +77,6 @@ function pushProcessLog($log) {
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log); pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
} }
function pushStepLog($log) {
$date = date('Y_m_d');
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
}
function pushLockLog($log) { function pushLockLog($log) {
$date = date('Y_m_d'); $date = date('Y_m_d');
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log); pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
@@ -378,8 +372,6 @@ function getGlobalActionLogWithDate(int $year, int $month):array {
} }
function LogHistory($isFirst=0) { function LogHistory($isFirst=0) {
if(STEP_LOG) pushStepLog(TimeUtil::now().', LogHistory Start');
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$obj = $gameStor->getValues(['startyear', 'year', 'month']); $obj = $gameStor->getValues(['startyear', 'year', 'month']);
@@ -426,8 +418,6 @@ function LogHistory($isFirst=0) {
return -($lhs['power']<=>$rhs['power']); return -($lhs['power']<=>$rhs['power']);
}); });
if(STEP_LOG) pushStepLog(TimeUtil::now().', contents collected');
$db->insert('ng_history', [ $db->insert('ng_history', [
'server_id' => UniqueConst::$serverID, 'server_id' => UniqueConst::$serverID,
'year' => $year, 'year' => $year,
@@ -438,6 +428,5 @@ function LogHistory($isFirst=0) {
'nations' => Json::encode($nations), 'nations' => Json::encode($nations),
]); ]);
if(STEP_LOG) pushStepLog(TimeUtil::now().', LogHistory Finish');
return true; return true;
} }
+51 -9
View File
@@ -8,8 +8,7 @@ function processTournament() {
$admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time']); $admin = $gameStor->getValues(['tournament', 'phase', 'tnmt_type', 'tnmt_auto', 'tnmt_time']);
$now = new \DateTime(); $now = new \DateTime();
$admin['now'] = $now->format('Y-m-d H:i:s'); $offset = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
$admin['offset'] = $now->getTimestamp() - (new \DateTime($admin['tnmt_time']))->getTimestamp();
//수동일땐 무시 //수동일땐 무시
if($admin['tnmt_auto'] == 0) { return; } if($admin['tnmt_auto'] == 0) { return; }
@@ -18,8 +17,11 @@ function processTournament() {
$tnmt = $admin['tournament']; $tnmt = $admin['tournament'];
$phase = $admin['phase']; $phase = $admin['phase'];
if($offset < 0){
return;
}
//현시간이 스탬프 지나친경우 //현시간이 스탬프 지나친경우
if($admin['offset'] >= 0) {
switch($admin['tnmt_auto']) { switch($admin['tnmt_auto']) {
case 1: $unit = 720; break; case 1: $unit = 720; break;
case 2: $unit = 420; break; case 2: $unit = 420; break;
@@ -32,7 +34,7 @@ function processTournament() {
} }
//업데이트 횟수 //업데이트 횟수
$iter = intdiv($admin['offset'], $unit) + 1; $iter = intdiv($offset, $unit) + 1;
for($i=0; $i < $iter; $i++) { for($i=0; $i < $iter; $i++) {
switch($tnmt) { switch($tnmt) {
@@ -55,6 +57,7 @@ function processTournament() {
case 5: //배정중 case 5: //배정중
final16set(); final16set();
$tnmt = 6; $phase = 0; $tnmt = 6; $phase = 0;
startBetting();
break; break;
case 6: //베팅중 case 6: //베팅중
$tnmt = 7; $phase = 0; $tnmt = 7; $phase = 0;
@@ -111,7 +114,6 @@ function processTournament() {
$gameStor->phase = $phase; $gameStor->phase = $phase;
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s'); $gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
} }
}
function getTournamentTerm() { function getTournamentTerm() {
$db = DB::db(); $db = DB::db();
@@ -296,11 +298,51 @@ function startTournament($auto, $type) {
['설전','책사'], ['설전','책사'],
][$type]; ][$type];
$history[] = "<S>◆</>{$admin['year']}{$admin['month']}월:{$openerText}<C>{$typeText}</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>{$genTypeText}</span>들을 모집하고 있습니다!"; $history[] = "<S>◆</>{$admin['year']}{$admin['month']}월:<B><b>【대회】</b></>{$openerText}<C>{$typeText}</> 대회가 개최됩니다! 천하의 <span class='ev_highlight'>{$genTypeText}</span>들을 모집하고 있습니다!";
pushGlobalHistoryLog($history, $admin['year'], $admin['month']); pushGlobalHistoryLog($history, $admin['year'], $admin['month']);
} }
function startBetting(){
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
pushGlobalHistoryLog([
"<S>◆</>{$year}{$month}월:<B><b>【대회】</b></>우승자를 예상하는 <C>내기</>가 진행중입니다! 호사가의 참여를 기다립니다!"
], $year, $month);
$betGold = 10;
$npcList = $db->queryFirstColumn('SELECT no FROM general WHERE npc >= 2 AND gold >= (500 + %i)', $betGold);
$npcBet = [];
$betSum = [
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
];
foreach($npcList as $npcID){
$target = Util::randRangeInt(0, 15);
$betSum[$target] += $betGold;
$npcBet[] = [$npcID, $target];
}
$db->update('general', [
'gold'=>$db->sqleval('gold - %i', $betGold),
], 'no IN %li', $npcList);
foreach($npcBet as [$npcID, $betTarget]){
$targetKey = "bet{$betTarget}";
$db->update('betting', [
"bet{$betTarget}"=>$db->sqleval('%b + %i', $targetKey, $betGold),
], 'general_id = %i', $npcID);
}
foreach($betSum as $betTarget=>$betSumGold){
$targetKey = "bet{$betTarget}";
$db->update('betting', [
"bet{$betTarget}"=>$db->sqleval('%b + %i', $targetKey, $betSumGold),
], 'general_id = 0');
}
}
function fillLowGenAll() { function fillLowGenAll() {
$db = DB::db(); $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
@@ -785,8 +827,8 @@ function setGift($tnmt_type, $tnmt, $phase) {
$josaYiWinner = JosaUtil::pick($winner['name'], '이'); $josaYiWinner = JosaUtil::pick($winner['name'], '이');
$josaYiRunnerUp = JosaUtil::pick($runnerUp['name'], '이'); $josaYiRunnerUp = JosaUtil::pick($runnerUp['name'], '이');
$winnerLogger->pushGlobalHistoryLog("<C>{$tp}</> 대회에서 <Y>{$winner['name']}</>{$josaYiWinner} <C>우승</>, <Y>{$runnerUp['name']}</>{$josaYiRunnerUp} <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!", ActionLogger::EVENT_YEAR_MONTH); $winnerLogger->pushGlobalHistoryLog("<B><b>【대회】</b></><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); $winnerLogger->pushGlobalHistoryLog("<B><b>【대회】</b></><C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$winnerRewardText}</>, <S>준우승자</>에겐 <C>{$runnerUpRewardText}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!", ActionLogger::EVENT_YEAR_MONTH);
$generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper)); $generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper));
@@ -1132,7 +1174,7 @@ function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$gen1resKey = 'd'; $gen1resKey = 'd';
$gen2resKey = 'd'; $gen2resKey = 'd';
break; break;
default: new MustNotBeReachedException(); default: throw new MustNotBeReachedException();
} }
$db->update('rank_data', [ $db->update('rank_data', [
+5 -2
View File
@@ -21,9 +21,11 @@ foreach($rawTurn as [$turn_idx, $action, $arg, $brief]){
]; ];
} }
[$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']); [$turnTerm, $year, $month, $lastExecute] = $gameStor->getValuesAsArray(['turnterm', 'year', 'month', 'turntime']);
$turnTime = $db->queryFirstField('SELECT turntime FROM general WHERE no=%i', $generalID); [$turnTime, $rawGeneralAux] = $db->queryFirstList('SELECT turntime, aux FROM general WHERE no=%i', $generalID);
$generalAux = Json::decode($rawGeneralAux??'{}');
if(cutTurn($turnTime, $turnTerm) > cutTurn($lastExecute, $turnTerm)){ if(cutTurn($turnTime, $turnTerm) > cutTurn($lastExecute, $turnTerm)){
//이미 이번달에 실행된 턴이다. //이미 이번달에 실행된 턴이다.
@@ -42,5 +44,6 @@ Json::die([
'year'=>$year, 'year'=>$year,
'month'=>$month, 'month'=>$month,
'date'=>TimeUtil::now(true), 'date'=>TimeUtil::now(true),
'turn'=>$commandList 'turn'=>$commandList,
'autorun_limit'=> $generalAux['autorun_limit']??null,
]); ]);
+1 -1
View File
@@ -47,7 +47,7 @@ else{
'name', 'leadership', 'strength', 'intel', 'gold','rice', 'name', 'leadership', 'strength', 'intel', 'gold','rice',
'troop','officer_level','npc','picture','imgsvr', 'troop','officer_level','npc','picture','imgsvr',
'permission','penalty','belong', 'crewtype', 'permission','penalty','belong', 'crewtype',
'experience', 'dedication', 'betray', 'dedlevel', 'explevel', 'makelimit', 'experience', 'dedication', 'betray', 'dedlevel', 'explevel', 'makelimit', 'aux',
], 1); ], 1);
if($general instanceof DummyGeneral){ if($general instanceof DummyGeneral){
+1 -7
View File
@@ -39,7 +39,7 @@ $db = DB::db();
$me = General::createGeneralObjFromDB($generalID); $me = General::createGeneralObjFromDB($generalID);
if($defence_train != $me->getVar('defence_train')){ if($defence_train !== $me->getVar('defence_train')){
if($defence_train == 999){ if($defence_train == 999){
$me->increaseVar('myset', -1); $me->increaseVar('myset', -1);
$me->setVar('defence_train', $defence_train); $me->setVar('defence_train', $defence_train);
@@ -53,14 +53,8 @@ if($defence_train != $me->getVar('defence_train')){
} }
$me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100)); $me->setAuxVar('use_treatment', Util::valueFit($use_treatment, 10, 100));
if($use_auto_nation_turn != $me->getAuxVar('use_auto_nation_turn')){
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn); $me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
}
if($me->getVar('tnmt') != $tnmt){
$me->setVar('tnmt', $tnmt); $me->setVar('tnmt', $tnmt);
}
if($me->getNPCType() == 1 && $detachNPC){ if($me->getNPCType() == 1 && $detachNPC){
$turnterm = $gameStor->turnterm; $turnterm = $gameStor->turnterm;
+21 -9
View File
@@ -1,4 +1,5 @@
<?php <?php
namespace sammo; namespace sammo;
include "lib.php"; include "lib.php";
@@ -57,7 +58,8 @@ if ($permission < 3) {
]); ]);
} }
function applyNationPolicy($policy, $nationID, $generalName):?string{ function applyNationPolicy($policy, $nationID, $generalName): ?string
{
$db = DB::db(); $db = DB::db();
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
@@ -139,7 +141,8 @@ function applyNationPolicy($policy, $nationID, $generalName):?string{
return null; return null;
} }
function applyNationPriority($priority, $nationID, $generalName):?string{ function applyNationPriority($priority, $nationID, $generalName): ?string
{
$db = DB::db(); $db = DB::db();
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
$nationPolicyRoot = $nationStor->npc_nation_policy; $nationPolicyRoot = $nationStor->npc_nation_policy;
@@ -157,17 +160,29 @@ function applyNationPriority($priority, $nationID, $generalName):?string{
return null; return null;
} }
function applyGeneralPriority($priority, $nationID, $generalName):?string{ function applyGeneralPriority($priority, $nationID, $generalName): ?string
{
$db = DB::db(); $db = DB::db();
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env'); $nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
$generalPolicyRoot = $nationStor->npc_general_policy; $generalPolicyRoot = $nationStor->npc_general_policy;
$defaultPriority = AutorunGeneralPolicy::$default_priority; $defaultPriority = AutorunGeneralPolicy::$default_priority;
$mustHaveActions = ['출병' => 1];
foreach ($priority as $item) { foreach ($priority as $item) {
if (key_exists($item, $mustHaveActions)) {
$mustHaveActions[$item] = 0;
}
if (!in_array($item, $defaultPriority)) { if (!in_array($item, $defaultPriority)) {
return "{$item}은 올바른 명령이 아닙니다."; return "{$item}은 올바른 명령이 아닙니다.";
} }
} }
foreach ($mustHaveActions as $actionKey => $unset) {
if ($unset) {
return "{$actionKey}은 항상 사용해야 합니다.";
}
}
$generalPolicyRoot['priority'] = $priority; $generalPolicyRoot['priority'] = $priority;
$generalPolicyRoot['prioritySetter'] = $generalName; $generalPolicyRoot['prioritySetter'] = $generalName;
$generalPolicyRoot['prioritySetTime'] = TimeUtil::now(); $generalPolicyRoot['prioritySetTime'] = TimeUtil::now();
@@ -177,14 +192,11 @@ function applyGeneralPriority($priority, $nationID, $generalName):?string{
if ($type == 'nationPolicy') { if ($type == 'nationPolicy') {
$result = applyNationPolicy($data, $nationID, $me['name']); $result = applyNationPolicy($data, $nationID, $me['name']);
} } else if ($type == 'generalPriority') {
else if($type == 'generalPriority'){
$result = applyGeneralPriority($data, $nationID, $me['name']); $result = applyGeneralPriority($data, $nationID, $me['name']);
} } else if ($type == 'nationPriority') {
else if($type == 'nationPriority'){
$result = applyNationPriority($data, $nationID, $me['name']); $result = applyNationPriority($data, $nationID, $me['name']);
} } else {
else{
throw new MustNotBeReachedException(); throw new MustNotBeReachedException();
} }
-4
View File
@@ -20,10 +20,6 @@ $loader->addClassMap((function () {
//디버그용 매크로 //디버그용 매크로
ini_set("session.cache_expire", 10080); // minutes ini_set("session.cache_expire", 10080); // minutes
// 각종 변수
define('STEP_LOG', true);
define('PROCESS_LOG', true);
ob_start(); ob_start();
// 에러 메세지 출력 // 에러 메세지 출력
+2
View File
@@ -264,12 +264,14 @@ function processWar_NG(
$attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType()); $attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType());
$defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType()); $defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType());
/*
if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){ if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){
$attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1); $attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
} }
if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){ if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){
$defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1); $defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
} }
*/
$attackerName = $attacker->getName(); $attackerName = $attacker->getName();
$attackerCrewTypeName = $attacker->getCrewTypeName(); $attackerCrewTypeName = $attacker->getCrewTypeName();
+15 -2
View File
@@ -16,6 +16,7 @@ use sammo\Session;
use sammo\SpecialityHelper; use sammo\SpecialityHelper;
use sammo\StringUtil; use sammo\StringUtil;
use sammo\TimeUtil; use sammo\TimeUtil;
use sammo\UserLogger;
use sammo\Util; use sammo\Util;
use sammo\Validator; use sammo\Validator;
use sammo\WebUtil; use sammo\WebUtil;
@@ -152,11 +153,13 @@ class Join extends \sammo\BaseAPI
} }
} }
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']); $admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year', 'month']);
$inheritTotalPoint = resetInheritanceUser($userID); $inheritTotalPoint = resetInheritanceUser($userID);
$inheritRequiredPoint = 0; $inheritRequiredPoint = 0;
$userLogger = new UserLogger($userID, $admin['year'], $admin['month'], false);
if ($inheritCity !== null) { if ($inheritCity !== null) {
$inheritRequiredPoint += GameConst::$inheritBornCityPoint; $inheritRequiredPoint += GameConst::$inheritBornCityPoint;
} }
@@ -183,6 +186,8 @@ class Join extends \sammo\BaseAPI
} }
if ($inheritSpecial) { if ($inheritSpecial) {
$speicalText = getGeneralSpecialWarName($inheritSpecial);
$userLogger->push("{$speicalText} 전투 특기를 가진 천재 생성", "inheritPoint");
$genius = true; $genius = true;
} else { } else {
// 현재 1% // 현재 1%
@@ -196,6 +201,8 @@ class Join extends \sammo\BaseAPI
} }
if ($inheritCity !== null) { if ($inheritCity !== null) {
$cityname = CityConst::byID($inheritCity)->name;
$userLogger->push("{$cityname}에 장수 생성", "inheritPoint");
$city = $inheritCity; $city = $inheritCity;
} else { } else {
// 공백지에서만 태어나게 // 공백지에서만 태어나게
@@ -207,6 +214,7 @@ class Join extends \sammo\BaseAPI
if ($inheritBonusStat) { if ($inheritBonusStat) {
[$pleadership, $pstrength, $pintel] = $inheritBonusStat; [$pleadership, $pstrength, $pintel] = $inheritBonusStat;
$userLogger->push("{$pleadership}, {$pstrength}, {$pintel} 보너스 능력치로 생성", "inheritPoint");
} else { } else {
$pleadership = 0; $pleadership = 0;
$pstrength = 0; $pstrength = 0;
@@ -276,8 +284,10 @@ class Join extends \sammo\BaseAPI
} }
if ($inheritTurntime !== null) { if ($inheritTurntime !== null) {
//FIXME: 오동작함
$inheritTurntime = $inheritTurntime % ($admin['turnterm'] * 60); $inheritTurntime = $inheritTurntime % ($admin['turnterm'] * 60);
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime%60), "inheritPoint");
$inheritTurntime += Util::randRangeInt(0, 999999) / 1000000; $inheritTurntime += Util::randRangeInt(0, 999999) / 1000000;
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm'])); $turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime)); $turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
@@ -372,9 +382,12 @@ class Join extends \sammo\BaseAPI
]); ]);
$cityname = CityConst::byID($city)->name; $cityname = CityConst::byID($city)->name;
if ($inheritRequiredPoint > 0) { if ($inheritRequiredPoint > 0) {
$userLogger->push("장수 생성으로 포인트 {$inheritRequiredPoint} 소모", "inheritPoint");
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}"); $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
$inheritStor->setValue('previous', [$inheritTotalPoint - $inheritRequiredPoint, null]); $inheritStor->setValue('previous', [$inheritTotalPoint - $inheritRequiredPoint, null]);
$userLogger->flush();
} }
$me = [ $me = [
@@ -10,6 +10,7 @@ use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\TimeUtil; use sammo\TimeUtil;
use sammo\TriggerInheritBuff; use sammo\TriggerInheritBuff;
use sammo\UserLogger;
use sammo\Validator; use sammo\Validator;
class BuyHiddenBuff extends \sammo\BaseAPI class BuyHiddenBuff extends \sammo\BaseAPI
@@ -50,6 +51,7 @@ class BuyHiddenBuff extends \sammo\BaseAPI
if ($userID != $general->getVar('owner')) { if ($userID != $general->getVar('owner')) {
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.'; return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
} }
$userLogger = new UserLogger($userID);
$inheritBuffList = $general->getAuxVar('inheritBuff') ?? []; $inheritBuffList = $general->getAuxVar('inheritBuff') ?? [];
$prevLevel = $inheritBuffList[$type] ?? 0; $prevLevel = $inheritBuffList[$type] ?? 0;
@@ -70,6 +72,11 @@ class BuyHiddenBuff extends \sammo\BaseAPI
return '충분한 유산 포인트를 가지고 있지 않습니다.'; return '충분한 유산 포인트를 가지고 있지 않습니다.';
} }
$buffTypeText = TriggerInheritBuff::BUFF_KEY_TEXT[$type];
$moreText = $prevLevel > 0 ? "추가":"";
$userLogger->push("{$reqAmount} 포인트로 {$buffTypeText} {$level} 단계 {$moreText}구입", "inheritPoint");
$userLogger->flush();
$inheritBuffList[$type] = $level; $inheritBuffList[$type] = $level;
$general->setAuxVar('inheritBuff', $inheritBuffList); $general->setAuxVar('inheritBuff', $inheritBuffList);
$inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]); $inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
@@ -9,6 +9,7 @@ use sammo\GameConst;
use sammo\General; use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\TimeUtil; use sammo\TimeUtil;
use sammo\UserLogger;
class BuyRandomUnique extends \sammo\BaseAPI class BuyRandomUnique extends \sammo\BaseAPI
{ {
@@ -40,12 +41,17 @@ class BuyRandomUnique extends \sammo\BaseAPI
$db = DB::db(); $db = DB::db();
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}"); $inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
$previousPoint = ($inheritStor->getValue('previous')??[0, 0])[0]; $previousPoint = ($inheritStor->getValue('previous')??[0, 0])[0];
if($previousPoint < GameConst::$inheritItemRandomPoint){ $reqAmount = GameConst::$inheritItemRandomPoint;
if($previousPoint < $reqAmount){
return '충분한 유산 포인트를 가지고 있지 않습니다.'; return '충분한 유산 포인트를 가지고 있지 않습니다.';
} }
$userLogger = new UserLogger($userID);
$userLogger->push("{$reqAmount} 포인트로 랜덤 유니크 구입", "inheritPoint");
$userLogger->flush();
$general->setAuxVar('inheritRandomUnique', TimeUtil::now()); $general->setAuxVar('inheritRandomUnique', TimeUtil::now());
$inheritStor->setValue('previous', [$previousPoint - GameConst::$inheritItemRandomPoint, null]); $inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
$general->applyDB($db); $general->applyDB($db);
return null; return null;
} }
@@ -8,12 +8,16 @@ use sammo\DB;
use sammo\GameConst; use sammo\GameConst;
use sammo\General; use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\UserLogger;
use sammo\Validator; use sammo\Validator;
use function sammo\buildItemClass;
class BuySpecificUnique extends \sammo\BaseAPI class BuySpecificUnique extends \sammo\BaseAPI
{ {
public function validateArgs(): ?string public function validateArgs(): ?string
{ {
$availableItems = [];
foreach (GameConst::$allItems as $items) { foreach (GameConst::$allItems as $items) {
foreach ($items as $itemKey => $amount) { foreach ($items as $itemKey => $amount) {
if ($amount == 0) { if ($amount == 0) {
@@ -70,6 +74,11 @@ class BuySpecificUnique extends \sammo\BaseAPI
return '충분한 유산 포인트를 가지고 있지 않습니다.'; return '충분한 유산 포인트를 가지고 있지 않습니다.';
} }
$itemObj = buildItemClass($itemKey);
$userLogger = new UserLogger($userID);
$userLogger->push("{$amount} 포인트로 유니크 {$itemObj->getName()} 구입 시도", "inheritPoint");
$userLogger->flush();
$itemTrials[$itemKey] = $amount; $itemTrials[$itemKey] = $amount;
$general->setAuxVar('inheritUniqueTrial', $itemTrials); $general->setAuxVar('inheritUniqueTrial', $itemTrials);
$inheritStor->setValue('previous', [$previousPoint - $amount, null]); $inheritStor->setValue('previous', [$previousPoint - $amount, null]);
@@ -8,6 +8,7 @@ use sammo\DB;
use sammo\GameConst; use sammo\GameConst;
use sammo\General; use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\UserLogger;
use sammo\Validator; use sammo\Validator;
class ResetSpecialWar extends \sammo\BaseAPI class ResetSpecialWar extends \sammo\BaseAPI
@@ -55,6 +56,10 @@ class ResetSpecialWar extends \sammo\BaseAPI
return '충분한 유산 포인트를 가지고 있지 않습니다.'; return '충분한 유산 포인트를 가지고 있지 않습니다.';
} }
$userLogger = new UserLogger($userID);
$userLogger->push("{$reqPoint} 포인트로 전투 특기 초기화", "inheritPoint");
$userLogger->flush();
$oldTypeKey = 'prev_types_special2'; $oldTypeKey = 'prev_types_special2';
$oldSpecialList = $general->getAuxVar($oldTypeKey) ?? []; $oldSpecialList = $general->getAuxVar($oldTypeKey) ?? [];
$oldSpecialList[] = $currentSpecialWar; $oldSpecialList[] = $currentSpecialWar;
@@ -10,6 +10,7 @@ use sammo\GameConst;
use sammo\General; use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\TimeUtil; use sammo\TimeUtil;
use sammo\UserLogger;
use sammo\Util; use sammo\Util;
class ResetTurnTime extends \sammo\BaseAPI class ResetTurnTime extends \sammo\BaseAPI
@@ -59,6 +60,15 @@ class ResetTurnTime extends \sammo\BaseAPI
$afterTurn = Util::randRange($turnTerm * -60 / 2, $turnTerm * 60 / 2); $afterTurn = Util::randRange($turnTerm * -60 / 2, $turnTerm * 60 / 2);
$userLogger = new UserLogger($userID);
if($afterTurn >= 0){
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 뒤로 밀림", intdiv(Util::toInt($afterTurn), 60), $afterTurn%60), "inheritPoint");
}
else{
$userLogger->push(sprintf("{$reqPoint} 포인트로 턴 시간을 바꾼 결과 %02d:%02d 앞으로 당김", intdiv(Util::toInt(-$afterTurn), 60), (-$afterTurn)%60), "inheritPoint");
}
$userLogger->flush();
$turnTime = $currTurnTime->add(TimeUtil::secondsToDateInterval($afterTurn)); $turnTime = $currTurnTime->add(TimeUtil::secondsToDateInterval($afterTurn));
if ($turnTime <= $serverTurnTimeObj && $serverTurnTimeObj <= $currTurnTime) { if ($turnTime <= $serverTurnTimeObj && $serverTurnTimeObj <= $currTurnTime) {
$turnTime = $turnTime->add(TimeUtil::secondsToDateInterval($turnTerm * 60)); $turnTime = $turnTime->add(TimeUtil::secondsToDateInterval($turnTerm * 60));
@@ -8,8 +8,11 @@ use sammo\DB;
use sammo\GameConst; use sammo\GameConst;
use sammo\General; use sammo\General;
use sammo\KVStorage; use sammo\KVStorage;
use sammo\UserLogger;
use sammo\Validator; use sammo\Validator;
use function sammo\buildGeneralSpecialWarClass;
class SetNextSpecialWar extends \sammo\BaseAPI class SetNextSpecialWar extends \sammo\BaseAPI
{ {
public function validateArgs(): ?string public function validateArgs(): ?string
@@ -67,6 +70,11 @@ class SetNextSpecialWar extends \sammo\BaseAPI
return '충분한 유산 포인트를 가지고 있지 않습니다.'; return '충분한 유산 포인트를 가지고 있지 않습니다.';
} }
$userLogger = new UserLogger($userID);
$specialWarObj = buildGeneralSpecialWarClass($type);
$userLogger->push("{$reqAmount} 포인트로 다음 전투 특기로 {$specialWarObj->getName()} 지정", "inheritPoint");
$userLogger->flush();
$general->setAuxVar('inheritSpecificSpecialWar', $type); $general->setAuxVar('inheritSpecificSpecialWar', $type);
$inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]); $inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
$general->applyDB($db); $general->applyDB($db);
@@ -19,7 +19,7 @@ class che_무기_09_동호비궁 extends \sammo\BaseStatItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new 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 + che_저격시도::TYPE_DEDUP_TYPE_BASE * 109, 0.2, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM) new che_저격발동($unit, che_저격발동::TYPE_ITEM)
); );
} }
@@ -19,7 +19,7 @@ class che_무기_13_양유기궁 extends \sammo\BaseStatItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new 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 + che_저격시도::TYPE_DEDUP_TYPE_BASE * 113, 0.1, 20, 40),
new che_저격발동($unit, che_저격발동::TYPE_ITEM) new che_저격발동($unit, che_저격발동::TYPE_ITEM)
); );
} }
@@ -15,7 +15,7 @@ class che_반계_백우선 extends \sammo\BaseItem{
protected $id = 45; protected $id = 45;
protected $rawName = '백우선'; protected $rawName = '백우선';
protected $name = '백우선(반계)'; protected $name = '백우선(반계)';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림'; protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
protected $cost = 200; protected $cost = 200;
protected $consumable = false; protected $consumable = false;
@@ -29,7 +29,7 @@ class che_반계_백우선 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller( return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301), new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, 0.2),
new che_반계발동($unit) new che_반계발동($unit)
); );
} }
@@ -15,7 +15,7 @@ class che_반계_파초선 extends \sammo\BaseItem{
protected $id = 45; protected $id = 45;
protected $rawName = '파초선'; protected $rawName = '파초선';
protected $name = '파초선(반계)'; protected $name = '파초선(반계)';
protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 40% 확률로 되돌림'; protected $info = '[전투] 상대의 계략 성공 확률 -10%p, 상대의 계략을 20% 확률로 되돌림';
protected $cost = 200; protected $cost = 200;
protected $consumable = false; protected $consumable = false;
@@ -29,7 +29,7 @@ class che_반계_파초선 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller( return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302), new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302, 0.2),
new che_반계발동($unit) new che_반계발동($unit)
); );
} }
@@ -16,12 +16,12 @@ class che_서적_07_사마법 extends \sammo\BaseStatItem{
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림"; $this->info .= "<br>[전투] 상대의 계략을 10% 확률로 되돌림";
} }
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller( return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, 0.2), new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, 0.1),
new che_반계발동($unit) new che_반계발동($unit)
); );
} }
@@ -16,12 +16,12 @@ class che_서적_12_산해경 extends \sammo\BaseStatItem{
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->info .= "<br>[전투] 상대의 계략을 20% 확률로 되돌림"; $this->info .= "<br>[전투] 상대의 계략을 10% 확률로 되돌림";
} }
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller( return new WarUnitTriggerCaller(
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM, 0.2), new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM, 0.1),
new che_반계발동($unit) new che_반계발동($unit)
); );
} }
@@ -11,25 +11,29 @@ class event_전투특기_무쌍 extends \sammo\BaseItem{
protected $id = 61; protected $id = 61;
protected $rawName = '비급'; protected $rawName = '비급';
protected $name = '비급(무쌍)'; protected $name = '비급(무쌍)';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)'; protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
protected $cost = 100; protected $cost = 100;
protected $buyable = true; protected $buyable = true;
protected $consumable = false; protected $consumable = false;
protected $reqSecu = 3000; protected $reqSecu = 3000;
public function onCalcStat(General $general, string $statName, $value, $aux=null){ public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){ if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
return $value += 0.1; return $value += 0.1;
} }
return $value; return $value;
} }
public function getWarPowerMultiplier(WarUnit $unit):array{ public function getWarPowerMultiplier(WarUnit $unit):array{
$attackMultiplier = 1.1; $generalWarSpecial = $unit->getGeneral()->getSpecialWar();
$defenceMultiplier = 0.95; if($generalWarSpecial !== null && $generalWarSpecial->getName() == '무쌍'){
return [1, 1];
}
$attackMultiplier = 1.05;
$defenceMultiplier = 0.98;
$killnum = $unit->getGeneral()->getRankVar('killnum'); $killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4); $attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3); $defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
return [$attackMultiplier, $defenceMultiplier]; return [$attackMultiplier, $defenceMultiplier];
} }
} }
@@ -38,7 +38,7 @@ class event_전투특기_반계 extends \sammo\BaseItem{
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
return new WarUnitTriggerCaller( return new WarUnitTriggerCaller(
new che_반계시도($unit), new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM),
new che_반계발동($unit) new che_반계발동($unit)
); );
} }
+1 -1
View File
@@ -35,7 +35,7 @@ class che_종횡가 extends \sammo\BaseNation{
public function onCalcStrategic(string $turnType, string $varType, $value){ public function onCalcStrategic(string $turnType, string $varType, $value){
if($varType == 'delay'){ if($varType == 'delay'){
return Util::round($value / 2); return Util::round($value * 3 / 4);
} }
if($varType == 'globalDelay'){ if($varType == 'globalDelay'){
return Util::round($value / 2); return Util::round($value / 2);
@@ -10,7 +10,7 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
protected $id = 61; protected $id = 61;
protected $name = '무쌍'; protected $name = '무쌍';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)'; protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
static $selectWeightType = SpecialityHelper::WEIGHT_NORM; static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
static $selectWeight = 1; static $selectWeight = 1;
@@ -19,18 +19,22 @@ class che_event_무쌍 extends \sammo\BaseSpecial{
]; ];
public function onCalcStat(General $general, string $statName, $value, $aux=null){ public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){ if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
return $value += 0.1; return $value += 0.1;
} }
return $value; return $value;
} }
public function getWarPowerMultiplier(WarUnit $unit):array{ public function getWarPowerMultiplier(WarUnit $unit):array{
$attackMultiplier = 1.1; $generalWarSpecial = $unit->getGeneral()->getSpecialWar();
$defenceMultiplier = 1; if($generalWarSpecial !== null && $generalWarSpecial->getName() == '무쌍'){
return [1, 1];
}
$attackMultiplier = 1.05;
$defenceMultiplier = 0.98;
$killnum = $unit->getGeneral()->getRankVar('killnum'); $killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4); $attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3); $defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
return [$attackMultiplier, $defenceMultiplier]; return [$attackMultiplier, $defenceMultiplier];
} }
} }
+6 -6
View File
@@ -10,7 +10,7 @@ class che_무쌍 extends \sammo\BaseSpecial{
protected $id = 61; protected $id = 61;
protected $name = '무쌍'; protected $name = '무쌍';
protected $info = '[전투] 대미지 +10%, 피해 -5%, 공격 시 필살 확률 +10%p, <br>승리 수만큼 대미지 0.20%씩 추가 상승(최대40%)<br>승리 수만큼 피해 0.05%씩 감소(최대30%)'; protected $info = '[전투] 대미지 +5%, 피해 -2%, 공격 시 필살 확률 +10%p, <br>승리 수의 로그 비례로 대미지 상승(10회 ⇒ +5%, 40회 ⇒ +15%)<br>승리 수의 로그 비례로 피해 감소(10회 ⇒ -2%, 40회 ⇒ -6%)';
static $selectWeightType = SpecialityHelper::WEIGHT_NORM; static $selectWeightType = SpecialityHelper::WEIGHT_NORM;
static $selectWeight = 1; static $selectWeight = 1;
@@ -19,18 +19,18 @@ class che_무쌍 extends \sammo\BaseSpecial{
]; ];
public function onCalcStat(General $general, string $statName, $value, $aux=null){ public function onCalcStat(General $general, string $statName, $value, $aux=null){
if($statName === 'warCriticalRatio' && $aux['isAttacker']??false){ if($statName === 'warCriticalRatio' && ($aux['isAttacker']??false)){
return $value += 0.1; return $value += 0.1;
} }
return $value; return $value;
} }
public function getWarPowerMultiplier(WarUnit $unit):array{ public function getWarPowerMultiplier(WarUnit $unit):array{
$attackMultiplier = 1.1; $attackMultiplier = 1.05;
$defenceMultiplier = 0.95; $defenceMultiplier = 0.98;
$killnum = $unit->getGeneral()->getRankVar('killnum'); $killnum = $unit->getGeneral()->getRankVar('killnum');
$attackMultiplier += Util::valueFit($killnum * 0.01 * 0.2, null, 0.4); $attackMultiplier += log(max(1, $killnum / 5), 2) / 20;
$defenceMultiplier -= Util::valueFit($killnum * 0.01 * 0.05, null, 0.3); $defenceMultiplier -= log(max(1, $killnum / 5), 2) / 50;
return [$attackMultiplier, $defenceMultiplier]; return [$attackMultiplier, $defenceMultiplier];
} }
} }
+2
View File
@@ -137,6 +137,7 @@ class AutorunNationPolicy {
public $reqNPCDevelRice = 500; public $reqNPCDevelRice = 500;
public $minimumResourceActionAmount = 1000; public $minimumResourceActionAmount = 1000;
public $maximumResourceActionAmount = 10000;
public $minNPCWarLeadership = 40; public $minNPCWarLeadership = 40;
public $minWarCrew = 1500; public $minWarCrew = 1500;
@@ -164,6 +165,7 @@ class AutorunNationPolicy {
'reqNPCDevelRice'=>500, 'reqNPCDevelRice'=>500,
'minimumResourceActionAmount'=>1000, 'minimumResourceActionAmount'=>1000,
'maximumResourceActionAmount'=>10000,
'minNPCWarLeadership'=>40, 'minNPCWarLeadership'=>40,
'minWarCrew'=>1500, 'minWarCrew'=>1500,
+3 -3
View File
@@ -3,9 +3,9 @@ namespace sammo;
class CityHelper{ class CityHelper{
//Just Helper //Just Helper
private static $list = null; private static ?array $list = null;
private static $listInv = null; private static ?array $listInv = null;
private static $listByNation = null; private static ?array $listByNation = null;
private function __construct(){ private function __construct(){
+2 -1
View File
@@ -13,6 +13,7 @@ use \sammo\{
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use function sammo\tryRollbackInheritUniqueItem;
class che_NPC능동 extends Command\GeneralCommand{ class che_NPC능동 extends Command\GeneralCommand{
static protected $actionName = 'NPC능동'; static protected $actionName = 'NPC능동';
@@ -97,7 +98,7 @@ class che_NPC능동 extends Command\GeneralCommand{
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
} }
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+1
View File
@@ -162,6 +162,7 @@ class che_거병 extends Command\GeneralCommand{
$exp = 100; $exp = 100;
$ded = 100; $ded = 100;
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp); $general->addExperience($exp);
$general->addDedication($ded); $general->addDedication($ded);
$general->setVar('belong', 1); $general->setVar('belong', 1);
+1
View File
@@ -188,6 +188,7 @@ class che_건국 extends Command\GeneralCommand
refreshNationStaticInfo(); refreshNationStaticInfo();
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryUniqueItemLottery($general, '건국'); tryUniqueItemLottery($general, '건국');
@@ -194,7 +194,7 @@ class che_등용수락 extends Command\GeneralCommand{
} }
$db->update('nation', $setScoutNationValues, 'nation=%i', $destNationID); $db->update('nation', $setScoutNationValues, 'nation=%i', $destNationID);
$general->increaseInheritancePoint('active_action', 1);
$general->setVar('permission', 'normal'); $general->setVar('permission', 'normal');
$general->setVar('belong', 1); $general->setVar('belong', 1);
$general->setVar('officer_level', 1); $general->setVar('officer_level', 1);
+21 -27
View File
@@ -181,51 +181,44 @@ class che_랜덤임관 extends Command\GeneralCommand
$generalsCnt = []; $generalsCnt = [];
if ($notIn) { if ($notIn) {
$rawGeneralsCnt = $db->query( $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 != 9 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc', "SELECT g.`nation`, n.`gennum`, n.name, SUM((ra.value + 1000)/(rb.value + 1000)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)) AS warpower, SUM(SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/5 AS develpower
FROM general AS g
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = 'killcrew_person'
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = 'deathcrew_person'
LEFT JOIN `nation` AS n ON g.`nation` = n.`nation`
WHERE g.`npc` IN (0, 1, 2, 3, 6) AND g.nation != 0 AND n.scout=0 AND n.gennum < %i AND n.nation NOT IN %li
GROUP BY g.`nation`",
$genLimit, $genLimit,
$notIn $notIn
); );
} else { } else {
$rawGeneralsCnt = $db->query( $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 != 9 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc', "SELECT g.`nation`, n.`gennum`, n.name, SUM((ra.value + 100)/(rb.value + 100)*(CASE WHEN g.`npc` < 2 THEN 1.5 ELSE 1 END)*(CASE WHEN g.`leadership` >= 40 THEN g.`leadership` ELSE 0 END)) AS warpower, SUM(SQRT(g.intel * g.strength) * 2 + g.leadership / 2)/5 AS develpower
FROM general AS g
LEFT JOIN `rank_data` AS ra ON g.`no` = ra.general_id AND ra.`type` = 'killcrew_person'
LEFT JOIN `rank_data` AS rb ON g.`no` = rb.general_id AND rb.`type` = 'deathcrew_person'
LEFT JOIN `nation` AS n ON g.`nation` = n.`nation`
WHERE g.`npc` IN (0, 1, 2, 3, 6) AND g.nation != 0 AND n.scout=0 AND n.gennum < %i
GROUP BY g.`nation`",
$genLimit $genLimit
); );
} }
foreach ($rawGeneralsCnt as $nation) { foreach ($rawGeneralsCnt as $nation) {
$nationID = $nation['nation']; $calcCnt = $nation['warpower'] + $nation['develpower'];
if (!\key_exists($nationID, $generalsCnt)) {
$generalsCnt[$nationID] = [
'nation' => $nationID,
'gennum' => $nation['gennum'],
'name' => $nation['name'],
'cnt' => 0,
];
$generalsCnt[$nationID]['cnt'] = 0;
}
if ($nation['npc'] <= 2) {
$calcCnt = $nation['cnt'];
} else {
$calcCnt = $nation['cnt'] / 2;
}
if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) { if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
$calcCnt *= 100; $calcCnt *= 100;
} }
$generalsCnt[$nationID]['cnt'] += $calcCnt; $generalsCnt[] = [$nation, (1 / $calcCnt)**3];
} }
$randVals = []; if ($generalsCnt) {
foreach ($generalsCnt as $testNation) { $destNation = Util::choiceRandomUsingWeightPair($generalsCnt);
$randVals[] = [$testNation, 1 / $testNation['cnt']];
}
if ($randVals) {
$destNation = Util::choiceRandomUsingWeightPair($randVals);
} }
} }
@@ -234,7 +227,7 @@ class che_랜덤임관 extends Command\GeneralCommand
if (!$destNation) { if (!$destNation) {
//임관 가능한 국가가 없다! //임관 가능한 국가가 없다!
$logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date</>"); $logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date</>");
$this->alternative = new che_요양($general, $this->env, null); $this->alternative = new che_인재탐색($general, $this->env, null);
return false; return false;
} }
@@ -292,6 +285,7 @@ class che_랜덤임관 extends Command\GeneralCommand
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
} }
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp); $general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
@@ -14,6 +14,8 @@ use \sammo\{
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use function sammo\tryRollbackInheritUniqueItem;
class che_모반시도 extends Command\GeneralCommand{ class che_모반시도 extends Command\GeneralCommand{
static protected $actionName = '모반시도'; static protected $actionName = '모반시도';
@@ -94,7 +96,9 @@ class che_모반시도 extends Command\GeneralCommand{
$lordLogger->pushGeneralHistoryLog("<D><b>{$generalName}</b></>의 모반으로 인해 <D><b>{$nationName}</b></>의 군주자리를 박탈당함"); $lordLogger->pushGeneralHistoryLog("<D><b>{$generalName}</b></>의 모반으로 인해 <D><b>{$nationName}</b></>의 군주자리를 박탈당함");
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->increaseInheritancePoint('active_action', 1);
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
$lordGeneral->applyDB($db); $lordGeneral->applyDB($db);
+3 -2
View File
@@ -15,7 +15,7 @@ use \sammo\Constraint\ConstraintHelper;
use sammo\CityConst; use sammo\CityConst;
use function sammo\DeleteConflict; use function sammo\DeleteConflict;
use function sammo\refreshNationStaticInfo; use function sammo\refreshNationStaticInfo;
use function sammo\tryRollbackInheritUniqueItem;
class che_방랑 extends Command\GeneralCommand{ class che_방랑 extends Command\GeneralCommand{
static protected $actionName = '방랑'; static protected $actionName = '방랑';
@@ -121,8 +121,9 @@ class che_방랑 extends Command\GeneralCommand{
], 'me=%i OR you=%i', $nationID, $nationID); ], 'me=%i OR you=%i', $nationID, $nationID);
refreshNationStaticInfo(); refreshNationStaticInfo();
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+3
View File
@@ -20,6 +20,7 @@ use function\sammo\tryUniqueItemLottery;
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use function sammo\tryRollbackInheritUniqueItem;
class che_선양 extends Command\GeneralCommand class che_선양 extends Command\GeneralCommand
{ {
@@ -134,8 +135,10 @@ class che_선양 extends Command\GeneralCommand
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 <Y>{$destGeneralName}</>에게 선양"); $logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 <Y>{$destGeneralName}</>에게 선양");
$destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 물려 받음"); $destLogger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>의 군주자리를 물려 받음");
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
$destGeneral->applyDB($db); $destGeneral->applyDB($db);
@@ -13,6 +13,8 @@ use \sammo\{
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use function sammo\tryRollbackInheritUniqueItem;
class che_소집해제 extends Command\GeneralCommand{ class che_소집해제 extends Command\GeneralCommand{
static protected $actionName = '소집해제'; static protected $actionName = '소집해제';
@@ -80,6 +82,7 @@ class che_소집해제 extends Command\GeneralCommand{
$general->addDedication($ded); $general->addDedication($ded);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+2 -1
View File
@@ -13,7 +13,7 @@ use \sammo\{
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use function sammo\tryRollbackInheritUniqueItem;
class che_요양 extends Command\GeneralCommand{ class che_요양 extends Command\GeneralCommand{
static protected $actionName = '요양'; static protected $actionName = '요양';
@@ -71,6 +71,7 @@ class che_요양 extends Command\GeneralCommand{
$general->addDedication($ded); $general->addDedication($ded);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
@@ -210,6 +210,7 @@ class che_인재탐색 extends Command\GeneralCommand
$exp = 200; $exp = 200;
$ded = 300; $ded = 300;
$general->increaseInheritancePoint('active_action', Util::valueFit(sqrt(1 / $foundProp), 1));
$general->increaseVarWithLimit('gold', -$reqGold, 0); $general->increaseVarWithLimit('gold', -$reqGold, 0);
$general->increaseVarWithLimit('rice', -$reqRice, 0); $general->increaseVarWithLimit('rice', -$reqRice, 0);
$general->addExperience($exp); $general->addExperience($exp);
+1
View File
@@ -171,6 +171,7 @@ class che_임관 extends Command\GeneralCommand{
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
} }
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp); $general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
@@ -89,7 +89,7 @@ class che_장비매매 extends Command\GeneralCommand{
else if($itemCode == $general->getVar($itemType)){ else if($itemCode == $general->getVar($itemType)){
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 가지고 있습니다.'); $this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 가지고 있습니다.');
} }
else if($itemType != 'item' && !buildItemClass($general->getVar($itemType))->isBuyable()){ else if(!buildItemClass($general->getVar($itemType))->isBuyable()){
$this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 진귀한 것을 가지고 있습니다.'); $this->fullConditionConstraints[] = ConstraintHelper::AlwaysFail('이미 진귀한 것을 가지고 있습니다.');
} }
} }
@@ -176,6 +176,7 @@ class che_장수대상임관 extends Command\GeneralCommand{
$general->setAuxVar('joinedNations', $joinedNations); $general->setAuxVar('joinedNations', $joinedNations);
} }
$general->increaseInheritancePoint('active_action', 1);
$general->addExperience($exp); $general->addExperience($exp);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
+3
View File
@@ -15,6 +15,7 @@ use \sammo\Json;
use function \sammo\searchDistance; use function \sammo\searchDistance;
use function \sammo\printCitiesBasedOnDistance; use function \sammo\printCitiesBasedOnDistance;
use function sammo\tryRollbackInheritUniqueItem;
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
@@ -210,6 +211,7 @@ class che_첩보 extends Command\GeneralCommand
$ded = Util::randRangeInt(1, 70); $ded = Util::randRangeInt(1, 70);
[$reqGold, $reqRice] = $this->getCost(); [$reqGold, $reqRice] = $this->getCost();
$general->increaseInheritancePoint('active_action', 0.5);//NOTE: 첩보만 예외!
$general->increaseVarWithLimit('gold', -$reqGold, 0); $general->increaseVarWithLimit('gold', -$reqGold, 0);
$general->increaseVarWithLimit('rice', -$reqRice, 0); $general->increaseVarWithLimit('rice', -$reqRice, 0);
$general->addExperience($exp); $general->addExperience($exp);
@@ -217,6 +219,7 @@ class che_첩보 extends Command\GeneralCommand
$general->increaseVar('leadership_exp', 1); $general->increaseVar('leadership_exp', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+5 -1
View File
@@ -223,9 +223,13 @@ class che_출병 extends Command\GeneralCommand
$this->destCity['term'] = 3; $this->destCity['term'] = 3;
$general->addDex($general->getCrewTypeObj(), $general->getVar('crew') / 100); $general->addDex($general->getCrewTypeObj(), $general->getVar('crew') / 100);
if($general->getVar('crew') > 500 && $general->getVar('train') * $general->getVar('atmos') > 70 * 70){
//500명 이상, 모훈출, 모사출
$general->increaseInheritancePoint('active_action', 1);
}
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->applyDB($db); $general->applyDB($db);
processWar($general, $this->nation, $this->destCity); processWar($general, $this->nation, $this->destCity);
+6 -4
View File
@@ -31,10 +31,12 @@ class che_탈취 extends che_화계{
$commandName = $this->getName(); $commandName = $this->getName();
$db = DB::db(); $db = DB::db();
// 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 5) / 2 // 탈취 최대 800 * 8 * sqrt(1 + (year - startyear) / 4) / 2
$yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 5) / 2; $yearCoef = sqrt(1 + ($this->env['year'] - $this->env['startyear']) / 4) / 2;
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef; $commRatio = $destCity['comm'] / $destCity['comm_max'];
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef; $agriRatio = $destCity['agri'] / $destCity['agri_max'];
$gold = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $commRatio / 4);
$rice = Util::randRangeInt(GameConst::$sabotageDamageMin, GameConst::$sabotageDamageMax) * $destCity['level'] * $yearCoef * (0.25 + $agriRatio / 4);
if($destCity['supply']){ if($destCity['supply']){
[$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID); [$destNationGold, $destNationRice] = $db->queryFirstList('SELECT gold,rice FROM nation WHERE nation=%i', $destNationID);
+3 -1
View File
@@ -14,7 +14,7 @@ use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
use sammo\CityConst; use sammo\CityConst;
use function sammo\tryRollbackInheritUniqueItem;
class che_하야 extends Command\GeneralCommand{ class che_하야 extends Command\GeneralCommand{
static protected $actionName = '하야'; static protected $actionName = '하야';
@@ -101,9 +101,11 @@ class che_하야 extends Command\GeneralCommand{
$general->setVar('officer_city', 0); $general->setVar('officer_city', 0);
$general->setVar('belong', 0); $general->setVar('belong', 0);
$general->setVar('makelimit', 12); $general->setVar('makelimit', 12);
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+2 -3
View File
@@ -16,8 +16,7 @@ use \sammo\Constraint\ConstraintHelper;
use sammo\CityConst; use sammo\CityConst;
use function sammo\refreshNationStaticInfo; use function sammo\refreshNationStaticInfo;
use function sammo\deleteNation; use function sammo\deleteNation;
use function sammo\tryRollbackInheritUniqueItem;
class che_해산 extends Command\GeneralCommand{ class che_해산 extends Command\GeneralCommand{
static protected $actionName = '해산'; static protected $actionName = '해산';
@@ -96,7 +95,7 @@ class che_해산 extends Command\GeneralCommand{
$oldGeneral->setVar('makelimit', 12); $oldGeneral->setVar('makelimit', 12);
$oldGeneral->applyDB($db); $oldGeneral->applyDB($db);
} }
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+3
View File
@@ -14,6 +14,7 @@ use \sammo\Command;
use function \sammo\searchDistance; use function \sammo\searchDistance;
use function \sammo\printCitiesBasedOnDistance; use function \sammo\printCitiesBasedOnDistance;
use function sammo\tryRollbackInheritUniqueItem;
use \sammo\Constraint\Constraint; use \sammo\Constraint\Constraint;
use \sammo\Constraint\ConstraintHelper; use \sammo\Constraint\ConstraintHelper;
@@ -294,6 +295,7 @@ class che_화계 extends Command\GeneralCommand
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return false; return false;
} }
@@ -327,6 +329,7 @@ class che_화계 extends Command\GeneralCommand
$general->increaseRankVar('firenum', 1); $general->increaseRankVar('firenum', 1);
$this->setResultTurn(new LastTurn(static::getName(), $this->arg)); $this->setResultTurn(new LastTurn(static::getName(), $this->arg));
$general->checkStatChange(); $general->checkStatChange();
tryRollbackInheritUniqueItem($general);
$general->applyDB($db); $general->applyDB($db);
return true; return true;
+3 -1
View File
@@ -7,6 +7,8 @@ use \sammo\JosaUtil;
use \sammo\LastTurn; use \sammo\LastTurn;
use \sammo\DB; use \sammo\DB;
use function sammo\tryRollbackInheritUniqueItem;
class 휴식 extends Command\GeneralCommand{ class 휴식 extends Command\GeneralCommand{
static protected $actionName = '휴식'; static protected $actionName = '휴식';
@@ -39,7 +41,7 @@ class 휴식 extends Command\GeneralCommand{
$logger->pushGeneralActionLog("아무것도 실행하지 않았습니다. <1>$date</>"); $logger->pushGeneralActionLog("아무것도 실행하지 않았습니다. <1>$date</>");
$this->setResultTurn(new LastTurn()); $this->setResultTurn(new LastTurn());
tryRollbackInheritUniqueItem($general);
$general->applyDB(DB::db()); $general->applyDB(DB::db());
return true; return true;
} }
+1
View File
@@ -199,6 +199,7 @@ class che_감축 extends Command\NationCommand{
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다."); $logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
$logger->pushGlobalHistoryLog("<M><b>【감축】</b></><D><b>{$nationName}</b></>{$josaYiNation} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다."); $logger->pushGlobalHistoryLog("<M><b>【감축】</b></><D><b>{$nationName}</b></>{$josaYiNation} <G><b>{$destCityName}</b></>{$josaUl} <M>감축</>하였습니다.");
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
$general->applyDB($db); $general->applyDB($db);
@@ -146,6 +146,7 @@ class che_국기변경 extends Command\NationCommand
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다"); $logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다");
$logger->pushGlobalHistoryLog("<S><b>【국기변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다."); $logger->pushGlobalHistoryLog("<S><b>【국기변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} <span style='color:{$color};'><b>국기</b></span>를 변경하였습니다.");
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
$general->applyDB($db); $general->applyDB($db);
return true; return true;
@@ -152,6 +152,7 @@ class che_국호변경 extends Command\NationCommand
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다."); $logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
$logger->pushGlobalHistoryLog("<S><b>【국호변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다."); $logger->pushGlobalHistoryLog("<S><b>【국호변경】</b></><D><b>{$nationName}</b></>{$josaYiNation} 국호를 <D><b>{$newNationName}</b></>{$josaRo} 변경합니다.");
$general->increaseInheritancePoint('active_action', 1);
$this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0)); $this->setResultTurn(new LastTurn($this->getName(), $this->arg, 0));
$general->applyDB($db); $general->applyDB($db);
return true; return true;
@@ -218,7 +218,7 @@ class che_물자원조 extends Command\NationCommand{
} }
$josaRoSrc = JosaUtil::pick($nationName, '로'); $josaRoSrc = JosaUtil::pick($nationName, '로');
$destNationLogger = new ActionLogger(0, $destChiefID, $year, $month); $destNationLogger = new ActionLogger(0, $destNationID, $year, $month);
$destNationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$riceAmountText}</>을 지원 받음"); $destNationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaRoSrc}부터 금<C>{$goldAmountText}</> 쌀<C>{$riceAmountText}</>을 지원 받음");
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env'); $destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
+1
View File
@@ -162,6 +162,7 @@ class che_증축 extends Command\NationCommand{
$general->addExperience(5 * ($this->getPreReqTurn() + 1)); $general->addExperience(5 * ($this->getPreReqTurn() + 1));
$general->addDedication(5 * ($this->getPreReqTurn() + 1)); $general->addDedication(5 * ($this->getPreReqTurn() + 1));
$general->increaseInheritancePoint('active_action', 1);
$josaUl = JosaUtil::pick($destCityName, '을'); $josaUl = JosaUtil::pick($destCityName, '을');
$josaYi = JosaUtil::pick($generalName, '이'); $josaYi = JosaUtil::pick($generalName, '이');
+1
View File
@@ -218,6 +218,7 @@ class che_천도 extends Command\NationCommand
'capset' => $db->sqleval('capset + 1'), 'capset' => $db->sqleval('capset + 1'),
], 'nation=%i', $nationID); ], 'nation=%i', $nationID);
$general->increaseInheritancePoint('active_action', 1);
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaRo} 천도했습니다. <1>$date</>"); $logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaRo} 천도했습니다. <1>$date</>");
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaRo} <M>천도</>명령"); $logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaRo} <M>천도</>명령");
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaRo} <M>천도</> 명령"); $logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaRo} <M>천도</> 명령");
@@ -184,6 +184,7 @@ class che_초토화 extends Command\NationCommand{
\sammo\refreshNationStaticInfo(); \sammo\refreshNationStaticInfo();
\sammo\SetNationFront($nationID); \sammo\SetNationFront($nationID);
$general->increaseInheritancePoint('active_action', 1);
$logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 초토화했습니다. <1>$date</>"); $logger->pushGeneralActionLog("<G><b>{$destCityName}</b></>{$josaUl} 초토화했습니다. <1>$date</>");
$logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령"); $logger->pushGeneralHistoryLog("<G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
$logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령"); $logger->pushNationalHistoryLog("<Y>{$generalName}</>{$josaYi} <G><b>{$destCityName}</b></>{$josaUl} <M>초토화</> 명령");
@@ -33,6 +33,9 @@ class che_피장파장 extends Command\NationCommand{
if(!key_exists('destNationID', $this->arg)){ if(!key_exists('destNationID', $this->arg)){
return false; return false;
} }
if(!key_exists('commandType', $this->arg)){
return false;
}
$destNationID = $this->arg['destNationID']; $destNationID = $this->arg['destNationID'];
$commandType = $this->arg['commandType']; $commandType = $this->arg['commandType'];
@@ -129,6 +132,7 @@ class che_피장파장 extends Command\NationCommand{
$nextTerm = Util::round(sqrt($genCount*2)*10); $nextTerm = Util::round(sqrt($genCount*2)*10);
$nextTerm = $this->generalObj->onCalcStrategic($this->getName(), 'delay', $nextTerm); $nextTerm = $this->generalObj->onCalcStrategic($this->getName(), 'delay', $nextTerm);
$nextTerm = Util::valueFit($nextTerm, Util::round(static::$delayCnt * 1.2));
return $nextTerm; return $nextTerm;
} }
+16
View File
@@ -42,6 +42,22 @@ class DummyGeneral extends General{
return $value; return $value;
} }
public function getInheritancePoint(string $key, &$aux = null, bool $forceCalc = false){
return 0;
}
public function setInheritancePoint(string $key, $value, $aux = null){
return;
}
public function increaseInheritancePoint(string $key, $value, $aux = null){
return;
}
public function mergeTotalInheritancePoint(){
return;
}
function applyDB($db):bool{ function applyDB($db):bool{
if($this->logger){ if($this->logger){
$this->initLogger(1, 1); $this->initLogger(1, 1);
+15 -3
View File
@@ -9,9 +9,11 @@ use function sammo\pickGeneralFromPool;
//기존 event_3.php //기존 event_3.php
class CreateManyNPC extends \sammo\Event\Action{ class CreateManyNPC extends \sammo\Event\Action{
protected $npcCount; protected $npcCount;
protected $fillCnt;
protected $avgGen; protected $avgGen;
public function __construct($npcCount = 10){ public function __construct($npcCount = 10, $fillCnt = 0){
$this->npcCount = $npcCount; $this->npcCount = $npcCount;
$this->fillCnt = $fillCnt;
} }
protected function generateNPC($env, int $cnt){ protected function generateNPC($env, int $cnt){
@@ -44,10 +46,20 @@ class CreateManyNPC extends \sammo\Event\Action{
public function run(array $env){ public function run(array $env){
if($this->npcCount <= 0){ if($this->npcCount <= 0 && $this->fillCnt <= 0){
return [__CLASS__, []]; return [__CLASS__, []];
} }
$result = $this->generateNPC($env, $this->npcCount);
$moreGenCnt = 0;
if($this->fillCnt){
$db = DB::db();
$nations = $db->queryFirstColumn('SELECT nation FROM general WHERE npc < 2 AND officer_level = 12');
$regGens = $db->queryFirstField('SELECT count(*) FROM general WHERE nation IN %li AND npc < 4', $nations);
$moreGenCnt = count($nations) * $this->fillCnt - $regGens;
}
$result = $this->generateNPC($env, $this->npcCount + $moreGenCnt);
$logger = new \sammo\ActionLogger(0, 0, $env['year'], $env['month']); $logger = new \sammo\ActionLogger(0, 0, $env['year'], $env['month']);
$genCnt = count($result); $genCnt = count($result);
+10 -3
View File
@@ -195,14 +195,21 @@ class GameConstBase
'che_은둔', 'None' 'che_은둔', 'None'
]; ];
public static $inheritBornSpecialPoint = 12000; public static $maxUniqueItemLimit = [
[-1, 1],
[3, 2],
[10, 3],
[20, 4]
];
public static $inheritBornSpecialPoint = 6000;
public static $inheritBornTurntimePoint = 3000; public static $inheritBornTurntimePoint = 3000;
public static $inheritBornCityPoint = 1000; public static $inheritBornCityPoint = 1000;
public static $inheritBornStatPoint = 1000; public static $inheritBornStatPoint = 1000;
public static $inheritItemUniqueMinPoint = 5000; public static $inheritItemUniqueMinPoint = 5000;
public static $inheritItemRandomPoint = 3000; public static $inheritItemRandomPoint = 3000;
public static $inheritBuffPoints = [0, 250, 750, 1500, 2500, 3750]; public static $inheritBuffPoints = [0, 200, 600, 1200, 2000, 3000];
public static $inheritSpecificSpecialPoint = 5000; public static $inheritSpecificSpecialPoint = 4000;
public static $inheritResetAttrPointBase = [1000, 1000, 2000, 3000];//필요하면 늘려서 쓰기 public static $inheritResetAttrPointBase = [1000, 1000, 2000, 3000];//필요하면 늘려서 쓰기
public static $allItems = [ public static $allItems = [
+209 -100
View File
@@ -5,7 +5,8 @@ namespace sammo;
use sammo\Command\GeneralCommand; use sammo\Command\GeneralCommand;
use sammo\WarUnitTrigger as WarUnitTrigger; use sammo\WarUnitTrigger as WarUnitTrigger;
class General implements iAction{ class General implements iAction
{
use LazyVarUpdater; use LazyVarUpdater;
protected $raw = []; protected $raw = [];
@@ -57,7 +58,8 @@ class General implements iAction{
'lived_month' => [true, 1, '생존'], 'lived_month' => [true, 1, '생존'],
'max_belong' => [false, 10, '최대 임관년 수'], 'max_belong' => [false, 10, '최대 임관년 수'],
'max_domestic_critical' => [true, 1, '최대 연속 내정 성공'], 'max_domestic_critical' => [true, 1, '최대 연속 내정 성공'],
'snipe_combat'=>[true, 10, '병종 상성 우위 횟수'], 'active_action' => [true, 3, '능동 행동 수'],
//'snipe_combat' => [true, 10, '병종 상성 우위 횟수'],
'combat' => [['rank', 'warnum'], 5, '전투 횟수'], 'combat' => [['rank', 'warnum'], 5, '전투 횟수'],
'sabotage' => [['rank', 'firenum'], 20, '계략 성공 횟수'], 'sabotage' => [['rank', 'firenum'], 20, '계략 성공 횟수'],
'unifier' => [true, 1, '천통 기여'], 'unifier' => [true, 1, '천통 기여'],
@@ -98,7 +100,8 @@ class General implements iAction{
* @param int|null $month 게임 * @param int|null $month 게임
* @param bool $fullConstruct iAction, ActionLogger 초기화 여부, false인 경우 no, name, city, nation, officer_level 정도로 초기화 가능 * @param bool $fullConstruct iAction, ActionLogger 초기화 여부, false인 경우 no, name, city, nation, officer_level 정도로 초기화 가능
*/ */
public function __construct(array $raw, ?array $rawRank, ?array $city, ?array $nation, ?int $year, ?int $month, bool $fullConstruct=true){ public function __construct(array $raw, ?array $rawRank, ?array $city, ?array $nation, ?int $year, ?int $month, bool $fullConstruct = true)
{
//TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함. //TODO: 밖에서 가져오도록 하면 버그 확률이 높아짐. 필요한 raw 값을 직접 구해야함.
if ($nation === null) { if ($nation === null) {
@@ -147,7 +150,8 @@ class General implements iAction{
} }
} }
function initLogger(int $year, int $month){ function initLogger(int $year, int $month)
{
$this->logger = new ActionLogger( $this->logger = new ActionLogger(
$this->getVar('no'), $this->getVar('no'),
$this->getVar('nation'), $this->getVar('nation'),
@@ -157,16 +161,26 @@ class General implements iAction{
); );
} }
function getTurnTime(int $short=self::TURNTIME_FULL_MS){ function getTurnTime(int $short = self::TURNTIME_FULL_MS)
{
return [ return [
self::TURNTIME_FULL_MS=>function($turntime){return $turntime;}, self::TURNTIME_FULL_MS => function ($turntime) {
self::TURNTIME_FULL=>function($turntime){return substr($turntime, 0, 19);}, return $turntime;
self::TURNTIME_HMS=>function($turntime){return substr($turntime, 11, 8);}, },
self::TURNTIME_HM=>function($turntime){return substr($turntime, 11, 5);}, self::TURNTIME_FULL => function ($turntime) {
return substr($turntime, 0, 19);
},
self::TURNTIME_HMS => function ($turntime) {
return substr($turntime, 11, 8);
},
self::TURNTIME_HM => function ($turntime) {
return substr($turntime, 11, 5);
},
][$short]($this->getVar('turntime')); ][$short]($this->getVar('turntime'));
} }
function setItem(string $itemKey='item', ?string $itemCode){ function setItem(string $itemKey = 'item', ?string $itemCode)
{
if ($itemCode === null) { if ($itemCode === null) {
$this->deleteItem($itemKey); $this->deleteItem($itemKey);
} }
@@ -175,49 +189,60 @@ class General implements iAction{
$this->itemObjs[$itemKey] = buildItemClass($itemCode); $this->itemObjs[$itemKey] = buildItemClass($itemCode);
} }
function deleteItem(string $itemKey='item'){ function deleteItem(string $itemKey = 'item')
{
$this->setVar($itemKey, 'None'); $this->setVar($itemKey, 'None');
$this->itemObjs[$itemKey] = new ActionItem\None(); $this->itemObjs[$itemKey] = new ActionItem\None();
} }
function getItem(string $itemKey='item'):BaseItem{ function getItem(string $itemKey = 'item'): BaseItem
{
return $this->itemObjs[$itemKey]; return $this->itemObjs[$itemKey];
} }
function getNPCType():int{ function getNPCType(): int
{
return $this->raw['npc']; return $this->raw['npc'];
} }
/** @return BaseItem[] */ /** @return BaseItem[] */
function getItems():array{ function getItems(): array
{
return $this->itemObjs; return $this->itemObjs;
} }
function getPersonality():iAction{ function getPersonality(): iAction
{
return $this->personalityObj; return $this->personalityObj;
} }
function getSpecialDomestic():iAction{ function getSpecialDomestic(): iAction
{
return $this->specialDomesticObj; return $this->specialDomesticObj;
} }
function getSpecialWar():iAction{ function getSpecialWar(): iAction
{
return $this->specialWarObj; return $this->specialWarObj;
} }
function getLastTurn():LastTurn{ function getLastTurn(): LastTurn
{
return $this->lastTurn; return $this->lastTurn;
} }
function _setResultTurn(LastTurn $resultTurn){ function _setResultTurn(LastTurn $resultTurn)
{
$this->resultTurn = $resultTurn; $this->resultTurn = $resultTurn;
} }
function getResultTurn():LastTurn{ function getResultTurn(): LastTurn
{
return $this->resultTurn; return $this->resultTurn;
} }
function clearActivatedSkill(){ function clearActivatedSkill()
{
foreach ($this->activatedSkill as $skillName => $state) { foreach ($this->activatedSkill as $skillName => $state) {
if (!$state) { if (!$state) {
continue; continue;
@@ -232,72 +257,88 @@ class General implements iAction{
$this->activatedSkill = []; $this->activatedSkill = [];
} }
function getActivatedSkillLog():array{ function getActivatedSkillLog(): array
{
return $this->logActivatedSkill; return $this->logActivatedSkill;
} }
function hasActivatedSkill(string $skillName):bool{ function hasActivatedSkill(string $skillName): bool
{
return $this->activatedSkill[$skillName] ?? false; return $this->activatedSkill[$skillName] ?? false;
} }
function activateSkill(... $skillNames){ function activateSkill(...$skillNames)
{
foreach ($skillNames as $skillName) { foreach ($skillNames as $skillName) {
$this->activatedSkill[$skillName] = true; $this->activatedSkill[$skillName] = true;
} }
} }
function deactivateSkill(... $skillNames){ function deactivateSkill(...$skillNames)
{
foreach ($skillNames as $skillName) { foreach ($skillNames as $skillName) {
$this->activatedSkill[$skillName] = false; $this->activatedSkill[$skillName] = false;
} }
} }
function getName():string{ function getName(): string
{
return $this->raw['name']; return $this->raw['name'];
} }
function getInfo():string{ function getInfo(): string
{
//iAction용 info로는 적절하지 않음 //iAction용 info로는 적절하지 않음
return ''; return '';
} }
function getID():int{ function getID(): int
{
return $this->raw['no']; return $this->raw['no'];
} }
function getRawCity():?array{ function getRawCity(): ?array
{
return $this->rawCity; return $this->rawCity;
} }
function setRawCity(?array $city){ function setRawCity(?array $city)
{
$this->rawCity = $city; $this->rawCity = $city;
} }
function getCityID():int{ function getCityID(): int
{
return $this->raw['city']; return $this->raw['city'];
} }
function getNationID():int{ function getNationID(): int
{
return $this->raw['nation']; return $this->raw['nation'];
} }
function getStaticNation():array{ function getStaticNation(): array
{
return getNationStaticInfo($this->raw['nation']); return getNationStaticInfo($this->raw['nation']);
} }
function getLogger():?ActionLogger{ function getLogger(): ?ActionLogger
{
return $this->logger; return $this->logger;
} }
public function getNationTypeObj():iAction{ public function getNationTypeObj(): iAction
{
return $this->nationType; return $this->nationType;
} }
public function getOfficerLevelObj():iAction{ public function getOfficerLevelObj(): iAction
{
return $this->officerLevelObj; return $this->officerLevelObj;
} }
function getCrewTypeObj():GameUnitDetail{ function getCrewTypeObj(): GameUnitDetail
{
$crewType = GameUnitConst::byID($this->getVar('crewtype')); $crewType = GameUnitConst::byID($this->getVar('crewtype'));
if ($crewType === null) { if ($crewType === null) {
throw new \InvalidArgumentException('Invalid CrewType:' . $this->getVar('crewtype')); throw new \InvalidArgumentException('Invalid CrewType:' . $this->getVar('crewtype'));
@@ -305,7 +346,8 @@ class General implements iAction{
return $crewType; return $crewType;
} }
function calcRecentWarTurn(int $turnTerm):int{ function calcRecentWarTurn(int $turnTerm): int
{
$cacheKey = "recent_war_turn_{$turnTerm}"; $cacheKey = "recent_war_turn_{$turnTerm}";
if (key_exists($cacheKey, $this->calcCache)) { if (key_exists($cacheKey, $this->calcCache)) {
return $this->calcCache[$cacheKey]; return $this->calcCache[$cacheKey];
@@ -329,7 +371,8 @@ class General implements iAction{
return $result; return $result;
} }
function getReservedTurn(int $turnIdx, array $env):GeneralCommand{ function getReservedTurn(int $turnIdx, array $env): GeneralCommand
{
$db = DB::db(); $db = DB::db();
$rawCmd = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND turn_idx = %i', $this->getID(), $turnIdx); $rawCmd = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND turn_idx = %i', $this->getID(), $turnIdx);
if (!$rawCmd) { if (!$rawCmd) {
@@ -345,7 +388,8 @@ class General implements iAction{
* @param array $env * @param array $env
* @return GeneralCommand[] * @return GeneralCommand[]
*/ */
public function getReservedTurnList(int $turnIdxFrom, int $turnIdxTo, array $env){ public function getReservedTurnList(int $turnIdxFrom, int $turnIdxTo, array $env)
{
if ($turnIdxFrom < 0 || $turnIdxFrom >= GameConst::$maxTurn) { if ($turnIdxFrom < 0 || $turnIdxFrom >= GameConst::$maxTurn) {
throw new \OutOfRangeException('$turnIdxFrom 범위 초과' . $turnIdxFrom); throw new \OutOfRangeException('$turnIdxFrom 범위 초과' . $turnIdxFrom);
} }
@@ -388,7 +432,8 @@ class General implements iAction{
* @return int|float 계산된 능력치 * @return int|float 계산된 능력치
*/ */
protected function getStatValue(string $statName, $withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true):float{ protected function getStatValue(string $statName, $withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true): float
{
$cKey = "{$statName}_{$withInjury}_{$withIActionObj}_{$withStatAdjust}"; $cKey = "{$statName}_{$withInjury}_{$withIActionObj}_{$withStatAdjust}";
if (key_exists($cKey, $this->calcCache)) { if (key_exists($cKey, $this->calcCache)) {
$statValue = $this->calcCache[$cKey]; $statValue = $this->calcCache[$cKey];
@@ -407,8 +452,7 @@ class General implements iAction{
if ($withStatAdjust) { if ($withStatAdjust) {
if ($statName === 'strength') { if ($statName === 'strength') {
$statValue += Util::round($this->getStatValue('intel', $withInjury, $withIActionObj, false, false) / 4); $statValue += Util::round($this->getStatValue('intel', $withInjury, $withIActionObj, false, false) / 4);
} } else if ($statName === 'intel') {
else if($statName === 'intel'){
$statValue += Util::round($this->getStatValue('strength', $withInjury, $withIActionObj, false, false) / 4); $statValue += Util::round($this->getStatValue('strength', $withInjury, $withIActionObj, false, false) / 4);
} }
} }
@@ -443,19 +487,23 @@ class General implements iAction{
return $statValue; return $statValue;
} }
function getLeadership($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true):float{ function getLeadership($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true): float
{
return $this->getStatValue('leadership', $withInjury, $withIActionObj, $withStatAdjust, $useFloor); return $this->getStatValue('leadership', $withInjury, $withIActionObj, $withStatAdjust, $useFloor);
} }
function getStrength($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true):float{ function getStrength($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true): float
{
return $this->getStatValue('strength', $withInjury, $withIActionObj, $withStatAdjust, $useFloor); return $this->getStatValue('strength', $withInjury, $withIActionObj, $withStatAdjust, $useFloor);
} }
function getIntel($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true):float{ function getIntel($withInjury = true, $withIActionObj = true, $withStatAdjust = true, $useFloor = true): float
{
return $this->getStatValue('intel', $withInjury, $withIActionObj, $withStatAdjust, $useFloor); return $this->getStatValue('intel', $withInjury, $withIActionObj, $withStatAdjust, $useFloor);
} }
function getDex(GameUnitDetail $crewType){ function getDex(GameUnitDetail $crewType)
{
$armType = $crewType->armType; $armType = $crewType->armType;
if ($armType == GameUnitConst::T_CASTLE) { if ($armType == GameUnitConst::T_CASTLE) {
@@ -465,7 +513,8 @@ class General implements iAction{
return $this->getVar("dex{$armType}"); return $this->getVar("dex{$armType}");
} }
function addDex(GameUnitDetail $crewType, float $exp, bool $affectTrainAtmos=false){ function addDex(GameUnitDetail $crewType, float $exp, bool $affectTrainAtmos = false)
{
$armType = $crewType->armType; $armType = $crewType->armType;
if ($armType == GameUnitConst::T_CASTLE) { if ($armType == GameUnitConst::T_CASTLE) {
@@ -478,8 +527,7 @@ class General implements iAction{
if ($armType == GameUnitConst::T_WIZARD) { if ($armType == GameUnitConst::T_WIZARD) {
$exp *= 0.9; $exp *= 0.9;
} } else if ($armType == GameUnitConst::T_SIEGE) {
else if($armType == GameUnitConst::T_SIEGE) {
$exp *= 0.9; $exp *= 0.9;
} }
@@ -492,7 +540,8 @@ class General implements iAction{
$this->increaseVar($dexType, $exp); $this->increaseVar($dexType, $exp);
} }
function addExperience(float $experience, bool $affectTrigger=true){ function addExperience(float $experience, bool $affectTrigger = true)
{
if ($affectTrigger) { if ($affectTrigger) {
$experience = $this->onCalcStat($this, 'experience', $experience); $experience = $this->onCalcStat($this, 'experience', $experience);
} }
@@ -509,14 +558,13 @@ class General implements iAction{
$josaRo = JosaUtil::pick($nextExpLevel, '로'); $josaRo = JosaUtil::pick($nextExpLevel, '로');
if ($comp > 0) { if ($comp > 0) {
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <C>레벨업</>!", ActionLogger::PLAIN); $this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <C>레벨업</>!", ActionLogger::PLAIN);
} } else {
else{
$this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <R>레벨다운</>!", ActionLogger::PLAIN); $this->getLogger()->pushGeneralActionLog("<C>Lv {$nextExpLevel}</>{$josaRo} <R>레벨다운</>!", ActionLogger::PLAIN);
} }
} }
function addDedication(float $dedication, bool $affectTrigger=true){ function addDedication(float $dedication, bool $affectTrigger = true)
{
if ($affectTrigger) { if ($affectTrigger) {
$dedication = $this->onCalcStat($this, 'dedication', $dedication); $dedication = $this->onCalcStat($this, 'dedication', $dedication);
} }
@@ -536,14 +584,13 @@ class General implements iAction{
$josaRoBill = JosaUtil::pick($billText, '로'); $josaRoBill = JosaUtil::pick($billText, '로');
if ($comp > 0) { if ($comp > 0) {
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <C>승급</>하여 봉록이 <C>{$billText}</>{$josaRoBill} <C>상승</>했습니다!", ActionLogger::PLAIN); $this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <C>승급</>하여 봉록이 <C>{$billText}</>{$josaRoBill} <C>상승</>했습니다!", ActionLogger::PLAIN);
} } else {
else{
$this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <R>강등</>되어 봉록이 <C>{$billText}</>{$josaRoBill} <R>하락</>했습니다!", ActionLogger::PLAIN); $this->getLogger()->pushGeneralActionLog("<Y>{$dedLevelText}</>{$josaRoDed} <R>강등</>되어 봉록이 <C>{$billText}</>{$josaRoBill} <R>하락</>했습니다!", ActionLogger::PLAIN);
} }
} }
function updateVar(string $key, $value){ function updateVar(string $key, $value)
{
if (($this->raw[$key] ?? null) === $value) { if (($this->raw[$key] ?? null) === $value) {
return; return;
} }
@@ -557,13 +604,56 @@ class General implements iAction{
/** /**
* @param \MeekroDB $db * @param \MeekroDB $db
*/ */
function kill($db, bool $sendDyingMessage=true, ?string $dyingMessage=null){ function kill($db, bool $sendDyingMessage = true, ?string $dyingMessage = null)
{
$generalID = $this->getID(); $generalID = $this->getID();
$logger = $this->getLogger(); $logger = $this->getLogger();
$generalName = $this->getName(); $generalName = $this->getName();
//유산포인트 관련 항목 환불
if ($this->getNPCType() < 2) {
$refundPoint = 0;
$userID = $this->getVar('owner');
$userLogger = new UserLogger($userID);
if ($this->getAuxVar('inheritRandomUnique')) {
$this->setAuxVar('inheritRandomUnique', null);
$userLogger->push(sprintf("사망으로 랜덤 유니크 구입 %d 포인트 반환", GameConst::$inheritItemRandomPoint), "inheritPoint");
$refundPoint += GameConst::$inheritItemRandomPoint;
}
$itemTrials = $this->getAuxVar('inheritUniqueTrial') ?? [];
foreach (array_keys($itemTrials) as $itemKey) {
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
$ownTrial = $trialStor->getValue("u{$userID}");
$itemObj = buildItemClass($itemKey);
$itemName = $itemObj->getName();
if (!$ownTrial) {
continue;
}
[,, $amount] = $ownTrial;
$trialStor->deleteValue("u{$userID}");
$userLogger->push("사망으로 {$itemName} 입찰에 사용한 {$amount} 포인트 반환", "inheritPoint");
$refundPoint += $amount;
}
if($this->getAuxVar('inheritSpecificSpecialWar')){
$this->setAuxVar('inheritSpecificSpecialWar', null);
$userLogger->push(sprintf("사망으로 전투 특기 지정 %d 포인트 반환", GameConst::$inheritSpecificSpecialPoint), "inheritPoint");
$refundPoint += GameConst::$inheritSpecificSpecialPoint;
}
if ($refundPoint > 0) {
$this->increaseInheritancePoint('previous', $refundPoint);
}
$this->mergeTotalInheritancePoint(); $this->mergeTotalInheritancePoint();
}
// 군주였으면 유지 이음 // 군주였으면 유지 이음
$officerLevel = $this->getVar('officer_level'); $officerLevel = $this->getVar('officer_level');
@@ -588,8 +678,7 @@ class General implements iAction{
if ($sendDyingMessage) { if ($sendDyingMessage) {
if ($dyingMessage) { if ($dyingMessage) {
$logger->pushGlobalActionLog($dyingMessage); $logger->pushGlobalActionLog($dyingMessage);
} } else {
else{
$dyingMessageObj = new TextDecoration\DyingMessage($this); $dyingMessageObj = new TextDecoration\DyingMessage($this);
$logger->pushGlobalActionLog($dyingMessageObj->getText()); $logger->pushGlobalActionLog($dyingMessageObj->getText());
} }
@@ -613,7 +702,8 @@ class General implements iAction{
], 'nation=%i', $this->getVar('nation')); ], 'nation=%i', $this->getVar('nation'));
} }
function rebirth(){ function rebirth()
{
$logger = $this->getLogger(); $logger = $this->getLogger();
$generalName = $this->getName(); $generalName = $this->getName();
@@ -649,7 +739,8 @@ class General implements iAction{
$logger->pushGeneralHistoryLog('나이가 들어 은퇴하고, 자손에게 관직을 물려줌'); $logger->pushGeneralHistoryLog('나이가 들어 은퇴하고, 자손에게 관직을 물려줌');
} }
function increaseRankVar(string $key, int $value){ function increaseRankVar(string $key, int $value)
{
if (!key_exists($key, static::RANK_COLUMN)) { if (!key_exists($key, static::RANK_COLUMN)) {
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key); throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
} }
@@ -673,21 +764,22 @@ class General implements iAction{
$this->rankVarIncrease[$key] = $value; $this->rankVarIncrease[$key] = $value;
} }
function setRankVar(string $key, int $value){ function setRankVar(string $key, int $value)
{
if (!key_exists($key, static::RANK_COLUMN)) { if (!key_exists($key, static::RANK_COLUMN)) {
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key); throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
} }
if (key_exists($key, $this->rankVarRead)) { if (key_exists($key, $this->rankVarRead)) {
unset($this->rankVarRead[$key]); unset($this->rankVarRead[$key]);
} } else if (key_exists($key, $this->rankVarIncrease)) {
else if(key_exists($key, $this->rankVarIncrease)){
unset($this->rankVarIncrease[$key]); unset($this->rankVarIncrease[$key]);
} }
$this->rankVarSet[$key] = $value; $this->rankVarSet[$key] = $value;
} }
function getRankVar(string $key):int{ function getRankVar(string $key): int
{
if (!key_exists($key, static::RANK_COLUMN)) { if (!key_exists($key, static::RANK_COLUMN)) {
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key); throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
} }
@@ -706,7 +798,8 @@ class General implements iAction{
/** /**
* @param \MeekroDB $db * @param \MeekroDB $db
*/ */
function applyDB($db):bool{ function applyDB($db): bool
{
if ($this->lastTurn && $this->getLastTurn() != $this->getResultTurn()) { if ($this->lastTurn && $this->getLastTurn() != $this->getResultTurn()) {
$this->setVar('last_turn', $this->getResultTurn()->toJson()); $this->setVar('last_turn', $this->getResultTurn()->toJson());
} }
@@ -754,7 +847,8 @@ class General implements iAction{
return $result; return $result;
} }
function checkStatChange():bool{ function checkStatChange(): bool
{
$logger = $this->getLogger(); $logger = $this->getLogger();
$limit = GameConst::$upgradeLimit; $limit = GameConst::$upgradeLimit;
@@ -774,8 +868,7 @@ class General implements iAction{
$this->increaseVar($statExpName, $limit); $this->increaseVar($statExpName, $limit);
$this->increaseVar($statName, -1); $this->increaseVar($statName, -1);
$result = true; $result = true;
} } else if ($this->getVar($statExpName) >= $limit) {
else if($this->getVar($statExpName) >= $limit){
$logger->pushGeneralActionLog("<S>{$statNickName}</>이 <C>1</> 올랐습니다!", ActionLogger::PLAIN); $logger->pushGeneralActionLog("<S>{$statNickName}</>이 <C>1</> 올랐습니다!", ActionLogger::PLAIN);
$this->increaseVar($statExpName, -$limit); $this->increaseVar($statExpName, -$limit);
$this->increaseVar($statName, 1); $this->increaseVar($statName, 1);
@@ -786,7 +879,8 @@ class General implements iAction{
return $result; return $result;
} }
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{ public function getPreTurnExecuteTriggerList(General $general): ?GeneralTriggerCaller
{
$caller = new GeneralTriggerCaller(); $caller = new GeneralTriggerCaller();
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
@@ -807,7 +901,8 @@ class General implements iAction{
return $caller; return $caller;
} }
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{ public function onCalcDomestic(string $turnType, string $varType, float $value, $aux = null): float
{
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
$this->officerLevelObj, $this->officerLevelObj,
@@ -826,7 +921,8 @@ class General implements iAction{
return $value; return $value;
} }
public function onCalcStat(General $general, string $statName, $value, $aux=null){ public function onCalcStat(General $general, string $statName, $value, $aux = null)
{
//xxx: $general? //xxx: $general?
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
@@ -846,7 +942,8 @@ class General implements iAction{
return $value; return $value;
} }
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){ public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
{
//xxx: $general? //xxx: $general?
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
@@ -866,7 +963,8 @@ class General implements iAction{
return $value; return $value;
} }
public function onCalcStrategic(string $turnType, string $varType, $value){ public function onCalcStrategic(string $turnType, string $varType, $value)
{
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
$this->officerLevelObj, $this->officerLevelObj,
@@ -885,7 +983,8 @@ class General implements iAction{
return $value; return $value;
} }
public function onCalcNationalIncome(string $type, $amount){ public function onCalcNationalIncome(string $type, $amount)
{
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
$this->officerLevelObj, $this->officerLevelObj,
@@ -904,7 +1003,8 @@ class General implements iAction{
return $amount; return $amount;
} }
public function getWarPowerMultiplier(WarUnit $unit):array{ public function getWarPowerMultiplier(WarUnit $unit): array
{
//xxx:$unit //xxx:$unit
$att = 1; $att = 1;
$def = 1; $def = 1;
@@ -927,7 +1027,8 @@ class General implements iAction{
} }
return [$att, $def]; return [$att, $def];
} }
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
$caller = new WarUnitTriggerCaller(); $caller = new WarUnitTriggerCaller();
foreach (array_merge([ foreach (array_merge([
$this->nationType, $this->nationType,
@@ -947,7 +1048,8 @@ class General implements iAction{
return $caller; return $caller;
} }
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{ public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
{
$caller = new WarUnitTriggerCaller( $caller = new WarUnitTriggerCaller(
new WarUnitTrigger\che_필살시도($unit), new WarUnitTrigger\che_필살시도($unit),
new WarUnitTrigger\che_필살발동($unit), new WarUnitTrigger\che_필살발동($unit),
@@ -976,12 +1078,13 @@ class General implements iAction{
return $caller; return $caller;
} }
static public function mergeQueryColumn(?array $reqColumns=null, int $constructMode=2):array{ static public function mergeQueryColumn(?array $reqColumns = null, int $constructMode = 2): array
{
$minimumColumn = ['no', 'name', 'city', 'nation', 'officer_level', 'officer_city']; $minimumColumn = ['no', 'name', 'city', 'nation', 'officer_level', 'officer_city'];
$defaultEventColumn = [ $defaultEventColumn = [
'no', 'name', 'owner', 'city', 'nation', 'officer_level', 'officer_city', 'no', 'name', 'owner', 'city', 'nation', 'officer_level', 'officer_city',
'special', 'special2', 'personal', 'special', 'special2', 'personal',
'horse', 'weapon', 'book', 'item', 'last_turn' 'horse', 'weapon', 'book', 'item', 'last_turn', 'aux',
]; ];
$fullColumn = [ $fullColumn = [
'no', 'name', 'owner', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity', 'no', 'name', 'owner', 'owner_name', 'picture', 'imgsvr', 'nation', 'city', 'troop', 'injury', 'affinity',
@@ -1003,8 +1106,7 @@ class General implements iAction{
foreach ($reqColumns as $column) { foreach ($reqColumns as $column) {
if (key_exists($column, static::RANK_COLUMN)) { if (key_exists($column, static::RANK_COLUMN)) {
$rankColumn[] = $column; $rankColumn[] = $column;
} } else {
else{
$subColumn[] = $column; $subColumn[] = $column;
} }
} }
@@ -1023,7 +1125,8 @@ class General implements iAction{
* @return \sammo\General[] * @return \sammo\General[]
* @throws MustNotBeReachedException * @throws MustNotBeReachedException
*/ */
static public function createGeneralObjListFromDB(?array $generalIDList, ?array $column=null, int $constructMode=2):array{ static public function createGeneralObjListFromDB(?array $generalIDList, ?array $column = null, int $constructMode = 2): array
{
if ($generalIDList === []) { if ($generalIDList === []) {
return []; return [];
} }
@@ -1032,8 +1135,7 @@ class General implements iAction{
if ($constructMode > 0) { if ($constructMode > 0) {
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
} } else {
else{
$year = null; $year = null;
$month = null; $month = null;
} }
@@ -1046,8 +1148,7 @@ class General implements iAction{
'no' 'no'
); );
$generalIDList = array_keys($rawGenerals); $generalIDList = array_keys($rawGenerals);
} } else {
else{
$rawGenerals = Util::convertArrayToDict( $rawGenerals = Util::convertArrayToDict(
$db->query('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList), $db->query('SELECT %l FROM general WHERE no IN %li', Util::formatListOfBackticks($column), $generalIDList),
'no' 'no'
@@ -1085,13 +1186,13 @@ class General implements iAction{
return $result; return $result;
} }
static public function createGeneralObjFromDB(int $generalID, ?array $column=null, int $constructMode=2):self{ static public function createGeneralObjFromDB(int $generalID, ?array $column = null, int $constructMode = 2): self
{
$db = DB::db(); $db = DB::db();
if ($constructMode > 0) { if ($constructMode > 0) {
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']); [$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
} } else {
else{
$year = null; $year = null;
$month = null; $month = null;
} }
@@ -1123,7 +1224,8 @@ class General implements iAction{
* @param array $env * @param array $env
* @return GeneralCommand[] * @return GeneralCommand[]
*/ */
static public function getReservedTurnByGeneralList(array $generalList, int $turnIdx, array $env){ static public function getReservedTurnByGeneralList(array $generalList, int $turnIdx, array $env)
{
if (!$generalList) { if (!$generalList) {
return []; return [];
} }
@@ -1154,7 +1256,8 @@ class General implements iAction{
* @param array $env * @param array $env
* @return GeneralCommand[][] * @return GeneralCommand[][]
*/ */
static public function getReservedTurnListByGeneralList(array $generalList, int $turnIdxFrom, int $turnIdxTo, array $env){ static public function getReservedTurnListByGeneralList(array $generalList, int $turnIdxFrom, int $turnIdxTo, array $env)
{
//XXX: static인데 return값이 General이 아니라고?? GeneralCommandHelper같은게 있어야하지 않을까? //XXX: static인데 return값이 General이 아니라고?? GeneralCommandHelper같은게 있어야하지 않을까?
if (!$generalList) { if (!$generalList) {
return []; return [];
@@ -1205,7 +1308,8 @@ class General implements iAction{
/** /**
* @return int|float * @return int|float
*/ */
public function getInheritancePoint(string $key, &$aux=null, bool $forceCalc=false){ public function getInheritancePoint(string $key, &$aux = null, bool $forceCalc = false)
{
$inheritType = static::INHERITANCE_KEY[$key] ?? null; $inheritType = static::INHERITANCE_KEY[$key] ?? null;
if ($inheritType === null) { if ($inheritType === null) {
throw new \OutOfRangeException("{$key}는 유산 타입이 아님"); throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
@@ -1247,7 +1351,9 @@ class General implements iAction{
throw new \InvalidArgumentException("{$storeType}은 올바르지 않은 유산 키임"); throw new \InvalidArgumentException("{$storeType}은 올바르지 않은 유산 키임");
} }
$extractFn = function(){ return [0, null];}; $extractFn = function () {
return [0, null];
};
switch ($key) { switch ($key) {
case 'dex': case 'dex':
$extractFn = function () use ($multiplier) { $extractFn = function () use ($multiplier) {
@@ -1280,7 +1386,8 @@ class General implements iAction{
return $value; return $value;
} }
public function setInheritancePoint(string $key, $value, $aux=null){ public function setInheritancePoint(string $key, $value, $aux = null)
{
if (!is_int($value) && !is_float($value)) { if (!is_int($value) && !is_float($value)) {
throw new \InvalidArgumentException("{$value}는 숫자가 아님"); throw new \InvalidArgumentException("{$value}는 숫자가 아님");
} }
@@ -1315,7 +1422,8 @@ class General implements iAction{
$inheritStor->setValue($key, [$value, $aux]); $inheritStor->setValue($key, [$value, $aux]);
} }
public function increaseInheritancePoint(string $key, $value, $aux=null){ public function increaseInheritancePoint(string $key, $value, $aux = null)
{
if (!is_int($value) && !is_float($value)) { if (!is_int($value) && !is_float($value)) {
throw new \InvalidArgumentException("{$value}는 숫자가 아님"); throw new \InvalidArgumentException("{$value}는 숫자가 아님");
} }
@@ -1355,7 +1463,8 @@ class General implements iAction{
$inheritStor->setValue($key, [$newValue, $aux]); $inheritStor->setValue($key, [$newValue, $aux]);
} }
public function mergeTotalInheritancePoint(){ public function mergeTotalInheritancePoint()
{
$ownerID = $this->getVar('owner'); $ownerID = $this->getVar('owner');
if (!$ownerID) { if (!$ownerID) {
return; return;
+214 -174
View File
@@ -93,8 +93,7 @@ class GeneralAI
$city = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $general->getCityID()); $city = $db->queryFirstRow('SELECT * FROM city WHERE city = %i', $general->getCityID());
$general->setRawCity($city); $general->setRawCity($city);
$this->city = $city; $this->city = $city;
} } else {
else{
$this->city = $general->getRawCity(); $this->city = $general->getRawCity();
} }
@@ -117,19 +116,19 @@ class GeneralAI
$nationStor = KVStorage::getStorage($db, $this->nation['nation'], 'nation_env'); $nationStor = KVStorage::getStorage($db, $this->nation['nation'], 'nation_env');
$nationStor->cacheValues(['npc_nation_policy', 'npc_general_policy', 'prev_income_gold', 'prev_income_rice']); $nationStor->cacheValues(['npc_nation_policy', 'npc_general_policy', 'prev_income_gold', 'prev_income_rice']);
$this->nationPolicy = new AutorunNationPolicy($general, $this->env['autorun_user']['options'], $nationStor->getValue('npc_nation_policy'), $gameStor->getValue('npc_nation_policy'), $this->nation, $this->env); $this->nationPolicy = new AutorunNationPolicy($general, $this->env['autorun_user']['options']??null, $nationStor->getValue('npc_nation_policy'), $gameStor->getValue('npc_nation_policy'), $this->nation, $this->env);
$this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options'], $nationStor->getValue('npc_general_policy'), $gameStor->getValue('npc_general_policy'), $this->nation, $this->env); $this->generalPolicy = new AutorunGeneralPolicy($general, $this->env['autorun_user']['options']??null, $nationStor->getValue('npc_general_policy'), $gameStor->getValue('npc_general_policy'), $this->nation, $this->env);
$prevIncomeGold = $nationStor->prev_income_gold ?? 1000; $prevIncomeGold = $nationStor->prev_income_gold ?? 1000;
$prevIncomeRice = $nationStor->prev_income_rice ?? 1000; $prevIncomeRice = $nationStor->prev_income_rice ?? 1000;
$this->maxResourceActionAmount = Util::round(max( $this->maxResourceActionAmount = Util::valueFit(Util::round(max(
$this->nationPolicy->minimumResourceActionAmount, $this->nationPolicy->minimumResourceActionAmount,
$prevIncomeGold / 10, $prevIncomeGold / 10,
$prevIncomeRice / 10, $prevIncomeRice / 10,
$this->nation['gold'] / 5, $this->nation['gold'] / 5,
$this->nation['rice'] / 5, $this->nation['rice'] / 5,
($this->env['year'] - $this->env['startyear'] - 3) * 1000 ($this->env['year'] - $this->env['startyear'] - 3) * 1000
), -2); ), -2), null, $this->nationPolicy->maximumResourceActionAmount);
if ($this->maxResourceActionAmount > GameConst::$maxResourceActionAmount) { if ($this->maxResourceActionAmount > GameConst::$maxResourceActionAmount) {
$this->maxResourceActionAmount = GameConst::$maxResourceActionAmount; $this->maxResourceActionAmount = GameConst::$maxResourceActionAmount;
} }
@@ -184,7 +183,6 @@ class GeneralAI
$genType |= self::t통솔장; $genType |= self::t통솔장;
} }
return $genType; return $genType;
} }
protected function calcDiplomacyState() protected function calcDiplomacyState()
@@ -219,8 +217,7 @@ class GeneralAI
} else if ($warState == 1 && $warTerm < 5) { } else if ($warState == 1 && $warTerm < 5) {
$onWarReady += 1; $onWarReady += 1;
$warTargetNation[$warNationID] = 1; $warTargetNation[$warNationID] = 1;
} } else {
else{
$onWarYet += 1; $onWarYet += 1;
} }
} }
@@ -251,7 +248,8 @@ class GeneralAI
} }
} }
protected function calcWarRoute(){ protected function calcWarRoute()
{
if ($this->warRoute !== null) { if ($this->warRoute !== null) {
return; return;
} }
@@ -570,8 +568,7 @@ class GeneralAI
$generalID = $general->getID(); $generalID = $general->getID();
if ($turnList[$generalID] instanceof Command\General\che_징병) { if ($turnList[$generalID] instanceof Command\General\che_징병) {
return true; return true;
} } else {
else{
return false; return false;
} }
}); });
@@ -1222,7 +1219,7 @@ class GeneralAI
} }
$crewtype = $targetUserGeneral->getCrewTypeObj(); $crewtype = $targetUserGeneral->getCrewTypeObj();
$reqMoney = $crewtype->costWithTech($this->nation['tech'], $targetUserGeneral->getLeadership(false)) * 100 * 3 * 1.1; $reqMoney = $crewtype->costWithTech($this->nation['tech'], Util::toInt($targetUserGeneral->getLeadership(false))) * 100 * 3 * 1.1;
if ($this->env['year'] > $this->env['startyear'] + 3) { if ($this->env['year'] > $this->env['startyear'] + 3) {
$reqMoney = max($reqMoney, $reqHumanMinRes); $reqMoney = max($reqMoney, $reqHumanMinRes);
} }
@@ -1244,7 +1241,8 @@ class GeneralAI
$payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount); $payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount);
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetUserGeneral->getID(), 'destGeneralID' => $targetUserGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $payAmount 'amount' => $payAmount
@@ -1259,7 +1257,10 @@ class GeneralAI
} }
$cmd = buildNationCommandClass( $cmd = buildNationCommandClass(
'che_포상', $this->general, $this->env, $lastTurn, 'che_포상',
$this->general,
$this->env,
$lastTurn,
Util::choiceRandomUsingWeightPair($candidateArgs) Util::choiceRandomUsingWeightPair($candidateArgs)
); );
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
@@ -1315,20 +1316,18 @@ class GeneralAI
if (key_exists($targetUserGeneral->getID(), $this->userWarGenerals)) { if (key_exists($targetUserGeneral->getID(), $this->userWarGenerals)) {
$isWarGeneral = true; $isWarGeneral = true;
} } else {
else{
$isWarGeneral = false; $isWarGeneral = false;
} }
if ($isWarGeneral) { if ($isWarGeneral) {
$reqHumanMinRes = $reqHumanMinWarRes; $reqHumanMinRes = $reqHumanMinWarRes;
} } else {
else{
$reqHumanMinRes = $reqHumanMinDevelRes; $reqHumanMinRes = $reqHumanMinDevelRes;
} }
$crewtype = $targetUserGeneral->getCrewTypeObj(); $crewtype = $targetUserGeneral->getCrewTypeObj();
$reqMoney = $crewtype->costWithTech($this->nation['tech'], $targetUserGeneral->getLeadership(false)) * 100 * 6 * 1.1; $reqMoney = $crewtype->costWithTech($this->nation['tech'], Util::toInt($targetUserGeneral->getLeadership(false))) * 100 * 6 * 1.1;
if ($this->env['year'] > $this->env['startyear'] + 3) { if ($this->env['year'] > $this->env['startyear'] + 3) {
$reqMoney = max($reqMoney, $reqHumanMinRes); $reqMoney = max($reqMoney, $reqHumanMinRes);
} }
@@ -1351,7 +1350,8 @@ class GeneralAI
$payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount); $payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount);
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetUserGeneral->getID(), 'destGeneralID' => $targetUserGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $payAmount 'amount' => $payAmount
@@ -1366,7 +1366,10 @@ class GeneralAI
} }
$cmd = buildNationCommandClass( $cmd = buildNationCommandClass(
'che_포상', $this->general, $this->env, $lastTurn, 'che_포상',
$this->general,
$this->env,
$lastTurn,
Util::choiceRandomUsingWeightPair($candidateArgs) Util::choiceRandomUsingWeightPair($candidateArgs)
); );
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
@@ -1417,7 +1420,7 @@ class GeneralAI
} }
$crewtype = $targetNPCGeneral->getCrewTypeObj(); $crewtype = $targetNPCGeneral->getCrewTypeObj();
$reqMoney = $crewtype->costWithTech($this->nation['tech'], $targetNPCGeneral->getLeadership(false)) * 100 * 1.5; $reqMoney = $crewtype->costWithTech($this->nation['tech'], Util::toInt($targetNPCGeneral->getLeadership(false))) * 100 * 1.5;
if ($this->env['year'] > $this->env['startyear'] + 5) { if ($this->env['year'] > $this->env['startyear'] + 5) {
$reqMoney = max($reqMoney, $reqNPCMinWarRes); $reqMoney = max($reqMoney, $reqNPCMinWarRes);
} }
@@ -1440,7 +1443,8 @@ class GeneralAI
$payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount); $payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount);
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetNPCGeneral->getID(), 'destGeneralID' => $targetNPCGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $payAmount 'amount' => $payAmount
@@ -1455,7 +1459,10 @@ class GeneralAI
} }
$cmd = buildNationCommandClass( $cmd = buildNationCommandClass(
'che_포상', $this->general, $this->env, $lastTurn, 'che_포상',
$this->general,
$this->env,
$lastTurn,
Util::choiceRandomUsingWeightPair($candidateArgs) Util::choiceRandomUsingWeightPair($candidateArgs)
); );
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
@@ -1509,7 +1516,7 @@ class GeneralAI
} }
$crewtype = $targetNPCGeneral->getCrewTypeObj(); $crewtype = $targetNPCGeneral->getCrewTypeObj();
$reqMoney = $crewtype->costWithTech($nation['tech'], $targetNPCGeneral->getLeadership(false)) * 100 * 3 * 1.1; $reqMoney = $crewtype->costWithTech($nation['tech'], Util::toInt($targetNPCGeneral->getLeadership(false))) * 100 * 3 * 1.1;
if ($this->env['year'] > $this->env['startyear'] + 5) { if ($this->env['year'] > $this->env['startyear'] + 5) {
$reqMoney = max($reqMoney, $reqNPCMinWarRes); $reqMoney = max($reqMoney, $reqNPCMinWarRes);
} }
@@ -1526,7 +1533,8 @@ class GeneralAI
continue; continue;
} }
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetNPCGeneral->getID(), 'destGeneralID' => $targetNPCGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => Util::valueFit($payAmount, 100, $this->maxResourceActionAmount) 'amount' => Util::valueFit($payAmount, 100, $this->maxResourceActionAmount)
@@ -1556,7 +1564,8 @@ class GeneralAI
$payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount); $payAmount = Util::valueFit($payAmount, 100, $this->maxResourceActionAmount);
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetNPCGeneral->getID(), 'destGeneralID' => $targetNPCGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $payAmount 'amount' => $payAmount
@@ -1564,7 +1573,6 @@ class GeneralAI
max(count($npcWarGenerals), count($npcCivilGenerals)) - $idx max(count($npcWarGenerals), count($npcCivilGenerals)) - $idx
]; ];
} }
} }
if (!$candidateArgs) { if (!$candidateArgs) {
@@ -1572,7 +1580,10 @@ class GeneralAI
} }
$cmd = buildNationCommandClass( $cmd = buildNationCommandClass(
'che_포상', $this->general, $this->env, $lastTurn, 'che_포상',
$this->general,
$this->env,
$lastTurn,
Util::choiceRandomUsingWeightPair($candidateArgs) Util::choiceRandomUsingWeightPair($candidateArgs)
); );
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
@@ -1626,7 +1637,8 @@ class GeneralAI
break; break;
} }
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetNPCGeneral->getID(), 'destGeneralID' => $targetNPCGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $takeAmount 'amount' => $takeAmount
@@ -1644,8 +1656,7 @@ class GeneralAI
if ($resVal >= $reqNationResVal) { if ($resVal >= $reqNationResVal) {
$willTakeSmallAmount = true; $willTakeSmallAmount = true;
} } else {
else{
$willTakeSmallAmount = false; $willTakeSmallAmount = false;
} }
@@ -1661,17 +1672,14 @@ class GeneralAI
if ($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes * 2) { if ($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes * 2) {
break; break;
} }
} else if ($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes) {
}
else if($targetNPCGeneral->getVar($resName) <= $reqNPCMinWarRes){
break; break;
} }
if (!$willTakeSmallAmount) { if (!$willTakeSmallAmount) {
$takeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes; $takeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes;
$takeAmount = Util::valueFit(sqrt($takeAmount * $reqResValDelta), 0, $takeAmount); $takeAmount = Util::valueFit(sqrt($takeAmount * $reqResValDelta), 0, $takeAmount);
} } else {
else{
$maxTakeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes; $maxTakeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes;
$minTakeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes * 2; $minTakeAmount = $targetNPCGeneral->getVar($resName) - $reqNPCMinWarRes * 2;
$takeAmount = Util::valueFit(sqrt($minTakeAmount * $reqResValDelta), 0, $maxTakeAmount); $takeAmount = Util::valueFit(sqrt($minTakeAmount * $reqResValDelta), 0, $maxTakeAmount);
@@ -1686,7 +1694,8 @@ class GeneralAI
} }
$takeAmount = Util::valueFit($takeAmount, 100, $this->maxResourceActionAmount); $takeAmount = Util::valueFit($takeAmount, 100, $this->maxResourceActionAmount);
$candidateArgs[] = [[ $candidateArgs[] = [
[
'destGeneralID' => $targetNPCGeneral->getID(), 'destGeneralID' => $targetNPCGeneral->getID(),
'isGold' => $resName == 'gold', 'isGold' => $resName == 'gold',
'amount' => $takeAmount 'amount' => $takeAmount
@@ -1694,7 +1703,6 @@ class GeneralAI
$takeAmount $takeAmount
]; ];
} }
} }
if (!$candidateArgs) { if (!$candidateArgs) {
@@ -1702,7 +1710,10 @@ class GeneralAI
} }
$cmd = buildNationCommandClass( $cmd = buildNationCommandClass(
'che_몰수', $this->general, $this->env, $lastTurn, 'che_몰수',
$this->general,
$this->env,
$lastTurn,
Util::choiceRandomUsingWeightPair($candidateArgs) Util::choiceRandomUsingWeightPair($candidateArgs)
); );
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
@@ -1896,11 +1907,9 @@ class GeneralAI
if (!key_exists($destNationID, $lowTargetNations)) { if (!key_exists($destNationID, $lowTargetNations)) {
$nations[$destNationID] = 1 / sqrt($destNationPower + 1); $nations[$destNationID] = 1 / sqrt($destNationPower + 1);
} } else {
else{
$warNations[$destNationID] = 1 / sqrt($destNationPower + 1); $warNations[$destNationID] = 1 / sqrt($destNationPower + 1);
} }
} }
if (!$nations) { if (!$nations) {
if (!$warNations) { if (!$warNations) {
@@ -2082,7 +2091,7 @@ class GeneralAI
$cmdList = []; $cmdList = [];
if($nation['rice'] < GameConst::$baserice){ if (($nation['rice'] < GameConst::$baserice) && Util::randBool(0.3)) {
return null; return null;
} }
@@ -2098,8 +2107,7 @@ class GeneralAI
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
$cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001)]; $cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001)];
} }
} } else if ($develRate['pop'] < 0.99) {
else if ($develRate['pop'] < 0.99) {
$cmd = buildGeneralCommandClass('che_정착장려', $general, $env); $cmd = buildGeneralCommandClass('che_정착장려', $general, $env);
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
$cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'] / 4, 0.001)]; $cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'] / 4, 0.001)];
@@ -2125,8 +2133,7 @@ class GeneralAI
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
$cmdList[] = [$cmd, $strength / Util::valueFit($develRate['secu'] / 0.8, 0.001, 1)]; $cmdList[] = [$cmd, $strength / Util::valueFit($develRate['secu'] / 0.8, 0.001, 1)];
} }
} } else if ($develRate['secu'] < 1) {
else if($develRate['secu'] < 1){
$cmd = buildGeneralCommandClass('che_치안강화', $general, $env); $cmd = buildGeneralCommandClass('che_치안강화', $general, $env);
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
$cmdList[] = [$cmd, $strength / 2 / Util::valueFit($develRate['secu'], 0.001)]; $cmdList[] = [$cmd, $strength / 2 / Util::valueFit($develRate['secu'], 0.001)];
@@ -2219,7 +2226,7 @@ class GeneralAI
$city = $this->city; $city = $this->city;
$nation = $this->nation; $nation = $this->nation;
if($nation['rice'] < GameConst::$baserice){ if (($nation['rice'] < GameConst::$baserice) && Util::randBool(0.3)) {
return null; return null;
} }
@@ -2243,8 +2250,7 @@ class GeneralAI
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
if (in_array($city['front'], [1, 3])) { if (in_array($city['front'], [1, 3])) {
$cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001)]; $cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001)];
} } else {
else{
$cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001) / 2]; $cmdList[] = [$cmd, $leadership / Util::valueFit($develRate['pop'], 0.001) / 2];
} }
} }
@@ -2290,8 +2296,7 @@ class GeneralAI
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
if (in_array($city['front'], [1, 3])) { if (in_array($city['front'], [1, 3])) {
$cmdList[] = [$cmd, ($isSpringSummer ? 1.2 : 0.8) * $intel / 4 / Util::valueFit($develRate['agri'], 0.001, 1)]; $cmdList[] = [$cmd, ($isSpringSummer ? 1.2 : 0.8) * $intel / 4 / Util::valueFit($develRate['agri'], 0.001, 1)];
} } else {
else{
$cmdList[] = [$cmd, ($isSpringSummer ? 1.2 : 0.8) * $intel / 2 / Util::valueFit($develRate['agri'], 0.001, 1)]; $cmdList[] = [$cmd, ($isSpringSummer ? 1.2 : 0.8) * $intel / 2 / Util::valueFit($develRate['agri'], 0.001, 1)];
} }
} }
@@ -2301,8 +2306,7 @@ class GeneralAI
if ($cmd->hasFullConditionMet()) { if ($cmd->hasFullConditionMet()) {
if (in_array($city['front'], [1, 3])) { if (in_array($city['front'], [1, 3])) {
$cmdList[] = [$cmd, ($isSpringSummer ? 0.8 : 1.2) * $intel / 4 / Util::valueFit($develRate['comm'], 0.001, 1)]; $cmdList[] = [$cmd, ($isSpringSummer ? 0.8 : 1.2) * $intel / 4 / Util::valueFit($develRate['comm'], 0.001, 1)];
} } else {
else{
$cmdList[] = [$cmd, ($isSpringSummer ? 0.8 : 1.2) * $intel / 2 / Util::valueFit($develRate['comm'], 0.001, 1)]; $cmdList[] = [$cmd, ($isSpringSummer ? 0.8 : 1.2) * $intel / 2 / Util::valueFit($develRate['comm'], 0.001, 1)];
} }
} }
@@ -2346,8 +2350,7 @@ class GeneralAI
'crewType' => $crewType->id, 'crewType' => $crewType->id,
'amount' => $this->fullLeadership * 100 'amount' => $this->fullLeadership * 100
]); ]);
} } else {
else{
$costCmd = buildGeneralCommandClass('che_징병', $general, $this->env, [ $costCmd = buildGeneralCommandClass('che_징병', $general, $this->env, [
'crewType' => $crewType->id, 'crewType' => $crewType->id,
'amount' => $this->fullLeadership * 100 'amount' => $this->fullLeadership * 100
@@ -2357,7 +2360,7 @@ class GeneralAI
$goldCost = $costCmd->getCost()[0]; $goldCost = $costCmd->getCost()[0];
$riceCost = $crewType->riceWithTech( $riceCost = $crewType->riceWithTech(
$this->nation['tech'], $this->nation['tech'],
$this->fullLeadership*100 Util::toInt($this->fullLeadership * 100)
); );
if (($relGold + $relRice) * 1.5 <= $goldCost + $riceCost) { if (($relGold + $relRice) * 1.5 <= $goldCost + $riceCost) {
@@ -2366,19 +2369,13 @@ class GeneralAI
$tryBuying = false; $tryBuying = false;
if ($this->generalPolicy->can상인무시) { if ($this->generalPolicy->can상인무시) {
if($relRice * 1.5 < $relGold && $relRice < $riceCost * 2) if ($relRice * 1.5 < $relGold && $relRice < $riceCost * 2) {
{ $tryBuying = true;
} else if ($relRice * 2 < $relGold) {
$tryBuying = true; $tryBuying = true;
} }
else if($relRice * 2 < $relGold) } else {
{ if ($relRice * 2 < $relGold && $relRice < $riceCost * 3) {
$tryBuying = true;
}
}
else{
if($relRice * 2 < $relGold && $relRice < $riceCost * 3)
{
$tryBuying = true; $tryBuying = true;
} }
} }
@@ -2387,7 +2384,10 @@ class GeneralAI
//1:1 //1:1
$amount = Util::valueFit(Util::toInt(($relGold - $relRice) / (1 + $deathRate)), 100, GameConst::$maxResourceActionAmount); $amount = Util::valueFit(Util::toInt(($relGold - $relRice) / (1 + $deathRate)), 100, GameConst::$maxResourceActionAmount);
if ($amount >= $this->nationPolicy->minimumResourceActionAmount) { if ($amount >= $this->nationPolicy->minimumResourceActionAmount) {
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env, $cmd = buildGeneralCommandClass(
'che_군량매매',
$general,
$this->env,
[ [
'buyRice' => true, 'buyRice' => true,
'amount' => $amount 'amount' => $amount
@@ -2401,19 +2401,13 @@ class GeneralAI
$trySelling = false; $trySelling = false;
if ($this->generalPolicy->can상인무시) { if ($this->generalPolicy->can상인무시) {
if($relGold * 1.5 < $relRice && $relGold < $goldCost * 2) if ($relGold * 1.5 < $relRice && $relGold < $goldCost * 2) {
{ $trySelling = true;
} else if ($relGold * 2 < $relRice) {
$trySelling = true; $trySelling = true;
} }
else if($relGold * 2 < $relRice) } else {
{ if ($relGold * 2 < $relRice && $relGold < $goldCost * 3) {
$trySelling = true;
}
}
else{
if($relGold * 2 < $relRice && $relGold < $goldCost * 3)
{
$trySelling = true; $trySelling = true;
} }
} }
@@ -2421,7 +2415,10 @@ class GeneralAI
if ($trySelling) { if ($trySelling) {
$amount = Util::valueFit(Util::toInt(($relRice - $relGold) / (1 + $deathRate)), 100, GameConst::$maxResourceActionAmount); $amount = Util::valueFit(Util::toInt(($relRice - $relGold) / (1 + $deathRate)), 100, GameConst::$maxResourceActionAmount);
if ($amount >= $this->nationPolicy->minimumResourceActionAmount) { if ($amount >= $this->nationPolicy->minimumResourceActionAmount) {
$cmd = buildGeneralCommandClass('che_군량매매', $general, $this->env, $cmd = buildGeneralCommandClass(
'che_군량매매',
$general,
$this->env,
[ [
'buyRice' => false, 'buyRice' => false,
'amount' => $amount 'amount' => $amount
@@ -2467,10 +2464,10 @@ class GeneralAI
$maxPop = $city['pop_max'] - $this->nationPolicy->minNPCRecruitCityPopulation; $maxPop = $city['pop_max'] - $this->nationPolicy->minNPCRecruitCityPopulation;
if (($city['pop'] / $city['pop_max'] < $this->nationPolicy->safeRecruitCityPopulationRatio) && if (($city['pop'] / $city['pop_max'] < $this->nationPolicy->safeRecruitCityPopulationRatio) &&
(Util::randF($remainPop/$maxPop))){ (Util::randF($remainPop / $maxPop))
) {
return null; return null;
} }
} }
$nationID = $general->getNationID(); $nationID = $general->getNationID();
@@ -2485,8 +2482,7 @@ class GeneralAI
if ($armType) { if ($armType) {
if (!($genType & self::t지장) && $armType == GameUnitConst::T_WIZARD) { if (!($genType & self::t지장) && $armType == GameUnitConst::T_WIZARD) {
$armType = null; $armType = null;
} } else if (!($genType & self::t무장) && in_array($armType, [GameUnitConst::T_FOOTMAN, GameUnitConst::T_ARCHER, GameUnitConst::T_CAVALRY])) {
else if(!($genType & self::t무장) && in_array($armType, [GameUnitConst::T_FOOTMAN, GameUnitConst::T_ARCHER, GameUnitConst::T_CAVALRY])){
$armType = null; $armType = null;
} }
} }
@@ -2535,7 +2531,7 @@ class GeneralAI
if ($types) { if ($types) {
$type = Util::choiceRandomUsingWeight($types); $type = Util::choiceRandomUsingWeight($types);
} else { } else {
throw new MustNotBeReachedException('에러:'.var_dump([$general->getName(), $general->getAuxVar('armType'), $armType, $cities, $regions, $relYear, $tech], true)); throw new MustNotBeReachedException('에러:' . print_r([$general->getName(), $general->getAuxVar('armType'), $armType, $cities, $regions, $relYear, $tech], true));
} }
if ($this->generalPolicy->can고급병종) { if ($this->generalPolicy->can고급병종) {
@@ -2543,8 +2539,7 @@ class GeneralAI
if ($currCrewType->isValid($cities, $regions, $relYear, $tech)) { if ($currCrewType->isValid($cities, $regions, $relYear, $tech)) {
if ($currCrewType->reqTech >= 2000) { if ($currCrewType->reqTech >= 2000) {
$type = $currCrewType->id; $type = $currCrewType->id;
} } else if ($currCrewType->armType != $armType && $currCrewType->reqTech >= 1000) {
else if($currCrewType->armType != $armType && $currCrewType->reqTech >= 1000){
//굳이 뽑은 이유가 있겠지 //굳이 뽑은 이유가 있겠지
$type = $currCrewType->id; $type = $currCrewType->id;
} }
@@ -2566,8 +2561,8 @@ class GeneralAI
$riceCost = $crewType->riceWithTech( $riceCost = $crewType->riceWithTech(
$this->nation['tech'], $this->nation['tech'],
$this->fullLeadership*100 * Util::toInt($this->fullLeadership * 100 *
$general->getRankVar('killcrew')/max($general->getRankVar('deathcrew'),1)*1.2 $general->getRankVar('killcrew') / max($general->getRankVar('deathcrew'), 1) * 1.2)
); );
$cmd = buildGeneralCommandClass('che_징병', $general, $env, [ $cmd = buildGeneralCommandClass('che_징병', $general, $env, [
@@ -2582,8 +2577,7 @@ class GeneralAI
'crewType' => $type, 'crewType' => $type,
'amount' => $crew 'amount' => $crew
]); ]);
} } else if ($gold < $cost && $gold * 2 >= $cost) {
else if($gold < $cost && $gold * 2 >= $cost){
$crew *= 0.5; $crew *= 0.5;
$riceCost *= 0.5; $riceCost *= 0.5;
$crew = Util::round($crew - 49, -2); $crew = Util::round($crew - 49, -2);
@@ -2671,7 +2665,7 @@ class GeneralAI
$city = $this->city; $city = $this->city;
$nation = $this->nation; $nation = $this->nation;
if($nation['rice'] < GameConst::$baserice){ if (($nation['rice'] < GameConst::$baserice) && Util::randBool(0.7)) {
return null; return null;
} }
@@ -2752,8 +2746,7 @@ class GeneralAI
if ($this->genType & self::t통솔장) { if ($this->genType & self::t통솔장) {
$reqRes = $reqNPCWar; $reqRes = $reqNPCWar;
} } else {
else{
$reqRes = $reqNPCDevel; $reqRes = $reqNPCDevel;
if ($genRes >= $reqNPCWar && $reqNPCWar > $reqNPCDevel + 1000) { if ($genRes >= $reqNPCWar && $reqNPCWar > $reqNPCDevel + 1000) {
$amount = $genRes - $reqNPCDevel; $amount = $genRes - $reqNPCDevel;
@@ -2783,8 +2776,7 @@ class GeneralAI
'isGold' => 'rice', 'isGold' => 'rice',
'amount' => $genRes 'amount' => $genRes
], $genRes]; ], $genRes];
} } else {
else{
$args[] = [[ $args[] = [[
'isGold' => 'rice', 'isGold' => 'rice',
'amount' => $genRes / 2 'amount' => $genRes / 2
@@ -2850,8 +2842,7 @@ class GeneralAI
if ($city['pop'] >= $minRecruitPop) { if ($city['pop'] >= $minRecruitPop) {
return null; return null;
} }
} } else {
else{
if ($city['pop'] / $city['pop_max'] >= $this->nationPolicy->safeRecruitCityPopulationRatio) { if ($city['pop'] / $city['pop_max'] >= $this->nationPolicy->safeRecruitCityPopulationRatio) {
if ($city['pop'] >= $this->nationPolicy->minNPCRecruitCityPopulation && $city['pop'] >= $minRecruitPop) { if ($city['pop'] >= $this->nationPolicy->minNPCRecruitCityPopulation && $city['pop'] >= $minRecruitPop) {
LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 인구 충분", [$city['pop'] / $city['pop_max'], $this->nationPolicy->safeRecruitCityPopulationRatio]); LogText("{$this->general->getName()}, {$this->general->getID()} 후방워프 불가: 인구 충분", [$city['pop'] / $city['pop_max'], $this->nationPolicy->safeRecruitCityPopulationRatio]);
@@ -2900,8 +2891,7 @@ class GeneralAI
} }
if (key_exists($cityID, $this->frontCities)) { if (key_exists($cityID, $this->frontCities)) {
$recruitableCityList[$cityID] = $pop_ratio / 2; $recruitableCityList[$cityID] = $pop_ratio / 2;
} } else {
else{
$recruitableCityList[$cityID] = $pop_ratio; $recruitableCityList[$cityID] = $pop_ratio;
} }
} }
@@ -2948,10 +2938,6 @@ class GeneralAI
return null; return null;
} }
if($this->nation['rice'] < GameConst::$baserice){
return null;
}
$this->categorizeNationCities(); $this->categorizeNationCities();
$this->categorizeNationGeneral(); $this->categorizeNationGeneral();
@@ -2980,9 +2966,6 @@ class GeneralAI
protected function do내정워프(): ?GeneralCommand protected function do내정워프(): ?GeneralCommand
{ {
if($this->nation['rice'] < GameConst::$baserice){
return null;
}
if (($this->genType & self::t통솔장) && in_array($this->dipState, [self::d징병, self::d직전, self::d전쟁])) { if (($this->genType & self::t통솔장) && in_array($this->dipState, [self::d징병, self::d직전, self::d전쟁])) {
return null; return null;
} }
@@ -3092,7 +3075,7 @@ class GeneralAI
$general = $this->general; $general = $this->general;
$lordCities = $db->queryFirstColumn('SELECT city.city as city FROM general LEFT JOIN city ON general.city = city.city WHERE general.officer_level = 12 AND city.nation = 0'); $lordCities = $db->queryFirstColumn('SELECT city.city as city FROM general LEFT JOIN city ON general.city = city.city WHERE general.officer_level = 12 AND city.nation = 0');
$nationCities = $db->queryFirstColumn('SELECT city a FROM city WHERE nation != 0'); $nationCities = $db->queryFirstColumn('SELECT city FROM city WHERE nation != 0');
$occupiedCities = []; $occupiedCities = [];
foreach ($lordCities as $tCityId) { foreach ($lordCities as $tCityId) {
@@ -3102,38 +3085,62 @@ class GeneralAI
$occupiedCities[$tCityId] = 1; $occupiedCities[$tCityId] = 1;
} }
$movingTargetCityID = $general->getAuxVar('movingTargetCityID');
$currCityID = $general->getCityID(); $currCityID = $general->getCityID();
$targetCity = []; if($movingTargetCityID === $currCityID){
$movingTargetCityID = null;
}
else if(key_exists($movingTargetCityID, $occupiedCities)){
$movingTargetCityID = null;
}
if($movingTargetCityID === null){
//어느 도시로 갈 것인가?
$candidateCities = [];
foreach(searchDistance($currCityID, 4) as $testCityID => $dist){
if(key_exists($testCityID, $occupiedCities)){
continue;
}
$cityLevel = CityConst::byID($testCityID)->level;
if ($cityLevel < 5 || 6 < $cityLevel) {
continue;
}
$candidateCities[] = [$testCityID, 1 / pow(2, $dist)];
}
if(!$candidateCities){
return null;
}
$movingTargetCityID = Util::choiceRandomUsingWeightPair($candidateCities);
$general->setAuxVar('movingTargetCityID', $movingTargetCityID);
}
if($movingTargetCityID == $currCityID){
return buildGeneralCommandClass('che_인재탐색', $general, $this->env);
}
$distMap = searchDistance($movingTargetCityID, 99);
$targetDistance = $distMap[$currCityID];
$candidateCities = [];
//NOTE: 최단 거리가 현재 도시에서 '어떻게 가야' 가장 짧은지 알 수가 없으므로, 한칸 간 다음 계산하기로
//출발지가 정해져 있으므로, searchAllDistanceByCityList는 비효율적.
foreach (array_keys(CityConst::byID($currCityID)->path) as $nearCityID) { foreach (array_keys(CityConst::byID($currCityID)->path) as $nearCityID) {
if (CityConst::byID($nearCityID)->level < 4) { $cityLevel = CityConst::byID($nearCityID)->level;
$targetCity[$nearCityID] = 0.5; if(5 <= $cityLevel && $cityLevel <= 6 && !key_exists($nearCityID, $occupiedCities)){
} else if (!key_exists($nearCityID, $occupiedCities)) { //바로 옆 도시로 이동하면 건국 가능하다면? 가보자
$targetCity[$nearCityID] = 2; $candidateCities[] = [$nearCityID, 10];
} else {
$targetCity[$nearCityID] = 0;
} }
if($distMap[$nearCityID] + 1 == $targetDistance){
$distanceFrom = searchDistance($nearCityID, 4, true); $candidateCities[] = [$nearCityID, 1];
foreach ($distanceFrom as $distance => $distCities) {
foreach ($distCities as $distCity) {
if (key_exists($distCity, $occupiedCities)) {
continue;
}
if (CityConst::byID($distCity)->level < 4) {
continue;
}
$targetCity[$nearCityID] += 1 / (2 ** $distance);
} }
} }
if(!$candidateCities){
return null;
} }
$cmd = buildGeneralCommandClass('che_이동', $general, $this->env, [ $cmd = buildGeneralCommandClass('che_이동', $general, $this->env, [
'destCityID'=>Util::choiceRandomUsingWeight($targetCity) 'destCityID' => Util::choiceRandomUsingWeightPair($candidateCities)
]); ]);
if (!$cmd->hasFullConditionMet()) { if (!$cmd->hasFullConditionMet()) {
return null; return null;
@@ -3156,6 +3163,43 @@ class GeneralAI
return null; return null;
} }
$currentCityLevel = CityConst::byID($general->getCityID())->level;
if (($currentCityLevel < 5 || 6 < $currentCityLevel) && Util::randBool(0.5)){
return null;
}
$db = DB::db();
$lordCities = $db->queryFirstColumn('SELECT city.city as city FROM general LEFT JOIN city ON general.city = city.city WHERE general.officer_level = 12 AND city.nation = 0');
$nationCities = $db->queryFirstColumn('SELECT city FROM city WHERE nation != 0');
$occupiedCities = [];
foreach ($lordCities as $tCityId) {
$occupiedCities[$tCityId] = 2;
}
foreach ($nationCities as $tCityId) {
$occupiedCities[$tCityId] = 1;
}
$availableNearCity = false;
foreach(searchDistance($general->getCityID(), 3) as $targetCityID => $dist){
if(key_exists($targetCityID, $occupiedCities)){
continue;
}
$cityLevel = CityConst::byID($targetCityID)->level;
if($cityLevel < 5 || 6 < $cityLevel){
continue;
}
if($dist == 3 && Util::randBool()){
continue;
}
$availableNearCity = true;
break;
}
if(!$availableNearCity){
return null;
}
$prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2; $prop = Util::randF() * (GameConst::$defaultStatNPCMax + GameConst::$chiefStatMin) / 2;
$ratio = ($this->fullLeadership + $this->fullStrength + $this->fullIntel) / 3; $ratio = ($this->fullLeadership + $this->fullStrength + $this->fullIntel) / 3;
@@ -3166,7 +3210,7 @@ class GeneralAI
//XXX: 건국기한 2년 //XXX: 건국기한 2년
$more = Util::valueFit(3 - $this->env['year'] + $this->env['init_year'], 1, 3); $more = Util::valueFit(3 - $this->env['year'] + $this->env['init_year'], 1, 3);
if(!Util::randBool(0.005*$more)){ if (!Util::randBool(0.0075 * $more)) {
return null; return null;
} }
@@ -3185,6 +3229,8 @@ class GeneralAI
return null; return null;
} }
$this->general->setAuxVar('movingTargetCityID', null);
return $cmd; return $cmd;
} }
@@ -3201,6 +3247,8 @@ class GeneralAI
return null; return null;
} }
$this->general->setAuxVar('movingTargetCityID', null);
return $cmd; return $cmd;
} }
@@ -3345,7 +3393,8 @@ class GeneralAI
return $cmd; return $cmd;
} }
protected function categorizeNationCities():void{ protected function categorizeNationCities(): void
{
if ($this->nationCities !== null) { if ($this->nationCities !== null) {
return; return;
@@ -3377,8 +3426,7 @@ class GeneralAI
} }
if ($nationCity['front']) { if ($nationCity['front']) {
$frontCities[$cityID] = $nationCity; $frontCities[$cityID] = $nationCity;
} } else {
else{
$backupCities[$cityID] = $nationCity; $backupCities[$cityID] = $nationCity;
} }
@@ -3392,7 +3440,8 @@ class GeneralAI
} }
protected function categorizeNationGeneral():void{ protected function categorizeNationGeneral(): void
{
if ($this->userGenerals !== null) { if ($this->userGenerals !== null) {
return; return;
} }
@@ -3436,8 +3485,7 @@ class GeneralAI
if ($officerLevel > 4) { if ($officerLevel > 4) {
$chiefGenerals[$officerLevel] = $nationGeneral; $chiefGenerals[$officerLevel] = $nationGeneral;
} } else if ($officerLevel > 2) {
else if($officerLevel > 2){
$nationCities[$officerCity]['important'] += 1; $nationCities[$officerCity]['important'] += 1;
} }
@@ -3453,29 +3501,24 @@ class GeneralAI
if ($npcType == 5) { if ($npcType == 5) {
//부대장임 //부대장임
$troopLeaders[$generalID] = $nationGeneral; $troopLeaders[$generalID] = $nationGeneral;
} } else if ($nationGeneral->getVar('troop') === $generalID && $nationGeneral->getReservedTurn(0, $this->env)->getName() === 'che_집합') {
else if($nationGeneral->getVar('troop') === $generalID && $nationGeneral->getReservedTurn(0, $this->env)->getName() === 'che_집합'){
//비 NPC부대장임 //비 NPC부대장임
$troopLeaders[$generalID] = $nationGeneral; $troopLeaders[$generalID] = $nationGeneral;
} } else if ($nationGeneral->getVar('killturn') < 5) {
else if($nationGeneral->getVar('killturn') < 5){
//삭턴이 몇 안남은 장수는 '내정장 npc'로 처리 //삭턴이 몇 안남은 장수는 '내정장 npc'로 처리
$npcCivilGenerals[$generalID] = $nationGeneral; $npcCivilGenerals[$generalID] = $nationGeneral;
} } else if ($npcType < 2) {
else if($npcType < 2) {
$userGenerals[$generalID] = $nationGeneral; $userGenerals[$generalID] = $nationGeneral;
if ($nationGeneral->calcRecentWarTurn($this->env['turnterm']) <= $lastWar + 12) { if ($nationGeneral->calcRecentWarTurn($this->env['turnterm']) <= $lastWar + 12) {
$userWarGenerals[$generalID] = $nationGeneral; $userWarGenerals[$generalID] = $nationGeneral;
} } else if (
else if(
$this->dipState !== self::d평화 && $this->dipState !== self::d평화 &&
$nationGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew $nationGeneral->getVar('crew') >= $this->nationPolicy->minWarCrew
) { ) {
$userWarGenerals[$generalID] = $nationGeneral; $userWarGenerals[$generalID] = $nationGeneral;
//TODO: 훈련,사기 나중에 되돌릴 것 //TODO: 훈련,사기 나중에 되돌릴 것
//TODO: 징,모병턴 기준으로 계산하는 코드를 추가할 것 //TODO: 징,모병턴 기준으로 계산하는 코드를 추가할 것
} } else {
else{
$userCivilGenerals[$generalID] = $nationGeneral; $userCivilGenerals[$generalID] = $nationGeneral;
} }
} else if ($nationGeneral->getLeadership(false) >= $this->nationPolicy->minNPCWarLeadership) { } else if ($nationGeneral->getLeadership(false) >= $this->nationPolicy->minNPCWarLeadership) {
@@ -3497,7 +3540,8 @@ class GeneralAI
} }
public function chooseNationTurn(NationCommand $reservedCommand): NationCommand{ public function chooseNationTurn(NationCommand $reservedCommand): NationCommand
{
//TODO: NationTurn과 InstantNationTurn 구분 필요 //TODO: NationTurn과 InstantNationTurn 구분 필요
$lastTurn = $reservedCommand->getLastTurn(); $lastTurn = $reservedCommand->getLastTurn();
$general = $this->general; $general = $this->general;
@@ -3523,8 +3567,7 @@ class GeneralAI
$this->chooseTexRate(); $this->chooseTexRate();
$this->chooseRiceBillRate(); $this->chooseRiceBillRate();
} }
} } else if (in_array($month, [3, 6, 9, 12])) {
else if(in_array($month, [3, 6, 9, 12])){
$this->chooseNonLordPromotion(); $this->chooseNonLordPromotion();
} }
} }
@@ -3564,7 +3607,8 @@ class GeneralAI
return $cmd; return $cmd;
} }
public function chooseInstantNationTurn(NationCommand $reservedCommand): ?NationCommand{ public function chooseInstantNationTurn(NationCommand $reservedCommand): ?NationCommand
{
if ($reservedCommand->hasFullConditionMet()) { if ($reservedCommand->hasFullConditionMet()) {
return $reservedCommand; return $reservedCommand;
} }
@@ -3585,7 +3629,8 @@ class GeneralAI
return buildNationCommandClass(null, $this->general, $this->env, $this->general->getLastTurn()); return buildNationCommandClass(null, $this->general, $this->env, $this->general->getLastTurn());
} }
public function chooseGeneralTurn(GeneralCommand $reservedCommand): GeneralCommand{ public function chooseGeneralTurn(GeneralCommand $reservedCommand): GeneralCommand
{
$general = $this->general; $general = $this->general;
$npcType = $general->getNPCType(); $npcType = $general->getNPCType();
$nationID = $general->getNationID(); $nationID = $general->getNationID();
@@ -3747,7 +3792,8 @@ class GeneralAI
return $this->devRate; return $this->devRate;
} }
protected function chooseNonLordPromotion(){ protected function chooseNonLordPromotion()
{
//빈자리는 아무나 채움 //빈자리는 아무나 채움
$db = DB::db(); $db = DB::db();
@@ -3772,17 +3818,13 @@ class GeneralAI
/** @var General */ /** @var General */
if ($this->npcWarGenerals) { if ($this->npcWarGenerals) {
$randGeneral = Util::choiceRandom($this->npcWarGenerals); $randGeneral = Util::choiceRandom($this->npcWarGenerals);
} } else if ($this->npcCivilGenerals) {
else if($this->npcCivilGenerals){
$randGeneral = Util::choiceRandom($this->npcCivilGenerals); $randGeneral = Util::choiceRandom($this->npcCivilGenerals);
} } else if ($this->userWarGenerals) {
else if($this->userWarGenerals){
$randGeneral = Util::choiceRandom($this->userWarGenerals); $randGeneral = Util::choiceRandom($this->userWarGenerals);
} } else if ($this->userCivilGenerals) {
else if($this->userCivilGenerals){
$randGeneral = Util::choiceRandom($this->userCivilGenerals); $randGeneral = Util::choiceRandom($this->userCivilGenerals);
} } else {
else{
break; break;
} }
@@ -3799,8 +3841,7 @@ class GeneralAI
if ($randGeneral->getStrength(false, false, false, false) < GameConst::$chiefStatMin) { if ($randGeneral->getStrength(false, false, false, false) < GameConst::$chiefStatMin) {
continue; continue;
} }
} } else {
else{
if ($randGeneral->getIntel(false, false, false, false) < GameConst::$chiefStatMin) { if ($randGeneral->getIntel(false, false, false, false) < GameConst::$chiefStatMin) {
continue; continue;
} }
@@ -3829,7 +3870,8 @@ class GeneralAI
} }
} }
protected function calcCityDevelRate(array $city){ protected function calcCityDevelRate(array $city)
{
return [ return [
'trust' => [$city['trust'] / 100, self::t통솔장], 'trust' => [$city['trust'] / 100, self::t통솔장],
'pop' => [$city['pop'] / $city['pop_max'], self::t통솔장], 'pop' => [$city['pop'] / $city['pop_max'], self::t통솔장],
@@ -3841,7 +3883,8 @@ class GeneralAI
]; ];
} }
protected function choosePromotion(){ protected function choosePromotion()
{
$db = DB::db(); $db = DB::db();
$nation = $this->nation; $nation = $this->nation;
@@ -3928,8 +3971,7 @@ class GeneralAI
if (!key_exists($chiefLevel, $this->chiefGenerals) && !key_exists($chiefLevel, $nextChiefs)) { if (!key_exists($chiefLevel, $this->chiefGenerals) && !key_exists($chiefLevel, $nextChiefs)) {
$newChiefProb = 1; $newChiefProb = 1;
} } else {
else{
$newChiefProb = Util::randF(0.1); $newChiefProb = Util::randF(0.1);
} }
@@ -3951,11 +3993,9 @@ class GeneralAI
} }
if ($chiefLevel == 11) { if ($chiefLevel == 11) {
} } else if ($chiefLevel % 2 == 0 && $general->getStrength(false, false, false, false) < GameConst::$chiefStatMin) {
else if($chiefLevel % 2 == 0 && $general->getStrength(false, false, false, false) < GameConst::$chiefStatMin){
continue; continue;
} } else if ($chiefLevel % 2 == 1 && $general->getIntel(false, false, false, false) < GameConst::$chiefStatMin) {
else if($chiefLevel % 2 == 1 && $general->getIntel(false, false, false, false) < GameConst::$chiefStatMin){
continue; continue;
} }
+1 -1
View File
@@ -128,7 +128,7 @@ class ResetHelper{
} }
} }
opcache_reset(); //opcache_reset();
$gameStor = KVStorage::getStorage($db, 'game_env'); $gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->resetValues(); $gameStor->resetValues();
+2 -2
View File
@@ -459,7 +459,7 @@ class GeneralBuilder{
} }
} }
if(!$this->dex1 && in_array('dex_t', $avgGen)){ if(!$this->dex1 && key_exists('dex_t', $avgGen)){
$dexTotal = $avgGen['dex_t']; $dexTotal = $avgGen['dex_t'];
if ($pickType == '무') { if ($pickType == '무') {
$dexVal = Util::choiceRandom([ $dexVal = Util::choiceRandom([
@@ -681,7 +681,7 @@ class GeneralBuilder{
'turntime'=>$turntime, 'turntime'=>$turntime,
'killturn'=>$killturn, 'killturn'=>$killturn,
'age'=>$age, 'age'=>$age,
'belong'=>1, 'belong'=>0,
'personal'=>$this->ego, 'personal'=>$this->ego,
'special'=>$this->specialDomestic, 'special'=>$this->specialDomestic,
'specage'=>$this->specAge, 'specage'=>$this->specAge,
+21 -1
View File
@@ -238,6 +238,7 @@ class TurnExecutionHelper
$turnObj = new static($general); $turnObj = new static($general);
$env = $gameStor->getAll(true); $env = $gameStor->getAll(true);
[$startYear, $year, $month, $turnterm] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'turnterm']);
$hasNationTurn = false; $hasNationTurn = false;
if ($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5) { if ($general->getVar('nation') != 0 && $general->getVar('officer_level') >= 5) {
@@ -263,13 +264,22 @@ class TurnExecutionHelper
$turnObj->preprocessCommand($env); $turnObj->preprocessCommand($env);
if ($general->getNPCType() >= 2 || ($autorun_user['limit_minutes'] ?? false)) { if ($general->getNPCType() >= 2){
$ai = new GeneralAI($turnObj->getGeneral());
} else {
$limitYearMonth = $general->getAuxVar('autorun_limit')??Util::joinYearMonth($year-2, $month);
if(Util::joinYearMonth($year, $month) < $limitYearMonth){
$ai = new GeneralAI($turnObj->getGeneral()); $ai = new GeneralAI($turnObj->getGeneral());
} }
}
$hasReservedTurn = false;
if (!$turnObj->processBlocked()) { if (!$turnObj->processBlocked()) {
if ($hasNationTurn) { if ($hasNationTurn) {
if (!($nationCommandObj instanceof Command\Nation\휴식)) {
$hasReservedTurn = true;
}
if ($ai && ($general->getAuxVar('use_auto_nation_turn') ?? 1)) { if ($ai && ($general->getAuxVar('use_auto_nation_turn') ?? 1)) {
$nationCommandObj = $ai->chooseNationTurn($nationCommandObj); $nationCommandObj = $ai->chooseNationTurn($nationCommandObj);
$cityName = CityConst::byID($general->getCityID())->name; $cityName = CityConst::byID($general->getCityID())->name;
@@ -283,6 +293,9 @@ class TurnExecutionHelper
} }
$generalCommandObj = $general->getReservedTurn(0, $env); $generalCommandObj = $general->getReservedTurn(0, $env);
if (!($generalCommandObj instanceof Command\General\휴식)) {
$hasReservedTurn = true;
}
if ($ai) { if ($ai) {
$newGeneralCommandObj = $ai->chooseGeneralTurn($generalCommandObj); // npc AI 처리 $newGeneralCommandObj = $ai->chooseGeneralTurn($generalCommandObj); // npc AI 처리
@@ -302,6 +315,13 @@ class TurnExecutionHelper
$currentTurn = $general->getTurnTime(); $currentTurn = $general->getTurnTime();
$general->increaseVarWithLimit('myset', 3, null, 9); $general->increaseVarWithLimit('myset', 3, null, 9);
if(($autorun_user['limit_minutes']??false) && $general->getNPCType() < 2 && $hasReservedTurn){
$autorun_limit = Util::joinYearMonth($year, $month);
$autorun_limit += intdiv($autorun_user['limit_minutes'], $turnterm);
$general->setAuxVar('autorun_limit', $autorun_limit);
}
$turnObj->updateTurnTime(); $turnObj->updateTurnTime();
$turnObj->applyDB(); $turnObj->applyDB();
} }
+89
View File
@@ -0,0 +1,89 @@
<?php
namespace sammo;
class UserLogger
{
protected $userID;
protected $year;
protected $month;
protected $autoFlush;
protected $log = [];
function __construct(int $userID, ?int $year = null, ?int $month = null, bool $autoFlush = true)
{
$this->userID = $userID;
if ($year === null || $month === null) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['year', 'month']);
if ($year === null) {
$year = $gameStor->year;
}
if ($month === null) {
$month = $gameStor->month;
}
}
$this->year = $year;
$this->month = $month;
$this->autoFlush = $autoFlush;
}
public function __destruct()
{
if ($this->autoFlush) {
$this->flush();
}
}
public function rollback()
{
$backup = $this->log;
$this->log = [];
return $backup;
}
public function flush()
{
if(!$this->log){
return;
}
if(!$this->userID){
return;
}
$db = DB::db();
$date = TimeUtil::now();
$serverID = UniqueConst::$serverID;
$request = array_map(function ($textAndType) use ($date, $serverID) {
[$text, $type] = $textAndType;
return [
'user_id' => $this->userID,
'server_id' => $serverID,
'log_type' => $type,
'year' => $this->year,
'month' => $this->month,
'date' => $date,
'text' => $text
];
}, array_values($this->log));
$db->insert('user_record', $request);
$this->log = [];
}
public function push($text, string $type)
{
if (!$text) {
return;
}
if (is_array($text)) {
foreach ($text as $textItem) {
$this->log[] = [$textItem, $type];
}
return;
}
$this->log[] = [$text, $type];
}
}
+10 -1
View File
@@ -56,6 +56,9 @@ class WarUnitGeneral extends WarUnit
$semiTurn = $general->getTurnTime(); $semiTurn = $general->getTurnTime();
} else if ($oppose !== null) { } else if ($oppose !== null) {
$semiTurn = $oppose->getGeneral()->getTurnTime(); $semiTurn = $oppose->getGeneral()->getTurnTime();
} else {
LogText("WarUnitGeneral::setOppose", "defender인데 oppose가 null {$general->getID()}, {$general->getTurnTime()}");
$semiTurn = $general->getTurnTime();
} }
$phase = $this->getRealPhase(); $phase = $this->getRealPhase();
$semiTurn = substr($semiTurn, 0, strlen($semiTurn) - 2); $semiTurn = substr($semiTurn, 0, strlen($semiTurn) - 2);
@@ -154,7 +157,13 @@ class WarUnitGeneral extends WarUnit
$general->increaseRankVar('occupied', 1); $general->increaseRankVar('occupied', 1);
} }
if($this->isAttacker()){
$general->multiplyVarWithLimit('atmos', 1.1, null, GameConst::$maxAtmosByWar); $general->multiplyVarWithLimit('atmos', 1.1, null, GameConst::$maxAtmosByWar);
}
else{
$general->multiplyVarWithLimit('atmos', 1.05, null, GameConst::$maxAtmosByWar);
}
$this->addStatExp(1); $this->addStatExp(1);
} }
@@ -205,7 +214,7 @@ class WarUnitGeneral extends WarUnit
if ($this->isAttacker) { if ($this->isAttacker) {
if ($officerLevel == 12) { if ($officerLevel == 12) {
$warPower *= 1.10; $warPower *= 1.10;
} else if ($officerLevel == 11 | $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) { } else if ($officerLevel == 11 || $officerLevel == 10 || $officerLevel == 8 || $officerLevel == 6) {
$warPower *= 1.05; $warPower *= 1.05;
} }
} else { } else {
@@ -14,6 +14,7 @@ class che_반계시도 extends BaseWarUnitTrigger{
public function __construct(WarUnit $unit, int $raiseType = 0, float $prob = 0.4){ public function __construct(WarUnit $unit, int $raiseType = 0, float $prob = 0.4){
$this->object = $unit; $this->object = $unit;
$this->raiseType = $raiseType;
$this->prob = $prob; $this->prob = $prob;
} }
@@ -22,7 +22,7 @@ class che_전투치료발동 extends BaseWarUnitTrigger{
} }
$selfEnv['치료발동'] = true; $selfEnv['치료발동'] = true;
$oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <C>치료</>했다!", ActionLogger::PLAIN); $oppose->getLogger()->pushGeneralBattleDetailLog("상대가 <R>치료</>했다!", ActionLogger::PLAIN);
$self->getLogger()->pushGeneralBattleDetailLog("<C>치료</>했다!", ActionLogger::PLAIN); $self->getLogger()->pushGeneralBattleDetailLog("<C>치료</>했다!", ActionLogger::PLAIN);
$oppose->multiplyWarPowerMultiply(0.5); $oppose->multiplyWarPowerMultiply(0.5);
+1 -1
View File
@@ -9,7 +9,7 @@
"events":[ "events":[
[ [
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30], ["CreateManyNPC", 10, 10],
["DeleteEvent"] ["DeleteEvent"]
], ],
[ [
+1 -1
View File
@@ -12,7 +12,7 @@
"events":[ "events":[
[ [
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30], ["CreateManyNPC", 10, 10],
["DeleteEvent"] ["DeleteEvent"]
], ],
[ [
+1 -1
View File
@@ -16,7 +16,7 @@
"events":[ "events":[
[ [
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]], ["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 30], ["CreateManyNPC", 10, 10],
["DeleteEvent"] ["DeleteEvent"]
], ],
[ [
+1 -1
View File
@@ -2,7 +2,7 @@
"title": "【가상모드19b】 진유저무쌍! (대형 지도)", "title": "【가상모드19b】 진유저무쌍! (대형 지도)",
"startYear": 180, "startYear": 180,
"history": [ "history": [
"<C>●</>180년 1월:<L><b>【가상모드19】</b>진유저무쌍! (대형 지도)</>", "<C>●</>180년 1월:<L><b>【가상모드19】</b>진유저무쌍! (대형 지도)</>",
"<C>●</>180년 1월:<L><b>【이벤트】</b></>고대장수 다 덤벼라! 유저가 최강이다!" "<C>●</>180년 1월:<L><b>【이벤트】</b></>고대장수 다 덤벼라! 유저가 최강이다!"
], ],
"stat": { "stat": {
+113
View File
@@ -0,0 +1,113 @@
{
"title": "【가상모드23】 CookieRun : Kingdom",
"startYear": 180,
"history": [
"<C>●</>180년 1월:<L><b>【가상모드23】</b>CookieRun : Kingdom</>",
"<C>●</>180년 1월:<L><b>【이벤트】</b></>쿠키들과 함께하는 삼모전"
],
"stat": {
"total": 200,
"min": 10,
"max": 90,
"npcTotal":180,
"npcMax":70,
"npcMin":10,
"chiefMin": 60
},
"iconPath": "쿠키런킹덤",
"fiction": 1,
"nation":[
],
"map":{
"mapName":"miniche",
"unitSet":"che"
},
"diplomacy":[],
"general":[
[30, "커스터드3세", null, 0, null, 60, 60, 60, 0, 160, 300, null, null, "새로운 백성이로구나. 반가워!"],
[30, "클로버", null, 0, null, 71, 49, 71, 0, 160, 300, null, null, "여러분의 모험에 행운이 깃들길..."],
[50, "마들렌", null, 0, null, 73, 57, 73, 0, 160, 300, null, null, "빛의 신께 세상을 구하라는 명을 받은 쿠키가 바로 나다!"],
[50, "호밀", null, 0, null, 73, 65, 65, 0, 160, 300, null, null, "애송이들! 그렇게 부드러워서야 되겠어?"],
[50, "에스프레소", null, 0, null, 75, 55, 75, 0, 160, 300, null, null, "커피마법이라고 다를 것 없습니다?"],
[50, "라떼", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "쓰디 쓴 실패라도 부드러운 우유 몇 방울이면 달콤해질거야"],
[50, "아몬드", null, 0, null, 69, 30, 100, 0, 160, 300, null, null, "당신을 마법 행정 규약 위반으로 체포합니다"],
[50, "블랙레이즌", null, 0, null, 65, 70, 60, 0, 160, 300, null, null, "깜깜한 어둠 속도 상관 없어. 난 전부 보이니까!"],
[60, "감초", null, 0, null, 70, 10, 120, 0, 160, 300, null, null, "나도 할 땐 하는 쿠키야!"],
[60, "독버섯", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "버서엇...?"],
[60, "딸기크레페", null, 0, null, 70, 60, 70, 0, 160, 300, null, null],
[70, "퓨어바닐라", null, 0, null, 90, 45, 90, 0, 160, 300, null, null, "힘들 땐 힘들다고 말해도 괜찮아요."],
[60, "다크초코", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "그저… 영웅이 되고 싶었을 뿐…"],
[60, "석류", null, 0, null, 75, 55, 75, 0, 160, 300, null, null, "영원히 그분만을 섬기리…"],
[999, "설탕노움", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[10, "The브레이브", null, 0, null, 69, 51, 69, 0, 160, 300, null, null, "모험은 이제부터 시작이야!"],
[10, "스트로베리", null, 0, null, 70, 50, 70, 0, 160, 300, null, null, "쿠키생은 혼자야…"],
[10, "매지션", null, 0, null, 66, 54, 66, 0, 160, 300, null, null, "가슴은 뜨겁게 머리는 앗 차거!"],
[10, "에인절", null, 0, null, 63, 57, 63, 0, 160, 300, null, null, "새처럼 날아가 볼까요…"],
[10, "비트", null, 0, null, 64, 56, 64, 0, 160, 300, null, null, "벌써 이곳에서 1000일을 버텼지!"],
[10, "The머슬", null, 0, null, 70, 50, 70, 0, 160, 300, null, null, "이번엔 스쿼트다! 하나! 둘!"],
[10, "닌자", null, 0, null, 63, 57, 63, 0, 160, 300, null, null, "허공을 가르고 바람을 밟는다!"],
[30, "용사", null, 0, null, 67, 58, 67, 0, 160, 300, null, null, "더 강해져야 해!"],
[30, "알케미스트", null, 0, null, 61, 64, 61, 0, 160, 300, null, null, "내가 어떤 걸 만들어 내는지 잘 보라구~!"],
[30, "체리", null, 0, null, 66, 59, 66, 0, 160, 300, null, null, "어랏? 터져버렸네~? 미안...일부러 그랬어~ 헤헷!"],
[30, "버블껌", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "껌은 씹는 것 보다 쏘는 게 더 재밌어!"],
[30, "블랙베리", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "맡기실 일이 있다면 뭐든 말씀하세요."],
[30, "팬케이크", null, 0, null, 52, 73, 52, 0, 160, 300, null, null, "나 도토리젤리 안 줄 거야?"],
[30, "The프린세스", null, 0, null, 60, 65, 60, 0, 160, 300, null, null, "나들이하기 좋은 날이네~!"],
[30, "아보카도", null, 0, null, 67, 58, 67, 0, 160, 300, null, null, "가장 맛있는 싸움은? 보쌈! 와하하!"],
[30, "어니언", null, 0, null, 72, 53, 72, 0, 160, 300, null, null, "으아아아아앙~"],
[30, "익스플로러", null, 0, null, 65, 60, 65, 0, 160, 300, null, null, "가보고 싶은 곳이 너무 많아!"],
[30, "캐롯", null, 0, null, 71, 54, 71, 0, 160, 300, null, null, "밭일하러 나갈 시간이야!"],
[60, "뱀파이어", null, 0, null, 58, 72, 58, 0, 160, 300, null, null, "나랑 포도주스 한 잔 어때?"],
[50, "스파클링", null, 0, null, 70, 60, 70, 0, 160, 300, null, null, "승리를 위한 한 잔이 필요하겠군요!"],
[50, "칠리", null, 0, null, 65, 65, 65, 0, 160, 300, null, null, "어이! 주머니 조심하라구!"],
[50, "자색고구마", null, 0, null, 65, 65, 65, 0, 160, 300, null, null, "나랑 싸울 쿠키 다 나와!"],
[50, "눈설탕", null, 0, null, 79, 51, 79, 0, 160, 300, null, null, "안녕? 반가워~ 나랑... 눈싸움할래?"],
[50, "정글전사", null, 0, null, 80, 50, 80, 0, 160, 300, null, null, "친구…들을… 지켜야… 해…"],
[50, "민트초코", null, 0, null, 76, 54, 76, 0, 160, 300, null, null, "어떤 음악을 들려드릴까요?"],
[50, "허브", null, 0, null, 71, 59, 71, 0, 160, 300, null, null, "무럭무럭 자라렴~"],
[50, "우유", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "평화를 위해 어둠과 맞서 싸우리라!"],
[50, "웨어울프", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "다가오지 마… 다쳐…"],
[50, "구미호", null, 0, null, 72, 58, 72, 0, 160, 300, null, null, "나한테 반하면 어떻게 되는지 궁금해?"],
[50, "슈크림", null, 0, null, 71, 59, 71, 0, 160, 300, null, null, "저도 이제 어엿한 마법사라구요!"],
[150, "케이크들개", null, 0, null, 40, 80, 40, 0, 160, 300, null, null],
[999, "곰젤리", null, 0, null, 40, 80, 40, 0, 160, 300, null, null],
[999, "곰젤리역장", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "후르츠칸앵무", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "순례자", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "은행강도", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "무녀", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[150, "역사선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "오늘 확실히 가르쳐 주겠습니다! 도서관의 규칙을!"],
[150, "화학선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "화학실에 멋대로 침입한 벌을 내리겠다!!"],
[150, "전술선생님", null, 0, null, 85, 45, 85, 0, 160, 300, null, null, "으하하하!! 그럼 어디 한 번 시험해 볼까! 너의 전술을!"],
[150, "꿈꾸는 바할로모트", null, 0, null, 90, 40, 90, 0, 160, 300, null, "환술", "난 이 학교의 교장이니까 말일세!"],
[999, "치료사", null, 0, null, 65, 55, 65, 0, 160, 300, null, null],
[999, "커스터드총리", null, 0, null, 63, 63, 63, 0, 160, 300, null, null],
[150, "3단케이크마녀", null, 0, null, 70, 70, 70, 0, 160, 300, null, null]
],
"general_ex":[
[999, "바람궁수", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "달빛술사", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "바다요정", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "불꽃정령", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[150, "어둠마녀", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "천년나무", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "다크카카오", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "세인트릴리", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "홀리베리", null, 0, null, 60, 60, 60, 0, 160, 300, null, null],
[999, "골드치즈", null, 0, null, 60, 60, 60, 0, 160, 300, null, null]
],
"events":[
[
["or", ["Date", "==", null, 12], ["Date", "==", null, 6]],
["CreateManyNPC", 10, 10],
["DeleteEvent"]
],
[
["Date", "==", 181, 1],
["RaiseNPCNation"],
["DeleteEvent"]
]
]
}
+1 -1
View File
@@ -60,7 +60,7 @@
"events":[ "events":[
[ [
["Date", "==", null, 12], ["Date", "==", null, 12],
["CreateManyNPC", 30], ["CreateManyNPC", 10, 10],
["DeleteEvent"] ["DeleteEvent"]
], ],
[ [
+1 -1
View File
@@ -12,7 +12,7 @@
"events": [ "events": [
[ [
["Date", "==", null, 12], ["Date", "==", null, 12],
["CreateManyNPC", 100], ["CreateManyNPC", 100, 0],
["DeleteEvent"] ["DeleteEvent"]
], ],
[ [
+9 -9
View File
@@ -1,13 +1,13 @@
<div class="buttonPlate bg1"> <div class="buttonPlate bg1">
<div> <div>
<a href="a_status.php" target="_blank"><button type="button" class="toolbarButton">세력도</button></a> <a href="a_status.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력도</button></a>
<a href="a_kingdomList.php" target="_blank"><button type="button" class="toolbarButton">세력일람</button></a> <a href="a_kingdomList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">세력일람</button></a>
<a href="a_genList.php" target="_blank"><button type="button" class="toolbarButton">장수일람</button></a> <a href="a_genList.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">장수일람</button></a>
<a href="a_bestGeneral.php" target="_blank"><button type="button" class="toolbarButton">명장일람</button></a> <a href="a_bestGeneral.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명장일람</button></a>
<a href="a_history.php" target="_blank"><button type="button" class="toolbarButton">연감</button></a> <a href="a_history.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">연감</button></a>
<a href="a_hallOfFame.php" target="_blank"><button type="button" class="toolbarButton">명예의전당</button></a> <a href="a_hallOfFame.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">명예의전당</button></a>
<a href="a_emperior.php" target="_blank"><button type="button" class="toolbarButton">왕조일람</button></a> <a href="a_emperior.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">왕조일람</button></a>
<a href="a_traffic.php" target="_blank"><button type="button" class="toolbarButton">접속량정보</button></a> <a href="a_traffic.php" target="_blank" class="open-window"><button type="button" class="toolbarButton">접속량정보</button></a>
</div> </div>
<div> <div>
<a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a> <a href="/bbs/board" target="_blank"><button type="button" class="toolbarButton2">삼모게시판</button></a>
@@ -17,6 +17,6 @@
<a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a> <a href="/bbs/history3" target="_blank"><button type="button" class="toolbarButton">국가 열전</button></a>
<a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a> <a href="/bbs/patch" target="_blank"><button type="button" class="toolbarButton">패치 내역</button></a>
<a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a> <a href="battle_simulator.php" target="_blank"><button type="button" class="toolbarButton">전투 시뮬레이터</button></a>
<a href="<?=$site?>" target="_blank"><button type="button" class="toolbarButton"><?=$call?></button></a> <a href="<?=$site?>" target="_blank" class="open-window"><button type="button" class="toolbarButton"><?=$call?></button></a>
</div> </div>
</div> </div>
+5 -5
View File
@@ -8,18 +8,18 @@
<a href='b_dipcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 무 부</button></a> <a href='b_dipcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 무 부</button></a>
<a href='b_chiefcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>사 령 부</button></a> <a href='b_chiefcenter.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>사 령 부</button></a>
<a href='v_NPCControl.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>NPC 정책</button></a> <a href='v_NPCControl.php'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>NPC 정책</button></a>
<a href='b_genList.php' target='_blank'><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>암 행 부</button></a> <a href='b_genList.php' target='_blank' class="open-window"><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>암 행 부</button></a>
<a href='b_tournament.php' target='_blank'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'> </button></a> <a href='b_tournament.php' target='_blank' class="open-window"><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'> </button></a>
<a href='b_myKingdomInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 정보</button></a> <a href='b_myKingdomInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 정보</button></a>
<a href='b_myCityInfo.php'><button type="button" class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 도시</button></a> <a href='b_myCityInfo.php'><button type="button" class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 도시</button></a>
<a href='b_myGenInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 장수</button></a> <a href='b_myGenInfo.php'><button type="button" class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 장수</button></a>
<a href='b_diplomacy.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>중원 정보</button></a> <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_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> <a href='b_battleCenter.php' target='_blank' class="open-window"><button type="button" class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>감 찰 부</button></a>
<a href='v_inheritPoint.php'><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>유산 관리</button></a> <a href='v_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_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_auction.php' target='_blank' class="open-window"><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> <a href='b_betting.php' target='_blank' class="open-window"><button type="button" class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'> </button></a>
</div> </div>
</div> </div>
+5 -5
View File
@@ -149,7 +149,7 @@
<div class="col col-md-1 col-3"> <div class="col col-md-1 col-3">
<label <label
><input type="checkbox" v-model="displayInherit" />{{ ><input type="checkbox" v-model="displayInherit" />{{
displayTable ? "숨기기" : "보이기" displayInherit ? "숨기기" : "보이기"
}}</label }}</label
> >
</div> </div>
@@ -305,7 +305,7 @@ import {
CTableRow, CTableRow,
CTableHeaderCell, CTableHeaderCell,
CTableDataCell, CTableDataCell,
} from "@coreui/vue/src"; } from "@coreui/vue/src/components/table";
import { getIconPath } from "./util/getIconPath"; import { getIconPath } from "./util/getIconPath";
import { isBrightColor } from "./util/isBrightColor"; import { isBrightColor } from "./util/isBrightColor";
import { import {
@@ -458,21 +458,21 @@ export default defineComponent({
}, },
inheritTurnTimeMinute(newValue: number) { inheritTurnTimeMinute(newValue: number) {
if (!this.inheritTurnTimeSet) { if (!this.inheritTurnTimeSet) {
this.args.inheritTurntime = 0; this.args.inheritTurntime = undefined;
return; return;
} }
this.args.inheritTurntime = newValue * 60 + this.inheritTurnTimeSecond; this.args.inheritTurntime = newValue * 60 + this.inheritTurnTimeSecond;
}, },
inheritTurnTimeSecond(newValue: number) { inheritTurnTimeSecond(newValue: number) {
if (!this.inheritTurnTimeSet) { if (!this.inheritTurnTimeSet) {
this.args.inheritTurntime = 0; this.args.inheritTurntime = undefined;
return; return;
} }
this.args.inheritTurntime = this.inheritTurnTimeMinute * 60 + newValue; this.args.inheritTurntime = this.inheritTurnTimeMinute * 60 + newValue;
}, },
inheritTurnTimeSet(newValue: boolean) { inheritTurnTimeSet(newValue: boolean) {
if (!newValue) { if (!newValue) {
this.args.inheritTurntime = 0; this.args.inheritTurntime = undefined;
return; return;
} }
this.args.inheritTurntime = this.args.inheritTurntime =
+9 -1
View File
@@ -50,7 +50,7 @@
<NumberInputWithInfo <NumberInputWithInfo
v-model="nationPolicy.reqHumanWarUrgentRice" v-model="nationPolicy.reqHumanWarUrgentRice"
:step="100" :step="100"
title="유저전투장 긴급포상 " title="유저전투장 긴급포상 "
>유저장긴급포상시 이보다 쌀이 적은 장수에게 포상합니다.<br />0이면 >유저장긴급포상시 이보다 쌀이 적은 장수에게 포상합니다.<br />0이면
기본 병종으로 {{ (defaultStatMax * 100).toLocaleString() }} * 6 사살 기본 병종으로 {{ (defaultStatMax * 100).toLocaleString() }} * 6 사살
가능한 쌀을 기준으로 하며, 수치는 현재 가능한 쌀을 기준으로 하며, 수치는 현재
@@ -154,6 +154,14 @@
title="포상/몰수/헌납/삼/팜 최소 단위" title="포상/몰수/헌납/삼/팜 최소 단위"
>연산결과가 단위보다 적다면 수행하지 않습니다.</NumberInputWithInfo >연산결과가 단위보다 적다면 수행하지 않습니다.</NumberInputWithInfo
> >
</div>
<div class="col">
<NumberInputWithInfo
v-model="nationPolicy.maximumResourceActionAmount"
:step="100"
title="포상/몰수/헌납/삼/팜 최대 단위"
>연산결과가 단위보다 크다면, 값에 맞춥니다.</NumberInputWithInfo
>
</div> </div>
<div class="col"> <div class="col">
<NumberInputWithInfo <NumberInputWithInfo
+3 -3
View File
@@ -893,7 +893,7 @@ $(function ($) {
} }
showBattleResult(result); showBattleResult(result);
}, function (result) { }, function () {
alert('전투 개시 실패!'); alert('전투 개시 실패!');
}); });
} }
@@ -933,7 +933,7 @@ $(function ($) {
} }
reorderDefender(result.order); reorderDefender(result.order);
}, function (result) { }, function () {
alert('재정렬 실패!'); alert('재정렬 실패!');
}); });
} }
@@ -968,7 +968,7 @@ $(function ($) {
}); });
$('#importModal').on('show.bs.modal', function (e) { $('#importModal').on('show.bs.modal', function () {
if (!initGeneralList) { if (!initGeneralList) {
const $list = $('#modalSelector'); const $list = $('#modalSelector');
-1
View File
@@ -19,7 +19,6 @@
"currentCity": "currentCity.ts", "currentCity": "currentCity.ts",
"hallOfFame": "hallOfFame.ts", "hallOfFame": "hallOfFame.ts",
"history": "history.ts", "history": "history.ts",
"join": "legacy/join.ts",
"select_general_from_pool": "select_general_from_pool.ts", "select_general_from_pool": "select_general_from_pool.ts",
"extKingdoms": "extKingdoms.ts", "extKingdoms": "extKingdoms.ts",
"common": "common_deprecated.ts" "common": "common_deprecated.ts"
+1
View File
@@ -125,6 +125,7 @@ export type NationPolicy = {
reqNPCDevelGold: number, reqNPCDevelGold: number,
reqNPCDevelRice: number, reqNPCDevelRice: number,
minimumResourceActionAmount: number, minimumResourceActionAmount: number,
maximumResourceActionAmount: number,
minNPCWarLeadership: number, minNPCWarLeadership: number,
minWarCrew: number, minWarCrew: number,
minNPCRecruitCityPopulation: number, minNPCRecruitCityPopulation: number,

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