Skip to content

Commit

Permalink
AoS 3.0 (fixes #1291) (#1292)
Browse files Browse the repository at this point in the history
* Update deps

* Add app banner

* Create core_rules.ts

* First pass with the Core Book

* Update deps

* Update getArmy.ts

* Remove outdated scenery rules

* Add all to the Core Rules

* Update modify.ts

* Move imports around

* Fix tests by adding core_rules: [],

* Update modify.ts

* Custom Triumphs for KO

* Update Faq.tsx
  • Loading branch information
daviseford authored Jun 21, 2021
1 parent 49b9bdb commit 155e52c
Show file tree
Hide file tree
Showing 43 changed files with 1,063 additions and 482 deletions.
2 changes: 1 addition & 1 deletion clean.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const replace = require('replace-in-file')

const replaceOptions = {
files: 'src/factions/**/*.*(ts|tsx)',
files: ['src/factions/**/*.*(ts|tsx)', 'src/generic_rules/*.*(ts|tsx)'],
from: [
/[‘’]/g, // Replace special apostrophes
/[“”]/g, // Replace special quotes
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "aos-reminders",
"version": "4.0.7",
"version": "5.0.0",
"private": true,
"homepage": "./",
"dependencies": {
"@auth0/auth0-react": "1.5.0",
"@reduxjs/toolkit": "1.5.1",
"@reduxjs/toolkit": "1.6.0",
"@stripe/react-stripe-js": "1.4.1",
"@stripe/stripe-js": "1.15.0",
"@stripe/stripe-js": "1.15.1",
"bootstrap": "4.6.0",
"core-js": "3.13.1",
"core-js": "3.15.0",
"deepmerge": "4.2.2",
"jspdf": "1.5.3",
"lodash": "4.17.21",
Expand All @@ -20,13 +20,13 @@
"qs": "6.10.1",
"react": "17.0.2",
"react-beautiful-dnd": "13.1.0",
"react-bootstrap": "1.6.0",
"react-bootstrap": "1.6.1",
"react-copy-to-clipboard": "5.0.3",
"react-dom": "17.0.2",
"react-dropzone": "11.3.2",
"react-ga": "3.3.0",
"react-icons": "4.2.0",
"react-modal": "3.14.2",
"react-modal": "3.14.3",
"react-redux": "7.2.4",
"react-router-dom": "5.2.0",
"react-scripts": "4.0.3",
Expand Down Expand Up @@ -83,15 +83,15 @@
"@types/jest": "26.0.23",
"@types/jspdf": "1.3.3",
"@types/lodash": "4.14.170",
"@types/luxon": "1.26.5",
"@types/node": "15.12.0",
"@types/luxon": "1.27.0",
"@types/node": "15.12.4",
"@types/parse5": "6.0.0",
"@types/pdfjs-dist": "2.7.1",
"@types/qs": "6.9.6",
"@types/react": "17.0.9",
"@types/react": "17.0.11",
"@types/react-beautiful-dnd": "13.0.0",
"@types/react-copy-to-clipboard": "5.0.0",
"@types/react-dom": "17.0.6",
"@types/react-dom": "17.0.8",
"@types/react-modal": "3.12.0",
"@types/react-redux": "7.1.16",
"@types/react-router-dom": "5.1.7",
Expand All @@ -100,15 +100,15 @@
"@types/webpack-env": "1.16.0",
"babel-jest": "26.6.3",
"husky": "4.3.8",
"prettier": "2.3.0",
"prettier": "2.3.1",
"prettier-plugin-organize-imports": "2.1.0",
"pretty-quick": "3.1.0",
"pretty-quick": "3.1.1",
"react-app-rewired": "2.1.8",
"replace-in-file": "6.2.0",
"source-map-explorer": "2.5.2",
"ts-node-dev": "1.1.6",
"tsconfig-paths": "3.9.0",
"typescript": "4.3.2",
"typescript": "4.3.4",
"workbox-core": "6.1.5",
"workbox-expiration": "6.1.5",
"workbox-precaching": "6.1.5",
Expand Down
4 changes: 2 additions & 2 deletions src/components/info/banners/app_banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'

const AppBanner = () => {
const { isDark } = useTheme()
const name = 'soulblight-gravelords-release'
const name = 'aos-3-release'

return (
<NotificationBanner
Expand All @@ -15,7 +15,7 @@ const AppBanner = () => {
variant={isDark ? `info` : `info`}
>
<span>
<strong>NEW!</strong> We've just added Soulblight Gravelords!
<strong>Welcome to AoS 3.0 {':)'}</strong>
</span>
</NotificationBanner>
)
Expand Down
4 changes: 4 additions & 0 deletions src/components/routes/Faq.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const Faq = () => {
text={`Log in and then visit your Profile. From there, please click "Cancel Subscription"`}
imgUrl={'/img/faq_unsubscribe.png'}
/>
<FaqEntry
title="I've noticed an incorrect or missing rule!"
text={`Please ping me on Discord, Twitter, email, or open a new issue on Github.`}
/>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/components/routes/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, { lazy, Suspense, useEffect } from 'react'
import { logPageView } from 'utils/analytics'

const AlliedArmies = lazy(() => import('components/input/ally_armies'))
// const AppBanner = lazy(() => import('components/info/banners/app_banner'))
const AppBanner = lazy(() => import('components/info/banners/app_banner'))
const ArmyBuilder = lazy(() => import('components/input/army_builder'))
const FooterComponent = lazy(() => import('components/page/footer'))
const LoadedArmyHeader = lazy(() => import('components/input/savedArmies/loaded_army_header'))
Expand All @@ -34,9 +34,9 @@ const Home = () => {
<div className={theme.bgColor}>
<Header />

{/* <Suspense fallback={<></>}>
<Suspense fallback={<></>}>
<AppBanner />
</Suspense> */}
</Suspense>

<Suspense fallback={<></>}>
<UpdateBanner />
Expand Down
3 changes: 3 additions & 0 deletions src/ducks/selections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ const selections = createSlice({
setCommandAbilities: (state, action: PayloadAction<string[]>) => {
state.selections.command_abilities = action.payload
},
setCoreRules: (state, action: PayloadAction<string[]>) => {
state.selections.core_rules = action.payload
},
setEndlessSpells: (state, action: PayloadAction<string[]>) => {
state.selections.endless_spells = action.payload
},
Expand Down
2 changes: 2 additions & 0 deletions src/factions/kharadron_overlords/subfactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import CommandAbilities from './command_abilities'
import CommandTraits from './command_traits'
import Flavors from './flavors'
import MountTraits from './mount_traits'
import Triumphs from './triumphs'
import Units from './units'

const subFactions = {
Expand All @@ -19,6 +20,7 @@ const subFactions = {
command_traits: [CommandTraits],
flavors: [Flavors],
mount_traits: [MountTraits],
triumphs: [Triumphs], // Note that KO has custom Triumphs (currently the only army to follow this pattern)
units: [Units],
},
},
Expand Down
62 changes: 62 additions & 0 deletions src/factions/kharadron_overlords/triumphs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { tagAs } from 'factions/metatagger'
import { HERO_PHASE, SHOOTING_PHASE, WOUND_ALLOCATION_PHASE } from 'types/phases'

// Kharadron Overlords specific triumphs.
const Triumphs = {
'Overcharged Aetheric Augmentation': {
effects: [
{
name: `Overcharged Aetheric Augmentation`,
desc: `Once per battle, before an Aether-Khemist uses Aetheric Augmentation, you can overchage it. Pick 1 friendly Skyfarers unit wholly within 18" (Can pick 2 with Supreme command trait). This can be used while in garrison as long as the target is in the same garrison.`,
when: [HERO_PHASE],
},
],
},
'Large-calibre Augmentation': {
effects: [
{
name: `Large-calibre Augmentation`,
desc: `Once per battle, when a friendly Skyvessel with an Aether-Khemist garrisoned is selected to shoot, pick 1 missile weapon it is armed with. You can reroll wounds rolls of 1 for that weapon until the end of the phase.`,
when: [SHOOTING_PHASE],
},
],
},
'Focused Aethersight': {
effects: [
{
name: `Focused Aethersight`,
desc: `Once per battle, before an Aetheric Navigator attempts to unbind/dispel, you can use this triumph to allow for a reroll on the unbind/dispel attempt.`,
when: [HERO_PHASE],
},
],
},
'Ride the Storm': {
effects: [
{
name: `Ride the Storm`,
desc: `Once per battle, before a friendly Aetheric Navigator garrisoned in a Skyvessel uses Aetherstorm, you can use this triumph. If used, add D6" to the Skyvessel's move characteristic and can also reroll run and charge rolls until the end of the turn.`,
when: [HERO_PHASE],
},
],
},
"The Gaffer's Motivation": {
effects: [
{
name: `The Gaffer's Motivation`,
desc: `Once per battle, you can pick 1 friendly Endrinmaster and use this triumph. You can use By Grungni, I Have My Eye On You! command ability without spending a command point. Add 1 to the number of wounds healed by the Endrinriggers unit.`,
when: [HERO_PHASE],
},
],
},
'Blow the Magazine': {
effects: [
{
name: `Blow the Magazine`,
desc: `Once per battle, when a Skyvessel garrisoning an Endrinmaster is destroyed, you can use this triumph. Roll a D6 and on a 1 nothing happens. On a 2-3 each enemy unit within 3" of the Skyvessel suffers 1 mortal wound. On a 4-5 the damage increases to D3 mortal wounds. On a 6, the damage increases to D6 mortal wounds. Proceed with Flying Transport rules as normal after this resolves.`,
when: [WOUND_ALLOCATION_PHASE],
},
],
},
}

export default tagAs(Triumphs, 'triumph')
4 changes: 1 addition & 3 deletions src/factions/slaanesh/scenery.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { tagAs } from 'factions/metatagger'
import { SceneryEffectLookup } from 'generic_rules/scenery'
import {
COMBAT_PHASE,
END_OF_MOVEMENT_PHASE,
SHOOTING_PHASE,
START_OF_HERO_PHASE,
START_OF_SETUP,
} from 'types/phases'
import { OBSTACLE } from 'types/terrain'

const Scenery = {
'Fane of Slaanesh': {
effects: [
...SceneryEffectLookup[OBSTACLE],
// ...SceneryEffectLookup[OBSTACLE],
{
name: `Fane of Slaanesh`,
desc: `After territories have been chosen, but before armies are set up, you can set up the Fane of Slaanesh wholly within your territory and more than 3" from any other terrain features or objectives. If both players can set up a terrain feature before territory selection, they must roll off with the winner placing first.`,
Expand Down
1 change: 1 addition & 0 deletions src/factions/temporaryAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const temporaryAdapter: TAdapter = (subFaction, subFactionName, FlavorTyp
BattleTraits: subFaction.effects,
CommandAbilities: mergeData(subFaction, 'command_abilities'),
CommandTraits: mergeData(subFaction, 'command_traits'),
CoreRules: mergeData(subFaction, 'core_rules'),
EndlessSpells: mergeData(subFaction, 'endless_spells'),
Flavors: mergeData(subFaction, 'flavors'),
FlavorType,
Expand Down
47 changes: 47 additions & 0 deletions src/generic_rules/artifacts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { TEntry } from 'types/data'
import { COMBAT_PHASE, HERO_PHASE, SAVES_PHASE, START_OF_HERO_PHASE } from 'types/phases'

// General artifacts from Core Rules 2021
const GenericArtifacts: TEntry[] = [
{
name: `Amulet of Destiny`,
effects: [
{
name: `Amulet of Destiny`,
desc: `The bearer has a ward of 5+.`,
when: [SAVES_PHASE],
},
],
},
{
name: `Vial of Manticore Venom`,
effects: [
{
name: `Vial of Manticore Venom`,
desc: `Pick 1 of the bearer's melee weapons. Add 1 to wound rolls for attacks made with that weapon.`,
when: [COMBAT_PHASE],
},
],
},
{
name: `Arcane Tome`,
effects: [
{
name: `Arcane Tome`,
desc: `The bearer becomes a Wizard that knows the Arcane Bolt and Mystic Shield spells. They can attempt to cast 1 spell in your hero phase and attempt to unbind 1 spell in the enemy hero phase. If the bearer is already a Wizard, they can attempt to cast 1 additional spell instead.`,
when: [HERO_PHASE],
},
],
},
{
name: `Seed of Rebirth`,
effects: [
{
name: `Seed of Rebirth`,
desc: `You can reroll heroic recovery rolls for the bearer.`,
when: [START_OF_HERO_PHASE],
},
],
},
]
export default GenericArtifacts
Loading

0 comments on commit 155e52c

Please sign in to comment.