add example tests for damage
This commit is contained in:
@@ -31,4 +31,12 @@ export class Level {
|
||||
diff(target: Level): number {
|
||||
return this.value - target.value;
|
||||
}
|
||||
|
||||
/** Damage threshold to reach the given level.
|
||||
* Level 1→2: 1000, Level 2→3: 3000, Level 3→4: 6000, etc.
|
||||
* Formula: 1000 * N * (N+1) / 2
|
||||
*/
|
||||
static damageThresholdForLevel(level: number): number {
|
||||
return 1000 * level * (level + 1) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user