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
+35
View File
@@ -1,6 +1,11 @@
<?php
use PHPUnit\Framework\TestCase;
use sammo\GeneralPool\SPoolUnderU100;
require_once __DIR__ . '/../hwe/sammo/AbsGeneralPool.php';
require_once __DIR__ . '/../hwe/sammo/AbsFromUserPool.php';
require_once __DIR__ . '/../hwe/sammo/GeneralPool/SPoolUnderU100.php';
final class CentennialAllStarPoolTest extends TestCase
{
@@ -57,6 +62,13 @@ final class CentennialAllStarPoolTest extends TestCase
$generalName = $row[$column['generalName']];
self::assertArrayNotHasKey($generalName, $generalNames);
$generalNames[$generalName] = true;
self::assertMatchesRegularExpression('/^(\d{1,2})·.+$/u', $generalName);
self::assertSame(
1,
preg_match('/^(\d{1,2})·/u', $generalName, $nameMatch)
);
self::assertSame($phase, (int) $nameMatch[1]);
self::assertLessThanOrEqual(32, mb_strlen($generalName));
self::assertCount(5, $row[$column['dex']]);
self::assertNotEmpty($row[$column['selectionReasons']]);
@@ -86,6 +98,29 @@ final class CentennialAllStarPoolTest extends TestCase
}
}
public function testCentennialSelectionWeightFavorsUserStatsAndKeepsZeroDexEligible(): void
{
$method = new ReflectionMethod(SPoolUnderU100::class, 'getCandidateWeight');
$method->setAccessible(true);
$low = [
'leadership' => 80,
'strength' => 70,
'intel' => 10,
'dex' => [0, 0, 0, 0, 0],
];
$high = [
'leadership' => 95,
'strength' => 85,
'intel' => 10,
'dex' => [0, 0, 0, 0, 0],
];
self::assertSame(100000, $method->invoke(null, $low, 0));
self::assertSame(100000.0, $method->invoke(null, $low, 1));
self::assertSame(150000.0, $method->invoke(null, $high, 1));
self::assertSame(100000, $method->invoke(null, $high, 0));
}
public function testEveryHistoricalEventSpecialHasAnImplementation(): void
{
$pool = json_decode(