Add character overlay, where skills and passives (changing this) can be set

This commit is contained in:
Peter Stockings
2026-01-04 21:12:07 +11:00
parent f67f488764
commit 171abb681a
9 changed files with 321 additions and 20 deletions

View File

@@ -10,6 +10,12 @@ describe('Combat Simulation', () => {
actors,
exit: { x: 9, y: 9 }
});
const createTestStats = (overrides: Partial<any> = {}) => ({
maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10,
statPoints: 0, skillPoints: 0, strength: 10, dexterity: 10, intelligence: 10, passiveNodes: [],
...overrides
});
describe('applyAction - attack', () => {
it('should deal damage when player attacks enemy', () => {
@@ -20,7 +26,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats()
});
actors.set(2, {
id: 2,
@@ -28,7 +34,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 1, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats({ maxHp: 10, hp: 10, attack: 3, defense: 1 })
});
const world = createTestWorld(actors);
@@ -49,7 +55,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 20, hp: 20, attack: 50, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats({ attack: 50 })
});
actors.set(2, {
id: 2,
@@ -57,7 +63,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 1,level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats({ maxHp: 10, hp: 10, attack: 3, defense: 1 })
});
const world = createTestWorld(actors);
@@ -78,7 +84,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats()
});
actors.set(2, {
id: 2,
@@ -86,7 +92,7 @@ describe('Combat Simulation', () => {
pos: { x: 4, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 10, hp: 10, attack: 3, defense: 3, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats({ maxHp: 10, hp: 10, attack: 3, defense: 3 })
});
const world = createTestWorld(actors);
@@ -109,7 +115,7 @@ describe('Combat Simulation', () => {
pos: { x: 3, y: 3 },
speed: 100,
energy: 0,
stats: { maxHp: 20, hp: 20, attack: 5, defense: 2, level: 1, exp: 0, expToNextLevel: 10 }
stats: createTestStats()
});
const world = createTestWorld(actors);