@@ -617,6 +617,18 @@ $(".set-selector").change(function () {
617
617
} else {
618
618
formeObj . hide ( ) ;
619
619
}
620
+ if ( gen === 8 ) {
621
+ if ( pokemon . canGigantamax ) {
622
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxOnly' ) . hide ( ) ;
623
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxAndGigantamax' ) . show ( ) ;
624
+ } else {
625
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxOnly' ) . show ( ) ;
626
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxAndGigantamax' ) . hide ( ) ;
627
+ }
628
+ } else {
629
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxOnly' ) . hide ( ) ;
630
+ $ ( this ) . closest ( '.poke-info' ) . find ( '.dynamaxAndGigantamax' ) . hide ( ) ;
631
+ }
620
632
calcHP ( pokeObj ) ;
621
633
calcStats ( pokeObj ) ;
622
634
abilityObj . change ( ) ;
@@ -838,15 +850,17 @@ function createPokemon(pokeInfo) {
838
850
var ability = pokeInfo . find ( ".ability" ) . val ( ) ;
839
851
var item = pokeInfo . find ( ".item" ) . val ( ) ;
840
852
var isDynamaxed = pokeInfo . find ( ".max" ) . prop ( "checked" ) ;
841
- var isGigantamaxed = isDynamaxed && pokeInfo . find ( ".gmax" ) . prop ( "checked" ) ;
853
+ var isGigantamaxed = pokeInfo . find ( ".gmax" ) . prop ( "checked" ) ;
854
+ if ( isGigantamaxed ) {
855
+ pokeInfo . find ( ".max" ) . prop ( "checked" , true ) ;
856
+ isDynamaxed = pokeInfo . find ( ".max" ) . prop ( "checked" ) ;
857
+ }
842
858
var teraType = pokeInfo . find ( ".teraToggle" ) . is ( ":checked" ) ? pokeInfo . find ( ".teraType" ) . val ( ) : undefined ;
843
- pokeInfo . isDynamaxed = isDynamaxed ;
844
- pokeInfo . isGigantamaxed = isGigantamaxed ;
845
- if ( pokeInfo . isGigantamaxed ) pokeInfo . isDynamaxed = true ;
859
+ pokeInfo . isDynamaxed = isGigantamaxed ? 'gmax' : ! ! isDynamaxed ;
846
860
calcHP ( pokeInfo ) ;
847
861
var curHP = ~ ~ pokeInfo . find ( ".current-hp" ) . val ( ) ;
848
862
// FIXME the Pokemon constructor expects non-dynamaxed HP
849
- if ( isDynamaxed || isGigantamaxed ) curHP = Math . floor ( curHP / 2 ) ;
863
+ if ( pokeInfo . isDynamaxed ) curHP = Math . floor ( curHP / 2 ) ;
850
864
var types = [ pokeInfo . find ( ".type1" ) . val ( ) , pokeInfo . find ( ".type2" ) . val ( ) ] ;
851
865
return new calc . Pokemon ( gen , name , {
852
866
level : ~ ~ pokeInfo . find ( ".level" ) . val ( ) ,
@@ -866,10 +880,10 @@ function createPokemon(pokeInfo) {
866
880
status : CALC_STATUS [ pokeInfo . find ( ".status" ) . val ( ) ] ,
867
881
toxicCounter : status === 'Badly Poisoned' ? ~ ~ pokeInfo . find ( ".toxic-counter" ) . val ( ) : 0 ,
868
882
moves : [
869
- getMoveDetails ( pokeInfo . find ( ".move1" ) , name , ability , item , isDynamaxed , isGigantamaxed ) ,
870
- getMoveDetails ( pokeInfo . find ( ".move2" ) , name , ability , item , isDynamaxed , isGigantamaxed ) ,
871
- getMoveDetails ( pokeInfo . find ( ".move3" ) , name , ability , item , isDynamaxed , isGigantamaxed ) ,
872
- getMoveDetails ( pokeInfo . find ( ".move4" ) , name , ability , item , isDynamaxed , isGigantamaxed )
883
+ getMoveDetails ( pokeInfo . find ( ".move1" ) , name , ability , item , isDynamaxed ) ,
884
+ getMoveDetails ( pokeInfo . find ( ".move2" ) , name , ability , item , isDynamaxed ) ,
885
+ getMoveDetails ( pokeInfo . find ( ".move3" ) , name , ability , item , isDynamaxed ) ,
886
+ getMoveDetails ( pokeInfo . find ( ".move4" ) , name , ability , item , isDynamaxed )
873
887
] ,
874
888
overrides : {
875
889
baseStats : baseStats ,
@@ -885,7 +899,7 @@ function getGender(gender) {
885
899
return 'F' ;
886
900
}
887
901
888
- function getMoveDetails ( moveInfo , species , ability , item , useMax , isGmax ) {
902
+ function getMoveDetails ( moveInfo , species , ability , item , useMax ) {
889
903
var moveName = moveInfo . find ( "select.move-selector" ) . val ( ) ;
890
904
var isZMove = gen > 6 && moveInfo . find ( "input.move-z" ) . prop ( "checked" ) ;
891
905
var isCrit = moveInfo . find ( ".move-crit" ) . prop ( "checked" ) ;
@@ -899,7 +913,7 @@ function getMoveDetails(moveInfo, species, ability, item, useMax, isGmax) {
899
913
if ( gen >= 4 ) overrides . category = moveInfo . find ( ".move-cat" ) . val ( ) ;
900
914
return new calc . Move ( gen , moveName , {
901
915
ability : ability , item : item , useZ : isZMove , species : species , isCrit : isCrit , hits : hits , timesUsed : timesUsed ,
902
- timesUsedWithMetronome : timesUsedWithMetronome , overrides : overrides , useMax : useMax , isGmax : isGmax
916
+ timesUsedWithMetronome : timesUsedWithMetronome , overrides : overrides , useMax : useMax ,
903
917
} ) ;
904
918
}
905
919
@@ -996,7 +1010,7 @@ function calcStat(poke, StatID) {
996
1010
}
997
1011
// Shedinja still has 1 max HP during the effect even if its Dynamax Level is maxed (DaWoblefet)
998
1012
var total = calc . calcStat ( gen , legacyStatToStat ( StatID ) , base , ivs , evs , level , nature ) ;
999
- if ( gen > 7 && StatID === "hp" && ( poke . isDynamaxed || poke . isGigantamaxed ) && total !== 1 ) {
1013
+ if ( gen > 7 && StatID === "hp" && poke . isDynamaxed && total !== 1 ) {
1000
1014
total *= 2 ;
1001
1015
}
1002
1016
stat . find ( ".total" ) . text ( total ) ;
0 commit comments