Commit graph

7622 commits

Author SHA1 Message Date
Kurt
8db21c2bd0 Update 21.01.30
Latest cumulative update release with mgdb/pget binaries updated.
2021-01-30 10:46:05 -08:00
Kurt
bdbbe5194e Update MoveSetApplicator.cs 2021-01-30 10:34:24 -08:00
Kurt
4f7faf9c85 Moveset generator tweaks, dexnav move logic 2021-01-30 10:15:38 -08:00
Kurt
1e86fdcea8
Fracture the encounter matching checks to allow progressive validation (#3137)
## Issue

We want to discard-but-remember any slots that aren't a perfect fit, on the off chance that a better one exists later in the search space. If there's no better match, then we gotta go with what we got.

## Example:
Wurmple exists in area `X`, and also has a more rare slot for Silcoon, with the same level for both slots. 
* We have a Silcoon that we've leveled up a few times.

Was our Silcoon originally a Wurmple, or was it caught as a Silcoon? 
* To be sure, we have to check the EC/PID if the Wurmple wouldn't evolve into Cascoon instead.
* We don't want to wholly reject that Wurmple slot, as maybe the Met Level isn't within Silcoon's slot range.

---

Existing implementation would store "deferred" matches in a list; we only need to keep 1 of these matches around (less allocation!). We also want to differentiate between a "good" deferral and a "bad" deferral; I don't think this is necessary but it's currently used by Mystery Gift matching (implemented for the Eeveelution mystery gifts which matter for evolution moves).

The existing logic didn't use inheritance, and instead had static methods being reused across generations. Quite kludgy. Also, the existing logic was a pain to modify the master encounter yield methods, as one generation's quirks had to not impact all other generations that used the method.

---

The new implementation splits out the encounter yielding methods to be separate for each generation / subset. Now, things don't have to check `WasLink` for Gen7 origin, because Pokémon Link wasn't a thing in Gen7.

---

## Future
Maybe refactoring yielders into "GameCores" that expose yielding behaviors / properties, rather than the static logic. As more generations and side-gamegroups get added (thanks LGPE/GO/GameCube), all this switch stuff gets annoying to maintain instead of just overriding/inheritance.

## Conclusion

This shouldn't impact any legality results negatively; if you notice any regressions, report them! This should reduce false flags where we didn't defer-discard an encounter when we should have (wild area mons being confused with raids).
2021-01-29 17:55:27 -08:00
CanoeHope
70b13fc28b
Added Spiritomb and Hallowed Tower DPPt Event Constants (#3136)
* Update const_dp_en.txt

* Update const_pt_en.txt

* Update const_dp_es.txt

* Update const_pt_es.txt

* Update const_dp_ko.txt

* Update const_pt_ko.txt

* Update const_dp_zh.txt

* Update const_pt_zh.txt
2021-01-29 16:17:33 -08:00
Kurt
ff21d63d16 Update MemoryVerifier.cs 2021-01-29 14:34:45 -08:00
Kurt
697a9fc668 Permit 80-89 memories on eggs
nice logic ya got there, GameFreak
2021-01-29 13:47:31 -08:00
Kurt
f7b703626c Only import gbera statics for Generation >0
GO requests would have Generation=-1 (no met location to differentiate 7/8).
2021-01-29 11:32:51 -08:00
Kurt
e5943e3c92 Clamp generation fetch for battleversion 2021-01-29 09:56:31 -08:00
Kurt
3a6bff11c9 Fix relearn move check for gen6+
Probably should rewrite some sections of the current move verifier; lots of old code with illogical paths
2021-01-28 18:08:13 -08:00
Kurt
e8fa28794c Make PIDIV lighter weight, readonly 2021-01-27 16:52:04 -08:00
Kurt
6c1b6a269d Pass gender when creating static entry 2021-01-27 12:29:49 -08:00
Kurt
7497e08f9b Template fields with species for save file
Fix PP since gen8 has pound at 35 rather than 40
2021-01-27 08:40:37 -08:00
CanoeHope
8144a5add2
Add HGSS Blue Card Points Event Constant (#3135)
* Update const_hgss_en.txt

* Update const_hgss_es.txt

* Update const_hgss_ko.txt

* Update const_hgss_zh.txt
2021-01-26 22:13:30 -08:00
Kurt
4bbe9dec96 Update FormVerifier.cs 2021-01-26 16:23:26 -08:00
sora10pls
1be20be877 Fix GO Shiny permissions 2021-01-26 13:35:57 -05:00
Kurt
511797c1f9 Fix gen4 hm indexing 2021-01-25 20:58:56 -08:00
CanoeHope
94d6ce42bd
Add and update some Gen III and IV Event Flags (#3134)
* Update const_frlg_en.txt

* Update const_frlg_es.txt

* Update flags_dp_en.txt

* Update flags_dp_es.txt

* Update flags_dp_ja.txt

* Update flags_dp_ko.txt

* Update flags_dp_zh.txt

* Update flags_pt_en.txt

* Update flags_pt_es.txt

* Update flags_pt_ja.txt

* Update flags_pt_ko.txt

* Update flags_pt_zh.txt

* Update flags_hgss_en.txt

* Update flags_hgss_es.txt

* Update flags_hgss_ja.txt

* Update flags_hgss_ko.txt

* Update flags_hgss_zh.txt

* Update const_hgss_en.txt

* Update const_hgss_es.txt

* Update const_hgss_ko.txt
2021-01-23 16:52:55 -08:00
Kurt
b1c3526618 Update WC8.cs 2021-01-23 11:43:56 -08:00
Kurt
f8c8a1b0e0 Trim out inaccessible headbutt tables
57.1KB => 53.6KB (-3.5KB)
Refer to dumper project for filtering logic
3642bfaf9d
2021-01-23 11:33:43 -08:00
Kurt
edfb8fc2ff Add TID/SID fetch for Battle Revolution
Can unlock boxes by setting a nonzero TID/SID

https://projectpokemon.org/home/forums/topic/36582-pok%C3%A9mon-battle-revolution-save-research-thread/?do=findComment&comment=221812
ty Akunoko
2021-01-22 22:55:55 -08:00
Kurt
68673cf671 Flag all marks, unlike prior commit
oops, unnecessary simplification
2021-01-22 21:17:41 -08:00
Kurt
acfbef6cfa Disallow raids matching if has mark
Closes #3133
not an ideal solution, but the encounter matching API is kinda limited in deferred-invalid vs deferred-notIdeal.

probably need to unify the match logic and generators so they can cache one secondary-check invalid
2021-01-22 20:28:54 -08:00
Kurt
5f8e2b13c5 Simplify headbutt tree pivot check
See the EncounterSlotDumper with the memoization logic & json tree listing.

Simplifies things a lot, and improves checking speed. Unreachable trees are now treated the same as no-trees maps.

ez 1.5KB reduction in file size :P
2021-01-22 19:20:18 -08:00
Kurt
5abd61816f Add gamesync interface for gen7
oops; gamesync ID now shows up as intended
2021-01-22 19:04:54 -08:00
Kurt
6d0da504d5 Fix Tree Area list from Whirl Islands (0x1F) to Route 42 (0x22)
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=264118

Thanks Tlili !
2021-01-21 22:21:13 -08:00
Kurt
944ff107b0 Add new distribution raids 2021-01-21 16:30:07 -08:00
Kurt
8546ecaf46 Fix suggested moveset 2021-01-21 09:27:33 -08:00
Kurt
06e6242944 Update SAV4BR.cs
Uses Big Endian unicode for savefile strings, but pkm strings are big-endian-g4
2021-01-20 22:13:59 -08:00
Kurt
ceb14c8468 Add consistent ctrl/alt modifiers for IV/EV/AV
Closes #3132
2021-01-20 22:09:25 -08:00
Kurt
803b8675fe Rework batrev current slot handling
Show all slots even if they're uninitialized. Empty first slots but present second slots caused errors on init.
2021-01-20 20:29:26 -08:00
Kurt
4c49d489a8 Update SAV_Inventory.cs 2021-01-20 20:01:59 -08:00
Kurt
46b988b6fa Remove unused checkbox 2021-01-20 17:06:37 -08:00
Kurt
fbc089e7eb Minor tweaks
Remove gen3 egg location hashset; only paths that reach it are for hatched eggs or current breed-eggs. Check breed eggs with the singular met location.
Simplify some logic flow
2021-01-20 12:37:51 -08:00
Kurt
9964c91dc6 Remove static init of yancy/curtis names
static constructor ran after the initializer; flip it and remove the unnecessary all-set
2021-01-20 12:36:46 -08:00
CanoeHope
121ae9b611
Rename SWSH blocks and update Chinese HGSS Event Constant (#3131)
* Update TrainerCard8.cs

* Update SaveBlockAccessor8SWSH.cs

* Update const_hgss_zh.txt
2021-01-19 12:46:54 -08:00
Kurt
d805167e7c Save battle version value on value change 2021-01-18 18:18:42 -08:00
CanoeHope
b117c269fe
Add some HGSS Event Flags and update existing ones (#3129)
* Update const_hgss_en.txt

* Update const_hgss_ko.txt

* Update const_hgss_es.txt

* Update const_hgss_zh.txt

* Update flags_hgss_en.txt

* Update flags_hgss_es.txt

* Update flags_hgss_ja.txt

* Update flags_hgss_ko.txt

* Update flags_hgss_zh.txt

* Update const_hgss_ko.txt
2021-01-18 09:04:03 -08:00
Kurt
680e8b711d Add some code analysis for try-return with nullable out 2021-01-17 00:05:07 -08:00
Kurt
bfd948ee2b Update pget binaries, check gender
yay single gender availability! (frillish/jellicent being male only)
2021-01-16 18:29:27 -08:00
Kurt
b5c30193fa Set initial capacity for stringbuilder to reduce reallocation
Default capacity is 16 so it's rarely an issue, but sometimes we don't need that much.

Update xmldoc for more clarity
2021-01-16 17:31:05 -08:00
Kurt
c31285fd6d Dump csv async
Skip Sprite column completely
2021-01-16 17:25:55 -08:00
Kurt
03ae3d470c Simplify value passing
buffers are fixed size matching the StringLength anyways; don't bother with confusing max length passing when the buffer is obvious
2021-01-16 13:56:37 -08:00
Kurt
3c42978afa Use IndexOf instead of FindIndex when possible 2021-01-16 12:47:02 -08:00
Kurt
de418e8db2 Simplify string termination handling
If 0x50,00.. terminated, treat differently than 0x50.. terminated buffer
2021-01-16 12:43:17 -08:00
Kurt
bb1d23e112 Minor clean
Use some enums, save a few virtual/static fetches
2021-01-16 12:01:40 -08:00
Lusamine
15da92f9bc
Document weather for static encounters (#3127)
This only matches the weather table with the Pokemon and does not fully
account for whether a location can spawn a particular weather.

Additional minor changes:
- Adds ScriptedNoMarks to Regis and Glimwood Tangle static encounters
- Corrects a few version-specific Pokemon such as Ludicolo/Shiftry
- Removes erroneous encounters such as Milotic in East/West Lake Axewell
- Removes an unused Motostoke Stadium encounter
2021-01-16 09:31:21 -08:00
Kurt
8eb499c4d0 Update EncounterStatic5.cs
Use base deferral method which only checks fateful flag.
2021-01-14 22:51:01 -08:00
Kurt
613e6db744 Use StringConverter api consistently; use stringbuilder when possible
Retain a stringbuilder to mutate the string rather than finalizing temporary strings

yields some speed improvements (less gen0 string objects allocated)
2021-01-14 22:50:13 -08:00
Kurt
3816d25f7b Condense some expressions
Simplify legal held item array creation, reduce linq usage in startup
Discard unreleased item array references; no need to retain after startup
2021-01-12 22:38:18 -08:00