Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6282445f7d | ||
|
|
bf244533f7 | ||
|
|
5ebfaf24ee | ||
|
|
0c0283dc02 | ||
|
|
375b08be87 | ||
|
|
cbc8f94b0a | ||
|
|
bdac8d163d | ||
|
|
1f61f37841 | ||
|
|
51d523ae72 | ||
|
|
3f9e4962e6 | ||
|
|
f8fc4fe56b | ||
|
|
fb64b7e412 | ||
|
|
3209cfbc45 | ||
|
|
8a99476136 | ||
|
|
eb80f8d111 | ||
|
|
afde3ce54d | ||
|
|
c4b61fec17 | ||
|
|
0b74abf300 | ||
|
|
e6c3c9f1d4 | ||
|
|
4e7560b4ed | ||
|
|
542491b278 | ||
|
|
d36439355d | ||
|
|
4a80815b39 | ||
|
|
6dc57f2566 | ||
|
|
07e8511ce1 | ||
|
|
8e927831f5 | ||
|
|
2c533d2ab3 | ||
|
|
38208750e7 | ||
|
|
df14d7c306 | ||
|
|
b3612db7d2 | ||
|
|
8d90da659e | ||
|
|
f8ddbc0622 | ||
|
|
673b7054aa | ||
|
|
1472cbf257 | ||
|
|
d806935c58 | ||
|
|
6b56eb79e1 | ||
|
|
d2aea16744 | ||
|
|
bb800f032e | ||
|
|
64b9f9443e | ||
|
|
fd2d3a0e06 | ||
|
|
08d678bdb8 | ||
|
|
418007e572 | ||
|
|
4a1bccdf75 | ||
|
|
00c0b59e9d | ||
|
|
ac82c8ff0b | ||
|
|
f4bef8a090 | ||
|
|
d8a1055bff | ||
|
|
d672ce4d80 | ||
|
|
43ec361d03 | ||
|
|
c3c99c5f76 | ||
|
|
eb1e1421ab | ||
|
|
e8a1d87919 | ||
|
|
921ba6811d | ||
|
|
906dd241b4 | ||
|
|
3f0cd2ad64 | ||
|
|
41420d1954 | ||
|
|
6e5a72b170 | ||
|
|
4b19e6aec8 | ||
|
|
58572cbc36 | ||
|
|
096d5766bf | ||
|
|
f5c5b56492 | ||
|
|
69c69d63e6 | ||
|
|
3fd8b21867 | ||
|
|
8660e8cd85 | ||
|
|
8458f725f2 | ||
|
|
366678c965 | ||
|
|
336b5668db | ||
|
|
55886269ea | ||
|
|
0b3698595b | ||
|
|
05e43a39db | ||
|
|
5737ad3db2 | ||
|
|
4ac174eb9a | ||
|
|
895eec10b4 | ||
|
|
e0d891e89a | ||
|
|
adf7734b85 | ||
|
|
5362be9c21 | ||
|
|
847ece52f2 | ||
|
|
851c59d22c | ||
|
|
0669534bba | ||
|
|
05db47e62a | ||
|
|
4a0e608d1c | ||
|
|
45fe73af86 | ||
|
|
4d9fcd657f | ||
|
|
a057deb0fe | ||
|
|
4766210a7d | ||
|
|
fd26aae6d3 | ||
|
|
c5c092cc8e | ||
|
|
58c0a21d90 | ||
|
|
8dc567f966 | ||
|
|
942b2752f5 | ||
|
|
b9259353f4 | ||
|
|
86c614dd40 | ||
|
|
1a010a16a9 | ||
|
|
d5b5726b1e | ||
|
|
d06f3b6bdf | ||
|
|
97a28f716c | ||
|
|
f54bdfcea0 | ||
|
|
5958c4b0ba | ||
|
|
7c3db881c7 | ||
|
|
51ee2e1b2c | ||
|
|
baa813004b | ||
|
|
86b5269d3d | ||
|
|
860e6dacac | ||
|
|
22025bd89e | ||
|
|
ed9301455d | ||
|
|
35df84e059 | ||
|
|
62deebf310 | ||
|
|
7ed4bd5c01 | ||
|
|
c8eb9332b4 | ||
|
|
1df55f9168 | ||
|
|
b726c6aa96 | ||
|
|
0a71962652 | ||
|
|
160946ef74 | ||
|
|
1dc67317dc | ||
|
|
08f4a2e8bf | ||
|
|
11ffdaa8f7 | ||
|
|
0f853303a4 | ||
|
|
d225eb9b16 | ||
|
|
d926e4b8bc | ||
|
|
3e2df1d4d8 | ||
|
|
d670dbf081 | ||
|
|
f510a312e3 | ||
|
|
19c44e3d31 | ||
|
|
d0848aee67 | ||
|
|
f4b4b6811c | ||
|
|
fecb3f1f7b | ||
|
|
4c924c0763 | ||
|
|
f1e8d70554 | ||
|
|
7d11bc152e |
+35
-29
@@ -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
|
||||||
@@ -153,9 +158,9 @@ return [
|
|||||||
// Thus, both first-party and third-party code being used by
|
// Thus, both first-party and third-party code being used by
|
||||||
// your application should be included in this list.
|
// your application should be included in this list.
|
||||||
'directory_list' => [
|
'directory_list' => [
|
||||||
'hwe/d_setting',
|
'hwe/d_setting',
|
||||||
'hwe/sammo',
|
'hwe/sammo',
|
||||||
'd_setting',
|
'd_setting',
|
||||||
'src/sammo',
|
'src/sammo',
|
||||||
'src/kakao',
|
'src/kakao',
|
||||||
'vendor'
|
'vendor'
|
||||||
@@ -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.
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
The MIT License
|
The MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Hide_D, 62che
|
Copyright (c) 2021 Hide_D, 62che
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
require(__DIR__ . '/vendor/autoload.php');
|
||||||
|
|
||||||
|
|
||||||
|
if (!class_exists('\\sammo\\RootDB')) {
|
||||||
|
Json::dieWithReason('No DB');
|
||||||
|
}
|
||||||
|
|
||||||
|
APIHelper::launch(dirname(__FILE__));
|
||||||
+4
-3
@@ -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
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
+70
-3
@@ -127,8 +127,75 @@ input::-webkit-input-placeholder {
|
|||||||
border-radius: .2rem;
|
border-radius: .2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#running_map{
|
#running_map {
|
||||||
overflow: hidden;
|
|
||||||
border: none;
|
border: none;
|
||||||
width:700px;
|
width: 700px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#map-subframe {
|
||||||
|
display: none;
|
||||||
|
width: 700px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width : 360px) {
|
||||||
|
#map-subframe {
|
||||||
|
display: block;
|
||||||
|
transform: scale(calc(330 / 700));
|
||||||
|
transform-origin: 350px 0px;
|
||||||
|
margin-bottom: -400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-width : 440px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(410 / 700));
|
||||||
|
margin-bottom: -300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width : 480px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(450 / 700));
|
||||||
|
margin-bottom: -250px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-width : 520px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(490 / 700));
|
||||||
|
margin-bottom: -200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width : 576px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(546 / 700));
|
||||||
|
margin-bottom: -150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width : 640px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(600/700));
|
||||||
|
margin-bottom: -100px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-width : 700px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: scale(calc(670 / 700));
|
||||||
|
margin-bottom: -20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (min-width : 730px) {
|
||||||
|
#map-subframe {
|
||||||
|
transform: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+26
-1
@@ -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);
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
;
|
||||||
@@ -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 객체 생성
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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', [
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
include "lib.php";
|
||||||
|
include "func.php";
|
||||||
|
|
||||||
|
APIHelper::launch(dirname(__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
@@ -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;
|
||||||
|
|||||||
@@ -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){
|
{
|
||||||
self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding);
|
if (self::$uDB === null) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
+335
-67
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
use sammo\Event\Action;
|
use sammo\Event\Action;
|
||||||
|
|
||||||
require_once 'process_war.php';
|
require_once 'process_war.php';
|
||||||
@@ -189,7 +190,7 @@ function myNationInfo(General $generalObj)
|
|||||||
$templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
$templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
||||||
|
|
||||||
$nationID = $generalObj->getNationID();
|
$nationID = $generalObj->getNationID();
|
||||||
$nation = $db->queryFirstRow('SELECT * FROM nation WHERE nation = %i', $nationID)??getNationStaticInfo(0);
|
$nation = $db->queryFirstRow('SELECT * FROM nation WHERE nation = %i', $nationID) ?? getNationStaticInfo(0);
|
||||||
$city = $db->queryFirstRow(
|
$city = $db->queryFirstRow(
|
||||||
'SELECT COUNT(*) as cnt, SUM(pop) as totpop, SUM(pop_max) as maxpop from city where nation=%i',
|
'SELECT COUNT(*) as cnt, SUM(pop) as totpop, SUM(pop_max) as maxpop from city where nation=%i',
|
||||||
$nationID
|
$nationID
|
||||||
@@ -198,16 +199,16 @@ function myNationInfo(General $generalObj)
|
|||||||
|
|
||||||
$topChiefs = Util::convertArrayToDict($db->query('SELECT officer_level, no, name, npc FROM general WHERE nation = %i AND officer_level >= 11', $nationID), 'officer_level');
|
$topChiefs = Util::convertArrayToDict($db->query('SELECT officer_level, no, name, npc FROM general WHERE nation = %i AND officer_level >= 11', $nationID), 'officer_level');
|
||||||
|
|
||||||
$level12Name = key_exists(12, $topChiefs)?getColoredName($topChiefs[12]['name'], $topChiefs[12]['npc']):'-';
|
$level12Name = key_exists(12, $topChiefs) ? getColoredName($topChiefs[12]['name'], $topChiefs[12]['npc']) : '-';
|
||||||
$level11Name = key_exists(11, $topChiefs)?getColoredName($topChiefs[11]['name'], $topChiefs[11]['npc']):'-';
|
$level11Name = key_exists(11, $topChiefs) ? getColoredName($topChiefs[11]['name'], $topChiefs[11]['npc']) : '-';
|
||||||
|
|
||||||
$impossibleStrategicCommandLists = [];
|
$impossibleStrategicCommandLists = [];
|
||||||
$strategicCommandLists = GameConst::$availableChiefCommand['전략'];
|
$strategicCommandLists = GameConst::$availableChiefCommand['전략'];
|
||||||
$yearMonth = Util::joinYearMonth($admin['year'], $admin['month']);
|
$yearMonth = Util::joinYearMonth($admin['year'], $admin['month']);
|
||||||
foreach($strategicCommandLists as $command){
|
foreach ($strategicCommandLists as $command) {
|
||||||
$cmd = buildNationCommandClass($command, $generalObj, $admin, new LastTurn());
|
$cmd = buildNationCommandClass($command, $generalObj, $admin, new LastTurn());
|
||||||
$nextAvailableTurn = $cmd->getNextAvailableTurn();
|
$nextAvailableTurn = $cmd->getNextAvailableTurn();
|
||||||
if($nextAvailableTurn > $yearMonth){
|
if ($nextAvailableTurn > $yearMonth) {
|
||||||
$impossibleStrategicCommandLists[] = [$cmd->getName(), $nextAvailableTurn - $yearMonth];
|
$impossibleStrategicCommandLists[] = [$cmd->getName(), $nextAvailableTurn - $yearMonth];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,28 +240,28 @@ function myNationInfo(General $generalObj)
|
|||||||
<tr>
|
<tr>
|
||||||
<td class='bg1 center'><b>총주민</b></td>
|
<td class='bg1 center'><b>총주민</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
echo $nationID===0 ? "해당 없음" : "{$city['totpop']}/{$city['maxpop']}";
|
echo $nationID === 0 ? "해당 없음" : "{$city['totpop']}/{$city['maxpop']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
<td class='bg1 center'><b>총병사</b></td>
|
<td class='bg1 center'><b>총병사</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
echo $nationID===0 ? "해당 없음" : "{$general['totcrew']}/{$general['maxcrew']}";
|
echo $nationID === 0 ? "해당 없음" : "{$general['totcrew']}/{$general['maxcrew']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='bg1 center'><b>국 고</b></td>
|
<td class='bg1 center'><b>국 고</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
echo $nationID===0 ? "해당 없음" : "{$nation['gold']}";
|
echo $nationID === 0 ? "해당 없음" : "{$nation['gold']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
<td class='bg1 center'><b>병 량</b></td>
|
<td class='bg1 center'><b>병 량</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
echo $nationID===0 ? "해당 없음" : "{$nation['rice']}";
|
echo $nationID === 0 ? "해당 없음" : "{$nation['rice']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='bg1 center'><b>지급률</b></td>
|
<td class='bg1 center'><b>지급률</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
if ($nationID===0) {
|
if ($nationID === 0) {
|
||||||
echo "해당 없음";
|
echo "해당 없음";
|
||||||
} else {
|
} else {
|
||||||
echo $nation['bill'] == 0 ? "0 %" : "{$nation['bill']} %";
|
echo $nation['bill'] == 0 ? "0 %" : "{$nation['bill']} %";
|
||||||
@@ -269,7 +270,7 @@ function myNationInfo(General $generalObj)
|
|||||||
</td>
|
</td>
|
||||||
<td class='bg1 center'><b>세 율</b></td>
|
<td class='bg1 center'><b>세 율</b></td>
|
||||||
<td class='center'>";
|
<td class='center'>";
|
||||||
if ($nationID===0) {
|
if ($nationID === 0) {
|
||||||
echo "해당 없음";
|
echo "해당 없음";
|
||||||
} else {
|
} else {
|
||||||
echo $nation['rate'] == 0 ? "0 %" : "{$nation['rate']} %";
|
echo $nation['rate'] == 0 ? "0 %" : "{$nation['rate']} %";
|
||||||
@@ -285,7 +286,7 @@ function myNationInfo(General $generalObj)
|
|||||||
|
|
||||||
$nation['tech'] = "$techCall / {$nation['tech']}";
|
$nation['tech'] = "$techCall / {$nation['tech']}";
|
||||||
|
|
||||||
if ($nationID===0) {
|
if ($nationID === 0) {
|
||||||
$nation['strategic_cmd_limit'] = "<font color=white>해당 없음</font>";
|
$nation['strategic_cmd_limit'] = "<font color=white>해당 없음</font>";
|
||||||
$nation['surlimit'] = "<font color=white>해당 없음</font>";
|
$nation['surlimit'] = "<font color=white>해당 없음</font>";
|
||||||
$nation['scout'] = "<font color=white>해당 없음</font>";
|
$nation['scout'] = "<font color=white>해당 없음</font>";
|
||||||
@@ -294,20 +295,20 @@ function myNationInfo(General $generalObj)
|
|||||||
} else {
|
} else {
|
||||||
if ($nation['strategic_cmd_limit'] != 0) {
|
if ($nation['strategic_cmd_limit'] != 0) {
|
||||||
$nation['strategic_cmd_limit'] = "<font color=red>{$nation['strategic_cmd_limit']}턴</font>";
|
$nation['strategic_cmd_limit'] = "<font color=red>{$nation['strategic_cmd_limit']}턴</font>";
|
||||||
} else if($impossibleStrategicCommandLists) {
|
} else if ($impossibleStrategicCommandLists) {
|
||||||
$nation['strategic_cmd_limit'] = "<font color=yellow>가 능</font>";
|
$nation['strategic_cmd_limit'] = "<font color=yellow>가 능</font>";
|
||||||
} else{
|
} else {
|
||||||
$nation['strategic_cmd_limit'] = "<font color=limegreen>가 능</font>";
|
$nation['strategic_cmd_limit'] = "<font color=limegreen>가 능</font>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($impossibleStrategicCommandLists){
|
if ($impossibleStrategicCommandLists) {
|
||||||
$text = [];
|
$text = [];
|
||||||
foreach($impossibleStrategicCommandLists as [$cmdName, $remainTurn]){
|
foreach ($impossibleStrategicCommandLists as [$cmdName, $remainTurn]) {
|
||||||
$text[] = "{$cmdName}: {$remainTurn}턴 뒤";
|
$text[] = "{$cmdName}: {$remainTurn}턴 뒤";
|
||||||
}
|
}
|
||||||
$nation['strategic_cmd_limit'] = $templates->render('tooltip', [
|
$nation['strategic_cmd_limit'] = $templates->render('tooltip', [
|
||||||
'text'=>'<span style="text-decoration:underline dashed;">'.$nation['strategic_cmd_limit'].'</span>',
|
'text' => '<span style="text-decoration:underline dashed;">' . $nation['strategic_cmd_limit'] . '</span>',
|
||||||
'info'=>'<span class="text-left d-inline-block">'.join('<br>', $text).'</span>',
|
'info' => '<span class="text-left d-inline-block">' . join('<br>', $text) . '</span>',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,11 +337,11 @@ function myNationInfo(General $generalObj)
|
|||||||
<tr>
|
<tr>
|
||||||
<td style='text-align:center;' class='bg1'><b>속 령</b></td>
|
<td style='text-align:center;' class='bg1'><b>속 령</b></td>
|
||||||
<td style='text-align:center;'>";
|
<td style='text-align:center;'>";
|
||||||
echo $nationID===0 ? "-" : "{$city['cnt']}";
|
echo $nationID === 0 ? "-" : "{$city['cnt']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
<td style='text-align:center;' class='bg1'><b>장 수</b></td>
|
<td style='text-align:center;' class='bg1'><b>장 수</b></td>
|
||||||
<td style='text-align:center;'>";
|
<td style='text-align:center;'>";
|
||||||
echo $nationID===0 ? "-" : "{$general['cnt']}";
|
echo $nationID === 0 ? "-" : "{$general['cnt']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -348,7 +349,7 @@ function myNationInfo(General $generalObj)
|
|||||||
<td style='text-align:center;'>{$nation['power']}</td>
|
<td style='text-align:center;'>{$nation['power']}</td>
|
||||||
<td style='text-align:center;' class='bg1'><b>기술력</b></td>
|
<td style='text-align:center;' class='bg1'><b>기술력</b></td>
|
||||||
<td style='text-align:center;'>";
|
<td style='text-align:center;'>";
|
||||||
echo $nationID===0 ? "-" : "{$nation['tech']}";
|
echo $nationID === 0 ? "-" : "{$nation['tech']}";
|
||||||
echo "</td>
|
echo "</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -904,7 +905,7 @@ function nationMsg(General $general)
|
|||||||
$nationID = $general->getNationID();
|
$nationID = $general->getNationID();
|
||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
|
|
||||||
return $nationStor->notice??'';
|
return $nationStor->notice ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function banner()
|
function banner()
|
||||||
@@ -1227,13 +1228,13 @@ function updateOnline()
|
|||||||
$onlineNum = count($onlineUser);
|
$onlineNum = count($onlineUser);
|
||||||
$onlineNationUsers = Util::arrayGroupBy($onlineUser, 'nation');
|
$onlineNationUsers = Util::arrayGroupBy($onlineUser, 'nation');
|
||||||
|
|
||||||
uasort($onlineNationUsers, function(array $lhs, array $rhs){
|
uasort($onlineNationUsers, function (array $lhs, array $rhs) {
|
||||||
return -(count($lhs)<=>count($rhs));
|
return - (count($lhs) <=> count($rhs));
|
||||||
});
|
});
|
||||||
|
|
||||||
$onlineNation = [];
|
$onlineNation = [];
|
||||||
|
|
||||||
foreach($onlineNationUsers as $nationID=>$rawOnlineUser){
|
foreach ($onlineNationUsers as $nationID => $rawOnlineUser) {
|
||||||
$nationName = getNationStaticInfo($nationID)['name'];
|
$nationName = getNationStaticInfo($nationID)['name'];
|
||||||
$onlineNation[] = "【{$nationName}】";
|
$onlineNation[] = "【{$nationName}】";
|
||||||
$userList = join(', ', Util::squeezeFromArray($rawOnlineUser, 'name'));
|
$userList = join(', ', Util::squeezeFromArray($rawOnlineUser, 'name'));
|
||||||
@@ -1255,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) {
|
||||||
@@ -1265,7 +1269,7 @@ function addAge()
|
|||||||
$generalID = $general['no'];
|
$generalID = $general['no'];
|
||||||
$special = SpecialityHelper::pickSpecialDomestic(
|
$special = SpecialityHelper::pickSpecialDomestic(
|
||||||
$general,
|
$general,
|
||||||
(Json::decode($general['aux'])['prev_types_special'])??[]
|
(Json::decode($general['aux'])['prev_types_special']) ?? []
|
||||||
);
|
);
|
||||||
$specialClass = buildGeneralSpecialDomesticClass($special);
|
$specialClass = buildGeneralSpecialDomesticClass($special);
|
||||||
$specialText = $specialClass->getName();
|
$specialText = $specialClass->getName();
|
||||||
@@ -1282,16 +1286,25 @@ function addAge()
|
|||||||
|
|
||||||
foreach ($db->query('SELECT no,name,nation,leadership,strength,intel,npc,dex1,dex2,dex3,dex4,dex5,aux from general where specage2<=age and special2=%s', GameConst::$defaultSpecialWar) as $general) {
|
foreach ($db->query('SELECT no,name,nation,leadership,strength,intel,npc,dex1,dex2,dex3,dex4,dex5,aux from general where specage2<=age and special2=%s', GameConst::$defaultSpecialWar) as $general) {
|
||||||
$generalID = $general['no'];
|
$generalID = $general['no'];
|
||||||
$special2 = SpecialityHelper::pickSpecialWar(
|
$generalAux = Json::decode($general['aux']);
|
||||||
$general,
|
|
||||||
(Json::decode($general['aux'])['prev_types_special2'])??[]
|
$updateVars = [];
|
||||||
);
|
if (key_exists('inheritSpecificSpecialWar', $generalAux)) {
|
||||||
|
$special2 = $generalAux['inheritSpecificSpecialWar'];
|
||||||
|
unset($generalAux['inheritSpecificSpecialWar']);
|
||||||
|
$updateVars['aux'] = Json::encode($generalAux);
|
||||||
|
} else {
|
||||||
|
$special2 = SpecialityHelper::pickSpecialWar(
|
||||||
|
$general,
|
||||||
|
($generalAux['prev_types_special2']) ?? []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$specialClass = buildGeneralSpecialWarClass($special2);
|
$specialClass = buildGeneralSpecialWarClass($special2);
|
||||||
$specialText = $specialClass->getName();
|
$specialText = $specialClass->getName();
|
||||||
|
|
||||||
$db->update('general', [
|
$updateVars['special2'] = $special2;
|
||||||
'special2' => $special2
|
$db->update('general', $updateVars, 'no=%i', $general['no']);
|
||||||
], 'no=%i', $general['no']);
|
|
||||||
|
|
||||||
$logger = new ActionLogger($generalID, $general['nation'], $year, $month);
|
$logger = new ActionLogger($generalID, $general['nation'], $year, $month);
|
||||||
|
|
||||||
@@ -1335,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;
|
||||||
//전력전 40%, 통, 일, 설 각 20%
|
|
||||||
if ($type > 3) {
|
|
||||||
$type = 0;
|
|
||||||
}
|
|
||||||
startTournament($admin['tnmt_trig'], $type);
|
|
||||||
}
|
}
|
||||||
|
if($tnmt_trig == 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!Util::randBool(0.4)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$tnmt_pattern){
|
||||||
|
// 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||||
|
//전력전 40%, 통, 일, 설 각 20%
|
||||||
|
$tnmt_pattern = [0, 0, 1, 2, 3];
|
||||||
|
shuffle($tnmt_pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
$tnmt_type = array_pop($tnmt_pattern);
|
||||||
|
$gameStor->setValue('tnmt_pattern', $tnmt_pattern);
|
||||||
|
startTournament($tnmt_trig, $tnmt_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckHall($no)
|
function CheckHall($no)
|
||||||
@@ -1537,15 +1562,15 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
|
|||||||
$occupiedUnique = [];
|
$occupiedUnique = [];
|
||||||
|
|
||||||
$invalidItemType = [];
|
$invalidItemType = [];
|
||||||
foreach(array_keys(GameConst::$allItems) as $itemType){
|
foreach (array_keys(GameConst::$allItems) as $itemType) {
|
||||||
$ownItem = $general->getItems()[$itemType]??null;
|
$ownItem = $general->getItems()[$itemType] ?? null;
|
||||||
if($ownItem !== null && !$ownItem->isBuyable()){
|
if ($ownItem !== null && !$ownItem->isBuyable()) {
|
||||||
$invalidItemType[$itemType] = true;
|
$invalidItemType[$itemType] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (array_keys(GameConst::$allItems) as $itemType) {
|
foreach (array_keys(GameConst::$allItems) as $itemType) {
|
||||||
if(key_exists($itemType, $invalidItemType)){
|
if (key_exists($itemType, $invalidItemType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach ($db->queryAllLists('SELECT %b, count(*) as cnt FROM general GROUP BY %b', $itemType, $itemType) as [$itemCode, $cnt]) {
|
foreach ($db->queryAllLists('SELECT %b, count(*) as cnt FROM general GROUP BY %b', $itemType, $itemType) as [$itemCode, $cnt]) {
|
||||||
@@ -1561,11 +1586,11 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (GameConst::$allItems as $itemType => $itemCategories) {
|
foreach (GameConst::$allItems as $itemType => $itemCategories) {
|
||||||
if(key_exists($itemType, $invalidItemType)){
|
if (key_exists($itemType, $invalidItemType)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach ($itemCategories as $itemCode => $cnt) {
|
foreach ($itemCategories as $itemCode => $cnt) {
|
||||||
if($cnt == 0){
|
if ($cnt == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!key_exists($itemCode, $occupiedUnique)) {
|
if (!key_exists($itemCode, $occupiedUnique)) {
|
||||||
@@ -1581,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'];
|
||||||
@@ -1607,6 +1642,207 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rollbackInheritUniqueTrial(General $general, string $itemKey, string $reason)
|
||||||
|
{
|
||||||
|
|
||||||
|
$ownerID = $general->getVar('owner');
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
|
||||||
|
$itemTrials = $general->getAuxVar('inheritUniqueTrial');
|
||||||
|
LogText("선택유니크 롤백:{$ownerID}", [$itemKey, $itemTrials]);
|
||||||
|
unset($itemTrials[$itemKey]);
|
||||||
|
if(count($itemTrials) == 0){
|
||||||
|
$itemTrials = null;
|
||||||
|
}
|
||||||
|
$general->setAuxVar('inheritUniqueTrial', $itemTrials);
|
||||||
|
|
||||||
|
|
||||||
|
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
|
||||||
|
$ownTrial = $trialStor->getValue("u{$ownerID}");
|
||||||
|
|
||||||
|
$itemObj = buildItemClass($itemKey);
|
||||||
|
$itemName = $itemObj->getName();
|
||||||
|
|
||||||
|
if ($ownTrial) {
|
||||||
|
//두 값이 general, KVStorage 둘다 있고, 이중에선 KVStorage 값을 기준으로 하자 따르자
|
||||||
|
[,, $amount] = $ownTrial;
|
||||||
|
$trialStor->deleteValue("u{$ownerID}");
|
||||||
|
$general->increaseInheritancePoint('previous', $amount);
|
||||||
|
LogText("선택유니크 롤백포인트:{$ownerID}", $amount);
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($ownerID);
|
||||||
|
$userLogger->push("{$itemName} 입찰에 사용한 {$amount} 포인트 반환", "inheritPoint");
|
||||||
|
}
|
||||||
|
|
||||||
|
//메시지
|
||||||
|
|
||||||
|
$staticNation = $general->getStaticNation();
|
||||||
|
|
||||||
|
$unlimited = new \DateTime('9999-12-31');
|
||||||
|
$src = new MessageTarget(0, '', 0, 'System', '#000000');
|
||||||
|
$dest = new MessageTarget($general->getID(), $general->getName(), $general->getNationID(), $staticNation['name'], $staticNation['color'], GetImageURL($general->getVar('imgsvr'), $general->getVar('picture')));
|
||||||
|
$josaUl = JosaUtil::pick($itemName, '을');
|
||||||
|
$msg = new Message(
|
||||||
|
Message::MSGTYPE_PRIVATE,
|
||||||
|
$src,
|
||||||
|
$dest,
|
||||||
|
"{$itemName}{$josaUl} 얻지 못했습니다. {$reason}",
|
||||||
|
new DateTime(),
|
||||||
|
$unlimited,
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
$general->applyDB($db);
|
||||||
|
$msg->send(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryRollbackInheritUniqueItem(General $general): void
|
||||||
|
{
|
||||||
|
tryInheritUniqueItem($general, 'Rollback', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryInheritUniqueItem(General $general, string $acquireType = '아이템', bool $justRollback = false): bool
|
||||||
|
{
|
||||||
|
$ownerID = $general->getVar('owner');
|
||||||
|
if (!$ownerID) {
|
||||||
|
LogText("선택유니크 실패???: {$ownerID}", $general->getName());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemTrials = $general->getAuxVar('inheritUniqueTrial') ?? [];
|
||||||
|
arsort($itemTrials);
|
||||||
|
LogText("선택유니크항목: {$ownerID}", $itemTrials);
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
|
||||||
|
$ownTarget = null;
|
||||||
|
$ownType = null;
|
||||||
|
|
||||||
|
foreach ($itemTrials as $itemKey => $amount) {
|
||||||
|
$availableItemTypes = [];
|
||||||
|
$reasons = [];
|
||||||
|
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||||
|
//아직은 그런 경우는 없지만 동일 유니크를 여러 부위에 장착할 수 있을지도 모름
|
||||||
|
if (!key_exists($itemKey, $itemList)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$ownItem = $general->getItem($itemType);
|
||||||
|
if ($ownItem->getRawClassName() == $itemKey) {
|
||||||
|
$reasons[] = '이미 그 유니크를 가지고 있습니다.';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (!$ownItem->isBuyable()) {
|
||||||
|
$reasons[] = '이미 다른 유니크를 가지고 있습니다.';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
$availableCnt = $itemList[$itemKey];
|
||||||
|
$occupiedCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE %b = %s', $itemType, $itemKey);
|
||||||
|
if ($occupiedCnt >= $availableCnt) {
|
||||||
|
$reasons[] = '그 유니크는 모두 점유되었습니다.';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$availableItemTypes[] = $itemType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$availableItemTypes) {
|
||||||
|
rollbackInheritUniqueTrial($general, $itemKey, join(' ', $reasons));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$reasons = [];
|
||||||
|
|
||||||
|
$itemType = Util::choiceRandom($availableItemTypes);
|
||||||
|
|
||||||
|
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}"); //혹시 itemKey의 크기가 37이 넘을 수 있을까?
|
||||||
|
$anyTrials = $trialStor->getAll();
|
||||||
|
if (!$anyTrials) {
|
||||||
|
//순서가 꼬였던 모양, 실제 값은 storage를 우선시하자
|
||||||
|
rollbackInheritUniqueTrial($general, $itemKey, '절차상의 오류입니다.');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//XXX: 정렬할 필요 없지 않나?
|
||||||
|
usort($anyTrials, function ($lhsTrial, $rhsTrial) {
|
||||||
|
[,, $lhsAmount] = $lhsTrial;
|
||||||
|
[,, $rhsAmount] = $rhsTrial;
|
||||||
|
return $rhsAmount <=> $lhsAmount; //큰 값이 앞에 오도록
|
||||||
|
});
|
||||||
|
|
||||||
|
LogText("선택유니크상태 {$ownerID} {$itemKey}", $anyTrials);
|
||||||
|
|
||||||
|
//공동 1등인데 본인이 있을 수도 있다.
|
||||||
|
[,, $topAmount] = $anyTrials[0];
|
||||||
|
if ($amount < $topAmount) {
|
||||||
|
$compAmount = $topAmount / $amount;
|
||||||
|
if ($compAmount > 2.0) {
|
||||||
|
$compText = '엄청난 차이로 ';
|
||||||
|
} else if ($compAmount > 1.2) {
|
||||||
|
$compText = '큰 차이로 ';
|
||||||
|
} else if ($compAmount > 1.05) {
|
||||||
|
$compText = '';
|
||||||
|
} else {
|
||||||
|
$compText = '아슬아슬한 차이로 ';
|
||||||
|
}
|
||||||
|
rollbackInheritUniqueTrial($general, $itemKey, "{$compText}상위 입찰한 장수가 있습니다.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//내가 1위다
|
||||||
|
if ($ownTarget !== null) {
|
||||||
|
//이미 다른 아이템을 얻기로 되어있다.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$ownTarget = $itemKey;
|
||||||
|
$ownType = $itemType;
|
||||||
|
}
|
||||||
|
unset($itemKey);
|
||||||
|
unset($itemType);
|
||||||
|
|
||||||
|
if ($ownTarget === null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ($justRollback) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogText("선택유니크획득{$ownerID}", $ownTarget);
|
||||||
|
|
||||||
|
$trialStor = KVStorage::getStorage($db, "ut_{$ownTarget}");
|
||||||
|
$trialStor->deleteValue("u{$ownerID}");
|
||||||
|
|
||||||
|
//rollbackInheritUniqueTrial 과정 때문에 새로 받아와야함
|
||||||
|
$itemTrials = $general->getAuxVar('inheritUniqueTrial');
|
||||||
|
unset($itemTrials[$ownTarget]);
|
||||||
|
$general->setAuxVar('inheritUniqueTrial', $itemTrials);
|
||||||
|
|
||||||
|
$nationName = $general->getStaticNation()['name'];
|
||||||
|
$generalName = $general->getName();
|
||||||
|
$josaYi = JosaUtil::pick($generalName, '이');
|
||||||
|
$itemObj = buildItemClass($ownTarget);
|
||||||
|
$itemName = $itemObj->getName();
|
||||||
|
$itemRawName = $itemObj->getRawName();
|
||||||
|
$josaUl = JosaUtil::pick($itemRawName, '을');
|
||||||
|
|
||||||
|
|
||||||
|
$general->setVar($ownType, $ownTarget);
|
||||||
|
|
||||||
|
|
||||||
|
$logger = $general->getLogger();
|
||||||
|
|
||||||
|
$logger->pushGeneralActionLog("<C>{$itemName}</>{$josaUl} 습득했습니다!");
|
||||||
|
$logger->pushGeneralHistoryLog("<C>{$itemName}</>{$josaUl} 습득");
|
||||||
|
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} <C>{$itemName}</>{$josaUl} 습득했습니다!");
|
||||||
|
$logger->pushGlobalHistoryLog("<C><b>【{$acquireType}】</b></><D><b>{$nationName}</b></>의 <Y>{$generalName}</>{$josaYi} <C>{$itemName}</>{$josaUl} 습득했습니다!");
|
||||||
|
|
||||||
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function tryUniqueItemLottery(General $general, string $acquireType = '아이템'): bool
|
function tryUniqueItemLottery(General $general, string $acquireType = '아이템'): bool
|
||||||
{
|
{
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
@@ -1616,25 +1852,48 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($general->getNPCType() > 6) {
|
$itemTypeCnt = count(GameConst::$allItems);
|
||||||
return false;
|
|
||||||
|
[$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
$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');
|
||||||
@@ -1653,22 +1912,29 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템
|
|||||||
$prob = 1 / ($genCount * $itemTypeCnt / 10 / 4); // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
|
$prob = 1 / ($genCount * $itemTypeCnt / 10 / 4); // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
|
||||||
}
|
}
|
||||||
|
|
||||||
$prob = Util::valueFit($prob, null, 1 / 4);//최대치 감소
|
$prob = Util::valueFit($prob, null, 1 / 4); //최대치 감소
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
|
$prob /= sqrt(2);
|
||||||
|
$moreProb = pow(2, 1 / 4);
|
||||||
|
|
||||||
|
if ($general->getAuxVar('inheritRandomUnique')) {
|
||||||
|
//포인트로 랜덤 유니크 획득
|
||||||
|
$prob = 1;
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
$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);
|
||||||
}
|
}
|
||||||
@@ -1681,7 +1947,7 @@ function getAdmin()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @return General[] */
|
/** @return General[] */
|
||||||
function deleteNation(General $lord, bool $applyDB):array
|
function deleteNation(General $lord, bool $applyDB): array
|
||||||
{
|
{
|
||||||
$lordID = $lord->getID();
|
$lordID = $lord->getID();
|
||||||
$nationID = $lord->getNationID();
|
$nationID = $lord->getNationID();
|
||||||
@@ -1706,7 +1972,8 @@ function deleteNation(General $lord, bool $applyDB):array
|
|||||||
$nationID,
|
$nationID,
|
||||||
$lordID
|
$lordID
|
||||||
),
|
),
|
||||||
['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'belong', 'aux'], 1
|
['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'belong', 'aux'],
|
||||||
|
1
|
||||||
);
|
);
|
||||||
$nationGeneralList[$lordID] = $lord;
|
$nationGeneralList[$lordID] = $lord;
|
||||||
|
|
||||||
@@ -1722,11 +1989,12 @@ function deleteNation(General $lord, bool $applyDB):array
|
|||||||
$destroyHistoryLog = "<D><b>{$nationName}</b></>{$josaYi} <R>멸망</>";
|
$destroyHistoryLog = "<D><b>{$nationName}</b></>{$josaYi} <R>멸망</>";
|
||||||
|
|
||||||
// 전 장수 재야로
|
// 전 장수 재야로
|
||||||
foreach($nationGeneralList as $general){
|
foreach ($nationGeneralList as $general) {
|
||||||
$general->setAuxVar('max_belong',
|
$general->setAuxVar(
|
||||||
|
'max_belong',
|
||||||
max(
|
max(
|
||||||
$general->getVar('belong'),
|
$general->getVar('belong'),
|
||||||
$general->getAuxVar('max_belong')??0
|
$general->getAuxVar('max_belong') ?? 0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$general->setVar('belong', 0);
|
$general->setVar('belong', 0);
|
||||||
@@ -1739,7 +2007,7 @@ function deleteNation(General $lord, bool $applyDB):array
|
|||||||
$logger->pushGeneralActionLog($destroyLog, ActionLogger::PLAIN);
|
$logger->pushGeneralActionLog($destroyLog, ActionLogger::PLAIN);
|
||||||
$logger->pushGeneralHistoryLog($destroyHistoryLog);
|
$logger->pushGeneralHistoryLog($destroyHistoryLog);
|
||||||
|
|
||||||
if($applyDB){
|
if ($applyDB) {
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2158,7 +2426,7 @@ function getRandTurn($term, ?\DateTimeInterface $baseDateTime = null)
|
|||||||
$randSecond = Util::randRangeInt(0, 60 * $term - 1);
|
$randSecond = Util::randRangeInt(0, 60 * $term - 1);
|
||||||
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
|
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
|
||||||
|
|
||||||
return $baseDateTime->add(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s');
|
return TimeUtil::format($baseDateTime->add(TimeUtil::secondsToDateInterval($randSecond + $randFraction)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null)
|
function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null)
|
||||||
@@ -2173,5 +2441,5 @@ function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null)
|
|||||||
$randSecond = Util::randRangeInt(0, 60 * $term - 1);
|
$randSecond = Util::randRangeInt(0, 60 * $term - 1);
|
||||||
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
|
$randFraction = Util::randRangeInt(0, 999999) / 1000000; //6자리 소수
|
||||||
|
|
||||||
return $baseDateTime->sub(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s');
|
return $baseDateTime->sub(TimeUtil::secondsToDateInterval($randSecond + $randFraction))->format('Y-m-d H:i:s.u');
|
||||||
}
|
}
|
||||||
|
|||||||
+80
-41
@@ -167,14 +167,15 @@ 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) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gennum'=>$gennum
|
'gennum' => $gennum
|
||||||
], 'nation=%i', $nationID);
|
], 'nation=%i', $nationID);
|
||||||
}
|
}
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
@@ -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)
|
||||||
@@ -386,7 +391,7 @@ function postUpdateMonthly()
|
|||||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
$genNum[$nationID] = $nation['gennum'];
|
$genNum[$nationID] = $nation['gennum'];
|
||||||
|
|
||||||
$powerValues = $maxPowerValues[$nationID]??[];
|
$powerValues = $maxPowerValues[$nationID] ?? [];
|
||||||
|
|
||||||
//약간의 랜덤치 부여 (95% ~ 105%)
|
//약간의 랜덤치 부여 (95% ~ 105%)
|
||||||
|
|
||||||
@@ -405,7 +410,7 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 전쟁기한 세팅
|
// 전쟁기한 세팅
|
||||||
foreach($db->query('SELECT me, you, dead, term FROM diplomacy WHERE state = 0') as $dip) {
|
foreach ($db->query('SELECT me, you, dead, term FROM diplomacy WHERE state = 0') as $dip) {
|
||||||
$genCount = $genNum[$dip['me']];
|
$genCount = $genNum[$dip['me']];
|
||||||
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
// 25% 참여율일때 두당 10턴에 4000명 소모한다고 계산
|
||||||
// 4000 / 10 * 0.25 = 100
|
// 4000 / 10 * 0.25 = 100
|
||||||
@@ -420,7 +425,7 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//개전국 로그
|
//개전국 로그
|
||||||
foreach($db->query('SELECT me, you FROM diplomacy WHERE state = 1 AND term <= 1 AND me < you') as $dip){
|
foreach ($db->query('SELECT me, you FROM diplomacy WHERE state = 1 AND term <= 1 AND me < you') as $dip) {
|
||||||
$nation1 = getNationStaticInfo($dip['me']);
|
$nation1 = getNationStaticInfo($dip['me']);
|
||||||
$name1 = $nation1['name'];
|
$name1 = $nation1['name'];
|
||||||
$nation2 = getNationStaticInfo($dip['you']);
|
$nation2 = getNationStaticInfo($dip['you']);
|
||||||
@@ -432,14 +437,13 @@ function postUpdateMonthly()
|
|||||||
}
|
}
|
||||||
//휴전국 로그
|
//휴전국 로그
|
||||||
$stopWarList = [];
|
$stopWarList = [];
|
||||||
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)) {
|
||||||
$stopWarList[$key] = true;
|
$stopWarList[$key] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -455,8 +459,8 @@ function postUpdateMonthly()
|
|||||||
|
|
||||||
$globalLogger->pushGlobalHistoryLog("<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.");
|
$globalLogger->pushGlobalHistoryLog("<R><b>【휴전】</b></><D><b>$name1</b></>{$josaWa} <D><b>$name2</b></>{$josaYi} <S>휴전</>합니다.");
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>2,
|
'state' => 2,
|
||||||
'term'=>0,
|
'term' => 0,
|
||||||
], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $me, $you, $me, $you);
|
], '(me=%i AND you=%i) OR (you=%i AND me=%i)', $me, $you, $me, $you);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,17 +468,17 @@ function postUpdateMonthly()
|
|||||||
|
|
||||||
//사상자 초기화, 외교 기한-1
|
//사상자 초기화, 외교 기한-1
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'dead'=>$db->sqleval('if(state!=0, 0, dead)'),
|
'dead' => $db->sqleval('if(state!=0, 0, dead)'),
|
||||||
'term'=>$db->sqleval('greatest(0, term-1)'),
|
'term' => $db->sqleval('greatest(0, term-1)'),
|
||||||
], true);
|
], true);
|
||||||
//불가침 끝나면 통상으로
|
//불가침 끝나면 통상으로
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>2,
|
'state' => 2,
|
||||||
], 'state = 7 AND term = 0');
|
], 'state = 7 AND term = 0');
|
||||||
//선포 끝나면 교전으로
|
//선포 끝나면 교전으로
|
||||||
$db->update('diplomacy', [
|
$db->update('diplomacy', [
|
||||||
'state'=>0,
|
'state' => 0,
|
||||||
'term'=>6,
|
'term' => 6,
|
||||||
], 'state = 1 AND term = 0');
|
], 'state = 1 AND term = 0');
|
||||||
|
|
||||||
//초반이후 방랑군 자동 해체
|
//초반이후 방랑군 자동 해체
|
||||||
@@ -567,8 +571,8 @@ function updateNationState()
|
|||||||
|
|
||||||
$updateVals = [
|
$updateVals = [
|
||||||
'level' => $nationlevel,
|
'level' => $nationlevel,
|
||||||
'gold'=>$db->sqleval('gold + %i', $nationlevel*1000),
|
'gold' => $db->sqleval('gold + %i', $nationlevel * 1000),
|
||||||
'rice'=>$db->sqleval('rice + %i', $nationlevel*1000),
|
'rice' => $db->sqleval('rice + %i', $nationlevel * 1000),
|
||||||
];
|
];
|
||||||
|
|
||||||
switch ($nationlevel) {
|
switch ($nationlevel) {
|
||||||
@@ -623,15 +627,26 @@ function updateNationState()
|
|||||||
$nation['nation'],
|
$nation['nation'],
|
||||||
$targetKillTurn
|
$targetKillTurn
|
||||||
);
|
);
|
||||||
$nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc'], 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -699,9 +716,9 @@ function updateNationState()
|
|||||||
$nation['nation']
|
$nation['nation']
|
||||||
);
|
);
|
||||||
$npcObj->setAffinity(999)->setStat(10, 10, 10)
|
$npcObj->setAffinity(999)->setStat(10, 10, 10)
|
||||||
->setSpecialSingle('척사')->setEgo('che_은둔')
|
->setSpecialSingle('척사')->setEgo('che_은둔')
|
||||||
->setKillturn(70)->setGoldRice(0, 0)
|
->setKillturn(70)->setGoldRice(0, 0)
|
||||||
->setNPCType(5)->fillRemainSpecAsZero($admin);
|
->setNPCType(5)->fillRemainSpecAsZero($admin);
|
||||||
$npcObj->build($admin);
|
$npcObj->build($admin);
|
||||||
$npcID = $npcObj->getGeneralID();
|
$npcID = $npcObj->getGeneralID();
|
||||||
|
|
||||||
@@ -990,9 +1007,9 @@ function checkEmperior()
|
|||||||
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
|
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
|
||||||
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
|
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
|
||||||
|
|
||||||
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
|
foreach (General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj) {
|
||||||
if($genObj->getNationID() == $nationID){
|
if ($genObj->getNationID() == $nationID) {
|
||||||
if($genObj->getVar('officer_level') > 4){
|
if ($genObj->getVar('officer_level') > 4) {
|
||||||
$genObj->increaseInheritancePoint('unifier', 2000);
|
$genObj->increaseInheritancePoint('unifier', 2000);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1008,7 +1025,7 @@ function checkEmperior()
|
|||||||
|
|
||||||
[$totalPop, $totalMaxPop] = $db->queryFirstList('SELECT SUM(pop), SUM(pop_max) FROM city');
|
[$totalPop, $totalMaxPop] = $db->queryFirstList('SELECT SUM(pop), SUM(pop_max) FROM city');
|
||||||
$pop = "{$totalPop} / {$totalMaxPop}";
|
$pop = "{$totalPop} / {$totalMaxPop}";
|
||||||
$poprate = round($totalPop / $totalMaxPop * 100, 2). " %";
|
$poprate = round($totalPop / $totalMaxPop * 100, 2) . " %";
|
||||||
|
|
||||||
$chiefs = Util::convertArrayToDict(
|
$chiefs = Util::convertArrayToDict(
|
||||||
$db->query(
|
$db->query(
|
||||||
@@ -1150,31 +1167,53 @@ function checkEmperior()
|
|||||||
LogHistory();
|
LogHistory();
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetInheritanceUser(int $userID, bool $isRebirth=false){
|
function resetInheritanceUser(int $userID, bool $isRebirth = false): float
|
||||||
|
{
|
||||||
$rebirthDegraded = [
|
$rebirthDegraded = [
|
||||||
'dex'=>0.5,
|
'dex' => 0.5,
|
||||||
];
|
];
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
|
||||||
$totalPoint = 0;
|
$totalPoint = 0;
|
||||||
foreach($inheritStor->getAll() as $key=>[$value,]){
|
$allPoints = $inheritStor->getAll();
|
||||||
if(key_exists($key, $rebirthDegraded)){
|
if (!$allPoints || count($allPoints) == 0) {
|
||||||
|
//비었으므로 리셋 안함
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (count($allPoints) == 1 && key_exists('previous', $allPoints)) {
|
||||||
|
//이미 리셋되었으므로 리셋 안함
|
||||||
|
return $allPoints['previous'][0];
|
||||||
|
}
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
|
||||||
|
$previousPoint = ($allPoints['previous'] ?? [0, 0])[0];
|
||||||
|
|
||||||
|
foreach ($allPoints as $key => [$value,]) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
$oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
|
$oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
|
||||||
if($maxDomesticCritical > $oldMaxDomesticCritical){
|
if ($maxDomesticCritical > $oldMaxDomesticCritical) {
|
||||||
$general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
|
$general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
+130
-88
@@ -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,99 +17,102 @@ 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;
|
case 3: $unit = 180; break;
|
||||||
case 3: $unit = 180; break;
|
case 4: $unit = 60; break;
|
||||||
case 4: $unit = 60; break;
|
case 5: $unit = 30; break;
|
||||||
case 5: $unit = 30; break;
|
case 6: $unit = 15; break;
|
||||||
case 6: $unit = 15; break;
|
case 7: $unit = 5; break;
|
||||||
case 7: $unit = 5; break;
|
default: throw new MustNotBeReachedException();
|
||||||
default: throw new MustNotBeReachedException();
|
}
|
||||||
|
|
||||||
|
//업데이트 횟수
|
||||||
|
$iter = intdiv($offset, $unit) + 1;
|
||||||
|
|
||||||
|
for($i=0; $i < $iter; $i++) {
|
||||||
|
switch($tnmt) {
|
||||||
|
case 1: //신청 마감
|
||||||
|
fillLowGenAll();
|
||||||
|
$tnmt = 2; $phase = 0;
|
||||||
|
break;
|
||||||
|
case 2: //예선중
|
||||||
|
qualify($type, $tnmt, $phase); $phase++;
|
||||||
|
if($phase >= 56) { $tnmt = 3; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 3: //추첨중
|
||||||
|
selectionAll($type, $tnmt, $phase); $phase+=8;
|
||||||
|
if($phase >= 32) { $tnmt = 4; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 4: //본선중
|
||||||
|
finallySingle($type, $tnmt, $phase); $phase++;
|
||||||
|
if($phase >= 6) { $tnmt = 5; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 5: //배정중
|
||||||
|
final16set();
|
||||||
|
$tnmt = 6; $phase = 0;
|
||||||
|
startBetting();
|
||||||
|
break;
|
||||||
|
case 6: //베팅중
|
||||||
|
$tnmt = 7; $phase = 0;
|
||||||
|
break;
|
||||||
|
case 7: //16강중
|
||||||
|
finalFight($type, $tnmt, $phase, 16); $phase++;
|
||||||
|
if($phase >= 8) { $tnmt = 8; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 8: //8강중
|
||||||
|
finalFight($type, $tnmt, $phase, 8); $phase++;
|
||||||
|
if($phase >= 4) { $tnmt = 9; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 9: //4강중
|
||||||
|
finalFight($type, $tnmt, $phase, 4); $phase++;
|
||||||
|
if($phase >= 2) { $tnmt = 10; $phase = 0; }
|
||||||
|
break;
|
||||||
|
case 10: //결승중
|
||||||
|
finalFight($type, $tnmt, $phase, 2);
|
||||||
|
$tnmt = 0; $phase = 0;
|
||||||
|
setGift($type, $tnmt, $phase);
|
||||||
|
$i = $iter;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//업데이트 횟수
|
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
||||||
$iter = intdiv($admin['offset'], $unit) + 1;
|
if($tnmt == 6) {
|
||||||
|
$betTerm = $unit * 60;
|
||||||
|
if($betTerm > 3600) { $betTerm = 3600; }
|
||||||
|
//처리 초 더한 날짜
|
||||||
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
||||||
|
$gameStor->tournament = $tnmt;
|
||||||
|
$gameStor->phase = $phase;
|
||||||
|
$gameStor->tnmt_time = $dt;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for($i=0; $i < $iter; $i++) {
|
if($admin['tnmt_auto'] == 1) {
|
||||||
switch($tnmt) {
|
//처리 초 더한 날짜
|
||||||
case 1: //신청 마감
|
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
||||||
fillLowGenAll();
|
$hr = substr($dt, 11, 2);
|
||||||
$tnmt = 2; $phase = 0;
|
//지정시간대 넘어가면 중단 20~24시
|
||||||
break;
|
if($hr < 20) {
|
||||||
case 2: //예선중
|
$dt = substr($dt, 0, 11)."20:00:00";
|
||||||
qualify($type, $tnmt, $phase); $phase++;
|
|
||||||
if($phase >= 56) { $tnmt = 3; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 3: //추첨중
|
|
||||||
selectionAll($type, $tnmt, $phase); $phase+=8;
|
|
||||||
if($phase >= 32) { $tnmt = 4; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 4: //본선중
|
|
||||||
finallySingle($type, $tnmt, $phase); $phase++;
|
|
||||||
if($phase >= 6) { $tnmt = 5; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 5: //배정중
|
|
||||||
final16set();
|
|
||||||
$tnmt = 6; $phase = 0;
|
|
||||||
break;
|
|
||||||
case 6: //베팅중
|
|
||||||
$tnmt = 7; $phase = 0;
|
|
||||||
break;
|
|
||||||
case 7: //16강중
|
|
||||||
finalFight($type, $tnmt, $phase, 16); $phase++;
|
|
||||||
if($phase >= 8) { $tnmt = 8; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 8: //8강중
|
|
||||||
finalFight($type, $tnmt, $phase, 8); $phase++;
|
|
||||||
if($phase >= 4) { $tnmt = 9; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 9: //4강중
|
|
||||||
finalFight($type, $tnmt, $phase, 4); $phase++;
|
|
||||||
if($phase >= 2) { $tnmt = 10; $phase = 0; }
|
|
||||||
break;
|
|
||||||
case 10: //결승중
|
|
||||||
finalFight($type, $tnmt, $phase, 2);
|
|
||||||
$tnmt = 0; $phase = 0;
|
|
||||||
setGift($type, $tnmt, $phase);
|
|
||||||
$i = $iter;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
//베팅은 무조건 60페이즈후 진행(최대 1시간)
|
|
||||||
if($tnmt == 6) {
|
|
||||||
$betTerm = $unit * 60;
|
|
||||||
if($betTerm > 3600) { $betTerm = 3600; }
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
|
|
||||||
$gameStor->tournament = $tnmt;
|
$gameStor->tournament = $tnmt;
|
||||||
$gameStor->phase = $phase;
|
$gameStor->phase = $phase;
|
||||||
$gameStor->tnmt_time = $dt;
|
$gameStor->tnmt_time = $dt;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($admin['tnmt_auto'] == 1) {
|
|
||||||
//처리 초 더한 날짜
|
|
||||||
$dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
|
|
||||||
$hr = substr($dt, 11, 2);
|
|
||||||
//지정시간대 넘어가면 중단 20~24시
|
|
||||||
if($hr < 20) {
|
|
||||||
$dt = substr($dt, 0, 11)."20:00:00";
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = $dt;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$second = $unit * $iter;
|
|
||||||
$gameStor->tournament = $tnmt;
|
|
||||||
$gameStor->phase = $phase;
|
|
||||||
$gameStor->tnmt_time = (new \DateTimeImmutable($admin['tnmt_time']))->add(new \DateInterval("PT{$second}S"))->format('Y-m-d H:i:s');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$second = $unit * $iter;
|
||||||
|
$gameStor->tournament = $tnmt;
|
||||||
|
$gameStor->phase = $phase;
|
||||||
|
$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() {
|
||||||
@@ -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', [
|
||||||
|
|||||||
@@ -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,
|
||||||
]);
|
]);
|
||||||
@@ -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){
|
||||||
|
|||||||
@@ -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));
|
||||||
|
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
|
||||||
if($use_auto_nation_turn != $me->getAuxVar('use_auto_nation_turn')){
|
$me->setVar('tnmt', $tnmt);
|
||||||
$me->setAuxVar('use_auto_nation_turn', $use_auto_nation_turn);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($me->getVar('tnmt') != $tnmt){
|
|
||||||
$me->setVar('tnmt', $tnmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($me->getNPCType() == 1 && $detachNPC){
|
if($me->getNPCType() == 1 && $detachNPC){
|
||||||
$turnterm = $gameStor->turnterm;
|
$turnterm = $gameStor->turnterm;
|
||||||
|
|||||||
+65
-53
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
@@ -21,18 +22,18 @@ $availableTypes = [
|
|||||||
'nationPolicy',
|
'nationPolicy',
|
||||||
];
|
];
|
||||||
|
|
||||||
if(!in_array($type, $availableTypes)){
|
if (!in_array($type, $availableTypes)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'올바른 타입이 아닙니다.',
|
'reason' => '올바른 타입이 아닙니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = Json::decode($data);
|
$data = Json::decode($data);
|
||||||
if(!$data || !is_array($data)){
|
if (!$data || !is_array($data)) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'올바른 입력이 아닙니다.',
|
'reason' => '올바른 입력이 아닙니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,89 +45,90 @@ $me = $db->queryFirstRow('SELECT no, name, npc, nation, city, officer_level, con
|
|||||||
$nationID = $me['nation'];
|
$nationID = $me['nation'];
|
||||||
if (!$nationID) {
|
if (!$nationID) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'국가에 소속되어있지 않습니다.',
|
'reason' => '국가에 소속되어있지 않습니다.',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$permission = checkSecretPermission($me);
|
$permission = checkSecretPermission($me);
|
||||||
if ($permission < 3) {
|
if ($permission < 3) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>'권한이 부족합니다. 군주, 외교권자, 조언자가 아닙니다.'
|
'reason' => '권한이 부족합니다. 군주, 외교권자, 조언자가 아닙니다.'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
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');
|
||||||
|
|
||||||
$defaultPolicy = AutorunNationPolicy::$defaultPolicy;
|
$defaultPolicy = AutorunNationPolicy::$defaultPolicy;
|
||||||
$troopCache = null;
|
$troopCache = null;
|
||||||
foreach($db->queryFirstColumn('SELECT troop_leader FROM troop WHERE nation=%i',$nationID) as $troopID){
|
foreach ($db->queryFirstColumn('SELECT troop_leader FROM troop WHERE nation=%i', $nationID) as $troopID) {
|
||||||
$troopCache[$troopID] = 'Neutral';
|
$troopCache[$troopID] = 'Neutral';
|
||||||
}
|
}
|
||||||
$cityList = CityConst::all();
|
$cityList = CityConst::all();
|
||||||
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
$nationPolicyRoot = $nationStor->npc_nation_policy;
|
||||||
$nationPolicy = $nationPolicyRoot['values']??[];
|
$nationPolicy = $nationPolicyRoot['values'] ?? [];
|
||||||
foreach($policy as $key=>$val){
|
foreach ($policy as $key => $val) {
|
||||||
|
|
||||||
if($key === 'CombatForce'){
|
if ($key === 'CombatForce') {
|
||||||
if(!is_array($val)){
|
if (!is_array($val)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
foreach($val as $troopID=>$troopTarget){
|
foreach ($val as $troopID => $troopTarget) {
|
||||||
if(!key_exists($troopID, $troopCache)){
|
if (!key_exists($troopID, $troopCache)) {
|
||||||
return "{$troopID}는 국가의 부대가 아닙니다.";
|
return "{$troopID}는 국가의 부대가 아닙니다.";
|
||||||
}
|
}
|
||||||
if($troopCache[$troopID] != 'Neutral'){
|
if ($troopCache[$troopID] != 'Neutral') {
|
||||||
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
||||||
}
|
}
|
||||||
if(!is_array($troopTarget) || count($troopTarget)!=2){
|
if (!is_array($troopTarget) || count($troopTarget) != 2) {
|
||||||
return "{$troopID}의 입력양식이 올바르지 않습니다.";
|
return "{$troopID}의 입력양식이 올바르지 않습니다.";
|
||||||
}
|
}
|
||||||
[$fromCity, $toCity] = $troopCache;
|
[$fromCity, $toCity] = $troopCache;
|
||||||
if(!key_exists($fromCity, $cityList) || !key_exists($toCity, $cityList)){
|
if (!key_exists($fromCity, $cityList) || !key_exists($toCity, $cityList)) {
|
||||||
return "{$troopID}의 도시 {$fromCity}, {$toCity}가 올바른 도시 번호가 아닙니다.";
|
return "{$troopID}의 도시 {$fromCity}, {$toCity}가 올바른 도시 번호가 아닙니다.";
|
||||||
}
|
}
|
||||||
$troopCache[$troopID]=$key;
|
$troopCache[$troopID] = $key;
|
||||||
}
|
}
|
||||||
$nationPolicy[$key]=$val;
|
$nationPolicy[$key] = $val;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(in_array($key, ['SupportForce', 'DevelopForce'])){
|
if (in_array($key, ['SupportForce', 'DevelopForce'])) {
|
||||||
if(!is_array($val)){
|
if (!is_array($val)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
foreach($val as $troopID){
|
foreach ($val as $troopID) {
|
||||||
if(!key_exists($troopID, $troopCache)){
|
if (!key_exists($troopID, $troopCache)) {
|
||||||
return "{$troopID}는 국가의 부대가 아닙니다.";
|
return "{$troopID}는 국가의 부대가 아닙니다.";
|
||||||
}
|
}
|
||||||
if($troopCache[$troopID] != 'Neutral'){
|
if ($troopCache[$troopID] != 'Neutral') {
|
||||||
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
return "부대({$troopID}는 하나의 역할만 지정할 수 있습니다.";
|
||||||
}
|
}
|
||||||
$troopCache[$troopID]=$key;
|
$troopCache[$troopID] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nationPolicy[$key]=array_values($val);
|
$nationPolicy[$key] = array_values($val);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!key_exists($key, $defaultPolicy)){
|
if (!key_exists($key, $defaultPolicy)) {
|
||||||
return "{$key}는 올바른 정책값이 아닙니다.";
|
return "{$key}는 올바른 정책값이 아닙니다.";
|
||||||
}
|
}
|
||||||
$defaultValue = $defaultPolicy[$key];
|
$defaultValue = $defaultPolicy[$key];
|
||||||
if(is_numeric($defaultValue) != is_numeric($val)){
|
if (is_numeric($defaultValue) != is_numeric($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_integer($defaultValue) != is_integer($val)){
|
if (is_integer($defaultValue) != is_integer($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_array($defaultValue) != is_array($val)){
|
if (is_array($defaultValue) != is_array($val)) {
|
||||||
return "{$key}는 올바른 값이 아닙니다.";
|
return "{$key}는 올바른 값이 아닙니다.";
|
||||||
}
|
}
|
||||||
if(is_integer($val) && $val < 0){
|
if (is_integer($val) && $val < 0) {
|
||||||
$val = 0;
|
$val = 0;
|
||||||
}
|
}
|
||||||
$nationPolicy[$key] = $val;
|
$nationPolicy[$key] = $val;
|
||||||
@@ -139,14 +141,15 @@ 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;
|
||||||
|
|
||||||
$defaultPriority = AutorunNationPolicy::$defaultPriority;
|
$defaultPriority = AutorunNationPolicy::$defaultPriority;
|
||||||
foreach($priority as $item){
|
foreach ($priority as $item) {
|
||||||
if(!in_array($item, $defaultPriority)){
|
if (!in_array($item, $defaultPriority)) {
|
||||||
return "{$item}은 올바른 명령이 아닙니다.";
|
return "{$item}은 올바른 명령이 아닙니다.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
foreach($priority as $item){
|
$mustHaveActions = ['출병' => 1];
|
||||||
if(!in_array($item, $defaultPriority)){
|
foreach ($priority as $item) {
|
||||||
|
if (key_exists($item, $mustHaveActions)) {
|
||||||
|
$mustHaveActions[$item] = 0;
|
||||||
|
}
|
||||||
|
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();
|
||||||
@@ -175,26 +190,23 @@ function applyGeneralPriority($priority, $nationID, $generalName):?string{
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($result!==null){
|
if ($result !== null) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result' => false,
|
||||||
'reason'=>$result,
|
'reason' => $result,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>true,
|
'result' => true,
|
||||||
'reason'=>'success',
|
'reason' => 'success',
|
||||||
]);
|
]);
|
||||||
-182
@@ -1,182 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
$session = Session::requireLogin()->setReadOnly();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
|
|
||||||
if (!$userID) {
|
|
||||||
MessageBox("잘못된 접근입니다!!!");
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//회원 테이블에서 정보확인
|
|
||||||
$member = RootDB::db()->queryFirstRow("select no,name,picture,imgsvr,grade from member where no= %i", $userID);
|
|
||||||
|
|
||||||
if (!$member) {
|
|
||||||
MessageBox("잘못된 접근입니다!!!");
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$admin = $gameStor->getValues(['block_general_create','show_img_level','maxgeneral']);
|
|
||||||
if($admin['block_general_create']){
|
|
||||||
MessageBox("잘못된 접근입니다!!!");
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title><?=UniqueConst::$serverName?>: 장수생성</title>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=1024" />
|
|
||||||
<script>
|
|
||||||
var defaultStatTotal = <?=GameConst::$defaultStatTotal?>;
|
|
||||||
var defaultStatMin = <?=GameConst::$defaultStatMin?>;
|
|
||||||
var defaultStatMax = <?=GameConst::$defaultStatMax?>;
|
|
||||||
|
|
||||||
var charInfoText = <?php
|
|
||||||
|
|
||||||
$charInfoText = [];
|
|
||||||
foreach(GameConst::$availablePersonality as $personalityID){
|
|
||||||
$personalityInfo = buildPersonalityClass($personalityID)->getInfo();
|
|
||||||
$charInfoText[$personalityID] = $personalityInfo;
|
|
||||||
}
|
|
||||||
echo Json::encode((object)$charInfoText);
|
|
||||||
?>;
|
|
||||||
</script>
|
|
||||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
|
||||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
|
||||||
<?=WebUtil::printCSS('css/common.css')?>
|
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
|
||||||
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
|
||||||
<?=WebUtil::printJS('dist_js/common.js')?>
|
|
||||||
<?=WebUtil::printJS('dist_js/join.js')?>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr><td>장 수 생 성<br><?=backButton()?></td></tr>
|
|
||||||
</table>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr><td align=center><?=info(0)?></td></tr>
|
|
||||||
</table>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$gencount = $db->queryFirstField('SELECT count(no) FROM general WHERE npc<2');
|
|
||||||
|
|
||||||
if ($gencount >= $admin['maxgeneral']) {
|
|
||||||
echo "<script>alert('더 이상 등록할 수 없습니다.');</script>";
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$nationList = $db->query('SELECT nation,`name`,color,scout FROM nation');
|
|
||||||
shuffle($nationList);
|
|
||||||
$nationList = Util::convertArrayToDict($nationList, 'nation');
|
|
||||||
//NOTE: join 안할것임
|
|
||||||
$scoutMsgs = KVStorage::getValuesFromInterNamespace($db, 'nation_env', 'scout_msg');
|
|
||||||
foreach($scoutMsgs as $nationID=>$scoutMsg){
|
|
||||||
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo getInvitationList($nationList);
|
|
||||||
?>
|
|
||||||
|
|
||||||
<form id='join_form' name=form1 method=post action=join_post.php>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr>
|
|
||||||
<td colspan=3 align=center class='bg1'>장수 생성</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>장수명</td>
|
|
||||||
<td colspan=2>
|
|
||||||
<input id="generalName" type=text name=name maxlength=18 size=18 style="color:white;background-color:black;" value="<?=$member['name']?>">(전각 9글자, 반각 18글자 이내)
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "") {
|
|
||||||
$imageTemp = GetImageURL($member['imgsvr']);
|
|
||||||
echo "
|
|
||||||
<tr>
|
|
||||||
<td align=right class='bg1'>전콘 사용 여부</td>
|
|
||||||
<td width=64 height=64>
|
|
||||||
<img width='64' height='64' src='{$imageTemp}/{$member['picture']}' border='0'>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type=checkbox name=pic value=1 checked>사용
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td align=center colspan=3>
|
|
||||||
계정관리에서 자신만을 표현할 수 있는 아이콘을 업로드 해보세요!
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>성격</td>
|
|
||||||
<td colspan=2>
|
|
||||||
<select id="selChar" name=character size=1 maxlength=15 style=color:white;background-color:black;>
|
|
||||||
<option selected value='Random'>????</option>
|
|
||||||
<?php foreach(GameConst::$availablePersonality as $personalityID): ?>
|
|
||||||
<?php $personalityName = buildPersonalityClass($personalityID)->getName(); ?>
|
|
||||||
<option value='<?=$personalityID?>'><?=$personalityName?></option>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select> <span id="charInfoText"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>통솔</td>
|
|
||||||
<td colspan=2><input type="number" name="leadership" id="leadership" value="50"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>무력</td>
|
|
||||||
<td colspan=2><input type="number" name="strength" id="strength" value="50"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>지력</td>
|
|
||||||
<td colspan=2><input type="number" name="intel" id="intel" value="50"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right class='bg1'>능력치 조정</td>
|
|
||||||
<td colspan=2>
|
|
||||||
<input type=button value=랜덤형 onclick=abilityRand()>
|
|
||||||
<input type=button value=통솔무력형 onclick=abilityLeadpow()>
|
|
||||||
<input type=button value=통솔지력형 onclick=abilityLeadint()>
|
|
||||||
<input type=button value=무력지력형 onclick=abilityPowint()>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align=center colspan=3>
|
|
||||||
<font color=orange>모든 능력치는 ( <?=GameConst::$defaultStatMin?> <= 능력치 <= <?=GameConst::$defaultStatMax?> ) 사이로 잡으셔야 합니다.<br>
|
|
||||||
그 외의 능력치는 가입되지 않습니다.</font>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align=center colspan=3>
|
|
||||||
능력치의 총합은 <?=GameConst::$defaultStatTotal?>입니다. 가입후 0~10의 능력치 보너스를 받게 됩니다.<br>
|
|
||||||
임의의 도시에서 재야로 시작하며 건국과 임관은 게임 내에서 실행합니다.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width=498 align=right><input type=submit name=join value=장수생성></td>
|
|
||||||
<td colspan=2><input type=reset name=reset value=다시입력></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr><td><?=backButton()?></td></tr>
|
|
||||||
<tr><td><?=banner()?> </td></tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,341 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
$v = new Validator($_POST);
|
|
||||||
$v
|
|
||||||
->rule('required', [
|
|
||||||
'name',
|
|
||||||
'leadership',
|
|
||||||
'strength',
|
|
||||||
'intel'
|
|
||||||
])
|
|
||||||
->rule('integer', [
|
|
||||||
'leadership',
|
|
||||||
'strength',
|
|
||||||
'intel',
|
|
||||||
])
|
|
||||||
->rule('stringWidthBetween', 'name', 1, 18)
|
|
||||||
->rule('min', [
|
|
||||||
'leadership',
|
|
||||||
'strength',
|
|
||||||
'intel'
|
|
||||||
], GameConst::$defaultStatMin)
|
|
||||||
->rule('max', [
|
|
||||||
'leadership',
|
|
||||||
'strength',
|
|
||||||
'intel'
|
|
||||||
], GameConst::$defaultStatMax)
|
|
||||||
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']));
|
|
||||||
|
|
||||||
if (!$v->validate()) {
|
|
||||||
MessageBox($v->errorStr());
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$session = Session::requireLogin()->setReadOnly();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
//NOTE: 이 페이지에서는 세션에 데이터를 등록하지 않음. 로그인은 이후에.
|
|
||||||
|
|
||||||
$name = Util::getPost('name');
|
|
||||||
$name = htmlspecialchars($name);
|
|
||||||
$name = StringUtil::removeSpecialCharacter($name);
|
|
||||||
$name = WebUtil::htmlPurify($name);
|
|
||||||
$name = StringUtil::textStrip($name);
|
|
||||||
$pic = (int)Util::getPost('pic', 'bool', 0);
|
|
||||||
$character = Util::getPost('character');
|
|
||||||
|
|
||||||
$leadership = Util::getPost('leadership', 'int', 50);
|
|
||||||
$strength = Util::getPost('strength', 'int', 50);
|
|
||||||
$intel = Util::getPost('intel', 'int', 50);
|
|
||||||
|
|
||||||
$join = Util::getPost('join'); //쓸모 없음
|
|
||||||
|
|
||||||
$rootDB = RootDB::db();
|
|
||||||
//회원 테이블에서 정보확인
|
|
||||||
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
|
||||||
|
|
||||||
if (!$member) {
|
|
||||||
MessageBox("잘못된 접근입니다!!!");
|
|
||||||
echo "<script>history.go(-1);</script>";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','turntime','genius','npcmode']);
|
|
||||||
########## 동일 정보 존재여부 확인. ##########
|
|
||||||
|
|
||||||
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
|
||||||
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
|
||||||
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
|
|
||||||
|
|
||||||
if ($oldGeneral) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('이미 등록하셨습니다!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
if ($oldName) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('이미 있는 장수입니다. 다른 이름으로 등록해 주세요!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
if ($gameStor->maxgeneral <= $gencount) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('더이상 등록할 수 없습니다!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
if ($name == '') {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('이름이 짧습니다. 다시 가입해주세요!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
if (mb_strwidth($name) > 18) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
if ($leadership + $strength + $intel > GameConst::$defaultStatTotal) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('능력치가 ".GameConst::$defaultStatTotal."을 넘어섰습니다. 다시 가입해주세요!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$genius = Util::randBool(0.01);
|
|
||||||
// 현재 1%
|
|
||||||
if ($genius && $gameStor->genius > 0) {
|
|
||||||
$gameStor->genius = $gameStor->genius-1;
|
|
||||||
} else {
|
|
||||||
$genius = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 공백지에서만 태어나게
|
|
||||||
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1");
|
|
||||||
if (!$city) {
|
|
||||||
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 order by rand() limit 0,1");
|
|
||||||
}
|
|
||||||
|
|
||||||
$pleadership = 0;
|
|
||||||
$pstrength = 0;
|
|
||||||
$pintel = 0;
|
|
||||||
foreach(Util::range(Util::randRangeInt(3, 5)) as $statIdx){
|
|
||||||
switch (Util::choiceRandomUsingWeight([$leadership, $strength, $intel])) {
|
|
||||||
case 0:
|
|
||||||
$pleadership++;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$pstrength++;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$pintel++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$leadership = $leadership + $pleadership;
|
|
||||||
$strength = $strength + $pstrength;
|
|
||||||
$intel = $intel + $pintel;
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']);
|
|
||||||
$relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0);
|
|
||||||
|
|
||||||
$age = 20 + ($pleadership + $pstrength + $pintel) * 2 - (mt_rand(0, 1));
|
|
||||||
// 아직 남았고 천재등록상태이면 특기 부여
|
|
||||||
if ($genius) {
|
|
||||||
$specage2 = $age;
|
|
||||||
$special2 = SpecialityHelper::pickSpecialWar([
|
|
||||||
'leadership'=>$leadership,
|
|
||||||
'strength'=>$strength,
|
|
||||||
'intel'=>$intel,
|
|
||||||
'dex1'=>0,
|
|
||||||
'dex2'=>0,
|
|
||||||
'dex3'=>0,
|
|
||||||
'dex4'=>0,
|
|
||||||
'dex5'=>0
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
$specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/6 - $relYear / 2), 3) + $age;
|
|
||||||
$special2 = GameConst::$defaultSpecialWar;
|
|
||||||
}
|
|
||||||
//내특
|
|
||||||
$specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/12 - $relYear / 2), 3) + $age;
|
|
||||||
$special = GameConst::$defaultSpecialDomestic;
|
|
||||||
|
|
||||||
if ($admin['scenario'] >= 1000) {
|
|
||||||
$specage2 = $age + 3;
|
|
||||||
$specage = $age + 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($relYear < 3){
|
|
||||||
$experience = 0;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 4');
|
|
||||||
$targetGenOrder = Util::round($expGenCount * 0.2);
|
|
||||||
$experience = $db->queryFirstField(
|
|
||||||
'SELECT experience FROM general WHERE nation != 0 AND npc < 4 ORDER BY experience ASC LIMIT %i, 1',
|
|
||||||
$targetGenOrder - 1
|
|
||||||
);
|
|
||||||
$experience *= 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
|
|
||||||
|
|
||||||
$now = date('Y-m-d H:i:s');
|
|
||||||
if ($now >= $turntime) {
|
|
||||||
$turntime = addTurn($turntime, $admin['turnterm']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//특회 전콘
|
|
||||||
if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic) {
|
|
||||||
$face = $member['picture'];
|
|
||||||
$imgsvr = $member['imgsvr'];
|
|
||||||
} else {
|
|
||||||
$face = "default.jpg";
|
|
||||||
$imgsvr = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//성격 랜덤시
|
|
||||||
if (!in_array($character, GameConst::$availablePersonality)){
|
|
||||||
$character = Util::choiceRandom(GameConst::$availablePersonality);
|
|
||||||
}
|
|
||||||
//상성 랜덤
|
|
||||||
$affinity = rand()%150 + 1;
|
|
||||||
|
|
||||||
########## 회원정보 테이블에 입력값을 등록한다. ##########
|
|
||||||
$db->insert('general', [
|
|
||||||
'owner' => $userID,
|
|
||||||
'name' => $name,
|
|
||||||
'owner_name' => $member['name'],
|
|
||||||
'picture' => $face,
|
|
||||||
'imgsvr' => $imgsvr,
|
|
||||||
'nation' => 0,
|
|
||||||
'city' => $city,
|
|
||||||
'troop' => 0,
|
|
||||||
'affinity' => $affinity,
|
|
||||||
'leadership' => $leadership,
|
|
||||||
'strength' => $strength,
|
|
||||||
'intel' => $intel,
|
|
||||||
'experience' => $experience,
|
|
||||||
'dedication' => 0,
|
|
||||||
'gold' => GameConst::$defaultGold,
|
|
||||||
'rice' => GameConst::$defaultRice,
|
|
||||||
'crew' => 0,
|
|
||||||
'train' => 0,
|
|
||||||
'atmos' => 0,
|
|
||||||
'officer_level' => 0,
|
|
||||||
'turntime' => $turntime,
|
|
||||||
'killturn' => 6,
|
|
||||||
'lastconnect' => $now,
|
|
||||||
'lastrefresh' => $now,
|
|
||||||
'crewtype'=>GameUnitConst::DEFAULT_CREWTYPE,
|
|
||||||
'makelimit' => 0,
|
|
||||||
'age' => $age,
|
|
||||||
'startage' => $age,
|
|
||||||
'personal' => $character,
|
|
||||||
'specage' => $specage,
|
|
||||||
'special' => $special,
|
|
||||||
'specage2' => $specage2,
|
|
||||||
'special2' => $special2
|
|
||||||
]);
|
|
||||||
$generalID = $db->insertId();
|
|
||||||
$turnRows = [];
|
|
||||||
foreach(Util::range(GameConst::$maxTurn) as $turnIdx){
|
|
||||||
$turnRows[] = [
|
|
||||||
'general_id'=>$generalID,
|
|
||||||
'turn_idx'=>$turnIdx,
|
|
||||||
'action'=>'휴식',
|
|
||||||
'arg'=>null,
|
|
||||||
'brief'=>'휴식'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$db->insert('general_turn', $turnRows);
|
|
||||||
|
|
||||||
resetInheritanceUser($userID);
|
|
||||||
|
|
||||||
$rank_data = [];
|
|
||||||
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
|
|
||||||
$rank_data[] = [
|
|
||||||
'general_id'=>$generalID,
|
|
||||||
'nation_id'=>0,
|
|
||||||
'type'=>$rankColumn,
|
|
||||||
'value'=>0
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$db->insert('rank_data', $rank_data);
|
|
||||||
$db->insert('betting', [
|
|
||||||
'general_id'=>$generalID,
|
|
||||||
]);
|
|
||||||
$cityname = CityConst::byID($city)->name;
|
|
||||||
|
|
||||||
$me = [
|
|
||||||
'no'=>$generalID
|
|
||||||
];
|
|
||||||
|
|
||||||
$log = [];
|
|
||||||
$mylog = [];
|
|
||||||
|
|
||||||
$logger = new ActionLogger($generalID, 0, $gameStor->year, $gameStor->month);
|
|
||||||
|
|
||||||
$josaRa = JosaUtil::pick($name, '라');
|
|
||||||
$speicalText = getGeneralSpecialWarName($special2);
|
|
||||||
if ($genius) {
|
|
||||||
|
|
||||||
$logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.");
|
|
||||||
$logger->pushGlobalActionLog("<C>{$speicalText}</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.");
|
|
||||||
$logger->pushGlobalHistoryLog("<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다.");
|
|
||||||
} else {
|
|
||||||
$logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$logger->pushGeneralHistoryLog("<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
|
|
||||||
$logger->pushGeneralActionLog("삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralActionLog("처음 하시는 경우에는 <D>도움말</>을 참고하시고,", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralActionLog("문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralActionLog("부디 즐거운 삼모전 되시길 바랍니다 ^^", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralActionLog("통솔 <C>$pleadership</> 무력 <C>$pstrength</> 지력 <C>$pintel</> 의 보너스를 받으셨습니다.", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralActionLog("연령은 <C>$age</>세로 시작합니다.", ActionLogger::PLAIN);
|
|
||||||
|
|
||||||
if ($genius) {
|
|
||||||
$logger->pushGeneralActionLog("축하합니다! 천재로 태어나 처음부터 <C>{$speicalText}</> 특기를 가지게 됩니다!", ActionLogger::PLAIN);
|
|
||||||
$logger->pushGeneralHistoryLog("<C>{$speicalText}</> 특기를 가진 천재로 탄생.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$logger->flush();
|
|
||||||
|
|
||||||
pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR")]);
|
|
||||||
|
|
||||||
$rootDB->insert('member_log', [
|
|
||||||
'member_no' => $userID,
|
|
||||||
'date'=>TimeUtil::now(),
|
|
||||||
'action_type'=>'make_general',
|
|
||||||
'action'=>Json::encode([
|
|
||||||
'server'=>DB::prefix(),
|
|
||||||
'type'=>'general',
|
|
||||||
'generalID'=>$generalID,
|
|
||||||
'generalName'=>$name
|
|
||||||
])
|
|
||||||
]);
|
|
||||||
|
|
||||||
?>
|
|
||||||
<script>
|
|
||||||
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
|
|
||||||
</script>
|
|
||||||
<script>location.replace('./');</script>
|
|
||||||
|
|
||||||
|
|
||||||
@@ -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();
|
||||||
|
|
||||||
// 에러 메세지 출력
|
// 에러 메세지 출력
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -0,0 +1,444 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\General;
|
||||||
|
|
||||||
|
use sammo\ActionLogger;
|
||||||
|
use sammo\CityConst;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\GameUnitConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\JosaUtil;
|
||||||
|
use sammo\Json;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\RootDB;
|
||||||
|
use sammo\Session;
|
||||||
|
use sammo\SpecialityHelper;
|
||||||
|
use sammo\StringUtil;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Util;
|
||||||
|
use sammo\Validator;
|
||||||
|
use sammo\WebUtil;
|
||||||
|
|
||||||
|
use function sammo\addTurn;
|
||||||
|
use function sammo\cutTurn;
|
||||||
|
use function sammo\getGeneralSpecialWarName;
|
||||||
|
use function sammo\getRandTurn;
|
||||||
|
use function sammo\pushAdminLog;
|
||||||
|
use function sammo\resetInheritanceUser;
|
||||||
|
|
||||||
|
class Join extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v
|
||||||
|
->rule('required', [
|
||||||
|
'name',
|
||||||
|
'leadership',
|
||||||
|
'strength',
|
||||||
|
'intel',
|
||||||
|
'pic',
|
||||||
|
'character',
|
||||||
|
])
|
||||||
|
->rule('integer', [
|
||||||
|
'leadership',
|
||||||
|
'strength',
|
||||||
|
'intel',
|
||||||
|
'inheritTurntime',
|
||||||
|
])
|
||||||
|
->rule('boolean', [
|
||||||
|
'pic'
|
||||||
|
])
|
||||||
|
->rule('stringWidthBetween', 'name', 1, 18)
|
||||||
|
->rule('min', [
|
||||||
|
'leadership',
|
||||||
|
'strength',
|
||||||
|
'intel'
|
||||||
|
], GameConst::$defaultStatMin)
|
||||||
|
->rule('max', [
|
||||||
|
'leadership',
|
||||||
|
'strength',
|
||||||
|
'intel'
|
||||||
|
], GameConst::$defaultStatMax)
|
||||||
|
->rule('in', 'character', array_merge(GameConst::$availablePersonality, ['Random']))
|
||||||
|
->rule('in', 'inheritSpecial', GameConst::$availableSpecialWar)
|
||||||
|
->rule('min', 'inheritTurntime', 0)
|
||||||
|
->rule('in', 'inheritCity', array_keys(CityConst::all()))
|
||||||
|
->rule('integerArray', 'inheritBonusStat');
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
return static::REQ_LOGIN | static::REQ_READ_ONLY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
|
||||||
|
$name = $this->args['name'];
|
||||||
|
$name = htmlspecialchars($name);
|
||||||
|
$name = StringUtil::removeSpecialCharacter($name);
|
||||||
|
$name = WebUtil::htmlPurify($name);
|
||||||
|
$name = StringUtil::textStrip($name);
|
||||||
|
$pic = $this->args['pic'];
|
||||||
|
$character = $this->args['character'];
|
||||||
|
|
||||||
|
$leadership = $this->args['leadership'];
|
||||||
|
$strength = $this->args['strength'];
|
||||||
|
$intel = $this->args['intel'];
|
||||||
|
|
||||||
|
$inheritSpecial = $this->args['inheritSpecial'] ?? null;
|
||||||
|
$inheritTurntime = $this->args['inheritTurntime'] ?? null;
|
||||||
|
$inheritCity = $this->args['inheritCity'] ?? null;
|
||||||
|
$inheritBonusStat = $this->args['inheritBonusStat'] ?? null;
|
||||||
|
|
||||||
|
$rootDB = RootDB::db();
|
||||||
|
//회원 테이블에서 정보확인
|
||||||
|
$member = $rootDB->queryFirstRow('SELECT `no`, id, picture, grade, `name`, imgsvr FROM member WHERE no=%i', $userID);
|
||||||
|
|
||||||
|
if (!$member) {
|
||||||
|
return "잘못된 접근입니다!!!";
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
$gameStor->cacheValues(['year', 'month', 'maxgeneral', 'scenario', 'show_img_level', 'turnterm', 'turntime', 'genius', 'npcmode']);
|
||||||
|
########## 동일 정보 존재여부 확인. ##########
|
||||||
|
|
||||||
|
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
|
||||||
|
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
|
||||||
|
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
|
||||||
|
|
||||||
|
if ($oldGeneral) {
|
||||||
|
return "이미 등록하셨습니다!";
|
||||||
|
}
|
||||||
|
if ($oldName) {
|
||||||
|
return "이미 있는 장수입니다. 다른 이름으로 등록해 주세요!";
|
||||||
|
}
|
||||||
|
if ($gameStor->maxgeneral <= $gencount) {
|
||||||
|
return "더이상 등록할 수 없습니다!";
|
||||||
|
}
|
||||||
|
if ($name == '') {
|
||||||
|
return "이름이 짧습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
if (mb_strwidth($name) > 18) {
|
||||||
|
return "이름이 유효하지 않습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
if ($leadership + $strength + $intel > GameConst::$defaultStatTotal) {
|
||||||
|
return "능력치가 " . GameConst::$defaultStatTotal . "을 넘어섰습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritBonusStat) {
|
||||||
|
if (count($inheritBonusStat) != 3) {
|
||||||
|
return "보너스 능력치가 잘못 지정되었습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
foreach ($inheritBonusStat as $stat) {
|
||||||
|
if ($stat < 0) {
|
||||||
|
return "보너스 능력치가 음수입니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$sum = array_sum($inheritBonusStat);
|
||||||
|
if ($sum == 0) {
|
||||||
|
$inheritBonusStat = null;
|
||||||
|
} else if ($sum < 3 || $sum > 5) {
|
||||||
|
return "보너스 능력치 합이 잘못 지정되었습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year', 'month']);
|
||||||
|
|
||||||
|
$inheritTotalPoint = resetInheritanceUser($userID);
|
||||||
|
$inheritRequiredPoint = 0;
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($userID, $admin['year'], $admin['month'], false);
|
||||||
|
|
||||||
|
if ($inheritCity !== null) {
|
||||||
|
$inheritRequiredPoint += GameConst::$inheritBornCityPoint;
|
||||||
|
}
|
||||||
|
if ($inheritBonusStat !== null) {
|
||||||
|
$inheritRequiredPoint += GameConst::$inheritBornStatPoint;
|
||||||
|
}
|
||||||
|
if ($inheritSpecial !== null) {
|
||||||
|
$inheritRequiredPoint += GameConst::$inheritBornSpecialPoint;
|
||||||
|
}
|
||||||
|
if ($inheritTurntime !== null) {
|
||||||
|
$inheritRequiredPoint += GameConst::$inheritBornTurntimePoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritTotalPoint < $inheritRequiredPoint) {
|
||||||
|
return "유산 포인트가 부족합니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritSpecial !== null && $gameStor->genius == 0) {
|
||||||
|
return "이미 천재가 모두 나타났습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritCity !== null && !key_exists($inheritCity, CityConst::all())) {
|
||||||
|
return "도시가 잘못 지정되었습니다. 다시 가입해주세요!";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritSpecial) {
|
||||||
|
$speicalText = getGeneralSpecialWarName($inheritSpecial);
|
||||||
|
$userLogger->push("{$speicalText} 전투 특기를 가진 천재 생성", "inheritPoint");
|
||||||
|
$genius = true;
|
||||||
|
} else {
|
||||||
|
// 현재 1%
|
||||||
|
$genius = Util::randBool(0.01);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($genius && $gameStor->genius > 0) {
|
||||||
|
$gameStor->genius = $gameStor->genius - 1;
|
||||||
|
} else {
|
||||||
|
$genius = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritCity !== null) {
|
||||||
|
$cityname = CityConst::byID($inheritCity)->name;
|
||||||
|
$userLogger->push("{$cityname}에 장수 생성", "inheritPoint");
|
||||||
|
$city = $inheritCity;
|
||||||
|
} else {
|
||||||
|
// 공백지에서만 태어나게
|
||||||
|
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 and nation=0 order by rand() limit 0,1");
|
||||||
|
if (!$city) {
|
||||||
|
$city = $db->queryFirstField("select city from city where level>=5 and level<=6 order by rand() limit 0,1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritBonusStat) {
|
||||||
|
[$pleadership, $pstrength, $pintel] = $inheritBonusStat;
|
||||||
|
$userLogger->push("{$pleadership}, {$pstrength}, {$pintel} 보너스 능력치로 생성", "inheritPoint");
|
||||||
|
} else {
|
||||||
|
$pleadership = 0;
|
||||||
|
$pstrength = 0;
|
||||||
|
$pintel = 0;
|
||||||
|
foreach (Util::range(Util::randRangeInt(3, 5)) as $statIdx) {
|
||||||
|
switch (Util::choiceRandomUsingWeight([$leadership, $strength, $intel])) {
|
||||||
|
case 0:
|
||||||
|
$pleadership++;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$pstrength++;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$pintel++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$leadership = $leadership + $pleadership;
|
||||||
|
$strength = $strength + $pstrength;
|
||||||
|
$intel = $intel + $pintel;
|
||||||
|
|
||||||
|
$relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0);
|
||||||
|
|
||||||
|
$age = 20 + ($pleadership + $pstrength + $pintel) * 2 - (mt_rand(0, 1));
|
||||||
|
// 아직 남았고 천재등록상태이면 특기 부여
|
||||||
|
if ($genius) {
|
||||||
|
$specage2 = $age;
|
||||||
|
if ($inheritSpecial) {
|
||||||
|
$special2 = $inheritSpecial;
|
||||||
|
} else {
|
||||||
|
$special2 = SpecialityHelper::pickSpecialWar([
|
||||||
|
'leadership' => $leadership,
|
||||||
|
'strength' => $strength,
|
||||||
|
'intel' => $intel,
|
||||||
|
'dex1' => 0,
|
||||||
|
'dex2' => 0,
|
||||||
|
'dex3' => 0,
|
||||||
|
'dex4' => 0,
|
||||||
|
'dex5' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age) / 6 - $relYear / 2), 3) + $age;
|
||||||
|
$special2 = GameConst::$defaultSpecialWar;
|
||||||
|
}
|
||||||
|
//내특
|
||||||
|
$specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age) / 12 - $relYear / 2), 3) + $age;
|
||||||
|
$special = GameConst::$defaultSpecialDomestic;
|
||||||
|
|
||||||
|
if ($admin['scenario'] >= 1000) {
|
||||||
|
$specage2 = $age + 3;
|
||||||
|
$specage = $age + 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($relYear < 3) {
|
||||||
|
$experience = 0;
|
||||||
|
} else {
|
||||||
|
$expGenCount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation != 0 AND npc < 4');
|
||||||
|
$targetGenOrder = Util::round($expGenCount * 0.2);
|
||||||
|
$experience = $db->queryFirstField(
|
||||||
|
'SELECT experience FROM general WHERE nation != 0 AND npc < 4 ORDER BY experience ASC LIMIT %i, 1',
|
||||||
|
$targetGenOrder - 1
|
||||||
|
);
|
||||||
|
$experience *= 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritTurntime !== null) {
|
||||||
|
$inheritTurntime = $inheritTurntime % ($admin['turnterm'] * 60);
|
||||||
|
|
||||||
|
$userLogger->push(sprintf("턴 시간 %02d:%02d 로 지정", intdiv($inheritTurntime, 60), $inheritTurntime%60), "inheritPoint");
|
||||||
|
|
||||||
|
$inheritTurntime += Util::randRangeInt(0, 999999) / 1000000;
|
||||||
|
$turntime = new \DateTimeImmutable(cutTurn($admin['turntime'], $admin['turnterm']));
|
||||||
|
$turntime = $turntime->add(TimeUtil::secondsToDateInterval($inheritTurntime));
|
||||||
|
$turntime = TimeUtil::format($turntime, true);
|
||||||
|
} else {
|
||||||
|
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$now = TimeUtil::now(true);
|
||||||
|
if ($now >= $turntime) {
|
||||||
|
$turntime = addTurn($turntime, $admin['turnterm']);
|
||||||
|
}
|
||||||
|
|
||||||
|
//특회 전콘
|
||||||
|
if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic) {
|
||||||
|
$face = $member['picture'];
|
||||||
|
$imgsvr = $member['imgsvr'];
|
||||||
|
} else {
|
||||||
|
$face = "default.jpg";
|
||||||
|
$imgsvr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//성격 랜덤시
|
||||||
|
if (!in_array($character, GameConst::$availablePersonality)) {
|
||||||
|
$character = Util::choiceRandom(GameConst::$availablePersonality);
|
||||||
|
}
|
||||||
|
//상성 랜덤
|
||||||
|
$affinity = rand() % 150 + 1;
|
||||||
|
|
||||||
|
########## 회원정보 테이블에 입력값을 등록한다. ##########
|
||||||
|
$db->insert('general', [
|
||||||
|
'owner' => $userID,
|
||||||
|
'name' => $name,
|
||||||
|
'owner_name' => $member['name'],
|
||||||
|
'picture' => $face,
|
||||||
|
'imgsvr' => $imgsvr,
|
||||||
|
'nation' => 0,
|
||||||
|
'city' => $city,
|
||||||
|
'troop' => 0,
|
||||||
|
'affinity' => $affinity,
|
||||||
|
'leadership' => $leadership,
|
||||||
|
'strength' => $strength,
|
||||||
|
'intel' => $intel,
|
||||||
|
'experience' => $experience,
|
||||||
|
'dedication' => 0,
|
||||||
|
'gold' => GameConst::$defaultGold,
|
||||||
|
'rice' => GameConst::$defaultRice,
|
||||||
|
'crew' => 0,
|
||||||
|
'train' => 0,
|
||||||
|
'atmos' => 0,
|
||||||
|
'officer_level' => 0,
|
||||||
|
'turntime' => $turntime,
|
||||||
|
'killturn' => 6,
|
||||||
|
'lastconnect' => $now,
|
||||||
|
'lastrefresh' => $now,
|
||||||
|
'crewtype' => GameUnitConst::DEFAULT_CREWTYPE,
|
||||||
|
'makelimit' => 0,
|
||||||
|
'age' => $age,
|
||||||
|
'startage' => $age,
|
||||||
|
'personal' => $character,
|
||||||
|
'specage' => $specage,
|
||||||
|
'special' => $special,
|
||||||
|
'specage2' => $specage2,
|
||||||
|
'special2' => $special2
|
||||||
|
]);
|
||||||
|
$generalID = $db->insertId();
|
||||||
|
$turnRows = [];
|
||||||
|
foreach (Util::range(GameConst::$maxTurn) as $turnIdx) {
|
||||||
|
$turnRows[] = [
|
||||||
|
'general_id' => $generalID,
|
||||||
|
'turn_idx' => $turnIdx,
|
||||||
|
'action' => '휴식',
|
||||||
|
'arg' => null,
|
||||||
|
'brief' => '휴식'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$db->insert('general_turn', $turnRows);
|
||||||
|
|
||||||
|
$rank_data = [];
|
||||||
|
foreach (array_keys(General::RANK_COLUMN) as $rankColumn) {
|
||||||
|
$rank_data[] = [
|
||||||
|
'general_id' => $generalID,
|
||||||
|
'nation_id' => 0,
|
||||||
|
'type' => $rankColumn,
|
||||||
|
'value' => 0
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$db->insert('rank_data', $rank_data);
|
||||||
|
$db->insert('betting', [
|
||||||
|
'general_id' => $generalID,
|
||||||
|
]);
|
||||||
|
$cityname = CityConst::byID($city)->name;
|
||||||
|
|
||||||
|
|
||||||
|
if ($inheritRequiredPoint > 0) {
|
||||||
|
$userLogger->push("장수 생성으로 포인트 {$inheritRequiredPoint} 소모", "inheritPoint");
|
||||||
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
|
||||||
|
$inheritStor->setValue('previous', [$inheritTotalPoint - $inheritRequiredPoint, null]);
|
||||||
|
$userLogger->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
$me = [
|
||||||
|
'no' => $generalID
|
||||||
|
];
|
||||||
|
|
||||||
|
$log = [];
|
||||||
|
$mylog = [];
|
||||||
|
|
||||||
|
$logger = new ActionLogger($generalID, 0, $gameStor->year, $gameStor->month);
|
||||||
|
|
||||||
|
$josaRa = JosaUtil::pick($name, '라');
|
||||||
|
$speicalText = getGeneralSpecialWarName($special2);
|
||||||
|
if ($genius) {
|
||||||
|
|
||||||
|
$logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.");
|
||||||
|
$logger->pushGlobalActionLog("<C>{$speicalText}</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.");
|
||||||
|
$logger->pushGlobalHistoryLog("<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다.");
|
||||||
|
} else {
|
||||||
|
$logger->pushGlobalActionLog("<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->pushGeneralHistoryLog("<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
|
||||||
|
$logger->pushGeneralActionLog("삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralActionLog("처음 하시는 경우에는 <D>도움말</>을 참고하시고,", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralActionLog("문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralActionLog("부디 즐거운 삼모전 되시길 바랍니다 ^^", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralActionLog("통솔 <C>$pleadership</> 무력 <C>$pstrength</> 지력 <C>$pintel</> 의 보너스를 받으셨습니다.", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralActionLog("연령은 <C>$age</>세로 시작합니다.", ActionLogger::PLAIN);
|
||||||
|
|
||||||
|
if ($genius) {
|
||||||
|
$logger->pushGeneralActionLog("축하합니다! 천재로 태어나 처음부터 <C>{$speicalText}</> 특기를 가지게 됩니다!", ActionLogger::PLAIN);
|
||||||
|
$logger->pushGeneralHistoryLog("<C>{$speicalText}</> 특기를 가진 천재로 탄생.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$logger->flush();
|
||||||
|
|
||||||
|
pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}" . getenv("REMOTE_ADDR")]);
|
||||||
|
|
||||||
|
$rootDB->insert('member_log', [
|
||||||
|
'member_no' => $userID,
|
||||||
|
'date' => TimeUtil::now(),
|
||||||
|
'action_type' => 'make_general',
|
||||||
|
'action' => Json::encode([
|
||||||
|
'server' => DB::prefix(),
|
||||||
|
'type' => 'general',
|
||||||
|
'generalID' => $generalID,
|
||||||
|
'generalName' => $name
|
||||||
|
])
|
||||||
|
]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\TriggerInheritBuff;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
class BuyHiddenBuff extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v->rule('required', [
|
||||||
|
'type',
|
||||||
|
'level',
|
||||||
|
])
|
||||||
|
->rule('integer', 'level')
|
||||||
|
->rule('min', 'level', 1)
|
||||||
|
->rule('max', 'level', TriggerInheritBuff::MAX_STEP)
|
||||||
|
->rule('keyExists', 'type', TriggerInheritBuff::BUFF_KEY_TEXT);
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//General.aux 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$type = $this->args['type'];
|
||||||
|
$level = $this->args['level'];
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if ($userID != $general->getVar('owner')) {
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
|
||||||
|
$inheritBuffList = $general->getAuxVar('inheritBuff') ?? [];
|
||||||
|
$prevLevel = $inheritBuffList[$type] ?? 0;
|
||||||
|
|
||||||
|
if ($prevLevel == $level) {
|
||||||
|
return '이미 구입했습니다.';
|
||||||
|
}
|
||||||
|
if ($prevLevel > $level) {
|
||||||
|
return '이미 더 높은 등급을 구입했습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$reqAmount = GameConst::$inheritBuffPoints[$level] - GameConst::$inheritBuffPoints[$prevLevel];
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous') ?? [0,0])[0];
|
||||||
|
if ($previousPoint < $reqAmount) {
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$buffTypeText = TriggerInheritBuff::BUFF_KEY_TEXT[$type];
|
||||||
|
$moreText = $prevLevel > 0 ? "추가":"";
|
||||||
|
$userLogger->push("{$reqAmount} 포인트로 {$buffTypeText} {$level} 단계 {$moreText}구입", "inheritPoint");
|
||||||
|
$userLogger->flush();
|
||||||
|
|
||||||
|
$inheritBuffList[$type] = $level;
|
||||||
|
$general->setAuxVar('inheritBuff', $inheritBuffList);
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
|
||||||
|
class BuyRandomUnique extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//General.aux 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if($userID != $general->getVar('owner')){
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($general->getAuxVar('inheritRandomUnique') !== null){
|
||||||
|
return '이미 구입 명령을 내렸습니다. 다음 턴까지 기다려주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous')??[0, 0])[0];
|
||||||
|
$reqAmount = GameConst::$inheritItemRandomPoint;
|
||||||
|
if($previousPoint < $reqAmount){
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
$userLogger->push("{$reqAmount} 포인트로 랜덤 유니크 구입", "inheritPoint");
|
||||||
|
$userLogger->flush();
|
||||||
|
|
||||||
|
$general->setAuxVar('inheritRandomUnique', TimeUtil::now());
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
use function sammo\buildItemClass;
|
||||||
|
|
||||||
|
class BuySpecificUnique extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$availableItems = [];
|
||||||
|
foreach (GameConst::$allItems as $items) {
|
||||||
|
foreach ($items as $itemKey => $amount) {
|
||||||
|
if ($amount == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$availableItems[$itemKey] = $amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v->rule('required', [
|
||||||
|
'item',
|
||||||
|
'amount',
|
||||||
|
])
|
||||||
|
->rule('integer', 'amount')
|
||||||
|
->rule('min', 'amount', GameConst::$inheritItemUniqueMinPoint)
|
||||||
|
->rule('keyExists', 'item', $availableItems);
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//KVStrorage, General.aux 모두 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$itemKey = $this->args['item'];
|
||||||
|
$amount = $this->args['amount'];
|
||||||
|
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if ($userID != $general->getVar('owner')) {
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemTrials = $general->getAuxVar('inheritUniqueTrial') ?? [];
|
||||||
|
if (key_exists($itemKey, $itemTrials)) {
|
||||||
|
return '이미 입찰한 아이템입니다. 다음 턴에 시도해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||||
|
if ($previousPoint < $amount) {
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemObj = buildItemClass($itemKey);
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
$userLogger->push("{$amount} 포인트로 유니크 {$itemObj->getName()} 구입 시도", "inheritPoint");
|
||||||
|
$userLogger->flush();
|
||||||
|
|
||||||
|
$itemTrials[$itemKey] = $amount;
|
||||||
|
$general->setAuxVar('inheritUniqueTrial', $itemTrials);
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $amount, null]);
|
||||||
|
$trialStor->setValue("u{$userID}", [$userID, $generalID, $amount]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
class ResetSpecialWar extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//KVStrorage, General.aux 모두 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if ($userID != $general->getVar('owner')) {
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$currentSpecialWar = $general->getVar('special2');
|
||||||
|
if ($currentSpecialWar === null || $currentSpecialWar == 'None') {
|
||||||
|
return '이미 전투 특기가 공란입니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentLevel = $general->getAuxVar('inheritResetSpecialWar') ?? -1;
|
||||||
|
$nextLevel = $currentLevel + 1;
|
||||||
|
while (count(GameConst::$inheritResetAttrPointBase) <= $nextLevel) {
|
||||||
|
$baseLen = count(GameConst::$inheritResetAttrPointBase);
|
||||||
|
GameConst::$inheritResetAttrPointBase[] = GameConst::$inheritResetAttrPointBase[$baseLen - 1] + GameConst::$inheritResetAttrPointBase[$baseLen - 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
$reqPoint = GameConst::$inheritResetAttrPointBase[$nextLevel];
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||||
|
if ($previousPoint < $reqPoint) {
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
$userLogger->push("{$reqPoint} 포인트로 전투 특기 초기화", "inheritPoint");
|
||||||
|
$userLogger->flush();
|
||||||
|
|
||||||
|
$oldTypeKey = 'prev_types_special2';
|
||||||
|
$oldSpecialList = $general->getAuxVar($oldTypeKey) ?? [];
|
||||||
|
$oldSpecialList[] = $currentSpecialWar;
|
||||||
|
$general->setAuxVar($oldTypeKey, $oldSpecialList);
|
||||||
|
|
||||||
|
$general->setAuxVar('inheritResetSpecialWar', $nextLevel);
|
||||||
|
$general->setVar('special2', 'None');
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $reqPoint, null]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use DateTimeImmutable;
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\TimeUtil;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Util;
|
||||||
|
|
||||||
|
class ResetTurnTime extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//KVStrorage, General.aux 모두 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if ($userID != $general->getVar('owner')) {
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$currentLevel = $general->getAuxVar('inheritResetTurnTime') ?? -1;
|
||||||
|
$nextLevel = $currentLevel + 1;
|
||||||
|
while (count(GameConst::$inheritResetAttrPointBase) <= $nextLevel) {
|
||||||
|
$baseLen = count(GameConst::$inheritResetAttrPointBase);
|
||||||
|
GameConst::$inheritResetAttrPointBase[] = GameConst::$inheritResetAttrPointBase[$baseLen - 1] + GameConst::$inheritResetAttrPointBase[$baseLen - 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
$reqPoint = GameConst::$inheritResetAttrPointBase[$nextLevel];
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||||
|
if ($previousPoint < $reqPoint) {
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$gameStor = new KVStorage($db, 'game_env');
|
||||||
|
[$turnTerm, $serverTurnTime] = $gameStor->getValuesAsArray(['turnterm', 'turntime']);
|
||||||
|
|
||||||
|
$currTurnTime = new DateTimeImmutable($general->getTurnTime());
|
||||||
|
$serverTurnTimeObj = new DateTimeImmutable($serverTurnTime);
|
||||||
|
|
||||||
|
$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));
|
||||||
|
if ($turnTime <= $serverTurnTimeObj && $serverTurnTimeObj <= $currTurnTime) {
|
||||||
|
$turnTime = $turnTime->add(TimeUtil::secondsToDateInterval($turnTerm * 60));
|
||||||
|
}
|
||||||
|
|
||||||
|
$general->setVar('turntime', TimeUtil::format($turnTime, true));
|
||||||
|
$general->setAuxVar('inheritResetTurnTime', $nextLevel);
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $reqPoint, null]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo\API\InheritAction;
|
||||||
|
|
||||||
|
use sammo\Session;
|
||||||
|
use DateTimeInterface;
|
||||||
|
use sammo\DB;
|
||||||
|
use sammo\GameConst;
|
||||||
|
use sammo\General;
|
||||||
|
use sammo\KVStorage;
|
||||||
|
use sammo\UserLogger;
|
||||||
|
use sammo\Validator;
|
||||||
|
|
||||||
|
use function sammo\buildGeneralSpecialWarClass;
|
||||||
|
|
||||||
|
class SetNextSpecialWar extends \sammo\BaseAPI
|
||||||
|
{
|
||||||
|
public function validateArgs(): ?string
|
||||||
|
{
|
||||||
|
$v = new Validator($this->args);
|
||||||
|
$v->rule('required', [
|
||||||
|
'type',
|
||||||
|
])
|
||||||
|
->rule('in', 'type', GameConst::$availableSpecialWar);
|
||||||
|
|
||||||
|
if (!$v->validate()) {
|
||||||
|
return $v->errorStr();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequiredSessionMode(): int
|
||||||
|
{
|
||||||
|
//General.aux 쓰므로 lock;
|
||||||
|
return static::REQ_GAME_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||||
|
{
|
||||||
|
$userID = $session->userID;
|
||||||
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
|
$type = $this->args['type'];
|
||||||
|
|
||||||
|
$general = General::createGeneralObjFromDB($generalID);
|
||||||
|
if ($userID != $general->getVar('owner')) {
|
||||||
|
return '로그인 상태가 이상합니다. 다시 로그인해 주세요.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$inheritSpecificSpecialWar = $general->getAuxVar('inheritSpecificSpecialWar');
|
||||||
|
$currentSpecialWar = $general->getVar('special2');
|
||||||
|
|
||||||
|
if ($currentSpecialWar == $type) {
|
||||||
|
return '이미 그 특기를 보유하고 있습니다.';
|
||||||
|
}
|
||||||
|
if ($inheritSpecificSpecialWar == $type) {
|
||||||
|
return '이미 그 특기를 예약하였습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inheritSpecificSpecialWar !== null) {
|
||||||
|
return '이미 예약한 특기가 있습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$reqAmount = GameConst::$inheritSpecificSpecialPoint;
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
|
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||||
|
if ($previousPoint < $reqAmount) {
|
||||||
|
return '충분한 유산 포인트를 가지고 있지 않습니다.';
|
||||||
|
}
|
||||||
|
|
||||||
|
$userLogger = new UserLogger($userID);
|
||||||
|
$specialWarObj = buildGeneralSpecialWarClass($type);
|
||||||
|
$userLogger->push("{$reqAmount} 포인트로 다음 전투 특기로 {$specialWarObj->getName()} 지정", "inheritPoint");
|
||||||
|
$userLogger->flush();
|
||||||
|
|
||||||
|
$general->setAuxVar('inheritSpecificSpecialWar', $type);
|
||||||
|
$inheritStor->setValue('previous', [$previousPoint - $reqAmount, null]);
|
||||||
|
$general->applyDB($db);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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,14 +15,21 @@ 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;
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, false, '계략약화'),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301, 0.2),
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*301),
|
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,14 +15,21 @@ 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;
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302, false, '계략약화'),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302, 0.2),
|
||||||
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM +BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*302),
|
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ class che_서적_07_논어 extends \sammo\BaseStatItem{
|
|||||||
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
|
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
return new WarUnitTriggerCaller(
|
{
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*207, false, '계략약화')
|
$debuff = [
|
||||||
);
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ class che_서적_11_춘추전 extends \sammo\BaseStatItem{
|
|||||||
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
|
$this->info .= "<br>[전투] 상대의 계략 성공 확률 -10%p";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
return new WarUnitTriggerCaller(
|
{
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM+BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*211, false, '계략약화')
|
$debuff = [
|
||||||
);
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo\ActionItem;
|
namespace sammo\ActionItem;
|
||||||
|
|
||||||
use \sammo\iAction;
|
use \sammo\iAction;
|
||||||
use \sammo\General;
|
use \sammo\General;
|
||||||
use \sammo\GeneralTrigger;
|
use \sammo\GeneralTrigger;
|
||||||
@@ -17,7 +19,8 @@ use sammo\WarUnitTrigger\che_전멸시페이즈증가;
|
|||||||
use sammo\WarUnitTrigger\che_부상무효;
|
use sammo\WarUnitTrigger\che_부상무효;
|
||||||
use sammo\WarUnitTrigger\WarActivateSkills;
|
use sammo\WarUnitTrigger\WarActivateSkills;
|
||||||
|
|
||||||
class che_치트_HideD의_사인검 extends \sammo\BaseItem{
|
class che_치트_HideD의_사인검 extends \sammo\BaseItem
|
||||||
|
{
|
||||||
|
|
||||||
protected $rawName = 'HideD의 사인검';
|
protected $rawName = 'HideD의 사인검';
|
||||||
protected $name = 'HideD의 사인검(치트)';
|
protected $name = 'HideD의 사인검(치트)';
|
||||||
@@ -37,33 +40,45 @@ EOT;
|
|||||||
protected $consumable = false;
|
protected $consumable = false;
|
||||||
protected $buyable = false;
|
protected $buyable = false;
|
||||||
|
|
||||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null):float{
|
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux = null): float
|
||||||
if($turnType == '계략'){
|
{
|
||||||
if($varType == 'success') return $value + 2;
|
if ($turnType == '계략') {
|
||||||
|
if ($varType == 'success') return $value + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
public function onCalcStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
$bonus = [
|
$bonus = [
|
||||||
'bonusTrain'=>30,
|
'bonusTrain' => 30,
|
||||||
'bonusAtmos'=>30,
|
'bonusAtmos' => 30,
|
||||||
'leadership'=>100,
|
'leadership' => 100,
|
||||||
'strength'=>100,
|
'strength' => 100,
|
||||||
'intel'=>100,
|
'intel' => 100,
|
||||||
'warMagicSuccessProb'=>1,
|
'warMagicSuccessProb' => 1,
|
||||||
][$statName]??0;
|
][$statName] ?? 0;
|
||||||
return $bonus + $value;
|
return $bonus + $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreTurnExecuteTriggerList(General $general):?GeneralTriggerCaller{
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPreTurnExecuteTriggerList(General $general): ?GeneralTriggerCaller
|
||||||
|
{
|
||||||
return new GeneralTriggerCaller(
|
return new GeneralTriggerCaller(
|
||||||
new GeneralTrigger\che_도시치료($general)
|
new GeneralTrigger\che_도시치료($general)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_NONE),
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '저격불가')
|
||||||
@@ -73,10 +88,10 @@ EOT;
|
|||||||
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
|
public function getBattlePhaseSkillTriggerList(\sammo\WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
{
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '위압불가', '격노불가', '계략약화', '저격불가'),
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_NONE, false, '필살불가', '위압불가', '격노불가', '저격불가'),
|
||||||
new che_전투치료시도($unit),
|
new che_전투치료시도($unit),
|
||||||
new che_전투치료발동($unit),
|
new che_전투치료발동($unit),
|
||||||
new che_저격시도($unit, che_저격시도::TYPE_NONE, 1/2, 20, 60),
|
new che_저격시도($unit, che_저격시도::TYPE_NONE, 1 / 2, 20, 60),
|
||||||
new che_저격발동($unit),
|
new che_저격발동($unit),
|
||||||
new che_격노시도($unit),
|
new che_격노시도($unit),
|
||||||
new che_격노발동($unit),
|
new che_격노발동($unit),
|
||||||
@@ -84,8 +99,8 @@ EOT;
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getWarPowerMultiplier(WarUnit $unit):array{
|
public function getWarPowerMultiplier(WarUnit $unit): array
|
||||||
|
{
|
||||||
return [1, 0.95];
|
return [1, 0.95];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,10 +28,17 @@ class event_전투특기_반계 extends \sammo\BaseItem{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*401, false, '계략약화'),
|
new che_반계시도($unit, BaseWarUnitTrigger::TYPE_ITEM),
|
||||||
new che_반계시도($unit),
|
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ class che_event_견고 extends \sammo\BaseSpecial{
|
|||||||
SpecialityHelper::STAT_STRENGTH
|
SpecialityHelper::STAT_STRENGTH
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattleInitSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM),
|
new che_부상무효($unit, BaseWarUnitTrigger::TYPE_ITEM),
|
||||||
@@ -30,7 +38,7 @@ class che_event_견고 extends \sammo\BaseSpecial{
|
|||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*402, false, '필살불가', '계략약화', '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE*402, false, '필살불가', '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,10 +33,17 @@ class che_event_반계 extends \sammo\BaseSpecial
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
{
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 403, false, '계략약화'),
|
|
||||||
new che_반계시도($unit),
|
new che_반계시도($unit),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -24,6 +24,14 @@ class che_견고 extends \sammo\BaseSpecial
|
|||||||
SpecialityHelper::STAT_STRENGTH
|
SpecialityHelper::STAT_STRENGTH
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
public function getBattleInitSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
{
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
@@ -35,7 +43,7 @@ class che_견고 extends \sammo\BaseSpecial
|
|||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit): ?WarUnitTriggerCaller
|
||||||
{
|
{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 404, false, '필살불가', '계략약화', '저격불가')
|
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 404, false, '필살불가', '저격불가')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,9 +29,16 @@ class che_반계 extends \sammo\BaseSpecial{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
|
{
|
||||||
|
$debuff = [
|
||||||
|
'warMagicSuccessProb' => 0.1,
|
||||||
|
][$statName] ?? 0;
|
||||||
|
return $value - $debuff;
|
||||||
|
}
|
||||||
|
|
||||||
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
public function getBattlePhaseSkillTriggerList(WarUnit $unit):?WarUnitTriggerCaller{
|
||||||
return new WarUnitTriggerCaller(
|
return new WarUnitTriggerCaller(
|
||||||
new WarActivateSkills($unit, BaseWarUnitTrigger::TYPE_ITEM + BaseWarUnitTrigger::TYPE_DEDUP_TYPE_BASE * 406, false, '계략약화'),
|
|
||||||
new che_반계시도($unit),
|
new che_반계시도($unit),
|
||||||
new che_반계발동($unit)
|
new che_반계발동($unit)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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,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(){
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use \sammo\LastTurn;
|
|||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
use function \sammo\printCitiesBasedOnDistance;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -161,6 +162,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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\getAllNationStaticInfo;
|
use function sammo\getAllNationStaticInfo;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
|
|
||||||
class che_거병 extends Command\GeneralCommand{
|
class che_거병 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '거병';
|
static protected $actionName = '거병';
|
||||||
@@ -163,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);
|
||||||
@@ -172,6 +172,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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, '건국');
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use \sammo\Constraint\Constraint;
|
|||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use \sammo\TextDecoration\SightseeingMessage;
|
use \sammo\TextDecoration\SightseeingMessage;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_견문 extends Command\GeneralCommand{
|
class che_견문 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '견문';
|
static protected $actionName = '견문';
|
||||||
@@ -111,6 +112,8 @@ class che_견문 extends Command\GeneralCommand{
|
|||||||
$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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ use \sammo\Constraint\Constraint;
|
|||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
use sammo\MustNotBeReachedException;
|
use sammo\MustNotBeReachedException;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_군량매매 extends Command\GeneralCommand{
|
class che_군량매매 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '군량매매';
|
static protected $actionName = '군량매매';
|
||||||
static public $reqArg = true;
|
static public $reqArg = true;
|
||||||
@@ -176,6 +178,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_귀환 extends Command\GeneralCommand{
|
class che_귀환 extends Command\GeneralCommand{
|
||||||
static protected $actionName = '귀환';
|
static protected $actionName = '귀환';
|
||||||
@@ -95,6 +95,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use \sammo\{
|
|||||||
use function \sammo\getAllNationStaticInfo;
|
use function \sammo\getAllNationStaticInfo;
|
||||||
use function \sammo\getNationStaticInfo;
|
use function \sammo\getNationStaticInfo;
|
||||||
use function \sammo\newColor;
|
use function \sammo\newColor;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -164,6 +165,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use \sammo\{
|
|||||||
|
|
||||||
use function \sammo\getDomesticExpLevelBonus;
|
use function \sammo\getDomesticExpLevelBonus;
|
||||||
use function \sammo\CriticalScoreEx;
|
use function \sammo\CriticalScoreEx;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -120,6 +121,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use \sammo\LastTurn;
|
|||||||
use \sammo\Command;
|
use \sammo\Command;
|
||||||
|
|
||||||
use function \sammo\printCitiesBasedOnDistance;
|
use function \sammo\printCitiesBasedOnDistance;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -169,6 +170,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($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);
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use \sammo\{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use function \sammo\buildItemClass;
|
use function \sammo\buildItemClass;
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
@@ -88,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 +177,7 @@ class che_장비매매 extends Command\GeneralCommand{
|
|||||||
$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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ use \sammo\Command;
|
|||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_증여 extends Command\GeneralCommand
|
class che_증여 extends Command\GeneralCommand
|
||||||
{
|
{
|
||||||
@@ -168,6 +169,8 @@ 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();
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
|
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
$destGeneral->applyDB($db);
|
$destGeneral->applyDB($db);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use \sammo\Command;
|
|||||||
use \sammo\Constraint\Constraint;
|
use \sammo\Constraint\Constraint;
|
||||||
use \sammo\Constraint\ConstraintHelper;
|
use \sammo\Constraint\ConstraintHelper;
|
||||||
|
|
||||||
|
use function sammo\tryUniqueItemLottery;
|
||||||
|
|
||||||
class che_헌납 extends Command\GeneralCommand
|
class che_헌납 extends Command\GeneralCommand
|
||||||
{
|
{
|
||||||
@@ -144,6 +145,8 @@ 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();
|
||||||
|
|
||||||
|
tryUniqueItemLottery($general);
|
||||||
$general->applyDB($db);
|
$general->applyDB($db);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
@@ -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, '이');
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ trait DefaultAction{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,30 @@ class DummyGeneral extends General{
|
|||||||
return new WarUnitTriggerCaller();
|
return new WarUnitTriggerCaller();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCalcStat(General $general, string $statName, $value, $aux=null){
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux=null){
|
||||||
|
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);
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
+72
-49
@@ -1,15 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
class GameConstBase
|
class GameConstBase
|
||||||
{
|
{
|
||||||
/** @var string 게임명 */
|
/** @var string 게임명 */
|
||||||
public static $title = "삼국지 모의전투 PHP HiDCHe";
|
public static $title = "삼국지 모의전투 PHP HiDCHe";
|
||||||
/** @var string 코드 아래에 붙는 설명 코드 */
|
/** @var string 코드 아래에 붙는 설명 코드 */
|
||||||
public static $banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : HideD(hided62@gmail.com) / <a href='https://sam.hided.net/wiki/hidche/credit' target='_blank' style='color:white;text-decoration: underline;'>Credit</a>";
|
public static $banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : HideD(hided62@gmail.com) / <a href='https://sam.hided.net/wiki/hidche/credit' target='_blank' style='color:white;text-decoration: underline;'>Credit</a>";
|
||||||
/** @var string 사용중인 지도명 */
|
/** @var string 사용중인 지도명 */
|
||||||
public static $mapName = 'che';
|
public static $mapName = 'che';
|
||||||
/** @var string 사용중인 유닛셋 */
|
/** @var string 사용중인 유닛셋 */
|
||||||
public static $unitSet = 'che';
|
public static $unitSet = 'che';
|
||||||
/** @var int 내정시 최하 민심 설정*/
|
/** @var int 내정시 최하 민심 설정*/
|
||||||
public static $develrate = 50;
|
public static $develrate = 50;
|
||||||
@@ -143,6 +144,11 @@ class GameConstBase
|
|||||||
/** @var int 거병,임관 제한 기간 */
|
/** @var int 거병,임관 제한 기간 */
|
||||||
public static $joinActionLimit = 12;
|
public static $joinActionLimit = 12;
|
||||||
|
|
||||||
|
/** @var int 장수 생성시 능력치 최소 보너스 */
|
||||||
|
public static $bornMinStatBonus = 3;
|
||||||
|
/** @var int 장수 생성시 능력치 최대 보너스 */
|
||||||
|
public static $bornMaxStatBonus = 5;
|
||||||
|
|
||||||
/** @var array 선택 가능한 국가 성향 */
|
/** @var array 선택 가능한 국가 성향 */
|
||||||
public static $availableNationType = [
|
public static $availableNationType = [
|
||||||
'che_도적', 'che_명가', 'che_음양가', 'che_종횡가', 'che_불가', 'che_오두미도', 'che_태평도', 'che_도가',
|
'che_도적', 'che_명가', 'che_음양가', 'che_종횡가', 'che_불가', 'che_오두미도', 'che_태평도', 'che_도가',
|
||||||
@@ -189,60 +195,77 @@ class GameConstBase
|
|||||||
'che_은둔', 'None'
|
'che_은둔', 'None'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static $maxUniqueItemLimit = [
|
||||||
|
[-1, 1],
|
||||||
|
[3, 2],
|
||||||
|
[10, 3],
|
||||||
|
[20, 4]
|
||||||
|
];
|
||||||
|
|
||||||
|
public static $inheritBornSpecialPoint = 6000;
|
||||||
|
public static $inheritBornTurntimePoint = 3000;
|
||||||
|
public static $inheritBornCityPoint = 1000;
|
||||||
|
public static $inheritBornStatPoint = 1000;
|
||||||
|
public static $inheritItemUniqueMinPoint = 5000;
|
||||||
|
public static $inheritItemRandomPoint = 3000;
|
||||||
|
public static $inheritBuffPoints = [0, 200, 600, 1200, 2000, 3000];
|
||||||
|
public static $inheritSpecificSpecialPoint = 4000;
|
||||||
|
public static $inheritResetAttrPointBase = [1000, 1000, 2000, 3000];//필요하면 늘려서 쓰기
|
||||||
|
|
||||||
public static $allItems = [
|
public static $allItems = [
|
||||||
'horse' => [
|
'horse' => [
|
||||||
'che_명마_01_노기'=>0, 'che_명마_02_조랑'=>0, 'che_명마_03_노새'=>0,
|
'che_명마_01_노기' => 0, 'che_명마_02_조랑' => 0, 'che_명마_03_노새' => 0,
|
||||||
'che_명마_04_나귀'=>0, 'che_명마_05_갈색마'=>0, 'che_명마_06_흑색마'=>0,
|
'che_명마_04_나귀' => 0, 'che_명마_05_갈색마' => 0, 'che_명마_06_흑색마' => 0,
|
||||||
|
|
||||||
'che_명마_07_백마'=>2, 'che_명마_07_기주마'=>2,
|
'che_명마_07_백마' => 2, 'che_명마_07_기주마' => 2,
|
||||||
'che_명마_08_양주마'=>2, 'che_명마_09_과하마'=>2,
|
'che_명마_08_양주마' => 2, 'che_명마_09_과하마' => 2,
|
||||||
'che_명마_10_대완마'=>2, 'che_명마_11_서량마'=>2,
|
'che_명마_10_대완마' => 2, 'che_명마_11_서량마' => 2,
|
||||||
'che_명마_12_사륜거'=>2, 'che_명마_13_절영'=>1, 'che_명마_13_적로'=>1,
|
'che_명마_12_사륜거' => 2, 'che_명마_13_절영' => 1, 'che_명마_13_적로' => 1,
|
||||||
'che_명마_14_적란마'=>1, 'che_명마_14_조황비전'=>1, 'che_명마_15_한혈마'=>1, 'che_명마_15_적토마'=>1,
|
'che_명마_14_적란마' => 1, 'che_명마_14_조황비전' => 1, 'che_명마_15_한혈마' => 1, 'che_명마_15_적토마' => 1,
|
||||||
],
|
],
|
||||||
'weapon' => [
|
'weapon' => [
|
||||||
'che_무기_01_단도'=>0, 'che_무기_02_단궁'=>0, 'che_무기_03_단극'=>0,
|
'che_무기_01_단도' => 0, 'che_무기_02_단궁' => 0, 'che_무기_03_단극' => 0,
|
||||||
'che_무기_04_목검'=>0, 'che_무기_05_죽창'=>0, 'che_무기_06_소부'=>0,
|
'che_무기_04_목검' => 0, 'che_무기_05_죽창' => 0, 'che_무기_06_소부' => 0,
|
||||||
|
|
||||||
'che_무기_07_동추'=>1, 'che_무기_07_철편'=>1, 'che_무기_07_철쇄'=>1, 'che_무기_07_맥궁'=>1,
|
'che_무기_07_동추' => 1, 'che_무기_07_철편' => 1, 'che_무기_07_철쇄' => 1, 'che_무기_07_맥궁' => 1,
|
||||||
'che_무기_08_유성추'=>1, 'che_무기_08_철질여골'=>1, 'che_무기_09_쌍철극'=>1, 'che_무기_09_동호비궁'=>1, 'che_무기_10_삼첨도'=>1, 'che_무기_10_대부'=>1, 'che_무기_11_고정도'=>1, 'che_무기_11_이광궁'=>1, 'che_무기_12_철척사모'=>1, 'che_무기_12_칠성검'=>1, 'che_무기_13_사모'=>1, 'che_무기_13_양유기궁'=>1,
|
'che_무기_08_유성추' => 1, 'che_무기_08_철질여골' => 1, 'che_무기_09_쌍철극' => 1, 'che_무기_09_동호비궁' => 1, 'che_무기_10_삼첨도' => 1, 'che_무기_10_대부' => 1, 'che_무기_11_고정도' => 1, 'che_무기_11_이광궁' => 1, 'che_무기_12_철척사모' => 1, 'che_무기_12_칠성검' => 1, 'che_무기_13_사모' => 1, 'che_무기_13_양유기궁' => 1,
|
||||||
'che_무기_14_언월도'=>1, 'che_무기_14_방천화극'=>1, 'che_무기_15_청홍검'=>1, 'che_무기_15_의천검'=>1
|
'che_무기_14_언월도' => 1, 'che_무기_14_방천화극' => 1, 'che_무기_15_청홍검' => 1, 'che_무기_15_의천검' => 1
|
||||||
],
|
],
|
||||||
'book' => [
|
'book' => [
|
||||||
'che_서적_01_효경전'=>0, 'che_서적_02_회남자'=>0, 'che_서적_03_변도론'=>0,
|
'che_서적_01_효경전' => 0, 'che_서적_02_회남자' => 0, 'che_서적_03_변도론' => 0,
|
||||||
'che_서적_04_건상역주'=>0, 'che_서적_05_여씨춘추'=>0, 'che_서적_06_사민월령'=>0,
|
'che_서적_04_건상역주' => 0, 'che_서적_05_여씨춘추' => 0, 'che_서적_06_사민월령' => 0,
|
||||||
|
|
||||||
'che_서적_07_위료자'=>1, 'che_서적_07_사마법'=>1, 'che_서적_07_한서'=>1, 'che_서적_07_논어'=>1,
|
'che_서적_07_위료자' => 1, 'che_서적_07_사마법' => 1, 'che_서적_07_한서' => 1, 'che_서적_07_논어' => 1,
|
||||||
'che_서적_08_전론'=>1, 'che_서적_08_사기'=>1, 'che_서적_09_장자'=>1, 'che_서적_09_역경'=>1,
|
'che_서적_08_전론' => 1, 'che_서적_08_사기' => 1, 'che_서적_09_장자' => 1, 'che_서적_09_역경' => 1,
|
||||||
'che_서적_10_시경'=>1, 'che_서적_10_구국론'=>1, 'che_서적_11_상군서'=>1, 'che_서적_11_춘추전'=>1,
|
'che_서적_10_시경' => 1, 'che_서적_10_구국론' => 1, 'che_서적_11_상군서' => 1, 'che_서적_11_춘추전' => 1,
|
||||||
'che_서적_12_산해경'=>1, 'che_서적_12_맹덕신서'=>1, 'che_서적_13_관자'=>1, 'che_서적_13_병법24편'=>1,
|
'che_서적_12_산해경' => 1, 'che_서적_12_맹덕신서' => 1, 'che_서적_13_관자' => 1, 'che_서적_13_병법24편' => 1,
|
||||||
'che_서적_14_한비자'=>1, 'che_서적_14_오자병법'=>1, 'che_서적_15_노자'=>1, 'che_서적_15_손자병법'=>1,
|
'che_서적_14_한비자' => 1, 'che_서적_14_오자병법' => 1, 'che_서적_15_노자' => 1, 'che_서적_15_손자병법' => 1,
|
||||||
],
|
],
|
||||||
'item' => [
|
'item' => [
|
||||||
'che_치료_환약'=>0, 'che_저격_수극'=>0, 'che_사기_탁주'=>0,
|
'che_치료_환약' => 0, 'che_저격_수극' => 0, 'che_사기_탁주' => 0,
|
||||||
'che_훈련_청주'=>0, 'che_계략_이추'=>0, 'che_계략_향낭'=>0,
|
'che_훈련_청주' => 0, 'che_계략_이추' => 0, 'che_계략_향낭' => 0,
|
||||||
|
|
||||||
'che_의술_청낭서'=>1, 'che_의술_태평청령'=>1, 'che_의술_상한잡병론'=>1,
|
'che_의술_청낭서' => 1, 'che_의술_태평청령' => 1, 'che_의술_상한잡병론' => 1,
|
||||||
'che_부적_태현청생부'=>1,
|
'che_부적_태현청생부' => 1,
|
||||||
'che_저격_매화수전'=>1, 'che_저격_비도'=>1,
|
'che_저격_매화수전' => 1, 'che_저격_비도' => 1,
|
||||||
'che_계략_육도'=>1, 'che_계략_삼략'=>1,
|
'che_계략_육도' => 1, 'che_계략_삼략' => 1,
|
||||||
'che_반계_백우선'=>1,
|
'che_반계_백우선' => 1,
|
||||||
'che_행동_서촉지형도'=>1,
|
'che_행동_서촉지형도' => 1,
|
||||||
|
|
||||||
|
|
||||||
'che_훈련_과실주'=>1, 'che_훈련_이강주'=>1, 'che_사기_두강주'=>1, 'che_사기_보령압주'=>1,
|
'che_훈련_과실주' => 1, 'che_훈련_이강주' => 1, 'che_사기_두강주' => 1, 'che_사기_보령압주' => 1,
|
||||||
'che_훈련_철벽서'=>1, 'che_훈련_단결도'=>1, 'che_사기_춘화첩'=>1, 'che_사기_초선화'=>1,
|
'che_훈련_철벽서' => 1, 'che_훈련_단결도' => 1, 'che_사기_춘화첩' => 1, 'che_사기_초선화' => 1,
|
||||||
'che_회피_태평요술'=>1, 'che_회피_둔갑천서'=>1,
|
'che_회피_태평요술' => 1, 'che_회피_둔갑천서' => 1,
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @var array 선택 가능한 커맨드 */
|
/** @var array 선택 가능한 커맨드 */
|
||||||
public static $availableGeneralCommand = [
|
public static $availableGeneralCommand = [
|
||||||
''=>[
|
'' => [
|
||||||
'휴식',
|
'휴식',
|
||||||
'che_요양'
|
'che_요양'
|
||||||
],
|
],
|
||||||
'내정'=>[
|
'내정' => [
|
||||||
'che_농지개간',
|
'che_농지개간',
|
||||||
'che_상업투자',
|
'che_상업투자',
|
||||||
'che_기술연구',
|
'che_기술연구',
|
||||||
@@ -253,7 +276,7 @@ class GameConstBase
|
|||||||
'che_주민선정',
|
'che_주민선정',
|
||||||
'che_물자조달',
|
'che_물자조달',
|
||||||
],
|
],
|
||||||
'군사'=>[
|
'군사' => [
|
||||||
'che_소집해제',
|
'che_소집해제',
|
||||||
'che_첩보',
|
'che_첩보',
|
||||||
'che_징병',
|
'che_징병',
|
||||||
@@ -262,7 +285,7 @@ class GameConstBase
|
|||||||
'che_사기진작',
|
'che_사기진작',
|
||||||
'che_출병',
|
'che_출병',
|
||||||
],
|
],
|
||||||
'인사'=>[
|
'인사' => [
|
||||||
'che_이동',
|
'che_이동',
|
||||||
'che_강행',
|
'che_강행',
|
||||||
'che_인재탐색',
|
'che_인재탐색',
|
||||||
@@ -273,13 +296,13 @@ class GameConstBase
|
|||||||
'che_랜덤임관',
|
'che_랜덤임관',
|
||||||
'che_장수대상임관',
|
'che_장수대상임관',
|
||||||
],
|
],
|
||||||
'계략'=>[
|
'계략' => [
|
||||||
'che_화계',
|
'che_화계',
|
||||||
'che_파괴',
|
'che_파괴',
|
||||||
'che_탈취',
|
'che_탈취',
|
||||||
'che_선동',
|
'che_선동',
|
||||||
],
|
],
|
||||||
'개인'=>[
|
'개인' => [
|
||||||
'che_내정특기초기화',
|
'che_내정특기초기화',
|
||||||
'che_전투특기초기화',
|
'che_전투특기초기화',
|
||||||
'che_단련',
|
'che_단련',
|
||||||
@@ -301,28 +324,28 @@ class GameConstBase
|
|||||||
|
|
||||||
/** @var array 선택 가능한 커맨드 */
|
/** @var array 선택 가능한 커맨드 */
|
||||||
public static $availableChiefCommand = [
|
public static $availableChiefCommand = [
|
||||||
'휴식'=>[
|
'휴식' => [
|
||||||
'휴식',
|
'휴식',
|
||||||
],
|
],
|
||||||
'인사'=>[
|
'인사' => [
|
||||||
'che_발령',
|
'che_발령',
|
||||||
'che_포상',
|
'che_포상',
|
||||||
'che_몰수',
|
'che_몰수',
|
||||||
],
|
],
|
||||||
'외교'=>[
|
'외교' => [
|
||||||
'che_물자원조',
|
'che_물자원조',
|
||||||
'che_불가침제의',
|
'che_불가침제의',
|
||||||
'che_선전포고',
|
'che_선전포고',
|
||||||
'che_종전제의',
|
'che_종전제의',
|
||||||
'che_불가침파기제의',
|
'che_불가침파기제의',
|
||||||
],
|
],
|
||||||
'특수'=>[
|
'특수' => [
|
||||||
'che_초토화',
|
'che_초토화',
|
||||||
'che_천도',
|
'che_천도',
|
||||||
'che_증축',
|
'che_증축',
|
||||||
'che_감축',
|
'che_감축',
|
||||||
],
|
],
|
||||||
'전략'=>[
|
'전략' => [
|
||||||
'che_필사즉생',
|
'che_필사즉생',
|
||||||
'che_백성동원',
|
'che_백성동원',
|
||||||
'che_수몰',
|
'che_수몰',
|
||||||
@@ -331,7 +354,7 @@ class GameConstBase
|
|||||||
'che_이호경식',
|
'che_이호경식',
|
||||||
'che_급습',
|
'che_급습',
|
||||||
],
|
],
|
||||||
'기타'=>[
|
'기타' => [
|
||||||
'che_피장파장',
|
'che_피장파장',
|
||||||
'che_국기변경',
|
'che_국기변경',
|
||||||
'che_국호변경',
|
'che_국호변경',
|
||||||
|
|||||||
+485
-338
@@ -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 = [];
|
||||||
@@ -35,33 +36,36 @@ class General implements iAction{
|
|||||||
protected $personalityObj = null;
|
protected $personalityObj = null;
|
||||||
/** @var iAction[] */
|
/** @var iAction[] */
|
||||||
protected $itemObjs = [];
|
protected $itemObjs = [];
|
||||||
|
/** @var iAction */
|
||||||
|
protected $inheritBuffObj = null;
|
||||||
|
|
||||||
protected $lastTurn = null;
|
protected $lastTurn = null;
|
||||||
protected $resultTurn = null;
|
protected $resultTurn = null;
|
||||||
|
|
||||||
const RANK_COLUMN = [
|
const RANK_COLUMN = [
|
||||||
'firenum'=>1, 'warnum'=>1, 'killnum'=>1, 'deathnum'=>1, 'killcrew'=>1, 'deathcrew'=>1,
|
'firenum' => 1, 'warnum' => 1, 'killnum' => 1, 'deathnum' => 1, 'killcrew' => 1, 'deathcrew' => 1,
|
||||||
'ttw'=>1, 'ttd'=>1, 'ttl'=>1, 'ttg'=>1, 'ttp'=>1,
|
'ttw' => 1, 'ttd' => 1, 'ttl' => 1, 'ttg' => 1, 'ttp' => 1,
|
||||||
'tlw'=>1, 'tld'=>1, 'tll'=>1, 'tlg'=>1, 'tlp'=>1,
|
'tlw' => 1, 'tld' => 1, 'tll' => 1, 'tlg' => 1, 'tlp' => 1,
|
||||||
'tsw'=>1, 'tsd'=>1, 'tsl'=>1, 'tsg'=>1, 'tsp'=>1,
|
'tsw' => 1, 'tsd' => 1, 'tsl' => 1, 'tsg' => 1, 'tsp' => 1,
|
||||||
'tiw'=>1, 'tid'=>1, 'til'=>1, 'tig'=>1, 'tip'=>1,
|
'tiw' => 1, 'tid' => 1, 'til' => 1, 'tig' => 1, 'tip' => 1,
|
||||||
'betwin'=>1, 'betgold'=>1, 'betwingold'=>1,
|
'betwin' => 1, 'betgold' => 1, 'betwingold' => 1,
|
||||||
'killcrew_person'=>1, 'deathcrew_person'=>1,
|
'killcrew_person' => 1, 'deathcrew_person' => 1,
|
||||||
'occupied'=>1,
|
'occupied' => 1,
|
||||||
];
|
];
|
||||||
|
|
||||||
const INHERITANCE_KEY = [
|
const INHERITANCE_KEY = [
|
||||||
'previous'=>[true, 1, '기존 포인트'],
|
'previous' => [true, 1, '기존 포인트'],
|
||||||
'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, '능동 행동 수'],
|
||||||
'combat'=>[['rank', 'warnum'], 5, '전투 횟수'],
|
//'snipe_combat' => [true, 10, '병종 상성 우위 횟수'],
|
||||||
'sabotage'=>[['rank', 'firenum'], 20, '계략 성공 횟수'],
|
'combat' => [['rank', 'warnum'], 5, '전투 횟수'],
|
||||||
'unifier'=>[true, 1, '천통 기여'],
|
'sabotage' => [['rank', 'firenum'], 20, '계략 성공 횟수'],
|
||||||
'dex'=>[false, 0.001, '숙련도'],
|
'unifier' => [true, 1, '천통 기여'],
|
||||||
'tournament'=>[true, 1, '토너먼트'],
|
'dex' => [false, 0.001, '숙련도'],
|
||||||
'betting'=>[false, 10, '베팅 당첨'],
|
'tournament' => [true, 1, '토너먼트'],
|
||||||
|
'betting' => [false, 10, '베팅 당첨'],
|
||||||
];
|
];
|
||||||
|
|
||||||
const TURNTIME_FULL_MS = -1;
|
const TURNTIME_FULL_MS = -1;
|
||||||
@@ -73,19 +77,19 @@ class General implements iAction{
|
|||||||
|
|
||||||
protected static $prohibitedDirectUpdateVars = [
|
protected static $prohibitedDirectUpdateVars = [
|
||||||
//Reason: iAction
|
//Reason: iAction
|
||||||
'leadership'=>1,
|
'leadership' => 1,
|
||||||
'power'=>1,
|
'power' => 1,
|
||||||
'intel'=>1,
|
'intel' => 1,
|
||||||
'nation'=>2,
|
'nation' => 2,
|
||||||
'officer_level'=>1,
|
'officer_level' => 1,
|
||||||
//NOTE: officerLevelObj로 인해 국가의 '레벨'이 바뀌는 것도 조심해야 하나, 국가 레벨의 변경은 월 초/말에만 일어남.
|
//NOTE: officerLevelObj로 인해 국가의 '레벨'이 바뀌는 것도 조심해야 하나, 국가 레벨의 변경은 월 초/말에만 일어남.
|
||||||
'special'=>1,
|
'special' => 1,
|
||||||
'special2'=>1,
|
'special2' => 1,
|
||||||
'personal'=>1,
|
'personal' => 1,
|
||||||
'horse'=>1,
|
'horse' => 1,
|
||||||
'weapon'=>1,
|
'weapon' => 1,
|
||||||
'book'=>1,
|
'book' => 1,
|
||||||
'item'=>1
|
'item' => 1
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -96,10 +100,11 @@ 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) {
|
||||||
$nation = getNationStaticInfo($raw['nation']);
|
$nation = getNationStaticInfo($raw['nation']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,20 +112,20 @@ class General implements iAction{
|
|||||||
$this->rawCity = $city;
|
$this->rawCity = $city;
|
||||||
|
|
||||||
$this->resultTurn = new LastTurn();
|
$this->resultTurn = new LastTurn();
|
||||||
if(key_exists('last_turn', $this->raw)){
|
if (key_exists('last_turn', $this->raw)) {
|
||||||
$this->lastTurn = LastTurn::fromJson($this->raw['last_turn']);
|
$this->lastTurn = LastTurn::fromJson($this->raw['last_turn']);
|
||||||
$this->resultTurn = $this->lastTurn->duplicate();
|
$this->resultTurn = $this->lastTurn->duplicate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($year !== null && $month !== null){
|
if ($year !== null && $month !== null) {
|
||||||
$this->initLogger($year, $month);
|
$this->initLogger($year, $month);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($rawRank){
|
if ($rawRank) {
|
||||||
$this->rankVarRead = $rawRank;
|
$this->rankVarRead = $rawRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$fullConstruct){
|
if (!$fullConstruct) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,9 +141,17 @@ class General implements iAction{
|
|||||||
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
$this->itemObjs['weapon'] = buildItemClass($raw['weapon']);
|
||||||
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
$this->itemObjs['book'] = buildItemClass($raw['book']);
|
||||||
$this->itemObjs['item'] = buildItemClass($raw['item']);
|
$this->itemObjs['item'] = buildItemClass($raw['item']);
|
||||||
|
|
||||||
|
if (key_exists('aux', $this->raw)) {
|
||||||
|
$rawInheritBuff = $this->getAuxVar('inheritBuff');
|
||||||
|
if ($rawInheritBuff !== null) {
|
||||||
|
$this->inheritBuffObj = new TriggerInheritBuff($rawInheritBuff);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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'),
|
||||||
@@ -148,17 +161,27 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,50 +189,61 @@ 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;
|
||||||
}
|
}
|
||||||
@@ -223,86 +257,103 @@ 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'));
|
||||||
}
|
}
|
||||||
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];
|
||||||
}
|
}
|
||||||
if(!$this->getVar('recent_war')){
|
if (!$this->getVar('recent_war')) {
|
||||||
$result = 12*1000;
|
$result = 12 * 1000;
|
||||||
$this->calcCache[$cacheKey] = $result;
|
$this->calcCache[$cacheKey] = $result;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -310,7 +361,7 @@ class General implements iAction{
|
|||||||
$turnNow = new \DateTimeImmutable($this->getVar('turntime'));
|
$turnNow = new \DateTimeImmutable($this->getVar('turntime'));
|
||||||
$secDiff = TimeUtil::DateIntervalToSeconds($recwar->diff($turnNow));
|
$secDiff = TimeUtil::DateIntervalToSeconds($recwar->diff($turnNow));
|
||||||
|
|
||||||
if($secDiff <= 0){
|
if ($secDiff <= 0) {
|
||||||
$this->calcCache[$cacheKey] = 0;
|
$this->calcCache[$cacheKey] = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -320,13 +371,14 @@ 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) {
|
||||||
return buildGeneralCommandClass(null, $this, $env);
|
return buildGeneralCommandClass(null, $this, $env);
|
||||||
}
|
}
|
||||||
return buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
return buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg'] ?? null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -336,13 +388,14 @@ 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){
|
{
|
||||||
throw new \OutOfRangeException('$turnIdxFrom 범위 초과'.$turnIdxFrom);
|
if ($turnIdxFrom < 0 || $turnIdxFrom >= GameConst::$maxTurn) {
|
||||||
|
throw new \OutOfRangeException('$turnIdxFrom 범위 초과' . $turnIdxFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($turnIdxTo <= $turnIdxFrom || GameConst::$maxTurn < $turnIdxTo){
|
if ($turnIdxTo <= $turnIdxFrom || GameConst::$maxTurn < $turnIdxTo) {
|
||||||
throw new \OutOfRangeException('$turnIdxTo 범위 초과'.$turnIdxTo);
|
throw new \OutOfRangeException('$turnIdxTo 범위 초과' . $turnIdxTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
@@ -353,15 +406,15 @@ class General implements iAction{
|
|||||||
|
|
||||||
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND %i <= turn_idx AND turn_idx < %i ORDER BY turn_idx ASC', $generalID, $turnIdxFrom, $turnIdxTo);
|
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id = %i AND %i <= turn_idx AND turn_idx < %i ORDER BY turn_idx ASC', $generalID, $turnIdxFrom, $turnIdxTo);
|
||||||
|
|
||||||
if(!$rawCmds){
|
if (!$rawCmds) {
|
||||||
foreach(Util::range($turnIdxFrom, $turnIdxTo) as $turnIdx){
|
foreach (Util::range($turnIdxFrom, $turnIdxTo) as $turnIdx) {
|
||||||
$result[$turnIdx] = buildGeneralCommandClass(null, $this, $env);
|
$result[$turnIdx] = buildGeneralCommandClass(null, $this, $env);
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($rawCmds as $turnIdx=>$rawCmd){
|
foreach ($rawCmds as $turnIdx => $rawCmd) {
|
||||||
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg']??null));
|
$result[$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $this, $env, Json::decode($rawCmd['arg'] ?? null));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
@@ -379,11 +432,12 @@ 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];
|
||||||
if($useFloor){
|
if ($useFloor) {
|
||||||
return Util::toInt($statValue);
|
return Util::toInt($statValue);
|
||||||
}
|
}
|
||||||
return $statValue;
|
return $statValue;
|
||||||
@@ -391,34 +445,34 @@ class General implements iAction{
|
|||||||
|
|
||||||
$statValue = $this->getVar($statName);
|
$statValue = $this->getVar($statName);
|
||||||
|
|
||||||
if($withInjury){
|
if ($withInjury) {
|
||||||
$statValue *= (100 - $this->getVar('injury')) / 100;
|
$statValue *= (100 - $this->getVar('injury')) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($withIActionObj){
|
if ($withIActionObj) {
|
||||||
foreach([
|
foreach ([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj
|
$this->personalityObj,
|
||||||
] as $actionObj){
|
$this->inheritBuffObj,
|
||||||
if($actionObj !== null){
|
] as $actionObj) {
|
||||||
|
if ($actionObj !== null) {
|
||||||
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->itemObjs as $actionObj){
|
foreach ($this->itemObjs as $actionObj) {
|
||||||
if($actionObj !== null){
|
if ($actionObj !== null) {
|
||||||
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
$statValue = $actionObj->onCalcStat($this, $statName, $statValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,54 +480,58 @@ class General implements iAction{
|
|||||||
|
|
||||||
$this->calcCache[$cKey] = $statValue;
|
$this->calcCache[$cKey] = $statValue;
|
||||||
|
|
||||||
if($useFloor){
|
if ($useFloor) {
|
||||||
return Util::toInt($statValue);
|
return Util::toInt($statValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
$armType = GameUnitConst::T_SIEGE;
|
$armType = GameUnitConst::T_SIEGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
$armType = GameUnitConst::T_SIEGE;
|
$armType = GameUnitConst::T_SIEGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($armType < 0){
|
if ($armType < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($affectTrainAtmos){
|
if ($affectTrainAtmos) {
|
||||||
$exp *= ($this->getVar('train') + $this->getVar('atmos')) / 200;
|
$exp *= ($this->getVar('train') + $this->getVar('atmos')) / 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,39 +540,39 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->increaseVar('experience', $experience);
|
$this->increaseVar('experience', $experience);
|
||||||
$nextExpLevel = getExpLevel($this->getVar('experience'));
|
$nextExpLevel = getExpLevel($this->getVar('experience'));
|
||||||
$comp = $nextExpLevel <=> $this->getVar('explevel');
|
$comp = $nextExpLevel <=> $this->getVar('explevel');
|
||||||
if($comp === 0){
|
if ($comp === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateVar('explevel', $nextExpLevel);
|
$this->updateVar('explevel', $nextExpLevel);
|
||||||
|
|
||||||
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->increaseVar('dedication', $dedication);
|
$this->increaseVar('dedication', $dedication);
|
||||||
$nextDedLevel = getDedLevel($this->getVar('dedication'));
|
$nextDedLevel = getDedLevel($this->getVar('dedication'));
|
||||||
$comp = $nextDedLevel <=> $this->getVar('dedlevel');
|
$comp = $nextDedLevel <=> $this->getVar('dedlevel');
|
||||||
if($comp === 0){
|
if ($comp === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,20 +582,19 @@ class General implements iAction{
|
|||||||
$billText = number_format(getBillByLevel($nextDedLevel));
|
$billText = number_format(getBillByLevel($nextDedLevel));
|
||||||
$josaRoDed = JosaUtil::pick($dedLevelText, '로');
|
$josaRoDed = JosaUtil::pick($dedLevelText, '로');
|
||||||
$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;
|
||||||
}
|
}
|
||||||
if(!key_exists($key, $this->updatedVar)){
|
if (!key_exists($key, $this->updatedVar)) {
|
||||||
$this->updatedVar[$key] = true;
|
$this->updatedVar[$key] = true;
|
||||||
}
|
}
|
||||||
$this->raw[$key] = $value;
|
$this->raw[$key] = $value;
|
||||||
@@ -547,39 +604,81 @@ 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();
|
||||||
|
|
||||||
$this->mergeTotalInheritancePoint();
|
//유산포인트 관련 항목 환불
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 군주였으면 유지 이음
|
// 군주였으면 유지 이음
|
||||||
$officerLevel = $this->getVar('officer_level');
|
$officerLevel = $this->getVar('officer_level');
|
||||||
if($officerLevel == 12) {
|
if ($officerLevel == 12) {
|
||||||
nextRuler($this);
|
nextRuler($this);
|
||||||
$this->setVar('officer_level', 1);
|
$this->setVar('officer_level', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 부대 처리
|
// 부대 처리
|
||||||
$troopLeaderID = $this->getVar('troop');
|
$troopLeaderID = $this->getVar('troop');
|
||||||
if($troopLeaderID == $generalID){
|
if ($troopLeaderID == $generalID) {
|
||||||
//부대장일 경우
|
//부대장일 경우
|
||||||
// 모두 탈퇴
|
// 모두 탈퇴
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'troop'=>0
|
'troop' => 0
|
||||||
], 'troop=%i', $troopLeaderID);
|
], 'troop=%i', $troopLeaderID);
|
||||||
// 부대 삭제
|
// 부대 삭제
|
||||||
$db->delete('troop', 'troop_leader=%i', $troopLeaderID);
|
$db->delete('troop', 'troop_leader=%i', $troopLeaderID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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());
|
||||||
}
|
}
|
||||||
@@ -587,9 +686,9 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db->update('select_pool', [
|
$db->update('select_pool', [
|
||||||
'general_id'=>null,
|
'general_id' => null,
|
||||||
'owner'=>null,
|
'owner' => null,
|
||||||
'reserved_until'=>null,
|
'reserved_until' => null,
|
||||||
], 'general_id=%i', $generalID);
|
], 'general_id=%i', $generalID);
|
||||||
|
|
||||||
$db->delete('general', 'no=%i', $generalID);
|
$db->delete('general', 'no=%i', $generalID);
|
||||||
@@ -599,17 +698,18 @@ class General implements iAction{
|
|||||||
$this->updatedVar = [];
|
$this->updatedVar = [];
|
||||||
|
|
||||||
$db->update('nation', [
|
$db->update('nation', [
|
||||||
'gennum'=>$db->sqleval('gennum - 1')
|
'gennum' => $db->sqleval('gennum - 1')
|
||||||
], '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();
|
||||||
|
|
||||||
$ownerID = $this->getVar('owner');
|
$ownerID = $this->getVar('owner');
|
||||||
if($ownerID){
|
if ($ownerID) {
|
||||||
$this->mergeTotalInheritancePoint();
|
$this->mergeTotalInheritancePoint();
|
||||||
resetInheritanceUser($ownerID, true);
|
resetInheritanceUser($ownerID, true);
|
||||||
}
|
}
|
||||||
@@ -629,7 +729,7 @@ class General implements iAction{
|
|||||||
$this->multiplyVar('dex4', 0.5);
|
$this->multiplyVar('dex4', 0.5);
|
||||||
$this->multiplyVar('dex5', 0.5);
|
$this->multiplyVar('dex5', 0.5);
|
||||||
|
|
||||||
foreach(array_keys(static::RANK_COLUMN) as $rankKey){
|
foreach (array_keys(static::RANK_COLUMN) as $rankKey) {
|
||||||
$this->setRankVar($rankKey, 0);
|
$this->setRankVar($rankKey, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -639,23 +739,24 @@ 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)){
|
{
|
||||||
throw new \InvalidArgumentException('올바르지 않은 인자 :'.$key);
|
if (!key_exists($key, static::RANK_COLUMN)) {
|
||||||
|
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_exists($key, $this->rankVarSet)){
|
if (key_exists($key, $this->rankVarSet)) {
|
||||||
$this->rankVarSet[$key] += $value;
|
$this->rankVarSet[$key] += $value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_exists($key, $this->rankVarRead)){
|
if (key_exists($key, $this->rankVarRead)) {
|
||||||
$this->rankVarSet[$key] = $this->rankVarRead[$key] + $value;
|
$this->rankVarSet[$key] = $this->rankVarRead[$key] + $value;
|
||||||
unset($this->rankVarRead[$key]);
|
unset($this->rankVarRead[$key]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_exists($key, $this->rankVarIncrease)){
|
if (key_exists($key, $this->rankVarIncrease)) {
|
||||||
$this->rankVarIncrease[$key] += $value;
|
$this->rankVarIncrease[$key] += $value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -663,31 +764,32 @@ 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)){
|
{
|
||||||
throw new \InvalidArgumentException('올바르지 않은 인자 :'.$key);
|
if (!key_exists($key, static::RANK_COLUMN)) {
|
||||||
|
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)){
|
{
|
||||||
throw new \InvalidArgumentException('올바르지 않은 인자 :'.$key);
|
if (!key_exists($key, static::RANK_COLUMN)) {
|
||||||
|
throw new \InvalidArgumentException('올바르지 않은 인자 :' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(key_exists($key, $this->rankVarSet)){
|
if (key_exists($key, $this->rankVarSet)) {
|
||||||
return $this->rankVarSet[$key];
|
return $this->rankVarSet[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!key_exists($key, $this->rankVarRead)){
|
if (!key_exists($key, $this->rankVarRead)) {
|
||||||
throw new \RuntimeException('인자가 없음 : '.$key);
|
throw new \RuntimeException('인자가 없음 : ' . $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->rankVarRead[$key];
|
return $this->rankVarRead[$key];
|
||||||
@@ -696,8 +798,9 @@ 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());
|
||||||
}
|
}
|
||||||
$updateVals = $this->getUpdatedValues();
|
$updateVals = $this->getUpdatedValues();
|
||||||
@@ -706,31 +809,31 @@ class General implements iAction{
|
|||||||
$generalID = $this->getID();
|
$generalID = $this->getID();
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
if($updateVals){
|
if ($updateVals) {
|
||||||
$db->update('general', $updateVals, 'no=%i', $generalID);
|
$db->update('general', $updateVals, 'no=%i', $generalID);
|
||||||
$result = $result || $db->affectedRows() > 0;
|
$result = $result || $db->affectedRows() > 0;
|
||||||
if(key_exists('nation', $updateVals)){
|
if (key_exists('nation', $updateVals)) {
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
'nation_id'=>$updateVals['nation']
|
'nation_id' => $updateVals['nation']
|
||||||
], 'general_id = %i', $generalID);
|
], 'general_id = %i', $generalID);
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
$this->flushUpdateValues();
|
$this->flushUpdateValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->rankVarIncrease){
|
if ($this->rankVarIncrease) {
|
||||||
foreach($this->rankVarIncrease as $rankKey => $rankVal){
|
foreach ($this->rankVarIncrease as $rankKey => $rankVal) {
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
'value'=>$db->sqleval('value + %i', $rankVal)
|
'value' => $db->sqleval('value + %i', $rankVal)
|
||||||
], 'general_id = %i AND type = %s', $generalID, $rankKey);
|
], 'general_id = %i AND type = %s', $generalID, $rankKey);
|
||||||
}
|
}
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->rankVarSet){
|
if ($this->rankVarSet) {
|
||||||
foreach($this->rankVarSet as $rankKey => $rankVal){
|
foreach ($this->rankVarSet as $rankKey => $rankVal) {
|
||||||
$db->update('rank_data', [
|
$db->update('rank_data', [
|
||||||
'value'=>$rankVal
|
'value' => $rankVal
|
||||||
], 'general_id = %i AND type = %s', $generalID, $rankKey);
|
], 'general_id = %i AND type = %s', $generalID, $rankKey);
|
||||||
$this->rankVarRead[$rankKey] = $rankVal;
|
$this->rankVarRead[$rankKey] = $rankVal;
|
||||||
}
|
}
|
||||||
@@ -744,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;
|
||||||
|
|
||||||
@@ -756,16 +860,15 @@ class General implements iAction{
|
|||||||
|
|
||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
foreach($table as [$statNickName, $statName]){
|
foreach ($table as [$statNickName, $statName]) {
|
||||||
$statExpName = $statName.'_exp';
|
$statExpName = $statName . '_exp';
|
||||||
|
|
||||||
if($this->getVar($statExpName) < 0){
|
if ($this->getVar($statExpName) < 0) {
|
||||||
$logger->pushGeneralActionLog("<R>{$statNickName}</>이 <C>1</> 떨어졌습니다!", ActionLogger::PLAIN);
|
$logger->pushGeneralActionLog("<R>{$statNickName}</>이 <C>1</> 떨어졌습니다!", ActionLogger::PLAIN);
|
||||||
$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);
|
||||||
@@ -776,18 +879,20 @@ 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,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
|
], $this->itemObjs) as $iObj) {
|
||||||
|
|
||||||
if(!$iObj){
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -796,16 +901,18 @@ 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,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -814,17 +921,19 @@ 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,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -833,16 +942,39 @@ class General implements iAction{
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
public function onCalcOpposeStat(General $general, string $statName, $value, $aux = null)
|
||||||
foreach(array_merge([
|
{
|
||||||
|
//xxx: $general?
|
||||||
|
foreach (array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/** @var iAction $iObj */
|
||||||
|
$value = $iObj->onCalcOpposeStat($this, $statName, $value, $aux);
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onCalcStrategic(string $turnType, string $varType, $value)
|
||||||
|
{
|
||||||
|
foreach (array_merge([
|
||||||
|
$this->nationType,
|
||||||
|
$this->officerLevelObj,
|
||||||
|
$this->specialDomesticObj,
|
||||||
|
$this->specialWarObj,
|
||||||
|
$this->personalityObj,
|
||||||
|
$this->getCrewTypeObj(),
|
||||||
|
$this->inheritBuffObj,
|
||||||
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -851,16 +983,18 @@ 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,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -869,19 +1003,21 @@ 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;
|
||||||
foreach(array_merge([
|
foreach (array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -891,17 +1027,19 @@ 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,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -910,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),
|
||||||
@@ -920,15 +1059,16 @@ class General implements iAction{
|
|||||||
new WarUnitTrigger\che_계략발동($unit),
|
new WarUnitTrigger\che_계략발동($unit),
|
||||||
new WarUnitTrigger\che_계략실패($unit)
|
new WarUnitTrigger\che_계략실패($unit)
|
||||||
);
|
);
|
||||||
foreach(array_merge([
|
foreach (array_merge([
|
||||||
$this->nationType,
|
$this->nationType,
|
||||||
$this->officerLevelObj,
|
$this->officerLevelObj,
|
||||||
$this->specialDomesticObj,
|
$this->specialDomesticObj,
|
||||||
$this->specialWarObj,
|
$this->specialWarObj,
|
||||||
$this->personalityObj,
|
$this->personalityObj,
|
||||||
$this->getCrewTypeObj(),
|
$this->getCrewTypeObj(),
|
||||||
], $this->itemObjs) as $iObj){
|
$this->inheritBuffObj,
|
||||||
if(!$iObj){
|
], $this->itemObjs) as $iObj) {
|
||||||
|
if (!$iObj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/** @var iAction $iObj */
|
/** @var iAction $iObj */
|
||||||
@@ -938,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',
|
||||||
@@ -956,22 +1097,21 @@ class General implements iAction{
|
|||||||
'specage', 'specage2', 'con', 'connect', 'aux', 'lastrefresh',
|
'specage', 'specage2', 'con', 'connect', 'aux', 'lastrefresh',
|
||||||
];
|
];
|
||||||
|
|
||||||
if($reqColumns === null){
|
if ($reqColumns === null) {
|
||||||
return [$fullColumn, array_keys(static::RANK_COLUMN)];
|
return [$fullColumn, array_keys(static::RANK_COLUMN)];
|
||||||
}
|
}
|
||||||
|
|
||||||
$rankColumn = [];
|
$rankColumn = [];
|
||||||
$subColumn = [];
|
$subColumn = [];
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($constructMode > 1){
|
if ($constructMode > 1) {
|
||||||
return [array_unique(array_merge($defaultEventColumn, $subColumn)), $rankColumn];
|
return [array_unique(array_merge($defaultEventColumn, $subColumn)), $rankColumn];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,31 +1125,30 @@ 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 [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
||||||
|
|
||||||
if($generalIDList === null){
|
if ($generalIDList === null) {
|
||||||
$rawGenerals = Util::convertArrayToDict(
|
$rawGenerals = Util::convertArrayToDict(
|
||||||
$db->query('SELECT %l FROM general WHERE 1', Util::formatListOfBackticks($column)),
|
$db->query('SELECT %l FROM general WHERE 1', Util::formatListOfBackticks($column)),
|
||||||
'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'
|
||||||
@@ -1018,14 +1157,14 @@ class General implements iAction{
|
|||||||
|
|
||||||
|
|
||||||
$rawRanks = [];
|
$rawRanks = [];
|
||||||
if($rankColumn){
|
if ($rankColumn) {
|
||||||
$rawValue = $db->queryAllLists(
|
$rawValue = $db->queryAllLists(
|
||||||
'SELECT `general_id`, `type`, `value` FROM rank_data WHERE general_id IN %li AND `type` IN %ls',
|
'SELECT `general_id`, `type`, `value` FROM rank_data WHERE general_id IN %li AND `type` IN %ls',
|
||||||
$generalIDList,
|
$generalIDList,
|
||||||
$rankColumn
|
$rankColumn
|
||||||
);
|
);
|
||||||
foreach($rawValue as [$generalID, $rankType, $rankValue]){
|
foreach ($rawValue as [$generalID, $rankType, $rankValue]) {
|
||||||
if(!key_exists($generalID, $rawRanks)){
|
if (!key_exists($generalID, $rawRanks)) {
|
||||||
$rawRanks[$generalID] = [];
|
$rawRanks[$generalID] = [];
|
||||||
}
|
}
|
||||||
$rawRanks[$generalID][$rankType] = $rankValue;
|
$rawRanks[$generalID][$rankType] = $rankValue;
|
||||||
@@ -1033,27 +1172,27 @@ class General implements iAction{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach($generalIDList as $generalID){
|
foreach ($generalIDList as $generalID) {
|
||||||
if(!key_exists($generalID, $rawGenerals)){
|
if (!key_exists($generalID, $rawGenerals)) {
|
||||||
$result[$generalID] = new DummyGeneral($constructMode > 0);
|
$result[$generalID] = new DummyGeneral($constructMode > 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(key_exists($generalID, $rawRanks) && count($rawRanks[$generalID]??[]) !== count($rankColumn)){
|
if (key_exists($generalID, $rawRanks) && count($rawRanks[$generalID] ?? []) !== count($rankColumn)) {
|
||||||
throw new \RuntimeException('column의 수가 일치하지 않음 : '.$generalID);
|
throw new \RuntimeException('column의 수가 일치하지 않음 : ' . $generalID);
|
||||||
}
|
}
|
||||||
$result[$generalID] = new static($rawGenerals[$generalID], $rawRanks[$generalID]??null, null, null, $year, $month, $constructMode > 1);
|
$result[$generalID] = new static($rawGenerals[$generalID], $rawRanks[$generalID] ?? null, null, null, $year, $month, $constructMode > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -1061,14 +1200,14 @@ class General implements iAction{
|
|||||||
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
[$column, $rankColumn] = static::mergeQueryColumn($column, $constructMode);
|
||||||
|
|
||||||
$rawGeneral = $db->queryFirstRow('SELECT %l FROM general WHERE no = %i', Util::formatListOfBackticks($column), $generalID);
|
$rawGeneral = $db->queryFirstRow('SELECT %l FROM general WHERE no = %i', Util::formatListOfBackticks($column), $generalID);
|
||||||
if(!$rawGeneral){
|
if (!$rawGeneral) {
|
||||||
return new DummyGeneral($constructMode > 0);
|
return new DummyGeneral($constructMode > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rawRankValues = [];
|
$rawRankValues = [];
|
||||||
if($rankColumn){
|
if ($rankColumn) {
|
||||||
$rawValue = $db->queryAllLists('SELECT `type`, `value` FROM rank_data WHERE general_id = %i AND `type` IN %ls', $generalID, $rankColumn);
|
$rawValue = $db->queryAllLists('SELECT `type`, `value` FROM rank_data WHERE general_id = %i AND `type` IN %ls', $generalID, $rankColumn);
|
||||||
foreach($rawValue as [$rankType, $rankValue]){
|
foreach ($rawValue as [$rankType, $rankValue]) {
|
||||||
$rawRankValues[$rankType] = $rankValue;
|
$rawRankValues[$rankType] = $rankValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,21 +1224,22 @@ 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 [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$generalIDList = array_map(function(General $general){
|
$generalIDList = array_map(function (General $general) {
|
||||||
return $general->getID();
|
return $general->getID();
|
||||||
}, $generalList);
|
}, $generalList);
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$result = [];
|
$result = [];
|
||||||
$rawCmds = Util::convertArrayToDict($db->query('SELECT * FROM general_turn WHERE general_id IN %li AND turn_idx = %i', $generalIDList, $turnIdx), 'general_id');
|
$rawCmds = Util::convertArrayToDict($db->query('SELECT * FROM general_turn WHERE general_id IN %li AND turn_idx = %i', $generalIDList, $turnIdx), 'general_id');
|
||||||
foreach($generalList as $general){
|
foreach ($generalList as $general) {
|
||||||
$generalID = $general->getID();
|
$generalID = $general->getID();
|
||||||
if(!key_exists($generalID, $rawCmds)){
|
if (!key_exists($generalID, $rawCmds)) {
|
||||||
$result[$generalID] = buildGeneralCommandClass(null, $general, $env);
|
$result[$generalID] = buildGeneralCommandClass(null, $general, $env);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1116,21 +1256,22 @@ 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 [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($turnIdxFrom < 0 || $turnIdxFrom >= GameConst::$maxTurn){
|
if ($turnIdxFrom < 0 || $turnIdxFrom >= GameConst::$maxTurn) {
|
||||||
throw new \OutOfRangeException('$turnIdxFrom 범위 초과'.$turnIdxFrom);
|
throw new \OutOfRangeException('$turnIdxFrom 범위 초과' . $turnIdxFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($turnIdxTo <= $turnIdxFrom || GameConst::$maxTurn < $turnIdxTo){
|
if ($turnIdxTo <= $turnIdxFrom || GameConst::$maxTurn < $turnIdxTo) {
|
||||||
throw new \OutOfRangeException('$turnIdxTo 범위 초과'.$turnIdxTo);
|
throw new \OutOfRangeException('$turnIdxTo 범위 초과' . $turnIdxTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
$generalIDList = array_map(function(General $general){
|
$generalIDList = array_map(function (General $general) {
|
||||||
return $general->getID();
|
return $general->getID();
|
||||||
}, $generalList);
|
}, $generalList);
|
||||||
|
|
||||||
@@ -1138,26 +1279,26 @@ class General implements iAction{
|
|||||||
|
|
||||||
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id IN %i AND %i <= turn_idx AND turn_idx < %i ORDER BY general_id ASC, turn_idx ASC', $generalIDList, $turnIdxFrom, $turnIdxTo);
|
$rawCmds = $db->queryFirstRow('SELECT * FROM general_turn WHERE general_id IN %i AND %i <= turn_idx AND turn_idx < %i ORDER BY general_id ASC, turn_idx ASC', $generalIDList, $turnIdxFrom, $turnIdxTo);
|
||||||
$orderedRawCmds = [];
|
$orderedRawCmds = [];
|
||||||
foreach($rawCmds as $rawCmd){
|
foreach ($rawCmds as $rawCmd) {
|
||||||
$generalID = $rawCmd['general_id'];
|
$generalID = $rawCmd['general_id'];
|
||||||
$turnIdx = $rawCmd['turn_idx'];
|
$turnIdx = $rawCmd['turn_idx'];
|
||||||
if(!key_exists($generalID, $orderedRawCmds)){
|
if (!key_exists($generalID, $orderedRawCmds)) {
|
||||||
$orderedRawCmds[$generalID] = [];
|
$orderedRawCmds[$generalID] = [];
|
||||||
}
|
}
|
||||||
$orderedRawCmds[$generalID][$turnIdx] = $rawCmd;
|
$orderedRawCmds[$generalID][$turnIdx] = $rawCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach($generalList as $general){
|
foreach ($generalList as $general) {
|
||||||
$generalID = $general->getID();
|
$generalID = $general->getID();
|
||||||
$result[$generalID] = [];
|
$result[$generalID] = [];
|
||||||
if(!key_exists($generalID, $orderedRawCmds)){
|
if (!key_exists($generalID, $orderedRawCmds)) {
|
||||||
foreach(Util::range($turnIdxFrom, $turnIdxTo) as $turnIdx){
|
foreach (Util::range($turnIdxFrom, $turnIdxTo) as $turnIdx) {
|
||||||
$result[$generalID][$turnIdx] = buildGeneralCommandClass(null, $general, $env);
|
$result[$generalID][$turnIdx] = buildGeneralCommandClass(null, $general, $env);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach($orderedRawCmds[$generalID] as $turnIdx=>$rawCmd){
|
foreach ($orderedRawCmds[$generalID] as $turnIdx => $rawCmd) {
|
||||||
$result[$generalID][$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $general, $env, Json::decode($rawCmd['arg']));
|
$result[$generalID][$turnIdx] = buildGeneralCommandClass($rawCmd['action'], $general, $env, Json::decode($rawCmd['arg']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1167,109 +1308,113 @@ 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;
|
{
|
||||||
if($inheritType === null){
|
$inheritType = static::INHERITANCE_KEY[$key] ?? null;
|
||||||
|
if ($inheritType === null) {
|
||||||
throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
|
throw new \OutOfRangeException("{$key}는 유산 타입이 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $this->getVar('owner');
|
$ownerID = $this->getVar('owner');
|
||||||
if(!$ownerID){
|
if (!$ownerID) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getVar('npc') != 0){
|
if ($this->getVar('npc') != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[$storeType, $multiplier, ] = $inheritType;
|
[$storeType, $multiplier,] = $inheritType;
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
if($storeType === true || ($gameStor->isunited != 0 && !$forceCalc)){
|
if ($storeType === true || ($gameStor->isunited != 0 && !$forceCalc)) {
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
||||||
[$value, $aux] = $inheritStor->getValue($key);
|
[$value, $aux] = $inheritStor->getValue($key);
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($storeType)){
|
if (is_array($storeType)) {
|
||||||
[$storSubType, $storSubKey] = $storeType;
|
[$storSubType, $storSubKey] = $storeType;
|
||||||
if($storSubType === 'rank'){
|
if ($storSubType === 'rank') {
|
||||||
return $this->getRankVar($storSubKey) * $multiplier;
|
return $this->getRankVar($storSubKey) * $multiplier;
|
||||||
}
|
}
|
||||||
if($storSubType === 'raw'){
|
if ($storSubType === 'raw') {
|
||||||
return $this->getVar($storSubKey) * $multiplier;
|
return $this->getVar($storSubKey) * $multiplier;
|
||||||
}
|
}
|
||||||
if($storSubType === 'aux'){
|
if ($storSubType === 'aux') {
|
||||||
return ($this->getAuxVar($storSubKey)??0) * $multiplier;
|
return ($this->getAuxVar($storSubKey) ?? 0) * $multiplier;
|
||||||
}
|
}
|
||||||
throw new \InvalidArgumentException("{$storSubType}은 참조 할 수 없는 유산 세부키임");
|
throw new \InvalidArgumentException("{$storSubType}은 참조 할 수 없는 유산 세부키임");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($storeType !== false){
|
if ($storeType !== false) {
|
||||||
throw new \InvalidArgumentException("{$storeType}은 올바르지 않은 유산 키임");
|
throw new \InvalidArgumentException("{$storeType}은 올바르지 않은 유산 키임");
|
||||||
}
|
}
|
||||||
|
|
||||||
$extractFn = function(){ return [0, null];};
|
$extractFn = function () {
|
||||||
switch($key){
|
return [0, null];
|
||||||
case 'dex':
|
};
|
||||||
$extractFn = function() use ($multiplier){
|
switch ($key) {
|
||||||
$totalDex = 0;
|
case 'dex':
|
||||||
foreach(array_keys(GameUnitConst::allType()) as $armType){
|
$extractFn = function () use ($multiplier) {
|
||||||
$totalDex += $this->getVar("dex{$armType}");
|
$totalDex = 0;
|
||||||
}
|
foreach (array_keys(GameUnitConst::allType()) as $armType) {
|
||||||
return [$totalDex * $multiplier, null];
|
$totalDex += $this->getVar("dex{$armType}");
|
||||||
};
|
}
|
||||||
break;
|
return [$totalDex * $multiplier, null];
|
||||||
case 'betting':
|
};
|
||||||
$extractFn = function() use ($multiplier){
|
break;
|
||||||
$betWin = $this->getRankVar('betwin');
|
case 'betting':
|
||||||
$betWinRate = $this->getRankVar('betwingold')/max(1, $this->getRankVar('betgold'));
|
$extractFn = function () use ($multiplier) {
|
||||||
|
$betWin = $this->getRankVar('betwin');
|
||||||
|
$betWinRate = $this->getRankVar('betwingold') / max(1, $this->getRankVar('betgold'));
|
||||||
|
|
||||||
return [$betWin * $multiplier * pow($betWinRate, 2), null];
|
return [$betWin * $multiplier * pow($betWinRate, 2), null];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'max_belong':
|
case 'max_belong':
|
||||||
$extractFn = function() use ($multiplier){
|
$extractFn = function () use ($multiplier) {
|
||||||
$maxBelong = max($this->getVar('belong'), $this->getAuxVar('max_belong')??0);
|
$maxBelong = max($this->getVar('belong'), $this->getAuxVar('max_belong') ?? 0);
|
||||||
return [$maxBelong * $multiplier, null];
|
return [$maxBelong * $multiplier, null];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \InvalidArgumentException("{$key}는 유산 추출기를 보유하고 있지 않음");
|
throw new \InvalidArgumentException("{$key}는 유산 추출기를 보유하고 있지 않음");
|
||||||
}
|
}
|
||||||
|
|
||||||
[$value, $aux] = ($extractFn)();
|
[$value, $aux] = ($extractFn)();
|
||||||
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}는 숫자가 아님");
|
||||||
}
|
}
|
||||||
$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}는 유산 타입이 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
[$storeType, $multiplier, ] = $inheritType;
|
[$storeType, $multiplier,] = $inheritType;
|
||||||
if($storeType !== true){
|
if ($storeType !== true) {
|
||||||
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
if($multiplier != 1 && $value != 0){
|
if ($multiplier != 1 && $value != 0) {
|
||||||
throw new \InvalidArgumentException("{$key}는 1:1 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key}는 1:1 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $this->getVar('owner');
|
$ownerID = $this->getVar('owner');
|
||||||
if(!$ownerID){
|
if (!$ownerID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getVar('npc') != 0){
|
if ($this->getVar('npc') != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
if($gameStor->isunited != 0){
|
if ($gameStor->isunited != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1277,39 +1422,40 @@ 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}는 숫자가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$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}는 유산 타입이 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
[$storeType, $multiplier, ] = $inheritType;
|
[$storeType, $multiplier,] = $inheritType;
|
||||||
if($storeType !== true){
|
if ($storeType !== true) {
|
||||||
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
throw new \InvalidArgumentException("{$key}는 직접 저장형 유산 포인트가 아님");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ownerID = $this->getVar('owner');
|
$ownerID = $this->getVar('owner');
|
||||||
if(!$ownerID){
|
if (!$ownerID) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getVar('npc') != 0){
|
if ($this->getVar('npc') != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
$gameStor = KVStorage::getStorage(DB::db(), 'game_env');
|
||||||
if($gameStor->isunited != 0){
|
if ($gameStor->isunited != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
||||||
[$oldValue, $oldAux] = $inheritStor->getValue($key)??[0, null];
|
[$oldValue, $oldAux] = $inheritStor->getValue($key) ?? [0, null];
|
||||||
|
|
||||||
if($oldAux !== $aux){
|
if ($oldAux !== $aux) {
|
||||||
$oldValue = 0;
|
$oldValue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1317,22 +1463,23 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->getVar('npc') != 0){
|
if ($this->getVar('npc') != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
$inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$ownerID}");
|
||||||
$inheritStor->cacheAll();
|
$inheritStor->cacheAll();
|
||||||
foreach(static::INHERITANCE_KEY as $key=>[$storType, ,]){
|
foreach (static::INHERITANCE_KEY as $key => [$storType,,]) {
|
||||||
$aux = null;
|
$aux = null;
|
||||||
$point = $this->getInheritancePoint($key, $aux, true);
|
$point = $this->getInheritancePoint($key, $aux, true);
|
||||||
if($storType === true){
|
if ($storType === true) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$inheritStor->setValue($key, [$point, $aux]);
|
$inheritStor->setValue($key, [$point, $aux]);
|
||||||
|
|||||||
+862
-822
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user