fix Allium specs syntax + implement Changing Level story

- Fix Allium spec syntax: type→value, enum for Status, remove implies chaining
- Fix factions.spec: add missing type declarations (Health, Level, Status)
- Fix magical-objects.spec: add type declarations, use .value for Health access,
  remove entity inheritance syntax, remove invalid invariants
- Implement Changing Level: add totalDamageTaken + factionsJoined to Character
- Add level-up logic in dealDamage() and joinFaction()
- Add Level.damageThresholdForLevel() static method
- Fix changing-level.spec.ts properties: handle target survival, compute
  expected level from threshold crossings
This commit is contained in:
2026-06-15 07:55:39 +01:00
parent 692bd7305b
commit 39839dc594
5 changed files with 165 additions and 105 deletions
+1 -1
View File
@@ -37,6 +37,6 @@ export class Level {
* Formula: 1000 * N * (N+1) / 2
*/
static damageThresholdForLevel(level: number): number {
return 1000 * level * (level + 1) / 2;
return (1000 * level * (level + 1)) / 2;
}
}