feat(sprint5): quest system + arcs + rebalance endurance/damage/xp
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 33s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 33s
Quest system: 4 entities (quest_arcs, quests, player_quests, player_quest_arcs) Arc "Les Marais du Têtard" (4 quêtes narratives) 3 quêtes standalone répétables (chasse/forge/craft) 5 achievements liés (quests_completed + quest_arc_completed) Event-driven: combat/forge/craft/loot émettent quest.progress API: available, active, completed, accept, claim, arcs Rebalance: Endurance coût combat 10→5, regen 6min→3min (20/h), repos 20→10 Dégâts joueur +3 base (plus de combats de 13 tours au level 1) Défaite endurance penalty 50→25 XP monstres réduite (25→8 Têtard, 130→50 Golem) — quêtes = source principale
This commit is contained in:
@@ -18,8 +18,8 @@ import {
|
||||
CombatantStats,
|
||||
} from './combat.engine';
|
||||
|
||||
const COMBAT_ENDURANCE_COST = 10;
|
||||
const DEFEAT_ENDURANCE_PENALTY = 50;
|
||||
const COMBAT_ENDURANCE_COST = 5;
|
||||
const DEFEAT_ENDURANCE_PENALTY = 25;
|
||||
const DEFEAT_HP_RATIO = 0.2; // 20% hpMax à la défaite
|
||||
const VICTORY_HP_REGEN_RATIO = 0.1; // +10% hpMax à la victoire
|
||||
const DEFEAT_GOLD_LOSS_RATIO = 0.05; // perte 5% or à la défaite
|
||||
@@ -171,6 +171,9 @@ export class CombatService {
|
||||
if (result.winner === 'player' && monster.dropMaterialId && Math.random() < 0.4) {
|
||||
await this.materialService.addMaterial(character.id, monster.dropMaterialId, 1);
|
||||
lootMaterial = { name: 'matériau', quantity: 1 };
|
||||
this.eventEmitter.emit('quest.progress', {
|
||||
characterId: character.id, type: 'gather_material', targetId: monster.dropMaterialId, increment: 1,
|
||||
});
|
||||
}
|
||||
|
||||
// Persister le log
|
||||
@@ -203,6 +206,13 @@ export class CombatService {
|
||||
this.eventEmitter.emit('community.contribute', {
|
||||
characterId: character.id, type: 'total_gold_earned', increment: result.goldEarned,
|
||||
});
|
||||
// Quest progress
|
||||
this.eventEmitter.emit('quest.progress', {
|
||||
characterId: character.id, type: 'kill_any', increment: 1,
|
||||
});
|
||||
this.eventEmitter.emit('quest.progress', {
|
||||
characterId: character.id, type: 'kill_monster', targetId: monster.id, increment: 1,
|
||||
});
|
||||
}
|
||||
|
||||
// Construire la réponse
|
||||
|
||||
Reference in New Issue
Block a user