From 336b5668db315203a0ebb2849464efe6718a28e7 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 18 Sep 2021 00:15:00 +0900 Subject: [PATCH] =?UTF-8?q?fix=20&=20inheritAction:=20=EB=9E=9C=EB=8D=A4?= =?UTF-8?q?=20=EC=9C=A0=EB=8B=88=ED=81=AC=20=EC=8A=B5=EB=93=9D=EC=8B=9C=20?= =?UTF-8?q?=ED=99=98=EB=B6=88=20=EA=B0=80=EB=8A=A5=ED=95=98=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 579bd3f6..20c6c1f1 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1594,9 +1594,19 @@ function giveRandomUniqueItem(General $general, string $acquireType): bool } 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; } + if ($general->getAuxVar('inheritRandomUnique')) { + $general->setAuxVar('inheritRandomUnique', null); + } + [$itemType, $itemCode] = Util::choiceRandomUsingWeightPair($availableUnique); $nationName = $general->getStaticNation()['name']; @@ -1850,6 +1860,12 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템 if ($trialCnt <= 0) { 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"); + } return false; } @@ -1881,8 +1897,6 @@ function tryUniqueItemLottery(General $general, string $acquireType = '아이템 if ($general->getAuxVar('inheritRandomUnique')) { //포인트로 랜덤 유니크 획득 $prob = 1; - LogText("{$general->getName()}, {$general->getID()} 유산 포인트 유니크", $prob); - $general->setAuxVar('inheritRandomUnique', null); } foreach (Util::range($trialCnt) as $_idx) {