diff --git a/hwe/sammo/API/InheritAction/BuySpecificUnique.php b/hwe/sammo/API/InheritAction/BuySpecificUnique.php index ee355f5f..b2885d6f 100644 --- a/hwe/sammo/API/InheritAction/BuySpecificUnique.php +++ b/hwe/sammo/API/InheritAction/BuySpecificUnique.php @@ -14,9 +14,9 @@ class BuySpecificUnique extends \sammo\BaseAPI { public function validateArgs(): ?string { - foreach(GameConst::$allItems as $items){ - foreach($items as $itemKey=>$amount){ - if($amount == 0){ + foreach (GameConst::$allItems as $items) { + foreach ($items as $itemKey => $amount) { + if ($amount == 0) { continue; } $availableItems[$itemKey] = $amount; @@ -29,7 +29,7 @@ class BuySpecificUnique extends \sammo\BaseAPI 'amount', ]) ->rule('integer', 'amount') - ->rule('min', GameConst::$inheritItemUniqueMinPoint) + ->rule('min', 'amount', GameConst::$inheritItemUniqueMinPoint) ->rule('keyExists', 'item', $availableItems); if (!$v->validate()) { @@ -53,20 +53,20 @@ class BuySpecificUnique extends \sammo\BaseAPI $generalID = $session->generalID; $general = General::createGeneralObjFromDB($generalID); - if($userID != $general->getVar('owner')){ + if ($userID != $general->getVar('owner')) { return '로그인 상태가 이상합니다. 다시 로그인해 주세요.'; } $itemTrials = $general->getAuxVar('inheritUniqueTrial') ?? []; - if(key_exists($itemKey, $itemTrials)){ + 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; - if($previousPoint < $amount){ + $previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0]; + if ($previousPoint < $amount) { return '충분한 유산 포인트를 가지고 있지 않습니다.'; } diff --git a/hwe/scss/inheritPoint.scss b/hwe/scss/inheritPoint.scss deleted file mode 100644 index 25d69429..00000000 --- a/hwe/scss/inheritPoint.scss +++ /dev/null @@ -1,23 +0,0 @@ -#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/ts/Board.vue b/hwe/ts/Board.vue index 5f09c48b..b33ba3f5 100644 --- a/hwe/ts/Board.vue +++ b/hwe/ts/Board.vue @@ -61,7 +61,6 @@ \ No newline at end of file diff --git a/hwe/v_inheritPoint.php b/hwe/v_inheritPoint.php index 0b244dfc..433d4908 100644 --- a/hwe/v_inheritPoint.php +++ b/hwe/v_inheritPoint.php @@ -15,10 +15,6 @@ $gameStor = KVStorage::getStorage($db, 'game_env'); $me = General::createGeneralObjFromDB($generalID); -$items = []; -foreach (array_keys(General::INHERITANCE_KEY) as $key) { - $items[$key] = $me->getInheritancePoint($key) ?? 0; -} $currentInheritBuff = []; foreach ($me->getAuxVar('inheritBuff') as $buff => $buffLevel) { @@ -37,9 +33,37 @@ function calcResetAttrPoint($level) return GameConst::$inheritResetAttrPointBase[$level]; } +$avilableSpecialWar = []; +foreach (GameConst::$availableSpecialWar as $specialWarKey) { + $specialWarObj = buildGeneralSpecialWarClass($specialWarKey); + $avilableSpecialWar[$specialWarKey] = [ + 'title' => $specialWarObj->getName(), + 'info' => $specialWarObj->getInfo(), + ]; +} -$resetTurnTimeLevel = $me->getAuxVar('inheritResetTurnTime')??0; -$resetSpecialWarLevel = $me->getAuxVar('inheritResetSpecialWar')??0; +$availableUnique = []; +foreach (GameConst::$allItems as $subItems){ + foreach($subItems as $itemKey=>$amount){ + if($amount == 0){ + continue; + } + $itemObj = buildItemClass($itemKey); + $availableUnique[$itemKey] = [ + 'title' => $itemObj->getName(), + 'info'=>$itemObj->getInfo(), + ]; + } +} + + +$items = []; +foreach (array_keys(General::INHERITANCE_KEY) as $key) { + $items[$key] = $me->getInheritancePoint($key) ?? 0; +} + +$resetTurnTimeLevel = $me->getAuxVar('inheritResetTurnTime') ?? 0; +$resetSpecialWarLevel = $me->getAuxVar('inheritResetSpecialWar') ?? 0; ?> @@ -48,7 +72,7 @@ $resetSpecialWarLevel = $me->getAuxVar('inheritResetSpecialWar')??0; <?= UniqueConst::$serverName ?>: 유산 관리 - + @@ -66,7 +90,11 @@ $resetSpecialWarLevel = $me->getAuxVar('inheritResetSpecialWar')??0; 'resetTurnTime' => calcResetAttrPoint($resetTurnTimeLevel), 'resetSpecialWar' => calcResetAttrPoint($resetSpecialWarLevel), 'randomUnique' => GameConst::$inheritItemRandomPoint, + 'nextSpecial' => GameConst::$inheritSpecificSpecialPoint, + 'minSpecificUnique'=>GameConst::$inheritItemUniqueMinPoint, ], + 'availableSpecialWar' => $avilableSpecialWar, + 'availableUnique' => $availableUnique, ]) ?>