+
+
+
\ No newline at end of file
diff --git a/hwe/b_npc_control.php b/hwe/b_npc_control.php
index 9b79445b..aa15035d 100644
--- a/hwe/b_npc_control.php
+++ b/hwe/b_npc_control.php
@@ -91,6 +91,7 @@ $zeroPolicy = new AutorunNationPolicy($general, ($gameStor->autorun_user)['optio
var availableGeneralActionPriorityItems = = Json::encode(AutorunGeneralPolicy::$default_priority) ?>;
var btnHelpMessage = {
+ '불가침제의': '군주가 NPC이고, 타국에서 원조를 받았을 때, 세입(금/쌀) 대비 원조량에 따라 불가침제의를 합니다.',
'선전포고': '군주가 NPC이고, 전쟁중이 아닐 때, 주변국중 하나를 골라 선포합니다.
선포 시점은 다음을 참고합니다. - 인구율 - 도시내정률 - NPC전투장권장 금 충족률 - NPC전투장권장 쌀 충족률
국력이 낮은 국가를 조금 더 선호합니다.',
'천도': '인구가 많은 곳을 찾아 천도를 시도합니다. 영토의 가운데를 선호합니다.
도시 인구가 충분하다면, 굳이 천도하지는 않습니다.',
'유저장긴급포상': '금/쌀이 부족한 유저전투장에게 긴급하게 포상합니다. 국고가 권장량보다 적어지더라도 시도합니다.',
diff --git a/hwe/css/inheritPoint.css b/hwe/css/inheritPoint.css
new file mode 100644
index 00000000..25d69429
--- /dev/null
+++ b/hwe/css/inheritPoint.css
@@ -0,0 +1,23 @@
+#inheritance_list{
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.inherit_padding{
+ width: 33%;
+ padding: 10px 2px;
+}
+
+.inherit_item{
+ width: 33%;
+ padding: 10px 2px;
+}
+
+.col-form-label{
+ text-align:right;
+ padding-right:2ch;
+}
+
+.inherit_value{
+ text-align: right;
+}
\ No newline at end of file
diff --git a/hwe/func.php b/hwe/func.php
index 2da79878..dc758aa5 100644
--- a/hwe/func.php
+++ b/hwe/func.php
@@ -1707,7 +1707,7 @@ function deleteNation(General $lord, bool $applyDB):array
$nationID,
$lordID
),
- ['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'aux'], 1
+ ['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'belong', 'aux'], 1
);
$nationGeneralList[$lordID] = $lord;
@@ -1724,6 +1724,12 @@ function deleteNation(General $lord, bool $applyDB):array
// 전 장수 재야로
foreach($nationGeneralList as $general){
+ $general->setAuxVar('max_belong',
+ max(
+ $general->getVar('belong'),
+ $general->getAuxVar('max_belong')??0
+ )
+ );
$general->setVar('belong', 0);
$general->setVar('troop', 0);
$general->setVar('officer_level', 0);
diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php
index 98c802cb..07d52f11 100644
--- a/hwe/func_gamerule.php
+++ b/hwe/func_gamerule.php
@@ -623,10 +623,14 @@ function updateNationState()
$nation['nation'],
$targetKillTurn
);
- $nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong'], 2);
+ $nationGenList = General::createGeneralObjListFromDB($nationGenIDList, ['belong', 'npc'], 2);
+ $chiefObj = null;
$uniqueLotteryWeightList = [];
foreach ($nationGenList as $nationGen) {
+ if ($nationGen->getVar('officer_level') == 12) {
+ $chiefObj = $nationGen;
+ }
$trialCnt = count(GameConst::$allItems);
foreach ($nationGen->getItems() as $item) {
@@ -665,6 +669,10 @@ function updateNationState()
giveRandomUniqueItem($winnerObj, '작위보상');
$winnerObj->applyDB($db);
}
+
+ if($chiefObj){
+ $chiefObj->increaseInheritancePoint('unifier', 250 * $levelDiff);
+ }
}
}
@@ -982,6 +990,15 @@ function checkEmperior()
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
$nationLogger->pushNationalHistoryLog("{$nationName}>{$josaYi} 전토를 통일");
+ foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
+ if($genObj->getNationID() == $nationID){
+ if($genObj->getVar('officer_level') > 4){
+ $genObj->increaseInheritancePoint('unifier', 2000);
+ };
+ }
+ $genObj->mergeTotalInheritancePoint();
+ }
+
$gameStor->isunited = 2;
$gameStor->conlimit = $gameStor->conlimit * 100;
@@ -1132,3 +1149,25 @@ function checkEmperior()
//연감 월결산
LogHistory();
}
+
+function resetInheritanceUser(int $userID){
+ $inheritStor = KVStorage::getStorage(DB::db(), "inheritance_{$userID}");
+ $totalPoint = 0;
+ foreach($inheritStor->getAll() as [$value,]){
+ $totalPoint += $value;
+ }
+ $totalPoint = Util::toInt($totalPoint);
+ $inheritStor->resetValues();
+ $inheritStor->setValue('previous', [$totalPoint, null]);
+}
+
+function updateMaxDomesticCritical(General $general, $score){
+ $maxDomesticCritical = $general->getAuxVar('max_domestic_critical')??0;
+ $maxDomesticCritical += $score / 2;
+ $general->setAuxVar('max_domestic_critical', $maxDomesticCritical);
+
+ $oldMaxDomesticCritical = $general->getInheritancePoint('max_domestic_critical');
+ if($maxDomesticCritical > $oldMaxDomesticCritical){
+ $general->setInheritancePoint('max_domestic_critical', $maxDomesticCritical);
+ }
+}
\ No newline at end of file
diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php
index 5a94b016..5039aa47 100644
--- a/hwe/func_tournament.php
+++ b/hwe/func_tournament.php
@@ -689,7 +689,8 @@ function setGift($tnmt_type, $tnmt, $phase) {
'grp_no'=>$general['grp_no'],
'reward'=>$cost,
'msg'=>"16강 진출",
- 'logger'=>$logger
+ 'logger'=>$logger,
+ 'inheritance_point'=>10,
];
}
//8강자 명성 돈
@@ -723,6 +724,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "4강 진출";
+ General::createGeneralObjFromDB($generalID)->increaseInheritancePoint('tournament', 10);
}
//결승자 명성 돈
$cost = $admin['develcost'] * 6;
@@ -739,6 +741,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "준우승으";
+ $resultHelper[$generalID]['inheritance_point'] = 50;
if($general['lose'] > 0){
$runnerUp = $general;
}
@@ -761,6 +764,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
//포상 장수 이름, 금액
$resultHelper[$generalID]['reward'] += $cost;
$resultHelper[$generalID]['msg'] = "우승으";
+ $resultHelper[$generalID]['inheritance_point'] = 100;
$winner = $general;
}
@@ -775,9 +779,6 @@ function setGift($tnmt_type, $tnmt, $phase) {
$runnerUpLogger = $resultHelper[$runnerUp['no']]['logger'];
$runnerUpLogger->pushGeneralHistoryLog("{$tp}> 대회에서 준우승");
-
-
-
$winnerRewardText = number_format($resultHelper[$winner['no']]['reward']);
$runnerUpRewardText = number_format($resultHelper[$runnerUp['no']]['reward']);
@@ -786,12 +787,16 @@ function setGift($tnmt_type, $tnmt, $phase) {
$winnerLogger->pushGlobalHistoryLog("{$tp}> 대회에서 {$winner['name']}>{$josaYiWinner} 우승>, {$runnerUp['name']}>{$josaYiRunnerUp} 준우승>을 차지하여 천하에 이름을 떨칩니다!", ActionLogger::EVENT_YEAR_MONTH);
$winnerLogger->pushGlobalHistoryLog("{$tp}> 대회의 우승자>에게는 {$winnerRewardText}>, 준우승자>에겐 {$runnerUpRewardText}>의 상금>과 약간의 명성>이 주어집니다!", ActionLogger::EVENT_YEAR_MONTH);
-
- foreach($resultHelper as $general){
+
+ $generalObjList = General::createGeneralObjListFromDB(array_keys($resultHelper));
+
+ foreach($resultHelper as $generalID=>$general){
$rewardText = number_format($general['reward']);
/** @var ActionLogger */
$logger = $general['logger'];
$logger->pushGeneralActionLog("{$tp}> 대회의 {$general['msg']}로 {$rewardText}>의 상금>, 약간의 명성> 획득!", ActionLogger::EVENT_PLAIN);
+ //TODO: 토너먼트의 다른 값이 모두 sql에 직접 입력하므로 기반을 바꿔야함.
+ $generalObjList[$generalID]->increaseInheritancePoint('tournament', $general['inheritance_point']);
}
//우승자 번호
diff --git a/hwe/j_simulate_battle.php b/hwe/j_simulate_battle.php
index 89edb9cc..85acd68e 100644
--- a/hwe/j_simulate_battle.php
+++ b/hwe/j_simulate_battle.php
@@ -140,6 +140,7 @@ if(!$v->validate()){
'reason'=>'[출병자]'.$v->errorStr()
]);
}
+$rawAttacker['owner'] = 0;
$defenderList = [];
foreach($rawDefenderList as $idx=>$rawDefenderGeneral){
@@ -152,6 +153,7 @@ foreach($rawDefenderList as $idx=>$rawDefenderGeneral){
'reason'=>"[수비자{$idx}]".$v->errorStr()
]);
}
+ $rawDefenderGeneral['owner'] = 0;
$defenderList[] = new General($rawDefenderGeneral, extractRankVar($rawDefenderGeneral), $rawDefenderCity, $rawAttackerNation, $year, $month, true);
}
diff --git a/hwe/join_post.php b/hwe/join_post.php
index 423ecbf6..fbd6b58a 100644
--- a/hwe/join_post.php
+++ b/hwe/join_post.php
@@ -266,6 +266,8 @@ foreach(Util::range(GameConst::$maxTurn) as $turnIdx){
}
$db->insert('general_turn', $turnRows);
+resetInheritanceUser($userID);
+
$rank_data = [];
foreach(array_keys(General::RANK_COLUMN) as $rankColumn){
$rank_data[] = [
diff --git a/hwe/js/inheritPoint.js b/hwe/js/inheritPoint.js
new file mode 100644
index 00000000..e0223ef3
--- /dev/null
+++ b/hwe/js/inheritPoint.js
@@ -0,0 +1,2 @@
+(()=>{var t={762:t=>{t.exports=function(t,e){for(var r,n=-1,o=t.length;++n{t.exports=function(t){return t}},297:(t,e,r)=>{var n=r(762),o=r(557);t.exports=function(t){return t&&t.length?n(t,o):0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(297),e=r.n(t);function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"";return o(this,a),h(l(t=n.call(this,e)),"name","RuntimeError"),t.message=e,t}return e=a,(r=[{key:"toString",value:function(){return this.message?this.name+": "+this.message:this.name}}])&&u(e.prototype,r),a}(f(Error)));function m(t){if(null==t)throw new b;return t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],i=!0,c=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r
+ * Copyright OpenJS Foundation and other contributors
+ * Released under MIT license
+ * Based on Underscore.js 1.8.3
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ */
diff --git a/hwe/js/inheritPoint.js.map b/hwe/js/inheritPoint.js.map
new file mode 100644
index 00000000..b5ef15bf
--- /dev/null
+++ b/hwe/js/inheritPoint.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"inheritPoint.js","mappings":"qBAuBAA,EAAOC,QAdP,SAAiBC,EAAOC,GAKtB,IAJA,IAAIC,EACAC,GAAS,EACTC,EAASJ,EAAMI,SAEVD,EAAQC,GAAQ,CACvB,IAAIC,EAAUJ,EAASD,EAAMG,SACbG,IAAZD,IACFH,OAAoBI,IAAXJ,EAAuBG,EAAWH,EAASG,GAGxD,OAAOH,I,QCATJ,EAAOC,QAJP,SAAkBQ,GAChB,OAAOA,I,cCjBT,IAAIC,EAAU,EAAQ,KAClBC,EAAW,EAAQ,KAsBvBX,EAAOC,QANP,SAAaC,GACX,OAAQA,GAASA,EAAMI,OACnBI,EAAQR,EAAOS,GACf,KCnBFC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBN,IAAjBO,EACH,OAAOA,EAAad,QAGrB,IAAID,EAASY,EAAyBE,GAAY,CAGjDb,QAAS,IAOV,OAHAe,EAAoBF,GAAUd,EAAQA,EAAOC,QAASY,GAG/Cb,EAAOC,QCpBfY,EAAoBI,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAa,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRL,EAAoBO,EAAI,CAACnB,EAASqB,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EV,EAAoBW,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,G,o2ECG3E,IAeMI,EAAb,yLACkB,mBADlB,YAfA,uB,IAAA,OAEI,aAAyC,MAAtBC,EAAsB,uDAAJ,GAAI,qBACrC,cAAMA,IAD+B,OAD3B,gBAC2B,EAAtBA,QAAAA,EAAsB,EAF7C,O,EAAA,G,EAAA,uBAKI,WACI,OAAIC,KAAKD,QACEC,KAAKC,KAAO,KAAOD,KAAKD,QAGxBC,KAAKC,U,iBAVxB,KAAkCC,SAmB3B,SAASC,EAAUnC,GACtB,GAAIA,MAAAA,EACA,MAAM,IAAI8B,EAEd,OAAO9B,E,87BCWXoC,OAAOC,UAzBP,WAEI,IAAMC,EAAOH,EAAOI,SAASC,cAAc,uBACrCC,EAAON,EAAOI,SAASC,cAAc,4BACrCE,EAAOP,EAAOI,SAASC,cAAc,uBAErCG,EAAWC,KAAKC,MAAM,IAAIxB,OAAOyB,OAAOV,OAAOW,SAC/CC,EAAWJ,KAAKC,MAAMT,OAAOW,MAAP,UACtBE,EAAcN,EAAWK,EAE/BV,EAAKjC,MAAQsC,EAASO,iBACtBT,EAAKpC,MAAQ2C,EAASE,iBACtBR,EAAKrC,MAAQ4C,EAAYC,iBAEzB,cAAwB7B,OAAO8B,QAAQf,OAAOW,OAA9C,eAAqD,CAAjD,gBAAO5B,EAAP,KAAYiC,EAAZ,KACcjB,EAAOI,SAASC,cAAT,mBAAmCrB,EAAnC,YACfd,MAAQuC,KAAKC,MAAMO,GAAKF,iBAGlC,cAAyB7B,OAAO8B,QAAQf,OAAOiB,UAA/C,eAAyD,CAArD,gBAAOlC,EAAP,KAAYmC,EAAZ,KACcnB,EAAOI,SAASC,cAAT,mBAAmCrB,EAAnC,sBACfoC,UAAYD,K","sources":["webpack://hidche_lib/./node_modules/lodash/_baseSum.js","webpack://hidche_lib/./node_modules/lodash/identity.js","webpack://hidche_lib/./node_modules/lodash/sum.js","webpack://hidche_lib/webpack/bootstrap","webpack://hidche_lib/webpack/runtime/compat get default export","webpack://hidche_lib/webpack/runtime/define property getters","webpack://hidche_lib/webpack/runtime/hasOwnProperty shorthand","webpack://hidche_lib/./hwe/ts/util.ts","webpack://hidche_lib/./hwe/ts/inheritPoint.ts"],"sourcesContent":["/**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\nfunction baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n}\n\nmodule.exports = baseSum;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseSum = require('./_baseSum'),\n identity = require('./identity');\n\n/**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\nfunction sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n}\n\nmodule.exports = sum;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","type ErrType = { new(msg?: string): T }\ntype Nullable = T | null | undefined\n\nexport class RuntimeError extends Error {\n public name = 'RuntimeError';\n constructor(public message: string = '') {\n super(message);\n }\n toString(): string {\n if (this.message) {\n return this.name + ': ' + this.message;\n }\n else {\n return this.name;\n }\n }\n}\n\nexport class NotNullExpected extends RuntimeError {\n public name = 'NotNullExpected';\n}\n\nexport function unwrap(result: Nullable): T {\n if (result === null || result === undefined) {\n throw new NotNullExpected();\n }\n return result;\n}\n\nexport function unwrap_err(result: Nullable, errType: ErrType, errMsg?: string): T {\n if (result === null || result === undefined) {\n throw new errType(errMsg);\n }\n return result;\n}","import { sum } from \"lodash\";\nimport { unwrap } from \"./util\";\ndeclare global {\n interface Window { \n formStart: ()=>void;\n items: {[name: string]:number};\n helpText: {[name: string]:string};\n }\n}\n\nexport {}\n\nfunction formStart() {\n\n const dSum = unwrap(document.querySelector('#inherit_sum_value')) as HTMLInputElement ;\n const dOld = unwrap(document.querySelector('#inherit_previous_value')) as HTMLInputElement;\n const dNew = unwrap(document.querySelector('#inherit_new_value')) as HTMLInputElement;\n\n const sumPoint = Math.floor(sum(Object.values(window.items)));\n const oldPoint = Math.floor(window.items['previous']);\n const sumNewPoint = sumPoint - oldPoint;\n\n dSum.value = sumPoint.toLocaleString();\n dOld.value = oldPoint.toLocaleString();\n dNew.value = sumNewPoint.toLocaleString();\n\n for(const [key, val] of Object.entries(window.items)){\n const dItem = unwrap(document.querySelector(`#inherit_${key}_value`)) as HTMLInputElement ;\n dItem.value = Math.floor(val).toLocaleString();\n }\n\n for(const [key, text] of Object.entries(window.helpText)){\n const dText = unwrap(document.querySelector(`#inherit_${key} small.form-text`)) as HTMLElement;\n dText.innerHTML = text;\n }\n}\n\nwindow.formStart = formStart;"],"names":["module","exports","array","iteratee","result","index","length","current","undefined","value","baseSum","identity","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","NotNullExpected","message","this","name","Error","unwrap","window","formStart","dSum","document","querySelector","dOld","dNew","sumPoint","Math","floor","values","items","oldPoint","sumNewPoint","toLocaleString","entries","val","helpText","text","innerHTML"],"sourceRoot":""}
\ No newline at end of file
diff --git a/hwe/process_war.php b/hwe/process_war.php
index 3eee843a..88d94666 100644
--- a/hwe/process_war.php
+++ b/hwe/process_war.php
@@ -261,6 +261,15 @@ function processWar_NG(
$attacker->addTrain(1);
$defender->addTrain(1);
+
+ $attackerCrewTypeCoef = $attacker->getCrewType()->getAttackCoef($defender->getCrewType()) * $defender->getCrewType()->getDefenceCoef($attacker->getCrewType());
+ $defenderCrewTypeCoef = $defender->getCrewType()->getAttackCoef($attacker->getCrewType()) * $attacker->getCrewType()->getDefenceCoef($defender->getCrewType());
+ if($attackerCrewTypeCoef > $defenderCrewTypeCoef && $attacker instanceof WarUnitGeneral){
+ $attacker->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
+ }
+ if($defenderCrewTypeCoef > $attackerCrewTypeCoef && $defender instanceof WarUnitGeneral){
+ $defender->getGeneral()->increaseInheritancePoint('snipe_combat', 1);
+ }
$attackerName = $attacker->getName();
$attackerCrewTypeName = $attacker->getCrewTypeName();
@@ -522,7 +531,7 @@ function ConquerCity(array $admin, General $general, array $city) {
$lord = new General($db->queryFirstRow(
'SELECT %l FROM general WHERE nation = %i AND officer_level = %i LIMIT 1',
- Util::formatListOfBackticks(General::mergeQueryColumn(['npc', 'gold', 'rice', 'experience', 'explevel', 'dedication', 'dedlevel', 'aux'], 1)[0]),
+ Util::formatListOfBackticks(General::mergeQueryColumn(['npc', 'gold', 'rice', 'experience', 'explevel', 'belong', 'dedication', 'dedlevel', 'aux'], 1)[0]),
$defenderNationID,
12
), null, $city, $loseNation, $year, $month, false);
diff --git a/hwe/sammo/AutorunNationPolicy.php b/hwe/sammo/AutorunNationPolicy.php
index 079b2547..2641048d 100644
--- a/hwe/sammo/AutorunNationPolicy.php
+++ b/hwe/sammo/AutorunNationPolicy.php
@@ -28,6 +28,7 @@ class AutorunNationPolicy {
static $NPC몰수 = 'NPC몰수';
// 군주 행동
+ static $불가침제의 = '불가침제의';
static $선전포고 = '선전포고';
static $천도 = '천도';
@@ -35,6 +36,7 @@ class AutorunNationPolicy {
//실제 행동
static public $defaultPriority = [
+ '불가침제의',
'선전포고',
'천도',
@@ -106,6 +108,7 @@ class AutorunNationPolicy {
public $canNPC포상 = true;
public $canNPC몰수 = true;
+ public $can불가침제의 = true;
public $can선전포고 = true;
public $can천도 = true;
diff --git a/hwe/sammo/Command/General/che_기술연구.php b/hwe/sammo/Command/General/che_기술연구.php
index 6c9f9a2a..9c8cb1db 100644
--- a/hwe/sammo/Command/General/che_기술연구.php
+++ b/hwe/sammo/Command/General/che_기술연구.php
@@ -14,7 +14,8 @@ use function sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
- tryUniqueItemLottery
+ tryUniqueItemLottery,
+ updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -93,6 +94,13 @@ class che_기술연구 extends che_상업투자{
$exp = $score * 0.7;
$ded = $score * 1.0;
+ if($pick == 'success'){
+ updateMaxDomesticCritical($general, $score);
+ }
+ else{
+ $general->setAuxVar('max_domestic_critical', 0);
+ }
+
$scoreText = number_format($score, 0);
$josaUl = JosaUtil::pick(static::$actionName, '을');
diff --git a/hwe/sammo/Command/General/che_랜덤임관.php b/hwe/sammo/Command/General/che_랜덤임관.php
index e0dd31f9..eac97fac 100644
--- a/hwe/sammo/Command/General/che_랜덤임관.php
+++ b/hwe/sammo/Command/General/che_랜덤임관.php
@@ -1,21 +1,22 @@
arg = null;
return true;
@@ -71,7 +74,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
$relYear = $env['year'] - $env['startyear'];
- $this->fullConditionConstraints=[
+ $this->fullConditionConstraints = [
ConstraintHelper::BeNeutral(),
ConstraintHelper::AllowJoinAction(),
];
@@ -83,28 +86,34 @@ class che_랜덤임관 extends Command\GeneralCommand{
*/
}
- public function getCommandDetailTitle():string{
+ public function getCommandDetailTitle(): string
+ {
return '무작위 국가로 임관';
}
- public function getBrief():string{
+ public function getBrief(): string
+ {
return '무작위 국가로 임관';
}
- public function getCost():array{
+ public function getCost(): array
+ {
return [0, 0];
}
-
- public function getPreReqTurn():int{
+
+ public function getPreReqTurn(): int
+ {
return 0;
}
- public function getPostReqTurn():int{
+ public function getPostReqTurn(): int
+ {
return 0;
}
- public function run():bool{
- if(!$this->hasFullConditionMet()){
+ public function run(): bool
+ {
+ if (!$this->hasFullConditionMet()) {
throw new \RuntimeException('불가능한 커맨드를 강제로 실행 시도');
}
@@ -126,108 +135,107 @@ class che_랜덤임관 extends Command\GeneralCommand{
$destNation = null;
if ($general->getNPCType() >= 2 && !$env['fiction'] && 1000 <= $env['scenario'] && $env['scenario'] < 2000) {
- if($notIn){
+ if ($notIn) {
$nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i and nation.nation not in %li',
- $relYear<3?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral,
+ $relYear < 3 ? GameConst::$initialNationGenLimit : GameConst::$defaultMaxGeneral,
$notIn
);
- }
- else{
+ } else {
$nations = $db->query(
'SELECT nation.`name` as `name`,nation.nation as nation,scout,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.officer_level = 12 WHERE scout=0 and gennum<%i',
- $relYear<3?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
+ $relYear < 3 ? GameConst::$initialNationGenLimit : GameConst::$defaultMaxGeneral
);
}
-
+
shuffle($nations);
$allGen = Util::arraySum($nations, 'gennum');
-
- $maxScore = 1<<30;
+
+ $maxScore = 1 << 30;
$affinity = $general->getVar('affinity');
-
- foreach($nations as $testNation){
+
+ foreach ($nations as $testNation) {
$affinity = abs($affinity - $testNation['affinity']);
$affinity = min($affinity, abs($affinity - 150));
-
- $score = log($affinity + 1, 2);//0~
-
+
+ $score = log($affinity + 1, 2); //0~
+
//쉐킷쉐킷
$score += Util::randF();
-
- $score += sqrt($testNation['gennum']/$allGen);
-
- if($score < $maxScore){
+
+ $score += sqrt($testNation['gennum'] / $allGen);
+
+ if ($score < $maxScore) {
$maxScore = $score;
$destNation = $testNation;
}
}
- }
- else{
+ } else {
$onlyRandom = $env['join_mode'] == 'onlyRandom';
$genLimit = GameConst::$defaultMaxGeneral;
- if($onlyRandom && TimeUtil::IsRangeMonth($env['init_year'], $env['init_month'], 1, $env['year'], $env['month'])){
+ if ($onlyRandom && TimeUtil::IsRangeMonth($env['init_year'], $env['init_month'], 1, $env['year'], $env['month'])) {
$genLimit = GameConst::$initialNationGenLimitForRandInit;
- }
- else if($relYear < 3){
+ } else if ($relYear < 3) {
$genLimit = GameConst::$initialNationGenLimit;
}
$generalsCnt = [];
- if($notIn){
+ if ($notIn) {
$rawGeneralsCnt = $db->query(
- 'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc < 4 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc',
+ 'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 AND nation.nation NOT IN %li GROUP BY general.nation, general.npc',
$genLimit,
$notIn
);
- }
- else{
+ } else {
$rawGeneralsCnt = $db->query(
- 'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc < 4 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc',
+ 'SELECT general.nation as nation, nation.gennum, nation.name, npc, count(*) as cnt FROM general JOIN nation ON general.nation = nation.nation WHERE npc != 9 AND nation.gennum < %i AND nation.scout=0 GROUP BY general.nation, general.npc',
$genLimit
);
}
-
- foreach($rawGeneralsCnt as $nation){
+
+ foreach ($rawGeneralsCnt as $nation) {
$nationID = $nation['nation'];
- if(!\key_exists($nationID, $generalsCnt)){
+ if (!\key_exists($nationID, $generalsCnt)) {
$generalsCnt[$nationID] = [
- 'nation'=>$nationID,
- 'gennum'=>$nation['gennum'],
- 'name'=>$nation['name'],
- 'cnt'=>0,
+ 'nation' => $nationID,
+ 'gennum' => $nation['gennum'],
+ 'name' => $nation['name'],
+ 'cnt' => 0,
];
$generalsCnt[$nationID]['cnt'] = 0;
}
-
- if($nation['npc'] <= 2){
+
+ if ($nation['npc'] <= 2) {
$calcCnt = $nation['cnt'];
- }
- else{
+ } else {
$calcCnt = $nation['cnt'] / 2;
}
+ if ($general->getNPCType() < 2 && Util::starts_with($nation['name'], 'ⓤ')) {
+ $calcCnt *= 100;
+ }
+
$generalsCnt[$nationID]['cnt'] += $calcCnt;
}
$randVals = [];
- foreach($generalsCnt as $testNation){
- $randVals[] = [$testNation, 1/$testNation['cnt']];
+ foreach ($generalsCnt as $testNation) {
+ $randVals[] = [$testNation, 1 / $testNation['cnt']];
}
- if($randVals){
+ if ($randVals) {
$destNation = Util::choiceRandomUsingWeightPair($randVals);
}
}
$logger = $general->getLogger();
- if(!$destNation){
+ if (!$destNation) {
//임관 가능한 국가가 없다!
- $logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date>");
+ $logger->pushGeneralActionLog("임관 가능한 국가가 없습니다. <1>$date>");
$this->alternative = new che_요양($general, $this->env, null);
return false;
}
@@ -236,7 +244,7 @@ class che_랜덤임관 extends Command\GeneralCommand{
$destNationID = $destNation['nation'];
$destNationName = $destNation['name'];
-
+
$talkList = [
'어쩌다 보니',
@@ -257,10 +265,9 @@ class che_랜덤임관 extends Command\GeneralCommand{
$logger->pushGeneralHistoryLog("{$destNationName}>에 랜덤 임관");
$logger->pushGlobalActionLog("{$generalName}>{$josaYi} {$randomTalk} {$destNationName}>에 임관>했습니다.");
- if($gennum < GameConst::$initialNationGenLimit) {
+ if ($gennum < GameConst::$initialNationGenLimit) {
$exp = 700;
- }
- else {
+ } else {
$exp = 100;
}
@@ -268,22 +275,21 @@ class che_랜덤임관 extends Command\GeneralCommand{
$general->setVar('officer_level', 1);
$general->setVar('officer_city', 0);
$general->setVar('belong', 1);
-
- if($this->destGeneralObj !== null){
+
+ if ($this->destGeneralObj !== null) {
$general->setVar('city', $this->destGeneralObj->getCityID());
- }
- else{
+ } else {
$targetCityID = $db->queryFirstField('SELECT city FROM general WHERE nation = %i AND officer_level=12', $destNationID);
$general->setVar('city', $targetCityID);
}
$db->update('nation', [
- 'gennum'=>$db->sqleval('gennum + 1')
+ 'gennum' => $db->sqleval('gennum + 1')
], 'nation=%i', $destNationID);
$relYear = $env['year'] - $env['startyear'];
- if($general->getNPCType() == 1 || $relYear >= 3){
- $joinedNations = $general->getAuxVar('joinedNations')??[];
+ if ($general->getNPCType() == 1 || $relYear >= 3) {
+ $joinedNations = $general->getAuxVar('joinedNations') ?? [];
$joinedNations[] = $destNationID;
$general->setAuxVar('joinedNations', $joinedNations);
}
@@ -296,5 +302,4 @@ class che_랜덤임관 extends Command\GeneralCommand{
return true;
}
-
-}
\ No newline at end of file
+}
diff --git a/hwe/sammo/Command/General/che_상업투자.php b/hwe/sammo/Command/General/che_상업투자.php
index 9643a3e2..6d6fe8d2 100644
--- a/hwe/sammo/Command/General/che_상업투자.php
+++ b/hwe/sammo/Command/General/che_상업투자.php
@@ -15,7 +15,8 @@ use function \sammo\{
getDomesticExpLevelBonus,
CriticalRatioDomestic,
CriticalScoreEx,
- tryUniqueItemLottery
+ tryUniqueItemLottery,
+ updateMaxDomesticCritical
};
use \sammo\Constraint\Constraint;
@@ -165,6 +166,13 @@ class che_상업투자 extends Command\GeneralCommand{
$exp = $score * 0.7;
$ded = $score * 1.0;
+ if($pick == 'success'){
+ updateMaxDomesticCritical($general, $score);
+ }
+ else{
+ $general->setAuxVar('max_domestic_critical', 0);
+ }
+
$scoreText = number_format($score, 0);
$josaUl = JosaUtil::pick(static::$actionName, '을');
@@ -203,6 +211,4 @@ class che_상업투자 extends Command\GeneralCommand{
return true;
}
-
-
}
\ No newline at end of file
diff --git a/hwe/sammo/Command/General/che_임관.php b/hwe/sammo/Command/General/che_임관.php
index 15175e7e..d0c0041d 100644
--- a/hwe/sammo/Command/General/che_임관.php
+++ b/hwe/sammo/Command/General/che_임관.php
@@ -202,6 +202,8 @@ class che_임관 extends Command\GeneralCommand{
$nationList[$nationID]['scoutmsg'] = $scoutMsg;
}
+ $hiddenItems = [];
+
foreach($nationList as &$nation){
if($env['year'] < $env['startyear']+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
$nation['availableJoin'] = false;
@@ -217,7 +219,9 @@ class che_임관 extends Command\GeneralCommand{
$nation['availableJoin'] = false;
}
-
+ if(Util::starts_with($nation['name'], 'ⓤ')){
+ $hiddenItems[$nation['nation']] = $nation['nation'];
+ }
}
unset($nation);
ob_start();
@@ -228,6 +232,7 @@ class che_임관 extends Command\GeneralCommand{
임관할 국가를 목록에서 선택하세요.