@@ -16,7 +16,7 @@ import { pokemonFormChanges } from "#app/data/pokemon-forms";
16
16
import type { LevelMoves } from "#app/data/balance/pokemon-level-moves" ;
17
17
import { pokemonFormLevelMoves , pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves" ;
18
18
import type PokemonSpecies from "#app/data/pokemon-species" ;
19
- import { allSpecies , getPokemonSpeciesForm } from "#app/data/pokemon-species" ;
19
+ import { allSpecies , getPokemonSpeciesForm , normalForm } from "#app/data/pokemon-species" ;
20
20
import { getStarterValueFriendshipCap , speciesStarterCosts } from "#app/data/balance/starters" ;
21
21
import { starterPassiveAbilities } from "#app/data/balance/passives" ;
22
22
import { Type } from "#enums/type" ;
@@ -383,7 +383,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
383
383
this . pokemonHatchedIcon . setScale ( 0.8 ) ;
384
384
this . pokemonCaughtHatchedContainer . add ( this . pokemonHatchedIcon ) ;
385
385
386
- this . pokemonShinyIcon = globalScene . add . sprite ( 14 , 76 , "shiny_icons" ) ;
386
+ this . pokemonShinyIcon = globalScene . add . sprite ( 14 , 117 , "shiny_icons" ) ;
387
387
this . pokemonShinyIcon . setOrigin ( 0.15 , 0.2 ) ;
388
388
this . pokemonShinyIcon . setScale ( 1 ) ;
389
389
this . pokemonCaughtHatchedContainer . add ( this . pokemonShinyIcon ) ;
@@ -601,7 +601,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
601
601
const form = species . forms [ formIndex ] ;
602
602
603
603
// If this form has a specific set of moves, we get them.
604
- this . levelMoves = ( formIndex > 0 && pokemonFormLevelMoves . hasOwnProperty ( formIndex ) ) ? pokemonFormLevelMoves [ species . speciesId ] [ formIndex ] : pokemonSpeciesLevelMoves [ species . speciesId ] ;
604
+ this . levelMoves = ( formIndex > 0 && pokemonFormLevelMoves . hasOwnProperty ( species . speciesId ) && pokemonFormLevelMoves [ species . speciesId ] . hasOwnProperty ( formIndex ) ) ? pokemonFormLevelMoves [ species . speciesId ] [ formIndex ] : pokemonSpeciesLevelMoves [ species . speciesId ] ;
605
605
this . ability1 = form . ability1 ;
606
606
this . ability2 = ( form . ability2 === form . ability1 ) ? undefined : form . ability2 ;
607
607
this . abilityHidden = ( form . abilityHidden === form . ability1 ) ? undefined : form . abilityHidden ;
@@ -741,14 +741,16 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
741
741
return biomes ;
742
742
}
743
743
744
- isCaught ( otherSpeciesDexEntry ?: DexEntry ) : bigint {
744
+ isCaught ( otherSpecies ?: PokemonSpecies ) : bigint {
745
745
if ( globalScene . dexForDevs ) {
746
746
return 255n ;
747
747
}
748
748
749
- const dexEntry = otherSpeciesDexEntry ? otherSpeciesDexEntry : this . speciesStarterDexEntry ;
749
+ const species = otherSpecies ? otherSpecies : this . species ;
750
+ const dexEntry = globalScene . gameData . dexData [ species . speciesId ] ;
751
+ const starterDexEntry = globalScene . gameData . dexData [ this . getStarterSpeciesId ( species . speciesId ) ] ;
750
752
751
- return dexEntry ?. caughtAttr ?? 0n ;
753
+ return ( dexEntry ?. caughtAttr ?? 0n ) & ( starterDexEntry ?. caughtAttr ?? 0n ) & species . getFullUnlocksData ( ) ;
752
754
}
753
755
/**
754
756
* Check whether a given form is caught for a given species.
@@ -765,11 +767,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
765
767
}
766
768
const species = otherSpecies ? otherSpecies : this . species ;
767
769
const formIndex = otherFormIndex !== undefined ? otherFormIndex : this . formIndex ;
768
- const dexEntry = globalScene . gameData . dexData [ species . speciesId ] ;
770
+ const caughtAttr = this . isCaught ( species ) ;
769
771
770
- const isFormCaught = dexEntry ?
771
- ( dexEntry . caughtAttr & globalScene . gameData . getFormAttr ( formIndex ?? 0 ) ) > 0n
772
- : false ;
772
+ const isFormCaught = ( caughtAttr & globalScene . gameData . getFormAttr ( formIndex ?? 0 ) ) > 0n ;
773
773
return isFormCaught ;
774
774
}
775
775
@@ -783,8 +783,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
783
783
*/
784
784
initStarterPrefs ( ) : StarterAttributes {
785
785
const starterAttributes : StarterAttributes | null = this . species ? { ...this . savedStarterAttributes } : null ;
786
- const dexEntry = globalScene . gameData . dexData [ this . species . speciesId ] ;
787
- const caughtAttr = this . isCaught ( dexEntry ) ;
786
+ const caughtAttr = this . isCaught ( ) ;
788
787
789
788
// no preferences or Pokemon wasn't caught, return empty attribute
790
789
if ( ! starterAttributes || ! caughtAttr ) {
@@ -1235,7 +1234,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
1235
1234
1236
1235
case MenuOptions . BIOMES :
1237
1236
1238
- if ( ! ( this . isCaught ( ) || this . speciesStarterDexEntry ?. seenAttr ) ) {
1237
+ if ( ! ( isCaught || this . speciesStarterDexEntry ?. seenAttr ) ) {
1239
1238
error = true ;
1240
1239
} else {
1241
1240
this . blockInput = true ;
@@ -1372,8 +1371,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
1372
1371
} ) ;
1373
1372
this . evolutions . map ( evo => {
1374
1373
const evoSpecies = allSpecies . find ( species => species . speciesId === evo . speciesId ) ;
1375
- const evoSpeciesStarterDexEntry = evoSpecies ? globalScene . gameData . dexData [ evoSpecies . speciesId ] : undefined ;
1376
- const isCaughtEvo = this . isCaught ( evoSpeciesStarterDexEntry ) ? true : false ;
1374
+ const isCaughtEvo = this . isCaught ( evoSpecies ) ? true : false ;
1377
1375
// Attempts to find the formIndex of the evolved species
1378
1376
const newFormKey = evo . evoFormKey ? evo . evoFormKey : ( this . species . forms . length > 0 ? this . species . forms [ this . formIndex ] . formKey : "" ) ;
1379
1377
const matchingForm = evoSpecies ?. forms . find ( form => form . formKey === newFormKey ) ;
@@ -1535,6 +1533,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
1535
1533
this . pokemonShinyIcon . setVisible ( true ) ;
1536
1534
1537
1535
starterAttributes . shiny = true ;
1536
+ this . savedStarterAttributes . shiny = starterAttributes . shiny ;
1538
1537
} else {
1539
1538
let newVariant = props . variant ;
1540
1539
do {
@@ -1688,7 +1687,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
1688
1687
}
1689
1688
this . pokemonCandyCountText . setText ( `x${ starterData . candyCount } ` ) ;
1690
1689
1691
- const egg = new Egg ( { scene : globalScene , species : this . species . speciesId , sourceType : EggSourceType . SAME_SPECIES_EGG } ) ;
1690
+ const egg = new Egg ( { scene : globalScene , species : this . starterId , sourceType : EggSourceType . SAME_SPECIES_EGG } ) ;
1692
1691
egg . addEggToGameData ( ) ;
1693
1692
1694
1693
globalScene . gameData . saveSystem ( ) . then ( success => {
@@ -1856,6 +1855,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
1856
1855
if ( this . canCycleGender ) {
1857
1856
this . updateButtonIcon ( SettingKeyboard . Button_Cycle_Gender , gamepadType , this . genderIconElement , this . genderLabel ) ;
1858
1857
}
1858
+ } else {
1859
+ // Making space for "Uncaught" text
1860
+ this . instructionRowY += 8 ;
1859
1861
}
1860
1862
if ( this . canCycleForm ) {
1861
1863
this . updateButtonIcon ( SettingKeyboard . Button_Cycle_Form , gamepadType , this . formIconElement , this . formLabel ) ;
@@ -2093,7 +2095,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
2093
2095
if ( species ) {
2094
2096
const dexEntry = globalScene . gameData . dexData [ species . speciesId ] ;
2095
2097
2096
- const caughtAttr = this . isCaught ( dexEntry ) ;
2098
+ const caughtAttr = this . isCaught ( species ) ;
2097
2099
2098
2100
if ( ! caughtAttr ) {
2099
2101
const props = this . starterAttributes ;
@@ -2240,13 +2242,11 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
2240
2242
this . pokemonCandyContainer . setVisible ( true ) ;
2241
2243
2242
2244
if ( pokemonPrevolutions . hasOwnProperty ( species . speciesId ) ) {
2243
- this . pokemonShinyIcon . setY ( 135 ) ;
2244
2245
this . pokemonShinyIcon . setFrame ( getVariantIcon ( variant ) ) ;
2245
2246
this . pokemonHatchedIcon . setVisible ( false ) ;
2246
2247
this . pokemonHatchedCountText . setVisible ( false ) ;
2247
2248
this . pokemonFormText . setY ( 36 ) ;
2248
2249
} else {
2249
- this . pokemonShinyIcon . setY ( 117 ) ;
2250
2250
this . pokemonHatchedIcon . setVisible ( true ) ;
2251
2251
this . pokemonHatchedCountText . setVisible ( true ) ;
2252
2252
this . pokemonFormText . setY ( 42 ) ;
@@ -2276,7 +2276,12 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
2276
2276
if ( isFormCaught || isFormSeen ) {
2277
2277
const speciesForm = getPokemonSpeciesForm ( species . speciesId , formIndex ! ) ; // TODO: is the bang correct?
2278
2278
this . setTypeIcons ( speciesForm . type1 , speciesForm . type2 ) ;
2279
- this . pokemonFormText . setText ( species . getFormNameToDisplay ( formIndex ) ) ;
2279
+ // TODO: change this once forms are refactored
2280
+ if ( normalForm . includes ( species . speciesId ) && ! formIndex ) {
2281
+ this . pokemonFormText . setText ( "" ) ;
2282
+ } else {
2283
+ this . pokemonFormText . setText ( species . getFormNameToDisplay ( formIndex ) ) ;
2284
+ }
2280
2285
this . pokemonFormText . setVisible ( true ) ;
2281
2286
if ( ! isFormCaught ) {
2282
2287
this . pokemonFormText . setY ( 18 ) ;
@@ -2321,7 +2326,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
2321
2326
*/
2322
2327
getCurrentDexProps ( speciesId : number ) : bigint {
2323
2328
let props = 0n ;
2324
- const caughtAttr = globalScene . gameData . dexData [ speciesId ] . caughtAttr ;
2329
+ const species = allSpecies . find ( sp => sp . speciesId === speciesId ) ;
2330
+ const caughtAttr = globalScene . gameData . dexData [ speciesId ] . caughtAttr & globalScene . gameData . dexData [ this . getStarterSpeciesId ( speciesId ) ] . caughtAttr & ( species ?. getFullUnlocksData ( ) ?? 0n ) ;
2325
2331
2326
2332
/* this checks the gender of the pokemon; this works by checking a) that the starter preferences for the species exist, and if so, is it female. If so, it'll add DexAttr.FEMALE to our temp props
2327
2333
* It then checks b) if the caughtAttr for the pokemon is female and NOT male - this means that the ONLY gender we've gotten is female, and we need to add DexAttr.FEMALE to our temp props
0 commit comments