유산 포인트 시스템, 추가 기수 대비 (#187)

- 유산 포인트
  - 기수 뒤로도 누적되는 포인트
  - 생존, 최대 임관년 수, 최대 연속 내정 성공, 병종 상성 우위 횟수, 전투 횟수, 계략 성공 횟수, 천통 기여(규모 상승, 천통 수뇌, 천통 군주), 숙련도, 토너먼트, 베팅 당첨
  - 유산 관리 페이지 제공

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

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

Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/187
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
This commit was merged in pull request #187.
This commit is contained in:
2021-08-11 21:57:52 +09:00
parent b306601c72
commit b4d7acb827
44 changed files with 1377 additions and 142 deletions
+40 -1
View File
@@ -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("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
foreach(General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc = 0')) as $genObj){
if($genObj->getNationID() == $nationID){
if($genObj->getVar('officer_level') > 4){
$genObj->increaseInheritancePoint('unifier', 2000);
};
}
$genObj->mergeTotalInheritancePoint();
}
$gameStor->isunited = 2;
$gameStor->conlimit = $gameStor->conlimit * 100;
@@ -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);
}
}