Skip to content

Commit

Permalink
Identify duplicate effects and consolidate them (#1347)
Browse files Browse the repository at this point in the history
* Fix army structure in verify script

The change from Army to AggregateArmy seems to be required

The change from keys with a lookup to using values directly was just a
nice to have

* Only console log each warning once

* Add description duplication check to verify script

* Group by more info, use effect id to ignore

Now matches on phase and name as well as description
Introduces an optional `id` to effect, that is then used for ignoring
(excluding from the input) effects that are seen multiple times but can
all be traced back to the same effect id

* Remove effect name from info

We added it to to matchBy, so it can already be seen in the output

* Add wanderers hornblower effect

* Fix mistakes in Sisters of the Thorn wizard rule

* Add wanderers standard bearer effect

* Add magister magic effect, and id to magic touched effect

* Sylvaneth and Tomb Kings

* Avoid adding from the same units again

eg Stormcast units will often appear a couple of times, so we should
avoid indicating that they have duplicate effects with themselves

* Switch entries array to objects

* Add identifiers to existing split-out effects

* Pull out Stormcast effects

* Calculate all ids in case we want to verify these

We should want to check that each id is only defined once in the code
but that will need either file recursion and reading in, or shelling out
to grep

* Soulblight

* Seraphon, Skaven, Slaves to Darkness

* Replace `id` with `shared`

Simpler

* OBR effects

* Ogors and wood elves

* Ogors and legacy Order stuff

* More effects

* More Nurgle and Slaanesh effects

* More Slaanesh

* OBR / Soulblight / LoN effects

* Blood and anger

* So many effects

* Is it... over...?

---

Yes, it is! Fixes #1338
  • Loading branch information
exonian authored Jul 8, 2021
1 parent 50b18ce commit cf2decb
Show file tree
Hide file tree
Showing 44 changed files with 913 additions and 821 deletions.
11 changes: 6 additions & 5 deletions src/factions/beasts_of_chaos/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,31 @@ const InfuseWithBestialVigorEffect = {
name: `Infuse with Bestial Vigour`,
desc: `At the start of your movement phase, add 3" to the Move characteristic of models in friendly BRAYHERD units wholly within 12" of any friendly GREAT BRAY-SHAMANS until the end of that phase.`,
when: [START_OF_MOVEMENT_PHASE],
shared: true,
}
const BloodgreedEffect = {
name: `Bloodgreed`,
desc: `Each unmodified wound roll of 6 for attacks made by this unit inflicts 1 mortal wound on the target in addition to any normal damage.`,
when: [COMBAT_PHASE],
shared: true,
}
const BannerBearerEffect = {
name: `Banner Bearer`,
desc: `A unit that includes any Banner Bearers can move an extra 1" when it runs or piles in.`,
when: [COMBAT_PHASE, MOVEMENT_PHASE],
shared: true,
}
const BrayhornEffect = {
name: `Brayhorn`,
desc: `A unit that includes any Brayhorns can run and still charge later in the same turn.`,
when: [MOVEMENT_PHASE, CHARGE_PHASE],
shared: true,
}
const DespoilersEffect = {
name: `Despoilers`,
desc: `Add 1 to hit rolls for attacks made by this unit that target enemy units with 10 or more models. In addition, you can reroll hit rolls of 1 for attacks by this unit that target ORDER units.`,
when: [COMBAT_PHASE],
shared: true,
}

const Units = {
Expand Down Expand Up @@ -425,16 +430,12 @@ const Units = {
when: [START_OF_HERO_PHASE],
},
BrayhornEffect,
GenericEffects.ArcaniteShieldEffect,
{
name: `Destined Mayhem`,
desc: `Add 1 to wound rolls for attacks made by this unit with melee weapons while this unit is wholly within 12" of any friendly ARCANITE HEROES.`,
when: [COMBAT_PHASE],
},
{
name: `Arcanite Shield`,
desc: `Roll a D6 each time you allocate a wound or mortal wound to a unit that has any models armed with Arcanite Shields. On a 6, that wound or mortal wound is negated. When you allocate wounds or mortal wounds to this unit, you must allocate them to a model armed with an Arcanite Shield if it is possible to do so.`,
when: [WOUND_ALLOCATION_PHASE],
},
{
name: `Paired Savage Blades`,
desc: `Add 1 to hit rolls for attacks made with a pair of Savage Blades.`,
Expand Down
Loading

0 comments on commit cf2decb

Please sign in to comment.