Skip to content

Commit

Permalink
Berry (Juice/Sweet) are unaffected by Natural Gift (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrianshChari authored Feb 14, 2024
1 parent c2cec7d commit c877bc7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion calc/src/mechanics/gen4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function calculateDPP(
desc.moveBP = basePower;
} else if (move.named('Judgment') && attacker.item && attacker.item.includes('Plate')) {
move.type = getItemBoostType(attacker.item)!;
} else if (move.named('Natural Gift') && attacker.item && attacker.item.includes('Berry')) {
} else if (move.named('Natural Gift') && attacker.item?.endsWith('Berry')) {
const gift = getNaturalGift(gen, attacker.item)!;
move.type = gift.t;
move.bp = gift.p;
Expand Down
2 changes: 1 addition & 1 deletion calc/src/mechanics/gen56.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function calculateBWXY(
move.type = getItemBoostType(attacker.item)!;
} else if (move.named('Techno Blast') && attacker.item && attacker.item.includes('Drive')) {
move.type = getTechnoBlast(attacker.item)!;
} else if (move.named('Natural Gift') && attacker.item && attacker.item.includes('Berry')) {
} else if (move.named('Natural Gift') && attacker.item?.endsWith('Berry')) {
const gift = getNaturalGift(gen, attacker.item)!;
move.type = gift.t;
move.bp = gift.p;
Expand Down
4 changes: 2 additions & 2 deletions calc/src/mechanics/gen789.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function calculateSMSSSV(
type = getTechnoBlast(attacker.item)!;
} else if (move.named('Multi-Attack') && attacker.item && attacker.item.includes('Memory')) {
type = getMultiAttack(attacker.item)!;
} else if (move.named('Natural Gift') && attacker.item && attacker.item.includes('Berry')) {
} else if (move.named('Natural Gift') && attacker.item?.endsWith('Berry')) {
const gift = getNaturalGift(gen, attacker.item)!;
type = gift.t;
desc.moveType = type;
Expand Down Expand Up @@ -826,7 +826,7 @@ export function calculateBasePowerSMSSSV(
desc.moveBP = basePower;
break;
case 'Natural Gift':
if (attacker.item?.includes('Berry')) {
if (attacker.item?.endsWith('Berry')) {
const gift = getNaturalGift(gen, attacker.item)!;
basePower = gift.p;
desc.attackerItem = attacker.item;
Expand Down

0 comments on commit c877bc7

Please sign in to comment.