Skip to content

Commit

Permalink
Add core battalions and remove them from the Core Rules section (#1295)
Browse files Browse the repository at this point in the history
* Add core battalions and remove them from the Core Rules section

* Update package.json
  • Loading branch information
daviseford authored Jun 22, 2021
1 parent 155e52c commit e229f4b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aos-reminders",
"version": "5.0.0",
"version": "5.0.1",
"private": true,
"homepage": "./",
"dependencies": {
Expand Down
67 changes: 67 additions & 0 deletions src/generic_rules/core_battalions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { TEntry } from 'types/data'
import {
CHARGE_PHASE,
COMBAT_PHASE,
MOVEMENT_PHASE,
SHOOTING_PHASE,
START_OF_HERO_PHASE,
START_OF_SETUP,
} from 'types/phases'
import { OneDropDeploymentEffect } from './core_rules'

const ExpertEffect = {
name: `Expert`,
desc: `Once per battle, 1 unit from this battalion can receive the All-out Attack or All-out Defence command without the command being issued and without a command point being spent.`,
when: [SHOOTING_PHASE, COMBAT_PHASE],
}
const MagnificentEffect = {
name: `Magnificent`,
desc: `When you pick enhancements for your army (see 27.3), you can pick 1 extra enhancement.`,
when: [START_OF_SETUP],
}
const SlayersEffect = {
name: `Slayers`,
desc: `Once per battle, 1 unit from this battalion can receive the All-out Attack or Unleash Hell command without the command being issued and without a command point being spent.`,
when: [SHOOTING_PHASE, COMBAT_PHASE, CHARGE_PHASE],
}
const StrategistsEffect = {
name: `Strategists`,
desc: `Once per battle, when you receive command points at the start of your hero phase, you can receive 1 extra command point.`,
when: [START_OF_HERO_PHASE],
}
const SwiftEffect = {
name: `Swift`,
desc: `Once per battle, 1 unit from this battalion can receive the At the Double or Forward to Victory command without the command being issued and without a command point being spent.`,
when: [MOVEMENT_PHASE],
}

// Core battalions from Core Rules 2021
const CoreBattalions: TEntry[] = [
{
name: 'Warlord',
effects: [StrategistsEffect, MagnificentEffect],
},

{
name: 'Battle Regiment',
effects: [OneDropDeploymentEffect],
},
{
name: 'Grand Battery',
effects: [SlayersEffect],
},
{
name: 'Vanguard',
effects: [SwiftEffect],
},
{
name: 'Linebreaker',
effects: [ExpertEffect],
},
{
name: 'Command Entourage',
effects: [],
},
]

export default CoreBattalions
41 changes: 9 additions & 32 deletions src/generic_rules/core_rules.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { TEntry } from 'types/data'
import {
BATTLESHOCK_PHASE,
CHARGE_PHASE,
COMBAT_PHASE,
DURING_GAME,
DURING_SETUP,
END_OF_CHARGE_PHASE,
END_OF_ROUND,
HERO_PHASE,
MOVEMENT_PHASE,
SHOOTING_PHASE,
START_OF_HERO_PHASE,
START_OF_ROUND,
START_OF_SETUP,
TURN_ONE_START_OF_TURN,
} from 'types/phases'

export const OneDropDeploymentEffect = {
name: `26.2.1 - One Drop Deployment`,
desc: `If a core battalion has the Unified icon, then after you set up a unit from the battalion, you must set up all of the other units from the battalion, one after the other, and you are not allowed to set up units that are not part of the battalion until all of the units in the battalion have been set up. In addition, if the set-up instructions for a battle say that the players must alternate setting up units one at a time, then after you set up a unit from the battalion, you must set up all of the other units from the battalion, one after the other, before your opponent is allowed to set up another unit.`,
when: [DURING_SETUP],
}

const CoreRules: TEntry[] = [
{
name: 'Unit Coherency',
Expand Down Expand Up @@ -225,34 +228,8 @@ const CoreRules: TEntry[] = [
},

{
name: 'Battalion Abilities',
effects: [
{
name: `Expert`,
desc: `Once per battle, 1 unit from this battalion can receive the All-out Attack or All-out Defence command without the command being issued and without a command point being spent.`,
when: [SHOOTING_PHASE, COMBAT_PHASE],
},
{
name: `Magnificent`,
desc: `When you pick enhancements for your army (see 27.3), you can pick 1 extra enhancement.`,
when: [START_OF_SETUP],
},
{
name: `Slayers`,
desc: `Once per battle, 1 unit from this battalion can receive the All-out Attack or Unleash Hell command without the command being issued and without a command point being spent.`,
when: [SHOOTING_PHASE, COMBAT_PHASE, CHARGE_PHASE],
},
{
name: `Strategists`,
desc: `Once per battle, when you receive command points at the start of your hero phase, you can receive 1 extra command point.`,
when: [START_OF_HERO_PHASE],
},
{
name: `Swift`,
desc: `Once per battle, 1 unit from this battalion can receive the At the Double or Forward to Victory command without the command being issued and without a command point being spent.`,
when: [MOVEMENT_PHASE],
},
],
name: 'One Drop Deployment',
effects: [OneDropDeploymentEffect],
},

// {
Expand Down
2 changes: 2 additions & 0 deletions src/generic_rules/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import GenericCommandAbilities from './command_abilities'
import GenericCommandTraits from './command_traits'
import CoreBattalions from './core_battalions'
import CoreRules from './core_rules'
import GenericEndlessSpells from './endless_spells'
import RealmscapeArtifacts from './realmscape_artifacts'
Expand All @@ -13,6 +14,7 @@ import GenericTriumphs from './triumphs'
// This file is used for data re-used across any army.
export {
CoreRules,
CoreBattalions,
GenericCommandAbilities,
GenericCommandTraits,
GenericEndlessSpells,
Expand Down
8 changes: 7 additions & 1 deletion src/utils/getArmy/modify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
AvailableOrderUnits,
} from 'factions/grand_alliances'
import {
CoreBattalions,
GenericCommandAbilities,
GenericCommandTraits,
GenericEndlessSpells,
Expand All @@ -28,7 +29,12 @@ const modifyFlavors = (flavors: TEntry[], Collection: TCollection): TEntry[] =>
return uniqBy(sortBy(flavors.concat(Collection.Flavors), 'name'), 'name')
}
const modifyBattalions = (battalions: TEntry[], Collection: TCollection): TEntry[] => {
return uniqBy(sortBy(battalions.concat(Collection.Battalions), 'name'), 'name')
return uniqBy(
sortBy(CoreBattalions, 'name')
.concat(sortBy(battalions.concat(Collection.Battalions), 'name'))
.map(u => ({ ...u, battalion: true })),
'name'
)
}

const modifyUnits = (
Expand Down

0 comments on commit e229f4b

Please sign in to comment.