Commit graph

4986 commits

Author SHA1 Message Date
Kurt
d1c2f6ef6e Add gen5 roamer get 2022-06-18 19:12:41 -07:00
Kurt
0eca5cbe05 Add gen4 roamer to block editor
Closes #3528
2022-06-18 14:11:22 -07:00
Kurt
fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00
Kurt
78092e070d Allow PA8 HT from Gen7, prefer min from PLA
Closes #3527
ty @spacesonata !
2022-06-18 10:30:14 -07:00
Kurt
51edaac704 Flag pokerus on LGPE, traded starter 2022-06-17 16:38:05 -07:00
sora10pls
b9c42aa56a Add latest distribution raid data 👊💧
Uncatchable Urshifu!
2022-06-16 20:10:56 -04:00
Kurt
8319bfe003 Fix Entree Forest saving
Closes #3524
2022-06-14 22:30:57 -07:00
Kurt
2a83bc5fa2 ReadOnlySpan encrypt signature
No functional change, just notes that the input array is not modified
2022-06-14 22:25:56 -07:00
Kurt
15c4e96097 Allow detection of ek6/ek7/eb7 from bytes 2022-06-14 17:29:47 -07:00
Lusamine
2ed1fc1e86 Poffins can be even worse 2022-06-14 08:22:49 -05:00
Kurt
ce935edcdf xmldoc
no functional change
2022-06-14 00:01:51 -07:00
Kurt
1a3a365d8a Relax gen4/8b poffin sheen max calc
Really bad burnt poffins.
2022-06-13 21:57:57 -07:00
Kurt
78d681751e Check tracker for WB8/WA8 HOME gifts
Refactor logic flow since Gen8 is done & dusted.
2022-06-13 20:39:29 -07:00
Kurt
f53cc768a6 Improve performance of TM fetch 2022-06-13 00:20:00 -07:00
Kurt
0093927e15 Use ReadOnlySpan instead of Span if appropriate 2022-06-13 00:04:20 -07:00
BlackShark
600c8f704f
Updated German translation (#3521)
* Updated German translation

* More translations

* And more

* Use correct language specific links in readmes
2022-06-12 15:29:04 -07:00
Kurt
10b27c9d95 Fiddle with tutors: no allocation
Besides expanding the move list, no more closures & linq.
2022-06-12 14:02:22 -07:00
Kurt
12ad7f6449 Fix inverted IV/EV count criteria
Thanks skai_louie !
https://projectpokemon.org/home/forums/topic/61491-database-search-returning-incorrect-results/
2022-06-12 12:37:27 -07:00
Kurt
5ce8938440 Use history for hypertraining possible check
Closes #3520
2022-06-12 09:26:45 -07:00
Kurt
c66588666c Split box manip default lists from base file
Only change is to allow SM/USUM to allow Heal action

SM/USUM where Transporter messes up PP for VC transfers; otherwise no need for Gen1-5 games.
2022-06-11 15:47:23 -07:00
Kurt
436588eb10 Replace é->e for code symbols
Closes #3519
Usages weren't consistent; since `é` isn't accessible on usual english keyboards, just use regular `e` instead of alt-223 entry.

Not sure why VS preferred to save the text files without an encoding prefix; oh well.
2022-06-11 15:32:12 -07:00
Kurt
184440f266 Add more GBMobileCableColor values
see 7225b2b87b
2fe0cbbb19/gfx/mobile/mobile_adapters.pal
2022-06-11 10:40:10 -07:00
Kurt
15a84d9d7e Minor clean 2022-06-11 09:51:43 -07:00
Kurt
bf8d47c52b Extract BK4 pokecrypto methods
Convert more magic numbers to their const meaning
2022-06-11 09:40:01 -07:00
Kurt
cc8cbeb749 Revise gen3 contest stat max sheen disparity
Closes #3517

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
2022-06-11 09:36:50 -07:00
Kurt
c3117994cc Allow GO7 handler 0
New current handler verifier settings flag GO => LGPE transfers. Unlike GO => HOME, these transfers use your LGPE OT info, so it's legal to have no HT and have the current handler be OT

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2022-06-08 00:27:24 -07:00
Kurt
c75f543f8b Minor tweaks 2022-06-07 23:32:57 -07:00
Kurt
5ccb678931 Permit Gen7b for GO even if location doesn't match
Feeling like the Move fetching needs to shift away from Generation too.
2022-06-07 20:15:32 -07:00
Kurt
8c528855f4 Differentiate dragged PK8/PB8 better w/preferences
Better determine preference with file extension string
2022-06-07 03:33:45 -07:00
Kurt
54cb4dc8c8 Minor comment fixes 2022-06-07 03:21:04 -07:00
Kurt
428ce52c27 Add Current Handler checks & toggles
Default settings do not flag, as Database view does not track the savefile (LegalityAnalysis only indirectly references the latest loaded save file, not the true source).

Bulk Analysis will flag them correctly if run. Can be turned off.
2022-06-05 13:18:31 -07:00
Kurt
39a09fbbbe Defer BDSP->PK8 marsh ball mismatches 2022-06-05 11:28:17 -07:00
Kurt
267521cfdf Permit old WC8 HOME shinies again
code getting a little bit spaghetti'd
2022-06-05 11:09:49 -07:00
Kurt
bd5cc538c4 Check met date of WA8/WB8 less than current moment 2022-06-05 10:56:17 -07:00
Kurt
893b5d5293 Revise more PB7/PK8->Interface type checks 2022-06-04 21:03:25 -07:00
Kurt
afed55f1e5 Don't yield empty moves on set text export 2022-06-04 16:05:51 -07:00
Kurt
9c5dc6e6e7 Add MarkValue verifier 2022-06-04 14:30:52 -07:00
Kurt
382ea5cd61 Extract move info api 2022-06-04 13:14:50 -07:00
Kurt
d54a9ba3a9 Fix mg8 partially restricted language check
Recipient language fetching a value of 0 will now be permitted to yield the recipient's language. Earlier logic in the method would check if any other language maps to the recipient language
2022-06-04 12:06:23 -07:00
Manu
7ae4e0769b
Translated MessageStrings_it.txt, text_ItemsG2_it.txt and some tweaks (#3514)
* Added Gen2 italian items text

* Italian translation text_ItemsG2_it.txt

* Translated MessageStrings_it.txt and improved some other italian messages/strings for better comprehension.

* Some tweaks
2022-06-04 01:00:33 -07:00
Kurt
db03a77c55 Refactor Marking access 2022-06-04 00:59:52 -07:00
Kurt
ab723af640 Expose Context for SaveFile/ITrainerInfo 2022-06-03 19:08:46 -07:00
Kurt
dde70f4962 Permit shared egg moves based on current type 2022-06-03 16:54:05 -07:00
Kurt
df02532697 Misc fixes
Simplify HM memory check (bit permission superset, just check directly)
Disallow BestFriends & Effort on PA8 exclusives
PA8 techrecord permits none.
2022-06-02 20:05:27 -07:00
Kurt
978be73b9a Trycatch path->sav factory method
Closes #3512 -- had a bad gen3 save backup causing trouble.
2022-06-02 19:21:47 -07:00
Kurt
ead7c2d973 Update contest stat restrictions for BDSP visitors
Closes #3513
2022-06-02 19:11:37 -07:00
Kurt
86814d014d Fix recog of Home fixed PID shinies
Not to be confused with Home fixed PID antishinies
WC8 is the only format to have fixed shinies, but let's copy the logic to WB8 and WA8 if they're ever added in the future.

Fix mgdb display filtering for SWSH & PLA (swapped oops)

Closes #3511
2022-06-02 19:04:27 -07:00
Kurt
e571a0b95f Check catchrate tradeback separately
Closes #3510
Thanks @CodeWithMa !
2022-06-02 18:32:22 -07:00
Kurt
48ace3ca49 Update translatables 2022-06-01 21:58:56 -07:00
Kurt
f2356f1865 Update 22.06.01 2022-06-01 21:27:54 -07:00
Manu
2f44d7486f
Italian translation for lang_it.txt and LegalityCheckStrings_it.txt (#3508)
* Italian translation for lang_it.txt and LegalityCheckStrings_it.txt

* Readme update

* Update README-it.md
2022-06-01 11:51:08 -07:00
Kurt
dc7889cc70 Extract common logic from sidegame struct
Fix size & offset on blank gamedata ctor
SIZE is the inner struct size, not including the 3byte header for type+len.
2022-05-31 19:03:56 -07:00
sora10pls
7d20363d6b Update プロポチャ Piplup end date 2022-05-31 20:21:55 -04:00
Kurt
cd8797da30 Fix PKH clone & crypt check when decrypted
Closes #3507
2022-05-31 05:42:24 -07:00
Kurt
5bcccc6d92
HOME 2.0.0: Handle conversion behavior & restrictions (#3506)
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH)
* Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games).
* Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1).
* Revises some APIs for better usage:
  - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes.
  - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation.
  - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
2022-05-30 21:43:52 -07:00
Kurt
af2ac169e1 Only disallow catchrate enc if !tradeback
Closes #3501
2022-05-30 00:50:35 -07:00
Kurt
ba19efb793 Fix gen8 mysterygift shiny xor check
lol oops
Closes #3500
2022-05-30 00:30:15 -07:00
Kurt
32e0bf95b0 Update LevelVerifier.cs
Closes #3499
ty @Ninjistix !
2022-05-19 22:07:09 -07:00
sora10pls
52082e0e9f Add latest distribution raid data 2022-05-19 20:03:48 -04:00
Lusamine
0b50d6d4ac Label SWSH Poke Job Storage Block 2022-05-18 00:03:59 -05:00
Kurt
8338c97719 Add PokeJob flag get/set 2022-05-17 21:32:31 -07:00
sora10pls
4847735a99 Only display Lord/Lady forms for Generation 8
Future-proofing. We know that Hisuian Zoroark is in SV, as well as Petilil, so if Hisuian Lilligant is also present, we need to not show Lady Lilligant in the form dropdown for those games.

Also only show Primal Kyogre/Groudon for Gens 6/7 (can be revised later if they come back in SV).
2022-05-16 09:25:45 -04:00
Kurt
50ce6a92db Revise stadium detection if no teams set
Closes #3494
Thanks @keiyakins !
2022-05-15 14:05:10 -07:00
Kurt
a5b46d80f5 Minor tweaks
ShowdownSet: Lessen allocation
MoveTutor: Remove boxing by calling the generic method instead of object method
Xoro8b: Add more xmldoc, use positive constant instead of inverse negative for parity
StadiumUtil: Use built-in endianness reversal methods
2022-05-14 08:28:13 -07:00
Kurt
c113ded3b7 Reorder OT comparison check so string checked last
Less allocation.
2022-05-14 08:21:19 -07:00
Lusamine
4e703b7c9e Correct ordering of SWSH rental team blocks 2022-05-13 20:02:41 -05:00
sora10pls
75f9f39cbf Add BDSP Hall of Origin unlock cheat 2022-05-13 17:25:18 -04:00
Kurt
700236249f Treat random gendered slots correctly 2022-05-10 21:52:01 -07:00
Kurt
53e99ee238 Allow parsing enum values if property is enum
Can now search `=Gender=Genderless` for filtering PLA encounter slots
2022-05-10 21:48:56 -07:00
Kurt
2a6026cc80 Load gender values for forced gender slots 2022-05-10 21:46:45 -07:00
Kurt
63784d748d Update LegendsArceusVerifier.cs 2022-05-09 21:24:10 -07:00
Kurt
a21d6c8248 Fix static8a move population 2022-05-08 19:08:44 -07:00
Kurt
bc054c09ed PK5: Clear party stats on import
Add property get/set for the undocumented fields
2022-05-08 18:36:18 -07:00
Kurt
69794e7328 PK4: Add Seals & Ball Capsule index
0xD4 + 0x18 = 0xEC = 236 bytes -- end of data!
2022-05-08 13:16:41 -07:00
Kurt
0206475ba4 Update LegendsArceusVerifier.cs 2022-05-08 12:33:30 -07:00
Kurt
8c4db878dd Extract logic to set initial mastery move flags
Are we done yet
2022-05-08 10:28:22 -07:00
Kurt
178e5e8bc5 More mastery tweaks for db->pkm + alpha statics
in the RNG generator, defer alpha move mastery flag set for templates to set themselves
2022-05-08 10:06:38 -07:00
Kurt
3e8527f11a Minor tweaks
Reduce allocation in a few places, delete unused stuff, more concise expressions.
2022-05-07 21:25:26 -07:00
Kurt
82fae7b350 Revise moveshop move suggest methods 2022-05-07 21:21:29 -07:00
Kurt
ccf87242c1 Eliminate boxing on encounter search (criteria)
struct implementing interface is boxed when passed to method that accepts interface (not generic method).
Removes IDexLevel (no other inheritors but EvoCriteria) and uses the primitive the data is stored (array, not IReadOnlyList) for slightly better perf.
2022-05-07 18:29:36 -07:00
Kurt
e4794efbfe
Split up csproj PropertyGroup for nuget metadata (#3492) 2022-05-07 17:30:42 -07:00
Kurt
e34d03d2e5 Update 22.05.08 2022-05-07 14:30:16 -07:00
Kurt
a9443be8fa Add bypass for alpha move purchased
ty @Atrius97 for finally nailing the repro on this

Co-Authored-By: Atrius97 <39707481+Atrius97@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-07 13:48:47 -07:00
Kurt
178069f889 Minor tweaks 2022-05-07 11:47:01 -07:00
Kurt
51a8dbaeac Merge branch 'master' of https://github.com/kwsch/PKHeX 2022-05-07 10:56:56 -07:00
CanoeHope
fd3cce0005
Update const_gg_en.txt (#3491) 2022-05-07 10:56:24 -07:00
Kurt
baa0a8185d Move to more appropriate folder
Pretty sure I've moved this back and forth before, but this is better not in the inner PKM group.
2022-05-07 09:26:49 -07:00
Kurt
8bf0469289 Remove allocations in SpeciesName helpers
Only allocations that remain are the runtime `new string(...)` that is required for the gen1-5 species name quirks.

Inlines some logic for language fetch, and requires slightly less memory.
2022-05-07 09:25:04 -07:00
Kurt
58caa37d58 Push alpha move for fixed statics
Oops
2022-05-07 08:52:00 -07:00
Kurt
a57f40ae7d Break up PKX into separate classes
Many years ago, PKX used to be a >4,000 line bloated file, which spun off multiple classes like CommonEdits and most of the early non-GUI PKM related logic. Now, it's just a stub to source the latest generation & personal table.

Separate files = more concise info, and more room to grow to do more advanced things.
Makes the IsPresent methods public (no longer internal).
2022-05-06 20:38:55 -07:00
Kurt
124bbf98ad Allow seed of mastery toggling mastered flag
oops
2022-05-06 16:11:52 -07:00
Kurt
59ceec3c65 Extract EffortValues class, add $rand + $suggest
Renames IV/EV verifier field objects for Legality Checks due to class name clashing.
2022-05-06 15:47:54 -07:00
Kurt
be9c947dd6 Use tuples and ComboItem, not anonymous class
Little more explicit
2022-05-06 15:43:51 -07:00
Kurt
9deafa851a
Create initial movesets for Alpha entities correctly, verify initial mastery (#3489)
* Draft checks for encounter slot mastery

* Check encounter mastery flags

* Add moves for LA static encounters that don't follow learnset

* Add moves on crossover LA static encounters

* add alpha moveset population method

Now generates and applies moves as the game does
Updates some handling of other methods to use Span

* Show better message for bad mastery init flags

* Insert descending if candidates have same level

Level 78 Yanmega:
- [01] [10] Quick Attack
- [06] [15] Gust
- [11] [20] Silver Wind
- [18] [28] Hypnosis
- [25] [35] Air Slash
- [34] [45] Ancient Power
- [43] [54] Crunch
- [43] [54] Bug Buzz

Yields:
AlphaMove
Crunch*
Bug Buzz*
Ancient Power

* Descending order due to iteration

Co-authored-by: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-05-06 15:43:23 -07:00
Kurt
232c65ed3a Update EncounterServerDate.cs
Closes #3488

Co-Authored-By: CanoeHope <43196464+CanoeHope@users.noreply.github.com>
2022-05-06 10:49:05 -07:00
Kurt
6e94eaaaee Add overload for ITrainerInfo blank fetch 2022-05-06 10:42:08 -07:00
Kurt
75874b6b81 Show lock capsule slot in mystery gift editor
Closes #3487

editor getting hacky, but it works
2022-05-05 21:21:03 -07:00
Kurt
4c73f1c592 More strict alpha move check for statics 2022-05-05 20:21:21 -07:00
Kurt
ea87140aea Remove optional gameversion for enc generators
Simplifies some of the logic a little.
2022-05-04 22:28:39 -07:00
Kurt
824e868efe Flag non-pokeball GO shedinja (evo'd from nincada) 2022-05-03 20:17:28 -07:00
Kurt
7c8f52cbbf Minor clean
invert nesting, add missing if( space, group OT checks together
2022-05-02 23:48:25 -07:00
Kurt
d58aed109d Add Current Box Changed flag for sav1/2
Flag not set causes the game to clear all boxes (except current box) to clear garbage sram if saves never cleared. Yay deferred execution?
2022-05-02 23:47:41 -07:00
Kurt
b51cdfe72f Flag Marks on BDSP/PLA encounters
Note to self: Exclusion lists aren't futureproof; inclusion more resilient :)
2022-05-02 19:27:22 -07:00
Kurt
5132f961cc Add server date checks for WA8 gifts 2022-05-02 18:52:43 -07:00
Kurt
41578132cf Minor tweaks
Add Get/Set Relearn method to PKM.cs
Alpha Mastered move now indicates incomplete text entry (like moves/relearn)
Split up legal move indication helper class, use DI to allow other implementations of DataSource to be returned (pkhex mobile?).
Remove unused gender refresh method (see previous added UserControl commit)
Add helper method to center control within control
2022-05-02 18:11:31 -07:00
Kurt
fa76da56c9 Inline some Rand32 calls
No functional change
2022-04-26 20:21:26 -07:00
Kurt
b55d706785 Only encrypt pk4-based pgt data
Closes #3484
ty @DeadSkullzJr !
2022-04-26 19:50:02 -07:00
Kurt
af141581ee Minor tweaks
Single underscore discards (one of the c# language revisions allowed reusing the single underscore discard).
Remove a temporary allocation in BDSP flag editor
2022-04-26 19:48:09 -07:00
Kurt
5be9863ef4 Sanitize gender on species/form change
clean up some if expressions
2022-04-25 17:30:16 -07:00
Kurt
ecee948107 Add gender sprites for main GUI
Might trickle this out to the other editors that have gender toggles.
2022-04-24 20:28:56 -07:00
Kurt
1f49574be1 Fix g6 hof len 2022-04-23 22:05:51 -07:00
Kurt
ef3cb34387
Refactor EvoCriteria to be a struct, reduce allocation (#3483)
* Make EvolutionCriteria struct

8 bytes per object instead of 26
Unify LevelMin/LevelMax to match EncounterTemplate
bubble up precise array type for better iteration

* Inline queue operations, less allocation

* Inline some logic

* Update EvolutionChain.cs

* Improve clarity on duplicate move check

* Search reverse

For a dual stage chain, finds it first iteration rather than second.
2022-04-23 21:33:17 -07:00
Kurt
959b9e998b Only flag r45 roamer if tile is water
Grass Tile is okay.
2022-04-23 21:10:09 -07:00
Kurt
f5358e0e37 Update HoF6 entity editing
Reusable entity struct, no more overlapping fields
Adds OT Gender, fixes some flags.

Thanks L1nk2futr3 !
https://projectpokemon.org/home/forums/topic/60977-hall-of-fame-tid-resetting-gen-6/?do=findComment&comment=275575
2022-04-23 10:42:56 -07:00
Lusamine
9d3f61b708 Fix MMO roll count 2022-04-23 00:44:55 -05:00
Kurt
ff2e890e69 Revise Overworld8a application of PIDIV
Instantiating from template now follows group seed -> spawn 1 correlation, including alpha move.
Differentiates static encounters that don't follow the ow8a correlation, scrambles EC to disassociate.
Adds rand64 to get initial seeds
Set correct level range to match slotSeed; not respecting the slot roll being valid, but whatever.
2022-04-22 21:11:11 -07:00
Kurt
ad249dbb76 Differentiate MO + MMO slot types 2022-04-22 20:33:12 -07:00
Kurt
e90f19c962 Add setters for spawner objects
UnknownSeed->CountSeed
Seed_01 -> AlphaSeed
yay, no more unknown seed functionality, all documented.
2022-04-18 22:25:34 -07:00
Kurt
b297351d20 Fix clone deletion, add unique get func 2022-04-17 14:58:52 -07:00
Kurt
515a503ee4 Update spawner models, import from permutemmo 2022-04-17 14:54:54 -07:00
Kurt
a61d8d1efc Extract IMultiplayerSprite from SaveFile
only used by gen6 saves
2022-04-15 14:58:40 -07:00
Kurt
a681783f1a Extract interface for SaveBlock, allow strict
External users shouldn't be using SaveBlock
2022-04-15 11:45:04 -07:00
Kurt
ac7947fd66 Misc tweaks - static namespace using 2022-04-15 09:54:12 -07:00
hp3721
f740e1dd72
Fixed rebattling BDSP trainers (#3481) 2022-04-14 18:36:01 -07:00
Kurt
841fcde2b2 Enhance Pokerus api functions
Fixes #3480 ; (0,0) is a valid state regardless of format.
2022-04-14 14:05:32 -07:00
Kurt
5f4bbcf8de Permit 0x1FF00 saves as stadium saves
Closes #3479
emulators are stupid
2022-04-13 10:42:35 -07:00
CanoeHope
adcbc0221f
Update LegalityCheckStrings_ja.txt (#3478) 2022-04-11 15:10:04 -07:00
CanoeHope
cf901861e7
Update Shortcuts and Legality texts (#3477)
* Update LegalityCheckStrings_en.txt

* Update LegalityCheckStrings_de.txt

* Update LegalityCheckStrings_es.txt

* Update LegalityCheckStrings_fr.txt

* Update LegalityCheckStrings_it.txt

* Update shortcuts.txt
2022-04-11 15:09:42 -07:00
Kurt
f753afaae8 Minor clean 2022-04-11 11:56:56 -07:00
Kurt
a5ee845c3b Decouple event flag/work from SaveFile 2022-04-09 18:12:57 -07:00
Kurt
a601180821 Extract Pokerus util logic
Simplify some GUI interactions when changing strain. Changing the day selection will update the visibility, no need to manually do it again.
2022-04-09 12:27:16 -07:00
Kurt
2f9e05972f slick switch expression
Might be a target for future refactoring if Format(int) is changed in the future...
2022-04-09 12:25:19 -07:00
Kurt
5260c5214e Move files 2022-04-09 12:01:43 -07:00
Kurt
0389624508 Extract unnecessary stringbuilding from pkmconvert 2022-04-09 11:58:52 -07:00
Kurt
e6cf5d0baf Split PKMConverter into multiple classes
EntityFormat -> detects byte[] -> ctor() PKM
EntityConverter -> converts between pkm formats
RecentTrainerCache -> used by other classes (not within EntityConverter!)
EntityBlank -> creates blank PKM objects indirectly
2022-04-09 01:39:34 -07:00
Kurt
d3749bd4b6 Minor tweaks
Move sociability
inline dictionaries
2022-04-09 00:08:24 -07:00
Kurt
cc1c3e8d42 Refactor stat loading to allow spans
Can load stats without allocating
2022-04-08 21:08:06 -07:00
Kurt
274b613487 Change signature to set stackalloc ivs 2022-04-08 20:43:31 -07:00
Kurt
d40bfa63c7 Refactor gen2 mail data structure
Now reads/writes correctly in the GUI.
Closes #3470

Not going to handle slot swaps not matching the data, as this becomes problematic when cloning slots. Previous commit added the ability to manually move mail slots.
2022-04-02 23:36:56 -07:00
Kurt
cec408e62a Use different checksum algo (bytewise) if no impl
Closes #3471
2022-04-02 17:58:47 -07:00
Kurt
647b5a3f87 Remove duplicate home tracker flagging 2022-04-02 17:58:17 -07:00
Kurt
77473476da Split savedata editing template 2022-04-02 17:58:05 -07:00
sora10pls
1a082ecf04 Unban Darkrai, associated Met Locations, Sketch Dark Void
Also reformat Encounters8b to be consistent with other games' static encounter defs
2022-04-01 06:18:11 -04:00
sora10pls
1b39222edf Add April Fool's 2022 distribution raid data 🌲 2022-03-31 20:03:40 -04:00
Kurt
6deaf3cb74 More explicit type checks for Encounter class
A little more explicit on what it is actually checking for
2022-03-26 14:53:15 -07:00
Kurt
55083ee02c Fill(0) -> Clear() 2022-03-26 13:33:58 -07:00
Kurt
977e977dbf Rewrite GeniusCrypto (XD/Batrev)
More clear usage of span
slightly less allocation+copying
more comments for future readers
2022-03-26 13:28:29 -07:00
Kurt
8bf618008a Remove structconverter
Won't work on bigendian architecture for non-byte fields, so just do it manually.
2022-03-25 19:47:23 -07:00
Kurt
6a96ad2278 Disallow loading invalid BDSP savefile versions
rom hacks smh
2022-03-25 19:24:37 -07:00
Kurt
b91031cb14 Remove temp method
*PLA method handles Legends: Arceus
*BDSP method handles BDSP
this one caused (NPC) (NPC) for location :)
2022-03-25 19:24:15 -07:00
Kurt
2cbdd5dbe6 Add gen4 pokedex extdata reader 2022-03-22 10:25:53 -07:00
Kurt
68e3a4430d Handle japanese RSBOX memcards
First 5 blocks are reserved for file accessing info, but we should include them when checking length
Closes #3468

Capture the bool indicating Japanese for the save file, so box names are now read correctly (if changed from game's default).
2022-03-21 19:20:06 -07:00
Kurt
46c83faa0e Refactor hall extradata to read as a separate block 2022-03-21 18:53:24 -07:00
Kurt
0dc641453b Condense some expressions
Getting close to weeding out all the easy inefficiencies to make me finally tackle the "stop gathering all moves instead of checking individual moves" allocation issue.
2022-03-20 23:28:18 -07:00
Kurt
3d759e1491 Move location lists to separate classes 2022-03-20 21:26:56 -07:00
Kurt
a4533b62d8 Reduce size of display-able met location arrays
shaves 5KB off the core DLL
2022-03-20 19:07:33 -07:00
Kurt
fadcf92dc8 Faster pokecrypto
net6 was 4x faster than 461 with the old implementation; now it is faster for both but not as disparate.

New implementation performance is always at least 30% better than the old implementation; even better for smaller chunks of data (40% less time).

Pretty much mimics bare metal value writes
2022-03-20 02:44:36 -07:00
Kurt
54f1e341f9 Spanify spawner object get 2022-03-20 01:46:24 -07:00
Kurt
1a26ecbf40 Update 22.03.18 2022-03-18 15:59:07 -07:00
sora10pls
f94c16c40f Add new distribution raids 🦴 2022-03-17 20:04:14 -04:00
sora10pls
5b9b5e4faa Update Tables8bs.cs
Sweet Heart still unobtainable (why did they give it a sprite if it's not functional ingame?)
Azure Flute is now obtainable
Sacred Ash was never obtainable
2022-03-17 14:40:35 -04:00
sora10pls
df408ced45 Revise Shining Pearl Hall of Origin location string 2022-03-17 13:29:40 -04:00
Jonathan Herbert
9222bfa919
Fix BDSP V1.3.0 Suffix (#3465) 2022-03-16 08:01:25 -07:00
Kurt
9aa5bbea2d BDSP v1.3 2022-03-15 19:24:17 -07:00
Kurt
434f89fa0f Merge branch 'master' of https://github.com/kwsch/PKHeX 2022-03-15 19:23:20 -07:00
Kurt
9a0f9f5119 Minor tweak 2022-03-15 19:23:13 -07:00
Kurt
70ea1f7048 Move some files around 2022-03-15 19:23:03 -07:00
sora10pls
5c8d1ceeec Unban BDSP Ver. 1.3.0 locations + Sketch Judgment 2022-03-15 21:36:26 -04:00
Kurt
d91d242719 Stackalloc EV/AV checks 2022-03-13 22:33:17 -07:00
Kurt
5942a74147 Expose SpeciesID3 for CK3/XK3
Closes #3463
Not going to add unobtainable species IDs to the GUI.
2022-03-13 19:53:46 -07:00
Kurt
d95ba482f3 Reduce allocation in methodfinder IV set 2022-03-13 19:39:38 -07:00
Kurt
d5ae6764aa Stackalloc IVs for template->pkm fill 2022-03-13 19:24:08 -07:00
Kurt
8f8726ac5e Disallow encstatic1 yield catchrate not tradeback 2022-03-13 18:29:47 -07:00
Kurt
8afc6814eb Disallow matching BU statics for non-JP 2022-03-13 17:45:01 -07:00
Kurt
4841a01b4e Update GO pickles, move Shiny.Never before Always 2022-03-12 17:39:01 -08:00
Kurt
801892b59e potential revisions for gible (#3462)
ddc6f414df caused it to be `<=` instead of `<`, but maybe the underlying issue was fixed a different way since all tests still pass with this reversion.
2022-03-12 17:39:01 -08:00
Kurt
69fafcab83 Performance: Slightly reduce allocations in moveset validation (#3460)
* Reuses move parse result objects for each encounter parsed in a LegalityCheck attempt, instead of creating a new object.
* Ensures the objects are never-null, and makes cleanup easier.

Slightly adjusts some other parts of the moveset validation to reduce allocations.
2022-03-12 17:39:00 -08:00
Kurt
93255efcb8 Disassociate Shiny enum from WC6 PIDType (#3461)
Have `Shiny.Random` be `0`, so we can skip init on this field for EncounterStatic. Plus makes it a little less brittle for future expansion if shiny qualities change.
2022-03-12 17:38:59 -08:00
Kurt
85b7541c9f Update EncounterArea1.cs 2022-03-10 18:04:39 -08:00
Kurt
2e6364dceb Fix pk2->pk1 nickname copy
nobody noticed until I did
2022-03-10 18:00:45 -08:00
Kurt
b45ce123da Show rainbow bean index
14 -> 15
Clean up some API functions
2022-03-08 21:02:06 -08:00
Kurt
5359a140a6 Handle fixed ability for 8b RNG 2022-03-08 08:44:55 -08:00
Kurt
bb8dee1e6c Return block value
oops, refactoring forgot to add return
Closes #3458
2022-03-08 08:36:17 -08:00
Kurt
f77b6fa405 Master moveshop moves on set import 2022-03-07 21:45:46 -08:00
Kurt
1185c63b15 Update MoveApplicator.cs 2022-03-07 21:42:51 -08:00
Kurt
33537465ca Simplify batch editor loading method
Lazy init the all-any-byType sorted string list, static ctor unneeded for some nuget users
2022-03-07 19:42:08 -08:00
Kurt
4e1276a954 -8 bytes from each encounter template
saves about ~1MB RAM savings (>=179,142 objects)
2022-03-06 23:25:47 -08:00
Kurt
462ef70ffb SlotNumber/MagnetStatic int->byte
more size reductions
2022-03-06 22:47:03 -08:00
Kurt
ba9d3c95af Fix bean get/set 2022-03-06 15:33:33 -08:00
Kurt
8f9de86347 Span-ify BreedInfo, saves 10bytes heap alloc
the Actual result still needs to leave the stack, so that has to be heap allocated.
2022-03-06 13:04:56 -08:00
Kurt
9049ef99fd Minor allocation reduction 2022-03-06 13:03:39 -08:00
Kurt
b869107c84 Randomize seed for multithreaded rand
ALM runs each legalization attempt in a separate thread, and if things are fast enough, we get multiple threads with the same Environment.TickCount seeding their Rand generator, resulting in the same PID/EC if similar templates are used.
2022-03-06 12:23:11 -08:00
Kurt
7911cd6d5c Seal some classes 2022-03-06 12:16:36 -08:00
Kurt
e1414a0bea Move some interfaces to different folder
No code changes
2022-03-06 12:06:50 -08:00
Kurt
c51d51d381 More specific primitives for Memories/others 2022-03-06 12:01:47 -08:00
Kurt
47f7efab2c Update SCBlockAccessor.cs 2022-03-06 00:46:10 -08:00
Kurt
9632ad44fd Span-ify HiddenPower methods
Zero heap allocation Hidden Power bruteforcing via Heap's algorithm
2022-03-06 00:43:49 -08:00
Kurt
41d2dd9294 Update EncounterTrade for Shiny metadata
Doesn't need to be stored in most cases
Now permits EncounterTrade1 to be shiny
2022-03-05 21:04:18 -08:00
Kurt
e17483fe46 some linq reduction 2022-03-05 20:03:52 -08:00
Kurt
1c0f842173 Remove unnecessary Clone method for Items
Remove linq using by doing things slightly more efficiently
2022-03-05 19:51:16 -08:00