Commit graph

182 commits

Author SHA1 Message Date
Kurt
680e8b711d Add some code analysis for try-return with nullable out 2021-01-17 00:05:07 -08:00
Kurt
e62ea685c3 Make SpeciesConverter methods visible (class)
4 public methods; shouldn't need these except for fringe scenarios.
2021-01-11 17:52:02 -08:00
Kurt
4a3a8dd090 Add japanese blue encounter tables (unique to jp_blue)
When creating a new pk1 for the slot->pkm, get it as a pk1-japanese.
Export the gameversion when in pk1/2 format (same as VC).
2021-01-08 11:29:00 -08:00
Kurt
cc43550357 Simplify more expressions 2021-01-04 17:31:43 -08:00
Kurt
4a52b349ff Minor clean 2021-01-02 19:11:34 -08:00
Kurt
09089da14e Use more expression return style
Reduces indentation & bracketing, a bit more concise
2021-01-01 17:08:49 -08:00
Kurt
aaad127b99 Condense things a little more 2020-12-31 10:41:55 -08:00
Kurt
38e02a53b2 Condense switch cases to switch expressions 2020-12-31 10:33:13 -08:00
Kurt
e8c23f6644 Simplify some repeated comparisons with expressions
Less prone for bugs since it uses the same value for all comparisons without re-specifying
2020-12-29 00:37:59 -08:00
Kurt
a124168e87 Make FormArg editing a complex control
Shows a dropdown for alcremie only, and a number entry for everything else.

See 771086a222 for initial implementation; I don't want the lag anymore lol
2020-12-28 11:51:25 -08:00
Kurt
ee5349ff98 moar is or 2020-12-25 12:30:26 -08:00
Kurt
4a8a495d04 Condense some switch expressions
Should be it for now; exhaustively searched for all that made sense to change
2020-12-25 10:58:33 -08:00
Kurt
95e3337f2c More switch expressions 2020-12-24 17:12:08 -08:00
Kurt
e34c8df044 Revise some method signatures 2020-12-22 20:50:33 -08:00
Kurt
98be0f6739 Target type'd new 2020-12-21 17:17:56 -08:00
Kurt
62018cce1a Unify concepts with different names
AltForm & Form & Forme => Form
GenNumber & Generation => Generation

Extract out SpeciesForm interface, and re-add IGeneration

