Commit graph

5111 commits

Author SHA1 Message Date
Manu
aecaca7298
Corrected typo in ITA translation (#3613) 2022-10-20 19:06:59 -05:00
sora10pls
56d3daa189 Add latest distribution raid data 🐴
good job shiny locking them this time
2022-10-20 20:05:57 -04:00
Kurt
3ab3f6ad53 Sanity check requested gender
Shedinja template in gen3 is gender:2, while the template needs to be gender:0/1

Closes #3612 ty @Kermalis !
2022-10-20 00:14:03 -07:00
Kurt
e1cf36e2c4 Add method to write both save slots 2022-10-19 20:36:56 -07:00
Kurt
25b217c53d Skip first iteration check of stop condition
Can unroll the loop, but would look more ugly :)
JIT will probably do it for us.

Fix <= to < for IVs
Inline temp var (start is unused after assigning to low)
2022-10-16 20:10:32 -07:00
Kurt
2a190dd6b3 Improve LCRNG seed reversal speed ~50x
Big thanks to Parzival from the RNG discord community for chiseling the LCRNG search space down to the best performing implementation possible.

50x? Down from O(2^8) -> O(2^3) is 32x, but we no longer need to access two heap arrays (262KB no longer needed!). Everything can be calculated tightly with the stack.

f641f3eab2/RNG/LCG_Reversal.py (L31)

Rainbow tables is the only faster implementation. However, nobody is gonna hog many GB of RAM for O(1) reversals. This is ~O(2^3), down from O(2^8). Much better than the days of O(2^16)!
2022-10-16 18:52:43 -07:00
Kurt
ba53f4a7bc Extract common csproj properties 2022-10-15 17:09:54 -07:00
Kurt
ab04c343dd Move shared G8PKM class to shared folder 2022-10-15 17:07:11 -07:00
Kurt
d63dad63f8 Remove old comments (now correct) 2022-10-15 17:06:58 -07:00
Kurt
37285aa8dc Limit allocation in BallApplicator methods
No longer uses linq, and uses stackalloc for temp array creation.
Silly enums not implementing IEquatable<T>, so I have to implement the Contains myself.
2022-10-15 01:15:45 -07:00
Kurt
ae6d53af7e Minor tweaks
Reduce allocation in gen8 static encounter init, single class
2022-10-15 01:14:50 -07:00
Kurt
66f43291d3 Fix ball enumerating when setter guards value
Ty Atrius!
2022-10-14 17:14:58 -07:00
Kurt
8b0e93b42f Fix GetLowestLevel underflow condition
Check end before decrement

