Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Super Fang & Ruination #576

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b40efad
included damages for super fang
ForwardFeed Aug 23, 2023
efbbb0f
included previous gens, and gen one hit ghosts
ForwardFeed Aug 23, 2023
90024d1
Added a fix where the move nature power was overwritting the nature t…
ForwardFeed Aug 25, 2023
2b53d0f
quick text fix, thanks for pointing it out
ForwardFeed Oct 13, 2023
4e1e2fa
ups, eslint
ForwardFeed Oct 13, 2023
c239793
Update sets
monsanto Aug 24, 2023
e4cd27e
Update sets
monsanto Aug 28, 2023
d674289
Update sets
monsanto Sep 3, 2023
8331869
Fix Gen 6 rands calc
KrisXV Sep 6, 2023
1febdfa
Update template
KrisXV Sep 6, 2023
717bf06
Update sets
monsanto Sep 8, 2023
e76a352
Update sets
monsanto Sep 14, 2023
4d53b56
Add Teal Mask DLC data
thejetou Sep 14, 2023
937a130
Add more Teal Mask DLC data
thejetou Sep 14, 2023
71aee62
Support Mind's Eye
thejetou Sep 14, 2023
c8f7aed
Support Fairy Feather
thejetou Sep 14, 2023
eff650d
Support Ogerpon
thejetou Sep 14, 2023
1334562
Support Ivy Cudgel
thejetou Sep 14, 2023
de99a8f
Remove console.log
thejetou Sep 15, 2023
53f5e42
Update @pkmn/dex
thejetou Sep 15, 2023
e18b638
Fix typo that prevents blank sets from having default abilities (#574)
FomTarro Sep 15, 2023
253a0a5
Remove unused code
thejetou Sep 15, 2023
9ffe5c4
Fix checkEmbody
thejetou Sep 15, 2023
2d52226
Fix Ogerpon UI edge case
thejetou Sep 15, 2023
626cfc7
Implement Ogerpon's move boost
thejetou Sep 15, 2023
141c637
Add Big Nugget's fling damage
thejetou Sep 15, 2023
aade01c
Update sets
monsanto Sep 19, 2023
a9b4b3d
Dipplin is affected by Eviolite
thejetou Sep 20, 2023
e741861
Improve Protosynthesis/QP auto selection (#546)
Ericzklm Sep 22, 2023
6aa0eea
More Booster Energy improvements
thejetou Sep 22, 2023
52ee339
Implement multihit moves properly
thejetou Sep 22, 2023
144d41a
Tests: Run Gen 9 tests by default
thejetou Sep 22, 2023
cf9d7bb
Fix critical multihit attacks
thejetou Sep 23, 2023
5580611
Show Stamina & Weak Armor in desc
thejetou Sep 23, 2023
a49a205
Update sets
monsanto Sep 25, 2023
c844f08
Fix more multihit bugs
thejetou Sep 25, 2023
354ce04
Add a calculateBaseDamage func
thejetou Sep 27, 2023
fb68876
Update sets
monsanto Sep 27, 2023
f062a32
Fix multihit/multiattack when boosts already exist
thejetou Sep 29, 2023
9983bf2
v0.8.0
thejetou Sep 29, 2023
0483b0b
Update sets
monsanto Oct 2, 2023
09d5819
Fix "No matches found" in dark mode (#580)
shrianshChari Oct 3, 2023
4ff2635
Support Loaded Dice in the UI
thejetou Oct 4, 2023
89d01b9
Update sets
monsanto Oct 5, 2023
e2aa5ac
Implement default level selection (#573)
DimK19 Oct 6, 2023
13e5a9a
Improve appearance of click-to-copy confirmation message (#579)
DimK19 Oct 6, 2023
226dcd7
Remove duplicate spaces in the calc description (#570)
shrianshChari Oct 6, 2023
1d016ff
Remove Enigma Berry from GSC only list (#569)
shrianshChari Oct 6, 2023
894a5f0
Bump word-wrap from 1.2.3 to 1.2.4 in /calc (#566)
dependabot[bot] Oct 6, 2023
460e753
Bump word-wrap from 1.2.3 to 1.2.4 (#565)
dependabot[bot] Oct 6, 2023
6e3f932
Bump word-wrap from 1.2.3 to 1.2.4 in /import (#564)
dependabot[bot] Oct 6, 2023
4076b32
Bump semver from 6.3.0 to 6.3.1 (#561)
dependabot[bot] Oct 6, 2023
30e5518
UI: Fix Loaded Dice & Skill Link
thejetou Oct 6, 2023
1c8c382
Fix Spectral Thief behavior (#575)
AWildNoob Oct 7, 2023
07328a7
Gen 4: Fix Klutz not dropping Speed from Iron Ball (#562)
shrianshChari Oct 7, 2023
b44f0ac
Update @pkmn/dex & package-lock.json (#581)
shrianshChari Oct 7, 2023
f7d49b5
Import Palafin sets into Palafin-Hero (#582)
shrianshChari Oct 7, 2023
89f6fc2
Update sets
monsanto Oct 10, 2023
aab1c21
Introduce a smoke tester
thejetou Oct 13, 2023
f6b2ee9
Fix Gen 5 Randoms damage calc
KrisXV Oct 14, 2023
fc8ee14
Update sets
monsanto Oct 14, 2023
1ba2a46
Heatproof is an attack modifier in SV
thejetou Oct 17, 2023
65f79ba
Bump @babel/traverse from 7.20.12 to 7.23.2 in /calc (#583)
dependabot[bot] Oct 18, 2023
ec20f8c
Bump @babel/traverse from 7.21.2 to 7.23.2 (#584)
dependabot[bot] Oct 18, 2023
a26de83
Update sets
monsanto Oct 19, 2023
6b933d5
Update sets
monsanto Oct 24, 2023
78ab355
Add VGC2023 Regulation E
monsanto Oct 28, 2023
5e32c5b
Update sets
monsanto Oct 28, 2023
e929667
Merge remote-tracking branch 'upstream/master'
ForwardFeed Oct 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions calc/src/mechanics/gen12.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be missing something but if defender.curHP() === 1, doesn't that mean lostHP === 0?

Super Fang should always do 1 damage at least, and will knock out a Pokemon with 1 HP.

Copy link
Collaborator

@thejetou thejetou Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but Math.floor(1 / 2) || 1 equals to 0 || 1 which evaluates to 1.

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export function calculateRBYGSC(
}
}

// In Gen 1, Super Fang can hit Ghost types
if (gen.num === 1 && (move.named('Super Fang'))) {
const lostHP = Math.floor(defender.curHP() / 2) || 1;
result.damage = lostHP;
return result;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Gen 2, you should check if the opposing Pokemon can be hit by Super Fang (probably by getMoveEffectiveness) and run the calculation if so.

And also check if the opposing Pokemon has Protect up just like it's done in gen789.ts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In gen 2 the check for Super fang pass after the check of type effectiveness.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same goes for the field.defenderSide.isProtected check, so as far i can tell, there is no issue with that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In gen 2 the check for Super fang pass after the check of type effectiveness.

In Gen 2 Super Fang doesn't seem to be ran though.

The same goes for the field.defenderSide.isProtected check, so as far i can tell, there is no issue with that.

Yeah there is no issue there. My bad.


const type1Effectiveness =
getMoveEffectiveness(gen, move, firstDefenderType, field.defenderSide.isForesight);
Expand Down
6 changes: 6 additions & 0 deletions calc/src/mechanics/gen3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ export function calculateADV(

desc.HPEVs = `${defender.evs.hp} HP`;

if (move.named('Super Fang')) {
thejetou marked this conversation as resolved.
Show resolved Hide resolved
const lostHP = Math.floor(defender.curHP() / 2) || 1;
result.damage = lostHP;
return result;
}

const fixedDamage = handleFixedDamageMoves(attacker, move);
if (fixedDamage) {
result.damage = fixedDamage;
Expand Down
6 changes: 6 additions & 0 deletions calc/src/mechanics/gen4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ export function calculateDPP(

desc.HPEVs = `${defender.evs.hp} HP`;

if (move.named('Super Fang')) {
const lostHP = Math.floor(defender.curHP() / 2) || 1;
result.damage = lostHP;
return result;
}

const fixedDamage = handleFixedDamageMoves(attacker, move);
if (fixedDamage) {
result.damage = fixedDamage;
Expand Down
6 changes: 6 additions & 0 deletions calc/src/mechanics/gen56.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ export function calculateBWXY(

desc.HPEVs = `${defender.evs.hp} HP`;

if (move.named('Super Fang')) {
const lostHP = Math.floor(defender.curHP() / 2) || 1;
result.damage = lostHP;
return result;
}

const fixedDamage = handleFixedDamageMoves(attacker, move);
if (fixedDamage) {
if (attacker.hasAbility('Parental Bond')) {
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 @@ -400,8 +400,8 @@ export function calculateSMSSSV(
return result;
}

if (move.named('Nature\'s Madness')) {
const lostHP = field.defenderSide.isProtected ? 0 : Math.floor(defender.curHP() / 2);
if (move.named('Nature\'s Madness', 'Super Fang', 'Ruination')) {
const lostHP = field.defenderSide.isProtected ? 0 : Math.floor(defender.curHP() / 2) || 1;
result.damage = lostHP;
return result;
}
Expand Down
1 change: 0 additions & 1 deletion calc/src/mechanics/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ export function handleFixedDamageMoves(attacker: Pokemon, move: Move) {
}
return 0;
}

// Game Freak rounds DOWN on .5
export function pokeRound(num: number) {
return num % 1 > 0.5 ? Math.ceil(num) : Math.floor(num);
Expand Down
2 changes: 1 addition & 1 deletion src/js/moveset_import.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function getStats(currentPoke, rows, offset) {
}

currentNature = rows[x] ? rows[x].trim().split(" ") : '';
if (currentNature[1] == "Nature") {
if (currentNature[1] == "Nature" && currentNature[2] !== "Power") { // edge case with the move nature power that overwrite nature)
currentPoke.nature = currentNature[0];
}
}
Expand Down