feat: improve analysis and release v1.0.2
This commit is contained in:
+1
-19
@@ -1,5 +1,5 @@
|
||||
import { effectiveCooldownSeconds } from './timeline.ts';
|
||||
import { skillTargetBelongsTo } from './skill-condition.ts';
|
||||
import { passiveScoreSupportAt } from './passive-support.ts';
|
||||
import type {
|
||||
CooldownReduction,
|
||||
ExactScoreOptions,
|
||||
@@ -34,24 +34,6 @@ export function scoreRatioFromNotes(notes: ExactSongChart['notes']): number {
|
||||
return weight * CHART_SCORE_WEIGHT_COEFFICIENT;
|
||||
}
|
||||
|
||||
function passiveScoreSupportAt(cards: readonly OptimizerCard[], targetIndex: number): number {
|
||||
let total = 0;
|
||||
cards.forEach((source, sourceIndex) => {
|
||||
for (const effect of source.passiveScoreSupportEffects ?? []) {
|
||||
let indexes: number[];
|
||||
if (effect.target === 'all') indexes = cards.map((_, index) => index);
|
||||
else if (effect.target === 'self') indexes = [sourceIndex];
|
||||
else indexes = cards
|
||||
.map((card, index) => ({ card, index }))
|
||||
.filter(({ card }) => skillTargetBelongsTo({ type: card.type ?? '', generation: card.generation ?? '' }, effect.targetGroup ?? ''))
|
||||
.slice(0, effect.targetCount ?? cards.length)
|
||||
.map(({ index }) => index);
|
||||
if (indexes.includes(targetIndex)) total += effect.percent;
|
||||
}
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
function comboBonus(combo: number): number {
|
||||
if (combo >= 1_000) return 0.1;
|
||||
if (combo >= 100) return Math.floor(combo / 100) * 0.01;
|
||||
|
||||
Reference in New Issue
Block a user