Skip to content

Commit

Permalink
Fixes for Battlescribe, Azyr, Warscroll Builder, and Warhammer App (#…
Browse files Browse the repository at this point in the history
…1415)

* Update deps

* Add Warhammer App updates

* Azyr fix for Godseekers Host

* Warscroll Builder fixes

* Update package.json

* Add Battlescribe fixes
  • Loading branch information
daviseford authored Oct 5, 2021
1 parent 1d85ca9 commit 40f400f
Show file tree
Hide file tree
Showing 37 changed files with 8,476 additions and 74 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "aos-reminders",
"version": "5.1.2",
"version": "5.1.3",
"private": true,
"homepage": "./",
"dependencies": {
"@auth0/auth0-react": "1.8.0",
"@reduxjs/toolkit": "1.6.1",
"@stripe/react-stripe-js": "1.5.0",
"@stripe/stripe-js": "1.19.0",
"@reduxjs/toolkit": "1.6.2",
"@stripe/react-stripe-js": "1.6.0",
"@stripe/stripe-js": "1.19.1",
"bootstrap": "4.6.0",
"core-js": "3.18.1",
"deepmerge": "4.2.2",
Expand All @@ -34,7 +34,7 @@
"react-switch": "6.0.0",
"redux": "4.1.1",
"redux-persist": "6.0.0",
"string.prototype.matchall": "4.0.5",
"string.prototype.matchall": "4.0.6",
"superagent": "6.1.0"
},
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions src/factions/factionClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class Faction<
BT extends TEffects[]
> {
public readonly AggregateArmy: TSubfactionArmy
public readonly flavorKeys: string[] = []
public readonly subFactionKeys: string[]
public readonly subFactionKeyMap: Record<K, K>
public readonly subFactionArmies: Record<K, TSubfactionArmy>
Expand All @@ -40,6 +41,8 @@ export class Faction<
) {
this.AggregateArmy = getAggregateArmy(SubFactions, flavorLabel)

this.flavorKeys = this.AggregateArmy.Flavors.map(x => x.name)

this.subFactionKeys = Object.keys(SubFactions) as K[]

this.subFactionKeyMap = this.subFactionKeys.reduce((a, k) => {
Expand Down
2 changes: 1 addition & 1 deletion src/factions/lumineth_realmlords/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const Units = {
},
],
},
'Ellania and Allathor, Eclipsian Warsages': {
'Ellania and Ellathor, Eclipsian Warsages': {
mandatory: {
spells: [keyPicker(spells, ['Salvation of Hysh'])],
},
Expand Down
2 changes: 1 addition & 1 deletion src/factions/nurgle/flavors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Flavors = {
effects: [...pickEffects(BattleTraits, ['Locus of Corrosion'])],
},

'Blessed Sons': {
'The Blessed Sons': {
mandatory: {
artifacts: [keyPicker(Artifacts, ['Blotshell Bileplate'])],
command_abilities: [keyPicker(CommandAbilities, ['Degraded and Defiled'])],
Expand Down
4 changes: 2 additions & 2 deletions src/factions/orruk_warclans/bonesplitterz/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const BonesplitterzUnits = {
},
],
},
'Hedrakka, Gob of Gork': {
'Hedkrakka, Gob of Gork': {
mandatory: {
spells: [keyPicker(spells, ['Bone Krusha'])],
},
Expand All @@ -208,7 +208,7 @@ const BonesplitterzUnits = {
},
],
},
"Hedrakka's Madmob": {
"Hedkrakka's Madmob": {
effects: [
PrimalSurgeEffect,
{
Expand Down
4 changes: 2 additions & 2 deletions src/factions/seraphon/command_traits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ const CommandTraits = {
],
},

'Mighty Warleader': {
'Mighty War Leader': {
effects: [
{
name: `Mighty Warleader`,
name: `Mighty War Leader`,
desc: `If this general is part of your army and on the battlefield at the start of your hero phase, roll a D6. On a 4+, you receive 1 extra command point.`,
when: [START_OF_HERO_PHASE],
},
Expand Down
2 changes: 1 addition & 1 deletion src/factions/tzeentch/battalions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const RegularBattalions = {
},
"Atra'zan's Blazing Cavalcade": {
mandatory: {
flavors: [keyPicker(Flavors, ['Eternal Conflagration'])],
flavors: [keyPicker(Flavors, ['The Eternal Conflagration'])],
units: [
keyPicker(Units, ['Fateskimmer, Herald of Tzeentch on Burning Chariot', 'Horrors of Tzeentch']),
],
Expand Down
2 changes: 1 addition & 1 deletion src/factions/tzeentch/flavors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CommandAbilities from './command_abilities'
import CommandTraits from './command_traits'

const Flavors = {
'Eternal Conflagration': {
'The Eternal Conflagration': {
mandatory: {
artifacts: [keyPicker(Artifacts, ['Shroud of Warpflame'])],
command_abilities: [keyPicker(CommandAbilities, ['Infernos of Mutation'])],
Expand Down
8 changes: 8 additions & 0 deletions src/tests/azyr/getAzyrArmy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ const getFile = (filename: string): string[] => {
}

describe('getAzyrArmyFromPdf', () => {
it('should correctly read 1632542322117-Azyr', () => {
const fileTxt = getFile('1632542322117-Azyr')
const pages = handleAzyrPages(fileTxt)
const res = getAzyrArmyFromPdf(pages)
expect(res.subFactionName).toEqual('Godseekers Host')
expect(res.errors).toEqual([])
})

it('should correctly read 1625898122403-Azyr', () => {
const fileTxt = getFile('1625898122403-Azyr')
const pages = handleAzyrPages(fileTxt)
Expand Down
56 changes: 54 additions & 2 deletions src/tests/battlescribe/battlescribeHTML.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,48 @@ const getFile = (filename: string) => {
}

describe('getBattlescribeArmy', () => {
it('should correctly read 1632263631817-Battlescribe', () => {
const parsedText = getFile('1632263631817-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.units).toContain('Kurnoth Hunters')
expect(res.errors).toEqual([])
})

it('should correctly read 1632323054450-Battlescribe', () => {
const parsedText = getFile('1632323054450-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.units).toContain('Ellania and Ellathor, Eclipsian Warsages')
})

it('should correctly read 1632394710991-Battlescribe', () => {
const parsedText = getFile('1632394710991-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.flavors).toContain('The Eternal Conflagration')
expect(res.errors).toEqual([])
})

it('should correctly read 1632426492475-Battlescribe', () => {
const parsedText = getFile('1632426492475-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.units).toContain('Kurnoth Hunters')
expect(res.errors).toEqual([])
})

it('should correctly read 1632980812991-Battlescribe', () => {
const parsedText = getFile('1632980812991-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.units).toContain('Swampcalla Shaman and Pot-grot')
expect(res.errors).toEqual([])
})

it('should correctly read 1633164617906-Battlescribe', () => {
const parsedText = getFile('1633164617906-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.selections.flavors).toContain('Zaitrec')
expect(res.selections.scenery).toContain('Shrine Luminor')
expect(res.errors).toEqual([])
})

it('should correctly read 1626199975730-Battlescribe', () => {
const parsedText = getFile('1626199975730-Battlescribe')
const res = getBattlescribeArmy(parsedText)
Expand Down Expand Up @@ -671,14 +713,24 @@ describe('getBattlescribeArmy', () => {
it('should correctly read 1602294536060-Battlescribe', () => {
const parsedText = getFile('1602294536060-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.errors).toEqual([])
expect(res.errors).toEqual([
{
severity: 'warn',
text: 'Aetherquartz Reserve, Alarith - Mountain Kindred, Iliatha, Vanari - Warriors of Light',
},
])
})

it('should correctly read 1602294559289-Battlescribe', () => {
const parsedText = getFile('1602294559289-Battlescribe')
const res = getBattlescribeArmy(parsedText)
expect(res.factionName).toEqual(LUMINETH_REALMLORDS)
expect(res.errors).toEqual([])
expect(res.errors).toEqual([
{
severity: 'warn',
text: 'Aetherquartz Reserve, Alarith - Mountain Kindred, Iliatha, Vanari - Warriors of Light',
},
])
})

it('should correctly read 1602790654401-Battlescribe', () => {
Expand Down
3 changes: 3 additions & 0 deletions src/tests/fixtures/azyr/json/1632542322117-Azyr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"HEADER Play Type: Open | Grand Alliance: Chaos | Allegiance: Slaanesh Host: Godseekers HEADER HEADER 150pts ITEM: Shardspeaker of Slaanesh Role: Leader Quantity: 1 Artefact: Threnody Voicebox Spell: Dark Delusions 200pts ITEM: Syll'Esske General Role: Leader Quantity: 1 Spell: Hysterical Frenzy 310pts ITEM: Shalaxi Helbane General Role: Leader, Behemoth Quantity: 1 Weapon: Living Whip 160pts ITEM: Blissbarb Archers Role: Battleline Quantity: 11 HEADER HEADER HEADER 110pts ITEM: Daemonettes Role: Battleline Quantity: 10 ITEM: Shalaxi Helbane See the \"Leader\" occurrence of this unit 200pts ITEM: Slickblade Seekers Role: Other Quantity: 5 140pts ITEM: Slaangor Fiendbloods Role: Other Quantity: 3 150pts ITEM: Seekers Role: Other Quantity: 5"
]
Loading

0 comments on commit 40f400f

Please sign in to comment.