feat: repeatable quests hors pool 3 slots + section tâches quotidiennes
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s
Répétables ne comptent plus dans le MAX_ACTIVE_QUESTS (3). Frontend: section séparée "Tâches quotidiennes" en grille 3 colonnes, quêtes narratives en haut avec les slots limités. Prépare le terrain pour le hub village (forgeron, taverne, etc.).
This commit is contained in:
@@ -83,12 +83,18 @@ export class QuestService {
|
||||
throw new BadRequestException(`Niveau ${quest.minLevel} requis`);
|
||||
}
|
||||
|
||||
// Check active quest count
|
||||
const activeCount = await this.playerQuestRepo.count({
|
||||
where: { characterId, status: 'active' },
|
||||
});
|
||||
if (activeCount >= MAX_ACTIVE_QUESTS) {
|
||||
throw new BadRequestException(`Maximum ${MAX_ACTIVE_QUESTS} quêtes actives`);
|
||||
// Check active quest count (repeatable quests don't count toward the limit)
|
||||
if (!quest.repeatable) {
|
||||
const activeNonRepeatable = await this.playerQuestRepo
|
||||
.createQueryBuilder('pq')
|
||||
.innerJoin('pq.quest', 'q')
|
||||
.where('pq.character_id = :characterId', { characterId })
|
||||
.andWhere('pq.status = :status', { status: 'active' })
|
||||
.andWhere('q.repeatable = false')
|
||||
.getCount();
|
||||
if (activeNonRepeatable >= MAX_ACTIVE_QUESTS) {
|
||||
throw new BadRequestException(`Maximum ${MAX_ACTIVE_QUESTS} quêtes actives (hors répétables)`);
|
||||
}
|
||||
}
|
||||
|
||||
// Check not already active
|
||||
|
||||
Reference in New Issue
Block a user