game: 이미 같은 부위에 유니크를 가지고 있다면 유산 입찰 금지
- 이미 입찰한 같은 부위 유니크는 반환
This commit is contained in:
+4
-2
@@ -1758,12 +1758,11 @@ function tryInheritUniqueItem(General $general, string $acquireType = '아이템
|
|||||||
$reasons[] = '이미 그 유니크를 가지고 있습니다.';
|
$reasons[] = '이미 그 유니크를 가지고 있습니다.';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (!$ownItem->isBuyable()) {
|
if (!$ownItem->isBuyable()) {
|
||||||
$reasons[] = '이미 다른 유니크를 가지고 있습니다.';
|
$reasons[] = '이미 다른 유니크를 가지고 있습니다.';
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
$availableCnt = $itemList[$itemKey];
|
$availableCnt = $itemList[$itemKey];
|
||||||
$occupiedCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE %b = %s', $itemType, $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);
|
$general->applyDB($db);
|
||||||
|
|
||||||
|
//같은 종류의 유니크를 입찰했을 수 있으니 한번 더 검사한다.
|
||||||
|
tryRollbackInheritUniqueItem($general);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,19 @@ class BuySpecificUnique extends \sammo\BaseAPI
|
|||||||
return '이미 입찰한 아이템입니다. 다음 턴에 시도해 주세요.';
|
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();
|
$db = DB::db();
|
||||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||||
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
|
$trialStor = KVStorage::getStorage($db, "ut_{$itemKey}");
|
||||||
|
|||||||
Reference in New Issue
Block a user