Commit graph

8942 commits

Author SHA1 Message Date
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
6e13031217 Add cancellationtoken to cancel long searches
Close the window if you accidentally search all, and the program will stop searching rather than continue running in the background.
2022-05-07 09:25:59 -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
703a641b4a Show + retain free space sorting index: gen7 items
Closes #3485

PKHeX has ignored gen7 free space since the initial implementation, if I recall correctly -- no more :)
2022-05-03 16:28:07 -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
a6561a91b1 Add clone deletion in savefile from pkmdb 2022-04-19 16:33:11 -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