Closes #3605 thanks @InfoManiac742 !
2022-10-14 17:05:19 -07:00
BlackShark
b2f5bd5bd6
Added SIZE_G3EMU (#3603) 2022-10-14 07:29:52 -07:00
Uiharu
056704d26e
Add Some Scripts Translations in CHT (#3601)
* Update CHT translation of locations in Colosseum/XD
* Add CHT translation for BDSP flag
* Add CHT translation for BDSP script
2022-10-13 18:17:48 -07:00
Kurt
58f729122e Tweak party undo/redo logic 2022-10-09 16:15:50 -07:00
Kitcham
d9b4a0c771
Fix 3DS-Region Display Bug in CHT GUI (#3599)
Fix 3DS region display bug in zh-HK traditional Chinese. Corresponding  3DSLocale text was omitted in previous commits.
Improve some expressions in zh-HK README + traditional Chinese GUI.
2022-10-05 06:05:26 -07:00
Kitcham
d70794668f
Add Traditional Chinese Support for PKHeX (#3597)
Add zh-HK README translation for README. It was wrote in Traditional Chinese Hong Kong style.

Add Traditional Chinese translation resource and make PKHeX support for tradition Chinese.
2022-10-02 13:15:58 -07:00
Zazsona
b804557627
Expand My Pokémon Ranch Support (#3595)
* Add RanchMii for SAV4Ranch

* Add RanchToy

* Add RanchTrainerMii

* Add RanchLevel

* Add RanchToy class; make existing RanchToy RanchToyType

* Add RanchToy and RanchLevel to SAV4Ranch

* Remove incorrect MaxPkmCount entry from RanchLevel

* Move code to remove PtHGSS data to a function in G$PKM

* Add RK4 for My Pokemon Ranch Pokemon

* Add RanchPkOwnershipType

* SAV4Ranch updates

* Fix PK4/RK4 conversion logic to stop breaking nicknames/OTs

* Fix EntityDetection.IsPresent() check tripping on the data end marker for SAV4Ranch

* Add .rk4 to README translations

* Minor tweaks

Fix RK4 TID/SID endianness/order, split Ownership enum into two enums
Condense mii classes to get/set properties
Make RanchLevel a static class for logic
Remove ClearFF for TrainerMii -- the FFFF is the string terminator char for gen4
Make Toy byte enum, with unused alignment bytes

Co-authored-by: Kurt <kaphotics@gmail.com>
2022-10-02 13:14:42 -07:00
Kurt
72410e1619 Fix genderless walker genders
Raw ROM data wasn't clean genders (0 for staryu, needed 2)
2022-09-30 19:27:29 -07:00
Kurt
0bc7eeb5f5 Improve RNG frame detection for gen4
stupid bruteforce for slot4->pk4
2022-09-30 19:26:59 -07:00
Kurt
65baf92608 Only add encounter moves if context matches
Viewing a PLA thundurus template into SWSH, then clicking current moves would green-tag
2022-09-28 21:51:22 -07:00
Kurt
baf2ac22d7 Update EncounterStatic4Pokewalker.cs 2022-09-28 00:09:10 -07:00
Kurt
583f96a598 Specify full movesets & course for Pokewalker encs
Didn't trust the existing manual transcribing, and both Bulbapedia and Serebii contain errors that don't match the original raw data. So, let's rip the raw data ourselves and use our own parse pickle (just raw bytes) instead of 162 manual entries.

For ripping logic, see: 203874da12

Partial match if language cannot access walker course
Re-do language override for EncounterStatic->pkm:
- Override gen1/2 event OT/language only if requested language is not possible
- Override walker OT/language if requested language is not possible (->japanese)

Closes #3594
2022-09-27 23:14:42 -07:00
Kurt
f42b8609c1 Emit bdsp&pla for swsh version range 2022-09-27 10:00:44 -07:00
Kurt
9bf303d79b Show sublocation for XY locations (routes)
have fun matt
2022-09-27 09:58:00 -07:00
Kurt
b6f5723d40 Make const location IDs ushort 2022-09-27 09:57:42 -07:00
Kurt
eabd8fad02 Reformat met location tables
More coherent alignment
Fix LGPE duplicate Met0 locations
Remove sublocations from XY hatch locations
2022-09-27 09:57:28 -07:00
sora10pls
4fd73d201f Remove unused GBLZero PogoType
This was implemented because Niantic messed up some GBL encounters in the past, but it was fixed quick enough for it to not matter for legality, so no encounters actually use this PogoType.

Also rename GBLDay => GBLD to match other PogoTypes for consistency across enum names.
2022-09-26 20:37:55 -04:00
Kurt
83d6402fd4 Add gen3 unown form-pid check 2022-09-26 07:27:51 -07:00
Kurt
05d43cef7c Set pk2 time of day for EncounterEgg ctor 2022-09-24 19:23:52 -07:00
Kurt
7cbde296f8 Make GameVersion a byte enum 2022-09-24 19:23:23 -07:00
Kurt
19d062480a Verify time of day for gen2 encounters 2022-09-24 18:07:58 -07:00
Kurt
9c133d4e39 Allow emitting Crystal eggs for location-less pk2's
Closes #3591
ty @randomdice101 !
2022-09-24 18:07:41 -07:00
Kurt
8c93fd1cbd Fix honeytree RNG frame matching
See EncounterSlotDumper for associated change (forgot to retain SlotType)
2022-09-23 13:36:44 -07:00
Kurt
0a9fbfc8c3 Size 7->8, make properties u8 instead of s32 2022-09-22 11:57:58 -07:00
Kurt
f1dcc33168 Update movepp sig to use ushort 2022-09-18 23:06:02 -07:00
Kurt
3a5aa22c6f Force alpha move state for below learn level 2022-09-18 22:00:46 -07:00
Kurt
84be9da49d Revise rotom form check 2022-09-18 17:07:43 -07:00
Kurt
98707b466c Bounds check move & species
searching for florges with dazzling gleam as a PK5 -> reject
2022-09-18 00:44:31 -07:00
Kurt
b04df6383a Fake OT/Nickname fetch for batch command compare 2022-09-17 02:00:26 -07:00
Kurt
fddddcba28 Ban evos byref all the way down
https://github.com/kwsch/PKHeX/issues/2973#issuecomment-1247776541
2022-09-15 17:43:52 -07:00
Lusamine
eb51826243 Add date legality for Otsukimi Festival 2022 Clefairy 2022-09-13 18:51:20 -05:00
Kurt
61aa10a564 Require AtAnyTime for flagging original egg moves
https://projectpokemon.org/home/forums/topic/62305-egg-moves-are-deemed-legal-even-if-they-are-not-in-relearn-moves-list-before-gen-8/?do=findComment&comment=279269

ty liopds !

for gen8, require "Encounter" flag to match gen6/7
gen6/7 don't need to check IsMovesetDeleted as 8->7 will not traverse to 7-- if it was deleted.
2022-09-13 15:22:19 -07:00
Kurt
5875d76468 Update 22.09.13 2022-09-12 23:55:30 -07:00
Kurt
d5cdd3e6cc Update SAV1.cs
Closes #3583
2022-09-12 11:54:35 -07:00
Kurt
c5908b2b97 Disassociate metadata's SAV reference from clone
Necessary for gen3 manual overrides; the fetched properties for Metadata should refer to the cloned data that it is using, not the original reference.

Closes #3582
2022-09-11 09:59:00 -07:00
Kurt
2bbd767066 Fix corrupted personal data entries
Script run 4y ago used the wrong size to jump between entries (used B2W2's), and ended up copying bytes to empty spots that were NOT abilities.

f8a1d26694

Used the original dump and re-ran the script from 9f4b18119e
2022-09-10 22:54:06 -07:00
Kurt
7d2808ea33 Requisite ribbon syndicate ribbons 2022-09-10 19:44:58 -07:00
Kurt
27eb68335b Update learn handling for side-game wiped movesets 2022-09-10 12:02:15 -07:00
Kurt
0a88cdc32e Update Encounters8.cs 2022-09-10 01:13:34 -07:00
Kurt
c611bba9b5 Update WA8.cs 2022-09-08 23:11:58 -07:00
sora10pls
39ccb50580 Add latest distribution raid data 2022-09-08 20:04:39 -04:00
Lusamine
f79560b8a2 Add Continental Vivillon pattern to Nagasaki, Japan for 3DS
Updated earlier this year:
https://docs.google.com/spreadsheets/d/e/2PACX-1vTVVOEZbXLVQvjIdzGACpZ_IrOWgVDBr_Wa-xULK3191BP9lf1tep-z-PsmcAfaH_aE56j3GHDX_9UO/pubhtml
2022-09-07 23:58:04 -05:00
Kurt
17b42219af Improve xd umbreon detection
Make PIDIV for xd starter indicate the TID/SID origin seed too.
2022-09-07 15:49:53 -07:00
Kurt
bbc45d8b0c CXD played: Use TotalHours to set elapsed hours 2022-09-07 14:39:58 -07:00
Kurt
a0c998fdd5 Simplify contest ribbon deadlock set
Was missing the check & revert step; just fix the logic completely.
We should have the contest star ribbon if we've set all the ribbons, otherwise it was already removed.
2022-09-06 21:05:39 -07:00
Kurt
20dcb8d407 Remove old showdown set aliases
Don't need to support sets that don't follow the current standard.
2022-09-06 21:04:40 -07:00
Kurt
d6e83362b3 Fix binarysearch result compare
Method returns a negative number if not found; not always -1
https://projectpokemon.org/home/forums/topic/62246-g3-xd-move-tutor-legality/
2022-09-05 08:50:27 -07:00
Kurt
06196e0440 Minor tweaks
Less alloc
2022-09-04 22:23:35 -07:00
Kurt
6a61b0e449 Update EvolutionTree.cs 2022-09-04 22:20:35 -07:00
Kurt
92a50264cc
Refactor RNG advance/reverse methods (#3579)
The new LCRNG/GCRNG/ARNG classes are static, rather than singletons. Allows them to be inlined much better.
2022-09-04 12:03:37 -07:00
Kurt
d9ad0052a1 Completely remove chatelaine memory check
Gen6 can get the memory on those who did not participate by being in the party with other participants.
This includes those who cannot enter into the Maison; having memory and no ribbon is entirely legal.
2022-09-03 10:12:42 -07:00
Kurt
fd27bde673 Update RibbonVerifierCommon6.cs 2022-09-03 08:25:12 -07:00
Kurt
da642ee16e Remap context for sidegame HT memory checks
gastrodon with recover as HT memory needs to verify within the context of SW/SH and prior learn environments.
2022-09-02 15:41:22 -07:00
Kurt
1960b335fd Remove PersonalInfo.Abilities, use interfaces
If you must get a list of abilities, then use the span extension methods.
Also reworks some initial moveset fetching to allocate less
2022-09-02 10:20:19 -07:00
Lusamine
a97e74e628 Correct Arceus Chronicles Growlithe dates 2022-09-02 02:40:40 -05:00
Lusamine
7bab0270bb Fix Wish Ralts moveset
Thanks @Kermalis !
2022-09-01 23:27:58 -05:00
Kurt
59c518f268 Condense moveset deletion check 2022-09-01 20:57:39 -07:00
Lusamine
8ecbd08efd Add start date for Arceus Chronicles Growlithe event 2022-09-01 21:04:56 -05:00
Kurt
e8aa2c8ed1 Correctly check xy/sm if not ao/usum levelup 2022-09-01 09:34:40 -07:00
Kurt
4a008e510d Sanity check friendship and level values parsed
Don't accept Level: 101, for example.
2022-08-31 22:22:23 -07:00
Kurt
f4f9df3a81 Don't add new gs moves to pk1 permit array
Out of range
https://projectpokemon.org/home/forums/topic/62190-user-message-an-unhandled-exception-has-occurred-you-can-continue-running-pkhex-but-please-report-this-error
2022-08-31 21:03:26 -07:00
Kurt
88ac14946d Don't be as strict with shedinja evo moves
EncounterMovesetGenerator doesn't specify a clean encounter, don't check it as thoroughly.
2022-08-31 19:09:06 -07:00
Kurt
fb9deab202 Specify full gift egg wc3 moveset
PKHeX needs the exact moveset rather than a "permit this extra move" because our recent logic improvements check for strict moveset matching when it is still an egg.
Closes #3577 thanks @wararjey !
2022-08-31 18:55:17 -07:00
Kurt
71e08222cf Update 22.08.31 2022-08-30 22:49:54 -07:00
Kurt
d350bb7fee Misc fixes & pickle updates 2022-08-30 21:15:07 -07:00
Kurt
66e0613d82 Minor clean 2022-08-30 15:00:45 -07:00
Kurt
319a671a6d Simplify munchlax tree list usage 2022-08-29 17:38:27 -07:00
Kurt
f18e884407 Remove unused BDSP bcat logic
ded game, underground distributions unused. no need to differentiate, no need to allocate unused collections.
2022-08-29 17:37:54 -07:00
Kurt
bf37be3ea1 Update LearnVerifierEgg.cs
Order of operations being spooky
2022-08-29 16:08:56 -07:00
Kurt
40649084b3 stackalloc temp unreleased item arrays 2022-08-29 16:08:30 -07:00
Kurt
d8fe34011d Remove some bounds checks, int->byte form oops
https://github.com/kwsch/PKHeX/pull/3575#issuecomment-1229244453
ty @Kermalis !
2022-08-27 12:53:30 -07:00
Kurt
3c232505e5
Refactoring: Narrow some value types (Species, Move, Form) (#3575)
In this pull request I've changed a ton of method signatures to reflect the more-narrow types of Species, Move# and Form; additionally, I've narrowed other large collections that stored lists of species / permitted values, and reworked them to be more performant with the latest API spaghetti that PKHeX provides. Roamer met locations, usually in a range of [max-min]<64, can be quickly checked using a bitflag operation on a UInt64. Other collections (like "Is this from Colosseum or XD") were eliminated -- shadow state is not transferred COLO<->XD, so having a Shadow ID or matching the met location from a gift/wild encounter is a sufficient check for "originated in XD".
2022-08-26 23:43:36 -07:00
Kurt
444c3d2209 Narrow more types 2022-08-26 10:07:24 -07:00
Kurt
6e4613a3a7 Narrow met location value checks for eggs s32->u16 2022-08-26 10:03:46 -07:00
Kurt
28d726da80 Simplify wild ball permitted checks 2022-08-26 01:20:49 -07:00
Kurt
e700a0e3e6 Handle traded BDSP egg transfers 2022-08-25 23:04:38 -07:00
Kurt
528a377f84 Handle version restrict for new gen4 legend cards
The other existing Eiscue/Stonjourner dmax crystal gifts are version restricted too, using this byte with same values.
2022-08-25 13:10:39 -07:00
Kurt
ad28f7b261 Delete old utility methods (unused)
MoveEgg: already range check in the Safe method
Inline some logic
2022-08-24 23:49:00 -07:00
Kurt
b241c19520 Simplify some memory args 2022-08-24 23:29:03 -07:00
Kurt
d3c2d77d11 Misc move/memory tweaks
Disallow max moves from Sketch
Hide dmax moves from legal dropdown lists
Pass ushort for moves for validating memories
Internal class for move pp (hide empty class from dll users)
2022-08-24 20:32:40 -07:00
Kurt
43871e856c Specify some lambdas as static
Rewrite some usages to be more clear
bikeshedding at its finest, ignoring more important things to update/fix :)
2022-08-23 23:11:26 -07:00
Kurt
26b1453002 Narrow ribbon count type from int->byte, split interface
Fix RibbonVerifier4 not checking gen4 contest ribbons correctly
Split IRibbonCommon6 to have memory ribbons separate, as they are not implemented in mystery gifts. Also, we can add the boolean flags to the interface, and check that the boolean is set if count is nonzero.
Fix adding ribbons to Gen8 gift templates
Improve Gen8 template ribbon fetch (no closure, faster IndexOf)
2022-08-23 21:25:22 -07:00
Kurt
eb2cef10c9 Minor clean
Stability intensifies
2022-08-22 23:18:53 -07:00
Kurt
0b458395f1 Fix handling for USUM banned species bypass
Tweak EReader check for Shadow3, more straightforward since we can just check the location ID (nothing else uses that location ID).
2022-08-21 19:15:02 -07:00
Kurt
6441bdadd8
Add specialized struct for Moveset and IV specs (#3572)
`Moveset` struct stores 4 moves, and exposes methods to interact with a moveset.
`IndividualValueSet` stores a 6 IV template (signed).

Performance impact:
* Less allocating on the heap: Moves - (8 bytes member ptr, 20 bytes heap->8 bytes member)
* Less allocating on the heap: IVs - (8 bytes member ptr, 28 bytes heap->8 bytes member)
* No heap pointers, no need to jump to grab data.
* Easy to inline logic for checking if moves are present (no linq usage with temporary collections).

End result is faster ctor times, less memory used, faster program.
2022-08-21 17:34:32 -07:00
Kurt
2cb2531288 Add more xmldoc 2022-08-21 01:39:16 -07:00
Kurt
7c0a7fd64e Improve static class localization perf
Every reflection GetValue / SetValue call would do a bunch of allocation; just let the runtime give us the full list it builds each time, then iterate off that.
Improve start index searching; properties do not contain spaces, so we can find the start by just searching for the first character of the splitter (space).
No longer need to trycatch as we're setting foreach property, instead of foreach string.
2022-08-20 12:11:43 -07:00
Kurt
d0ca8403a9 Minor tweaks
Flag enigma berry on ck3/xk3
Suggest national ribbon if missing
Flag N's pkm if any IV is != 30, even if sum is 180.
2022-08-19 22:37:27 -07:00
Kurt
db0b77c493 Update RibbonVerifierCommon7.cs
Closes #3571
2022-08-19 13:22:39 -07:00
Kurt
44c8e772a3 Fix incorrect method call
Copypasta oops, previous commit at fault.
2022-08-18 01:17:03 -07:00
Kurt
5cfaf7eecd Add overloads to get localized showdown sets 2022-08-17 23:50:14 -07:00
Kurt
3dde8a7cfa Reduce linq usage, minor perf 2022-08-17 23:48:37 -07:00
Kurt
5140c47e84 Pass missing flag so that remove all can revert 2022-08-17 23:47:15 -07:00
Kurt
136f742299 Flag cross-transfer presence if tracker missing
Can't get a Pioneer Ribbon on SW/SH alolan vulpix lacking a HOME Tracker, assuming you have the HOME Tracker setting enabled.
2022-08-16 15:50:35 -07:00
Kurt
912023d756 Fix 7->prev EncounterMovesetGenerator traversal
The dummy EncounterInvalid has Generation:0, when 7->6/2 depends on which generation the encounter originated on. Change it so that the origin generation gets passed along.
2022-08-16 13:14:48 -07:00
Kurt
f62597cc24 Add shared egg moves to GetAllMoves fetch 2022-08-16 12:42:40 -07:00
Kurt
855e28b086 Update GUI translation text files
winforms control localization has some issues (discarding mgdb/encdb/pkmdb stuff)
2022-08-15 22:05:04 -07:00
Kurt
768047cd80
Legality: Rewrite Ribbon Verifier (#3570)
* Rewrite ribbon verification
* Explicitly verifies all ribbons instead of chained iterators.
* Verifies using only the stack, using `struct` and `Span<T>`. No allocation on heap, or `IEnumerable` iterators.
* Verifies all egg ribbons using a separate method, explicitly implemented. No reflection overhead.
* Separates each ribbon interface to separate `static` classes. Easier to identify code needing change on new game update.
* Extracted logic for specific ribbons. Can easily revise complicated ribbon's acquisition rules.
* Simplifies GiveAll/RemoveAll legal ribbon mutations. No reflection overhead, and no allocation.
* Can be expanded in the future if we need to track conditions for ribbon acquisition (was Sinnoh Champ received in BDSP or Gen4?)

End result is a more performant implementation and easier to maintain & reuse logic.
2022-08-15 21:04:30 -07:00
Kurt
a4274d370f Hide DynamaxLevel outside of Gen8 format 2022-08-14 18:54:08 -07:00
Kurt
3cccb3a9cd Revise alola champ ribbon check 2022-08-12 10:16:12 -07:00
tastymeatball
5f3516c3ce
Fixed error getting Z coordinate (#3567) 2022-08-12 07:58:23 -07:00
Kurt
b900361ad3 Permit alolan champ ribbon from mystery gift
silly world pikachu gift
2022-08-11 21:03:08 -07:00
sora10pls
7ad70a04c7 Add latest distribution raid data 👿 2022-08-11 20:07:02 -04:00
Kurt
7c4e5e7b04 Add more xmldoc 2022-08-11 00:46:41 -07:00
Kurt
af87d038aa Delete unused logic 2022-08-11 00:25:16 -07:00
Kurt
d1959d90a4 Move files 2022-08-11 00:24:59 -07:00
Kurt
30f2450a30 Minor clean, xmldoc personal tables 2022-08-11 00:24:25 -07:00
Kurt
f53d468db2 Show complete form name if possible
Get rid of the pk3DS janky form naming :)
2022-08-09 19:16:55 -07:00
berichan
ef0b3f9607
Prompt user for clipboard directory use if present for box dump/save (#3566) 2022-08-09 18:03:00 -07:00
Kurt
59fad0e8cf Minor tweaks
Extract some logic (origin markings)
Revise directives for NET7 targeting, remove old net5 refs
2022-08-05 16:18:42 -07:00
Kurt
54910b8fba Early return if no evos
GO transfers like Snivy can be viewed but shouldn't exist in Gen8. This avoids any exception being thrown for shared move check.
2022-08-05 16:18:06 -07:00
Kurt
94668b4672 Fix clearing of clones (off by 1 last box)
Clamp end box in the clear/modify actions too, just in case.
2022-08-05 11:24:54 -07:00
Kurt
999caedf6e Allow viewing of un-convertible GO encounters 2022-08-05 11:23:48 -07:00
Kurt
538d651aef Misc tweaks
Add xmldoc, simplify some expressions
2022-08-05 11:23:28 -07:00
Kurt
ec45ca1a83 Set species flag on ck3/xk3->pk3
Make GetG3Species return ushort

Fixes regression caused by 5942a74147
Copying SpeciesID3 instead of Species is fine as it skips the map/unmap step, but it also skips the setting of the HasSpecies flag. So we'll just set it in the individual ConvertToPK3 methods.
2022-08-04 09:53:15 -07:00
Kurt
bab2cc11d6 CK3: Fix field width of Friendship
Closes #3564
2022-08-04 08:56:17 -07:00
Kurt
87e45b14c8 Disallow BD/SP Tower Master ribbon w/mythicals
Thanks TFSthegreat !
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=278427
2022-08-03 20:27:13 -07:00
Kurt
19b4a26cd7 Use evo history to check visitation
Previously, the history shared Gen8 for Gen8a/Gen8b; now they're distinct.

Add "HasVisited" for other gens
2022-08-03 18:17:46 -07:00
Kurt
ac17c7d4a3 Prevent setting of invalid dmax levels to set
Just an extra protection.
2022-08-03 17:50:11 -07:00
Kurt
50a64d8beb Add DynamaxLevel parsing for ShowdownSet 2022-08-03 17:10:00 -07:00
Kurt
98c1420b22 Update PKM.cs
Closes #3562
2022-08-03 16:41:10 -07:00
tastymeatball
c6aa13ddc6
Lots of flags added to FireRed/LeafGreen (#3554)
* Lot of flags added to FireRedLeafGreen
* Added a few more flags
2022-08-03 16:15:56 -07:00
CanoeHope
89b49b41d9
Fixed Crystal Event Constant formatting (#3548)
* Update const_c_en.txt
* Update const_c_es.txt
* Update const_c_zh.txt
* Update const_c_zh.txt
2022-08-03 16:15:44 -07:00
Kurt
9166d0eb64
Refactoring: Move Source (Legality) (#3560)
Rewrites a good amount of legality APIs pertaining to:
* Legal moves that can be learned
* Evolution chains & cross-generation paths
* Memory validation with forgotten moves

In generation 8, there are 3 separate contexts an entity can exist in: SW/SH, BD/SP, and LA. Not every entity can cross between them, and not every entity from generation 7 can exist in generation 8 (Gogoat, etc). By creating class models representing the restrictions to cross each boundary, we are able to better track and validate data.

The old implementation of validating moves was greedy: it would iterate for all generations and evolutions, and build a full list of every move that can be learned, storing it on the heap. Now, we check one game group at a time to see if the entity can learn a move that hasn't yet been validated. End result is an algorithm that requires 0 allocation, and a smaller/quicker search space.

The old implementation of storing move parses was inefficient; for each move that was parsed, a new object is created and adjusted depending on the parse. Now, move parse results are `struct` and store the move parse contiguously in memory. End result is faster parsing and 0 memory allocation.

* `PersonalTable` objects have been improved with new API methods to check if a species+form can exist in the game.
* `IEncounterTemplate` objects have been improved to indicate the `EntityContext` they originate in (similar to `Generation`).
* Some APIs have been extended to accept `Span<T>` instead of Array/IEnumerable
2022-08-03 16:15:27 -07:00
Kurt
d1dad7b8eb Revise check for apply PID shinyxor
was checking stale value

make loop max adjustable by caller; knowingly requesting squares is 1:65,536, so a higher loop count than 50k might guarantee more successes.

Maybe in the future we'd have separate algorithms to pre-choose seeds by choosing a PID and unrolling -> rolling.

Co-Authored-By: Kermalis <29823718+Kermalis@users.noreply.github.com>
2022-08-03 16:11:49 -07:00
Kurt
46655147ba Update underground pickles: nat dex considerations
4354cd736e
2022-08-03 13:33:27 -07:00
sora10pls
54babc2217 Allow Ranked Ribbon on Mythicals, extend availability 2022-08-02 09:23:07 -04:00
Lusamine
7ad9f68dda Add missing static Loop Lagoon Gyarados
Closes #3555
2022-07-22 18:15:24 -05:00
Kurt
038722ee09 Allow pkrs on PK1->PA8 Kleavor 2022-07-11 18:55:32 -07:00
Kurt
7d35517614 Revise AV check string to show which stat invalid 2022-07-10 17:34:46 -07:00
Kurt
79913a2474 Update IAwakened.cs 2022-07-10 17:16:48 -07:00
Kurt
3dbf46be92 Handle "random" AV gains from level up 2022-07-10 15:53:33 -07:00
Kurt
45af203a26 Fix C/XD playtime reading
ty @trigger-segfault
e611c9661e
apparently Japanese XD uses 32bit instead of 64bit, different struct size. Seems the same as the memo size being different for japanese XD too.

Since we're now using Config, apply the correct CurrentRegion/OriginalRegion values when setting a pk* to sav.
2022-07-06 17:33:15 -07:00
Kurt
d13488f517 Split FrameworkUtil into separate extension classes
Adds bigendian float/double logic
2022-07-06 17:30:14 -07:00
Kurt
42743d8c2f RS: Locations 75/77 unused
Remove from valid hatch location list
Mark as (unused) in text files

Closes #3544

Co-Authored-By: prof64 <80442784+prof64@users.noreply.github.com>
2022-07-04 01:02:47 -07:00
Kurt
cf86cafdf7 Add optional loop for generating min level 2022-07-02 17:10:30 -07:00
Kurt
0605a01b24 Remove unnecessary assignment
PIDIV.None is equivalent to a zeroed field.
2022-07-02 12:24:43 -07:00
Kurt
daf9ad76c9 Change default ShowdownSet import for empty moves
Don't replace current moveset if no moves requested.
2022-06-30 17:24:01 -07:00