Skip to content

Commit

Permalink
Merge pull request #137 from mardanbeigi/main
Browse files Browse the repository at this point in the history
40k: 10th tweaks and fixes
  • Loading branch information
rweyrauch committed Sep 6, 2023
2 parents d31a780 + 3a7b17c commit a95a41a
Show file tree
Hide file tree
Showing 77 changed files with 28,289 additions and 283 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
node_modules
#dist
.idea
.vscode/settings.json
/dist/app*
/dist/main*
/dist/renderer*
/dist/roster*
/dist/app*

3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"type": "node",
"request": "launch",
"name": "Jasmine Current File",
"program": "${workspaceFolder}/node_modules/jasmine-ts/lib/index",
"runtimeExecutable": "/usr/local/bin/npx",
"program": "jasmine",
"args": ["--config=./jasmine.json", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
Expand Down
11 changes: 4 additions & 7 deletions css/prettyscribe.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ label {
padding-left: var(--notchSize);
}

.wh40k_unit_sheet > table > thead.header_row {
text-transform: uppercase
}

.wh40k_unit_sheet > table > thead.info_row > tr > td:first-child {
font: bold 1em sans-serif;
text-transform: uppercase;
Expand All @@ -254,7 +250,7 @@ label {

.wh40k_unit_sheet > table > thead.unit_header {
text-align: center;
text-transform: uppercase
text-transform: uppercase;
}

.wh40k_unit_sheet > table > thead.unit_header > tr > td:nth-child(2) {
Expand All @@ -266,7 +262,8 @@ label {
color: white;
}

.wh40k_unit_sheet > table > thead.header_row > tr > th {
.wh40k_unit_sheet > table > thead > tr.header_row > th {
text-transform: uppercase;
white-space: nowrap;
}

Expand Down Expand Up @@ -370,4 +367,4 @@ label {

.page_break {
break-before: page;
}
}
27,685 changes: 27,683 additions & 2 deletions dist/prettyscribe.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion jasmine.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
],
"spec_dir": "spec",
"spec_files": [
"**Spec.ts"
"**Spec.ts",
"*/**Spec.ts"
],
"helpers": [
"helpers/jasmine-typescript-helper.js"
Expand Down
184 changes: 184 additions & 0 deletions spec/40k10th/Necrons10eSpec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Wh40k } from "../../src/roster40k10th";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("CreateRoster", function() {
it("loads test/40k10th/Necrons 10e.rosz", async function() {
const doc = await readZippedRosterFile('test/40k10th/Necrons 10e.rosz');
const roster = Wh40k.CreateRoster(doc);

expect(roster).toEqual(
jasmine.objectContaining({
'_cost': jasmine.objectContaining({_points: 1205}),
'_forces': [
jasmine.objectContaining({
'_configurations': [
"Detachment Choice: Awakened Dynasty",
"Battle Size: 2. Strike Force (2000 Point limit)",
"Show Legends",
],
'_units': [
jasmine.objectContaining({
'_name': "The Silent King",
'_cost': jasmine.objectContaining({_points: 470}),
'_profileTables': {
"Melee Weapons": jasmine.objectContaining({
'_headers': ["Melee Weapons","Range","A","WS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Scythe of Dust"]),
jasmine.arrayContaining(["Close combat weapon"]),
],
}),
"Ranged Weapons": jasmine.objectContaining({
'_headers': ["Ranged Weapons","Range","A","BS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Sceptre of Eternal Glory"]),
jasmine.arrayContaining(["Staff of Stars"]),
jasmine.arrayContaining(["Annihilator beam"]),
],
}),
"Unit": jasmine.objectContaining({
'_headers': ["Unit","M","T","SV","W","LD","OC"],
'_contents': [
jasmine.arrayContaining(["Szarekh"]),
jasmine.arrayContaining(["Triarchal Menhir"]),
],
})
},
'_modelList': [
"Szarekh (Sceptre of Eternal Glory, Scythe of Dust, Staff of Stars)",
"2x Triarchal Menhir (Annihilator beam, Close combat weapon)",
"Unit Upgrades (Warlord)"
],
'_rules': mapWithKeys(["Command Protocols", "Deadly Demise D6+3 (Szarekh model only)", "Devastating Wounds", "Indirect Fire", "Lethal Hits", "Reanimation Protocols"]),
'_abilities': {
"Abilities": mapWithKeys(["Damaged: 1-6 wounds remaining", "Invulnerable Save", "The Silent King", "Triarchal Menhirs", "Voice of the Triarch"]),
"Triarch Abilities": mapWithKeys(["Bringer of Unity (Aura)", "Phaeron of the Blades (Aura)", "Phaeron of the Stars (Aura)"]),
}}),
jasmine.objectContaining({
'_name': "Overlord",
'_cost': jasmine.objectContaining({_points: 85}),
'_profileTables': {
"Melee Weapons": jasmine.objectContaining({
'_headers': ["Melee Weapons","Range","A","WS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Overlord's blade"]),
],
}),
"Ranged Weapons": jasmine.objectContaining({
'_headers': ["Ranged Weapons","Range","A","BS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Tachyon arrow"]),
],
}),
"Unit": jasmine.objectContaining({
'_headers': ["Unit","M","T","SV","W","LD","OC"],
'_contents': [
jasmine.arrayContaining(["Overlord"]),
],
})
},
'_modelList': [
"Overlord (Overlord's blade, Tachyon arrow)"
],
'_rules': mapWithKeys(["Command Protocols", "Devastating Wounds", "Leader", "One Shot", "Reanimation Protocols"]),
'_abilities': {
"Abilities": mapWithKeys(["Implacable Resilience", "Invulnerable Save", "Leader", "My Will Be Done"]),
}}),
jasmine.objectContaining({
'_name': "Doom Scythe",
'_cost': jasmine.objectContaining({_points: 225}),
'_profileTables': {
"Melee Weapons": jasmine.objectContaining({
'_headers': ["Melee Weapons","Range","A","WS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Armoured bulk"]),
],
}),
"Ranged Weapons": jasmine.objectContaining({
'_headers': ["Ranged Weapons","Range","A","BS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Heavy death ray"]),
jasmine.arrayContaining(["Twin tesla destructor"]),
],
}),
"Unit": jasmine.objectContaining({
'_headers': ["Unit","M","T","SV","W","LD","OC"],
'_contents': [
jasmine.arrayContaining(["Doom Scythe"]),
],
})
},
'_modelList': [
"Doom Scythe (Armoured bulk, Heavy death ray, Twin tesla destructor)"
],
'_rules': mapWithKeys(["Command Protocols", "Deadly Demise D3", "Reanimation Protocols", "Sustained Hits", "Twin-linked"]),
'_abilities': {
"Abilities": mapWithKeys(["Atavistic Instigation", "Damaged: 1-4 wounds remaining"]),
}}),
jasmine.objectContaining({
'_name': "Tesseract Vault",
'_cost': jasmine.objectContaining({_points: 425}),
'_profileTables': {
"C'tan Powers": jasmine.objectContaining({
'_headers': ["C'tan Powers","Range","A","BS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Cosmic Fire"]),
jasmine.arrayContaining(["Time's Arrow"]),
jasmine.arrayContaining(["Antimatter Meteor"]),
],
}),
"Melee Weapons": jasmine.objectContaining({
'_headers': ["Melee Weapons","Range","A","WS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Armoured bulk"]),
],
}),
"Ranged Weapons": jasmine.objectContaining({
'_headers': ["Ranged Weapons","Range","A","BS","S","AP","D","Keywords"],
'_contents': [
jasmine.arrayContaining(["Tesla sphere"]),
],
}),
"Unit": jasmine.objectContaining({
'_headers': ["Unit","M","T","SV","W","LD","OC"],
'_contents': [
jasmine.arrayContaining(["Tesseract Vault"]),
],
})
},
'_modelList': [
"Tesseract Vault (Armoured bulk, C'tan Powers, 4x Tesla sphere)"
],
'_rules': mapWithKeys(["Anti-", "Blast", "Command Protocols", "Deadly Demise D6+3", "Devastating Wounds", "Ignores Cover", "Indirect Fire", "Precision", "Reanimation Protocols", "Sustained Hits", "Torrent"]),
'_abilities': {
"Abilities": mapWithKeys(["Damaged: 1-8 wounds remaining", "Invulnerable Save", "Powers of the C’tan"]),
}}),
],
'_rules': new Map([
["Devastating Wounds", jasmine.any(String)],
["One Shot", jasmine.any(String)],
["Command Protocols", jasmine.any(String)],
["Leader", jasmine.any(String)],
["Reanimation Protocols", jasmine.any(String)],
["Anti-", jasmine.any(String)],
["Sustained Hits", jasmine.any(String)],
["Blast", jasmine.any(String)],
["Indirect Fire", jasmine.any(String)],
["Ignores Cover", jasmine.any(String)],
["Torrent", jasmine.any(String)],
["Precision", jasmine.any(String)],
["Deadly Demise D6+3", jasmine.any(String)],
["Lethal Hits", jasmine.any(String)],
["Deadly Demise D6+3 (Szarekh model only)", jasmine.any(String)],
["Twin-linked", jasmine.any(String)],
["Deadly Demise D3", jasmine.any(String)],
]),
'_factionRules': new Map(),
}),
]}));
});
});
8 changes: 4 additions & 4 deletions spec/AeldariTestSpec.ts → spec/40k8th/AeldariTestSpec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Aeldari Test.ros", async function() {
const doc = await readZippedRosterFile('test/Aeldari Test.ros');
it("loads test/40k8th/Aeldari Test.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Aeldari Test.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Black Templar - Test Output.ros", async function() {
const doc = await readZippedRosterFile('test/Black Templar - Test Output.ros');
it("loads test/40k8th/Black Templar - Test Output.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Black Templar - Test Output.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Black Templar 2000.ros", async function() {
const doc = await readZippedRosterFile('test/Black Templar 2000.ros');
it("loads test/40k8th/Black Templar 2000.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Black Templar 2000.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
8 changes: 4 additions & 4 deletions spec/ChaosSMTestSpec.ts → spec/40k8th/ChaosSMTestSpec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Chaos SM Test.ros", async function() {
const doc = await readZippedRosterFile('test/Chaos SM Test.ros');
it("loads test/40k8th/Chaos SM Test.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Chaos SM Test.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Death Guard and 1000 Sons.rosz", async function() {
const doc = await readZippedRosterFile('test/Death Guard and 1000 Sons.rosz');
it("loads test/40k8th/Death Guard and 1000 Sons.rosz", async function() {
const doc = await readZippedRosterFile('test/40k8th/Death Guard and 1000 Sons.rosz');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
8 changes: 4 additions & 4 deletions spec/DrukariTestSpec.ts → spec/40k8th/DrukariTestSpec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Drukari Test.ros", async function() {
const doc = await readZippedRosterFile('test/Drukari Test.ros');
it("loads test/40k8th/Drukari Test.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Drukari Test.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
8 changes: 4 additions & 4 deletions spec/GreyKnightsSpec.ts → spec/40k8th/GreyKnightsSpec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Grey Knights.rosz", async function() {
const doc = await readZippedRosterFile('test/Grey Knights.rosz');
it("loads test/40k8th/Grey Knights.rosz", async function() {
const doc = await readZippedRosterFile('test/40k8th/Grey Knights.rosz');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
8 changes: 4 additions & 4 deletions spec/GuardSpec.ts → spec/40k8th/GuardSpec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { readZippedRosterFile } from './helpers/readRosterFile';
import { Create40kRoster } from "../src/roster40k";
import { readZippedRosterFile } from '../helpers/readRosterFile';
import { Create40kRoster } from "../../src/roster40k";

function mapWithKeys(keys: string[]) {
return new Map(keys.map(e => [e, jasmine.any(String)]));
}

describe("Create40kRoster", function() {
it("loads test/Guard.ros", async function() {
const doc = await readZippedRosterFile('test/Guard.ros');
it("loads test/40k8th/Guard.ros", async function() {
const doc = await readZippedRosterFile('test/40k8th/Guard.ros');
const roster = Create40kRoster(doc);

expect(roster).toEqual(
Expand Down
Loading

0 comments on commit a95a41a

Please sign in to comment.