feat: 100기 NPC 동조와 후보 추첨 보완

This commit is contained in:
2026-07-28 16:02:14 +00:00
parent c1ce478d22
commit 5ab08403c6
12 changed files with 4936 additions and 4722 deletions
+7 -3
View File
@@ -8,6 +8,11 @@ use sammo\Util;
abstract class AbsFromUserPool extends AbsGeneralPool{
protected static function getCandidateWeight(array $info, int $owner): int|float
{
return array_sum($info['dex'] ?? []);
}
public function occupyGeneralName(): bool
{
$generalID = $this->getGeneralBuilder()->getGeneralID();
@@ -36,8 +41,7 @@ abstract class AbsFromUserPool extends AbsGeneralPool{
$pool = [];
foreach($db->query('SELECT id, unique_name, info FROM select_pool WHERE reserved_until IS NULL AND general_id IS NULL', $pickCnt) as $cand){
$cand['info'] = Json::decode($cand['info']);
$dexTotal = array_sum($cand['info']['dex']);
$pool[] = [$cand, $dexTotal];
$pool[] = [$cand, static::getCandidateWeight($cand['info'], $owner)];
}
if(count($pool) < $pickCnt){
@@ -69,4 +73,4 @@ abstract class AbsFromUserPool extends AbsGeneralPool{
return array_values($result);
}
}
}