Team Ai
Apppublic

Lashtw/Vibecodingex

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes
test_evolution.js30 linesDownload Raw Back to root
1import { getNextMonster, MONSTER_DEFS } from './src/utils/monsterUtils.js';
2
3const mockMonster = { id: 'L2_CA', name: '駭客蟲', stage: 2 };
4const classSizes = [10, 30];
5const likeCounts = [0, 5, 20]; // Test Low, Mid, High tiers
6
7console.log(`Testing Evolution for: ${mockMonster.name} (${mockMonster.id})`);
8
9classSizes.forEach(size => {
10    likeCounts.forEach(likes => {
11        // We want to see what it evolves INTO, so we ask for Stage 3
12        const next = getNextMonster(3, likes, size, mockMonster.id);
13        console.log(`Class: ${size}, Likes: ${likes} -> Next: ${next.name} (${next.id})`);
14    });
15});
16
17console.log('\n--- Checking Evolution for Trash Mob (L2_CC) ---');
18// Verify if L2_CC evolves to Virus King (L3_CCA) or others
19const trashMob = { id: 'L2_CC', name: '垃圾怪', stage: 2 };
20const nextTrash = getNextMonster(3, 5, 10, trashMob.id);
21console.log(`Trash Mob (L2_CC) w/ High Likes -> ${nextTrash.name} (${nextTrash.id})`);
22
23console.log('\n--- Debugging candidates for L2_CA ---');
24// Manually replicate the util logic step
25const candidates = MONSTER_DEFS.filter(m => m.stage === 3);
26const currentPath = 'CA';
27const rigidMatches = candidates.filter(m => m.id.startsWith(`L3_${currentPath}`));
28console.log('Strict Matches for L3_CA*:');
29rigidMatches.forEach(m => console.log(m.id, m.name));
30