Commit graph

9276 commits

Author SHA1 Message Date
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
d012134d23 Improve display precision of size floats
Use the Round-trip format when converting to string.
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#RFormatString

The default behavior in net4.~ ToString doesn't use "R", hence me assuming F6 would be sufficient, but it does not display as a round-trip value.

netcore3+ changed the default behavior and aligned it with standards ~ https://devblogs.microsoft.com/dotnet/floating-point-parsing-and-formatting-improvements-in-net-core-3-0/

now, both net461 and net6 builds display the same values. Doesn't resolve the mono issue where legality check flags calc != stored.
2022-10-16 18:36:33 -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
6c86acf5d8
Sync zh_HK translation with the latest README (#3598)
Pokémon Ranch file (\*.rk4) is available now for PKHeX, so sync zh_HK translation with the latest information in README.
2022-10-02 20:25:39 -05: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
3a085c6607 Show "Add" button next to batch command dropdowns 2022-09-17 02:00:06 -07:00
Kurt
d33b97bf67 Fix direct cast from object(->int)->ushort
https://projectpokemon.org/home/forums/topic/62327-error-occurs-when-trying-to-goto-a-specific-pokemon-through-combo-box-in-pokedex-editor/
ty liopds !
2022-09-17 01:16:11 -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
Kurt
d8923fe3fb Keep GroupViewer in front when popped up
Closes #3588
2022-09-15 17:37:23 -07:00
Kurt
787bf1a49b Export csv as unicode instead of UTF8
Better handles corrupt (invalid) chars from nick/OT strings.
https://projectpokemon.org/home/forums/topic/62312-error-occurs-when-trying-to-save-box-data-report-to-a-csv-file-in-gen-7/

Thanks liopds !
2022-09-14 19:34:23 -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