For those using PKHeX as a dependency, this should be a pretty straightforward manual replacement... GenNumber and AltForm should be quick find-replace`s.
2020-12-10 20:42:30 -08:00
Kurt
9b178fefe2 Xmldoc, minor tweaks
Move form-info logic from FormConverter to AltFormInfo; now FormConverter is entirely form=>string[]
Add a bunch of xmldoc
Make pogo no-end-date cmp agaisnt UTCnow rather than local now.
2020-11-27 11:51:02 -08:00
sora10pls
a437cbb9ca Update FormConverter.cs
Display 0-9999 for Galarian Yamask formarg values.
2020-11-26 18:41:45 -05:00
Kurt
771086a222 Show all valid yamask-1 formarg values
from 319 (max HP-1) to 9999 (max saved value).

Causes a little bit of GUI lag when loading 10k items to the combobox; could be a number entry but meh. Lazily allocate the 10k strings; wait until it's requested.
2020-11-24 12:40:56 -08:00
Kurt
b6da6c1207 Add raticate form list for gen8+ 2020-11-15 08:31:58 -08:00
Kurt
3b5bcc9dad Update comments with context/clarification
No functional change, the order of switch case won't matter
2020-10-24 23:08:39 -07:00
Kurt
5326067c8d Return old Chinese species name for Gen7 fetch
Add documentation comments, because changing species names is so weird.

ty anubis for confirming the game resets the old-nickname to new-nickname even without transferring to HOME.

Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2020-10-24 22:28:39 -07:00
Kurt
5fa4ddd4a2 Update internal data sources for Crown Tundra
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: ReignOfComputer <2667537+ReignOfComputer@users.noreply.github.com>
2020-10-24 11:11:05 -07:00
Kurt
6239f59b9d Inline checksum logic for gen3, simplify else case 2020-10-18 09:16:52 -07:00
Kurt
7132750c9b Placeholder crown tundra logic
To be updated:
- Tables8: magic numbers for maximums
- IGigantamax: any new gigantamax forms?
- FormConverter: any new forms? (calyrex)
2020-10-10 13:14:32 -07:00
Kurt
478cb33788 Unshorten parameter names
lang->language
nick->nickname
2020-10-08 13:59:58 -07:00
Kurt
6938d2f94d Split VivillonTables into two classes
Indicate that the content is for 3DS specific logic
Reduce restriction for parameters requiring IGeoTrack => IRegionOrigin
2020-10-04 14:15:13 -07:00
Kurt
09c6359e3a Add flexibility for SK2 imports
Check language character table for English vs Japanese when loading for a destination
2020-10-04 10:25:34 -07:00
Kurt
52a67f2425 Add Stadium2 Support
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
2020-10-02 18:08:40 -07:00
Kurt
060b0bf7fe Reduce linq/allocation
don't fetch IVs/EVs array, just scan and apply
2020-09-26 11:30:30 -07:00
Kurt
2b7e06e217 Refactoring
Extract some logic, suppress some compiler messages
2020-09-18 22:11:13 -07:00
Kurt
9191f023a3 Minor clean
Nullability annotations and some logic simplification
2020-09-06 11:24:54 -07:00
Kurt
cf9e5ec37f Minor refactoring
Change Ability array to IReadOnlyList, add method to check ability index in personal data
Suppress some message warnings
Change EvolutionChain short-circuit for VC to jump from gen6 directly down to gen2. There aren't any notradeback 1 situations, so a notradeback1 will always start with g=1, so no need for the other if-continue.

Simplify pk5 conversion
2020-09-06 10:53:13 -07:00
Kurt
1ee459a46c Use language for checking IsNicknamed flag 2020-08-29 10:40:41 -07:00
ReignOfComputer
f313321126
Gen 4 French Egg Fix (#2978)
* Gen 4 French Egg Fix

Mauvais œuf, je le réparerai. Bon appétit!

Fixes Gen 4 edge case reported by Taya on Discord.

* Tweak flow to handle gen2

Add a comment to indicate why this special handling is required
2020-08-26 10:18:10 -07:00
Kurt
12d9397c8c Split GO from "GG" gameversion
Make Gen7b as the combined ver for that expression
2020-08-06 18:24:20 -07:00
Kurt
b7211000b0 Split Country/Region/ConsoleRegion from ITrainerInfo
Only present in mainline gen6/7 game pairs, so it's not wise to have it for all games
2020-07-31 13:53:42 -07:00
Kurt
27f15d2f20 Split Country/Region/ConsoleRegion to interface 2020-07-31 11:17:31 -07:00
Kurt
12b8060ec1 Use byte instead of int 2020-07-21 23:43:34 -05:00
Kurt
a7ba178005 Remove unreachable/const logic
Earlier compares result in some logic being unnecessary

The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
2020-06-27 22:44:14 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
2cdb5d26db Clean up some method signatures
rename things to be a little more consistent in naming conventions
2020-06-16 21:46:22 -05:00
Kurt
efb628c002 PID Rand: Handle ability bits for gen34 differently from gen5
quite an old method we have here; used to just maintain both low bits from u16. Need to handle things differently for g34/g5.

Rearrange some variable init for slightly better perf, and clean up parameter names

https://projectpokemon.org/home/forums/topic/55750-pkhex-square-shiny/
2020-06-11 09:32:43 -07:00
Kirk Scheibelhut
0aa84f3456
Fix minor typos in FormConverter comments (#2831) 2020-05-10 14:27:12 -07:00
Kurt
3100471299 Strip out some unnecessary logic
notnull => no need to check for null manually
2020-04-16 12:58:48 -07:00
Kurt
b8814d2448 Split GG into LGPE (GP/GE), GG (LGPE||GO)
Update usages
2020-04-16 12:48:18 -07:00
Kurt
0b48034f4d && -> ||
we want to decrypt if either are set
(they should be zero as they're the always-null terminators of strings)

ty @Lusamine !
2020-04-06 15:12:51 -07:00
Kurt
270d984130 Minor clean
Remove unnecessary null checks
Mark some methods with nullable type
2020-04-04 19:30:50 -07:00
Kurt
cce28df6e3 Update PKMConverter.cs 2020-03-20 09:28:16 -07:00
Kurt
287a2ac5c5 Rework handling of bk4 constructor
Can't really detect if it's shuffled or not; just assume it's always unshuffled unless it originates from a save file read. Probably not a perfect solution, but achieves better results.

https://projectpokemon.org/home/forums/topic/56217-error-in-archive-bk4/
2020-03-18 23:34:53 -07:00