| 1 | import test from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | import { mobCanFight, mobMeleeAttackProfile } from "../../shared/definitions/mobCombat.js"; |
| 4 | import { MobId, mobDefinition } from "../../shared/definitions/mobs.js"; |
| 5 | |
| 6 | test("living targetable mobs can fight except pigeons", () => |
| 7 | { |
| 8 | assert.equal(mobCanFight(mobDefinition(MobId.deer)), true); |
| 9 | assert.equal(mobCanFight(mobDefinition(MobId.rat)), true); |
| 10 | assert.equal(mobCanFight(mobDefinition(MobId.pigeon)), false); |
| 11 | }); |
| 12 | |
| 13 | test("mob attack profile uses one attackSkill for hit and damage rolls", () => |
| 14 | { |
| 15 | const profile = mobMeleeAttackProfile(mobDefinition(MobId.rat)); |
| 16 | assert.equal(profile.mobAttackSkill, 3); |
| 17 | assert.equal(profile.baseDamage, 2); |
| 18 | }); |