Skip to content

Commit

Permalink
Flower Gift should stack with Huge Power (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrianshChari authored Jul 24, 2024
1 parent 534259c commit a22478f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
11 changes: 7 additions & 4 deletions calc/src/mechanics/gen4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,6 @@ export function calculateAttackDPP(
attack = Math.floor(attack * 1.5);
desc.attackerAbility = attacker.ability;
desc.weather = field.weather;
} else if (field.attackerSide.isFlowerGift && field.hasWeather('Sun') && isPhysical) {
attack = Math.floor(attack * 1.5);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
} else if (
(isPhysical &&
(attacker.hasAbility('Hustle') || (attacker.hasAbility('Guts') && attacker.status)) ||
Expand All @@ -518,6 +514,13 @@ export function calculateAttackDPP(
desc.attackerAbility = attacker.ability;
}

if (field.attackerSide.isFlowerGift && !attacker.hasAbility('Flower Gift') &&
field.hasWeather('Sun') && isPhysical) {
attack = Math.floor(attack * 1.5);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
}

if ((isPhysical ? attacker.hasItem('Choice Band') : attacker.hasItem('Choice Specs')) ||
(!isPhysical && attacker.hasItem('Soul Dew') && attacker.named('Latios', 'Latias'))) {
attack = Math.floor(attack * 1.5);
Expand Down
17 changes: 10 additions & 7 deletions calc/src/mechanics/gen56.ts
Original file line number Diff line number Diff line change
Expand Up @@ -849,13 +849,6 @@ export function calculateAtModsBWXY(
atMods.push(6144);
desc.attackerAbility = attacker.ability;
desc.weather = field.weather;
} else if (
field.attackerSide.isFlowerGift &&
field.hasWeather('Sun', 'Harsh Sunshine') &&
move.category === 'Physical') {
atMods.push(6144);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
} else if (
(attacker.hasAbility('Defeatist') && attacker.curHP() <= attacker.maxHP() / 2) ||
(attacker.hasAbility('Slow Start') && attacker.abilityOn && move.category === 'Physical')
Expand All @@ -867,6 +860,16 @@ export function calculateAtModsBWXY(
desc.attackerAbility = attacker.ability;
}

if (
field.attackerSide.isFlowerGift &&
!attacker.hasAbility('Flower Gift') &&
field.hasWeather('Sun', 'Harsh Sunshine') &&
move.category === 'Physical') {
atMods.push(6144);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
}

if ((attacker.hasItem('Thick Club') &&
attacker.named('Cubone', 'Marowak', 'Marowak-Alola') &&
move.category === 'Physical') ||
Expand Down
17 changes: 10 additions & 7 deletions calc/src/mechanics/gen789.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,13 +1326,6 @@ export function calculateAtModsSMSSSV(
!attacker.isDynamaxed)) {
atMods.push(6144);
desc.attackerAbility = attacker.ability;
} else if (
field.attackerSide.isFlowerGift &&
field.hasWeather('Sun', 'Harsh Sunshine') &&
move.category === 'Physical') {
atMods.push(6144);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
} else if (
(attacker.hasAbility('Guts') && attacker.status && move.category === 'Physical') ||
(attacker.curHP() <= attacker.maxHP() / 3 &&
Expand Down Expand Up @@ -1368,6 +1361,16 @@ export function calculateAtModsSMSSSV(
desc.attackerAbility = attacker.ability;
}

if (
field.attackerSide.isFlowerGift &&
!attacker.hasAbility('Flower Gift') &&
field.hasWeather('Sun', 'Harsh Sunshine') &&
move.category === 'Physical') {
atMods.push(6144);
desc.weather = field.weather;
desc.isFlowerGiftAttacker = true;
}

if ((defender.hasAbility('Thick Fat') && move.hasType('Fire', 'Ice')) ||
(defender.hasAbility('Water Bubble') && move.hasType('Fire')) ||
(defender.hasAbility('Purifying Salt') && move.hasType('Ghost'))) {
Expand Down

0 comments on commit a22478f

Please sign in to comment.