From b1395e7ff895f197b2cf6b1713cabbf38d34309d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 11 May 2022 00:12:57 +0900 Subject: [PATCH] =?UTF-8?q?game:=20=EC=9D=B4=EB=AF=B8=20=EA=B0=99=EC=9D=80?= =?UTF-8?q?=20=EB=B6=80=EC=9C=84=EC=97=90=20=EC=9C=A0=EB=8B=88=ED=81=AC?= =?UTF-8?q?=EB=A5=BC=20=EA=B0=80=EC=A7=80=EA=B3=A0=20=EC=9E=88=EB=8B=A4?= =?UTF-8?q?=EB=A9=B4=20=EC=9C=A0=EC=82=B0=20=EC=9E=85=EC=B0=B0=20=EA=B8=88?= =?UTF-8?q?=EC=A7=80=20-=20=EC=9D=B4=EB=AF=B8=20=EC=9E=85=EC=B0=B0?= =?UTF-8?q?=ED=95=9C=20=EA=B0=99=EC=9D=80=20=EB=B6=80=EC=9C=84=20=EC=9C=A0?= =?UTF-8?q?=EB=8B=88=ED=81=AC=EB=8A=94=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func.php | 6 ++++-- hwe/sammo/API/InheritAction/BuySpecificUnique.php | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/hwe/func.php b/hwe/func.php index 050ab21e..bde7ffc5 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1758,12 +1758,11 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템 $reasons[] = '이미 그 유니크를 가지고 있습니다.'; continue; } - /* + if (!$ownItem->isBuyable()) { $reasons[] = '이미 다른 유니크를 가지고 있습니다.'; continue; } - */ $availableCnt = $itemList[$itemKey]; $occupiedCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE %b = %s', $itemType, $itemKey); @@ -1865,6 +1864,9 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템 $general->applyDB($db); + //같은 종류의 유니크를 입찰했을 수 있으니 한번 더 검사한다. + tryRollbackInheritUniqueItem($general); + return true; } diff --git a/hwe/sammo/API/InheritAction/BuySpecificUnique.php b/hwe/sammo/API/InheritAction/BuySpecificUnique.php index d97da7c5..33f1c28e 100644 --- a/hwe/sammo/API/InheritAction/BuySpecificUnique.php +++ b/hwe/sammo/API/InheritAction/BuySpecificUnique.php @@ -67,6 +67,19 @@ class BuySpecificUnique extends \sammo\BaseAPI return '이미 입찰한 아이템입니다. 다음 턴에 시도해 주세요.'; } + foreach(GameConst::$allItems as $itemType => $items){ + if(!key_exists($itemKey, $items)){ + continue; + } + + $prevItem = $general->getItem($itemType); + if(!$prevItem->isBuyable()){ + return '이미 같은 자리에 유니크를 보유하고 있습니다.'; + } + + break; + } + $db = DB::db(); $inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}"); $trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");