Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ coverage/
Thumbs.db

!.dev.vars.example

# Wrangler local dev state
.wrangler/
8 changes: 4 additions & 4 deletions src/data/customUnits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe("custom units", () => {
]);
});

it("Dramar Thungnisson (Mounted): Dwarf Hero supporting Ram Riders", () => {
it("Dramar Thungnisson (Mounted): Dwarf Hero with two named rules", () => {
const dramar = customUnit(customDwarfs, "dwarfs:dramar-thungnisson-mounted");
expect(dramar.type).toBe("Hero");
expect(dramar.category).toBe("character");
Expand All @@ -127,9 +127,10 @@ describe("custom units", () => {
expect(dramar.command).toBe(8);
expect(dramar.points).toBe(80);
expect(dramar.max).toBe(1);
expect(dramar.specialName).toBe("Master of the Goats");
expect(dramar.specialName).toBeNull();
expect(dramar.specials).toEqual([
"When attached to a unit of Ram Riders a unit with this sword can re-roll one unsuccessful Attack dice each round of combat.",
"**For the Hold!:** When attached to a unit, if that unit has moved into contact with an enemy unit this turn you can re-roll one unsuccessful attack each round of combat.",
"**Ironbreaker's Resolve:** When attached to a unit, one shooting hit inflicted on the unit after saves have been taken in each turn is ignored. This includes hits from magic spells inflicted in the Shooting phase.",
]);
});

Expand Down Expand Up @@ -158,7 +159,6 @@ describe("custom units", () => {
expect(yorri.points).toBe(80);
expect(yorri.max).toBe(1);
expect(yorri.specials).toEqual([
"**Leading the Outcasts:** When attached to a unit of Slayers increase bonus attacks by +1.",
"**This Will be the One:** When the unit this character is attached to is in close combat with an enemy Giant or Troll increase bonus attacks by +1.",
]);
});
Expand Down
11 changes: 5 additions & 6 deletions src/data/customUnits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ export function applyCustomUnits(custom: RuleSetInfo, base: RuleSetInfo): void {
}),
);

// Mounted Dramar fights alongside the Ram Riders.
// Mounted Dramar spurs on a charging unit and shrugs off incoming fire.
dwarfs.units.push(
deriveDwarfHero({
unitId: "dwarfs:dramar-thungnisson-mounted",
troop: "Dramar Thungnisson (Mounted)",
specialName: "Master of the Goats",
specialName: null,
specials: [
"When attached to a unit of Ram Riders a unit with this sword can re-roll one unsuccessful Attack dice each round of combat.",
"**For the Hold!:** When attached to a unit, if that unit has moved into contact with an enemy unit this turn you can re-roll one unsuccessful attack each round of combat.",
"**Ironbreaker's Resolve:** When attached to a unit, one shooting hit inflicted on the unit after saves have been taken in each turn is ignored. This includes hits from magic spells inflicted in the Shooting phase.",
],
}),
);
Expand All @@ -141,16 +142,14 @@ export function applyCustomUnits(custom: RuleSetInfo, base: RuleSetInfo): void {
}),
);

// Yorri Thungnisson is especially deadly alongside Slayers and against
// Giants or Trolls.
// Yorri Thungnisson is especially deadly against Giants or Trolls.
dwarfs.units.push(
deriveDwarfHero({
unitId: "dwarfs:yorri-thungnisson",
troop: "Yorri Thungnisson",
bonusAttacks: 2,
specialName: null,
specials: [
"**Leading the Outcasts:** When attached to a unit of Slayers increase bonus attacks by +1.",
"**This Will be the One:** When the unit this character is attached to is in close combat with an enemy Giant or Troll increase bonus attacks by +1.",
],
}),
Expand Down
12 changes: 9 additions & 3 deletions src/domain/unitCard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function unit(army: typeof orcs, troop: string) {

describe("unit cards", () => {
it("splits Markdown-style names from custom special rules", () => {
expect(splitRuleHeading("**Leading the Outcasts:** Rule text.")).toEqual({
title: "Leading the Outcasts",
expect(splitRuleHeading("**This Will be the One:** Rule text.")).toEqual({
title: "This Will be the One",
text: "Rule text.",
});
});
Expand All @@ -41,9 +41,15 @@ describe("unit cards", () => {
"Ironbreaker's Resolve",
);

const mountedDramar = buildCard(unit(customDwarfs, "Dramar Thungnisson (Mounted)"));
const mountedTitles = [...mountedDramar.frontRules, ...mountedDramar.backRules].map(
(rule) => rule.title,
);
expect(mountedTitles).toContain("For the Hold!");
expect(mountedTitles).toContain("Ironbreaker's Resolve");

const yorri = buildCard(unit(customDwarfs, "Yorri Thungnisson"));
const yorriTitles = [...yorri.frontRules, ...yorri.backRules].map((rule) => rule.title);
expect(yorriTitles).toContain("Leading the Outcasts");
expect(yorriTitles).toContain("This Will be the One");

const highElves = getArmy("warmaster-revolution", "high-elves")!;
Expand Down