From d1280f76eec7ad81f7378eee6b49e652d704f0c0 Mon Sep 17 00:00:00 2001 From: Leonard Craft III Date: Sat, 1 May 2021 23:38:48 -0500 Subject: [PATCH 1/2] Add FFA spread move modifier support --- calc/src/data/interface.ts | 2 +- calc/src/mechanics/gen78.ts | 3 ++- src/index.template.html | 7 +++++-- src/randoms.template.html | 7 +++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/calc/src/data/interface.ts b/calc/src/data/interface.ts index 192020a79..9f4b88fd2 100644 --- a/calc/src/data/interface.ts +++ b/calc/src/data/interface.ts @@ -12,7 +12,7 @@ export type SpeciesName = string & As<'SpeciesName'>; export type StatusName = 'slp' | 'psn' | 'brn' | 'frz' | 'par' | 'tox'; -export type GameType = 'Singles' | 'Doubles'; +export type GameType = 'Singles' | 'Doubles' | 'FFA'; export type Terrain = 'Electric' | 'Grassy' | 'Psychic' | 'Misty'; export type Weather = | 'Sand' | 'Sun' | 'Rain' | 'Hail' | 'Harsh Sunshine' | 'Heavy Rain' | 'Strong Winds'; diff --git a/calc/src/mechanics/gen78.ts b/calc/src/mechanics/gen78.ts index 4a307e1a6..92ac33f26 100644 --- a/calc/src/mechanics/gen78.ts +++ b/calc/src/mechanics/gen78.ts @@ -320,7 +320,8 @@ export function calculateSMSS( const isSpread = field.gameType !== 'Singles' && ['allAdjacent', 'allAdjacentFoes'].includes(move.target); if (isSpread) { - baseDamage = pokeRound(OF32(baseDamage * 3072) / 4096); + const spreadModifier = field.gameType === 'Doubles' ? 3072 : 2048; + baseDamage = pokeRound(OF32(baseDamage * spreadModifier) / 4096); } if (attacker.hasAbility('Parental Bond (Child)')) { diff --git a/src/index.template.html b/src/index.template.html index 853012ea9..9136f7c4b 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -631,12 +631,15 @@
Field -
+
Select the battle format. - + + + +
Select the current terrain. diff --git a/src/randoms.template.html b/src/randoms.template.html index 215f393c5..9b3eff7fd 100644 --- a/src/randoms.template.html +++ b/src/randoms.template.html @@ -645,12 +645,15 @@
Field -
+
Select the battle format. - + + + +
Select the current terrain. From 6004d5977457d44df7c8a4e1154224127579350f Mon Sep 17 00:00:00 2001 From: Leonard Craft III Date: Wed, 7 Jul 2021 21:24:49 -0500 Subject: [PATCH 2/2] Use Free-for-All instead of FFA --- calc/src/data/interface.ts | 2 +- src/index.template.html | 2 +- src/randoms.template.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/calc/src/data/interface.ts b/calc/src/data/interface.ts index 9f4b88fd2..eb4829e5d 100644 --- a/calc/src/data/interface.ts +++ b/calc/src/data/interface.ts @@ -12,7 +12,7 @@ export type SpeciesName = string & As<'SpeciesName'>; export type StatusName = 'slp' | 'psn' | 'brn' | 'frz' | 'par' | 'tox'; -export type GameType = 'Singles' | 'Doubles' | 'FFA'; +export type GameType = 'Singles' | 'Doubles' | 'Free-For-All'; export type Terrain = 'Electric' | 'Grassy' | 'Psychic' | 'Misty'; export type Weather = | 'Sand' | 'Sun' | 'Rain' | 'Hail' | 'Harsh Sunshine' | 'Heavy Rain' | 'Strong Winds'; diff --git a/src/index.template.html b/src/index.template.html index 9136f7c4b..bdfc32be9 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -638,7 +638,7 @@ - +
diff --git a/src/randoms.template.html b/src/randoms.template.html index 9b3eff7fd..41d973807 100644 --- a/src/randoms.template.html +++ b/src/randoms.template.html @@ -652,7 +652,7 @@ - +