Commit graph

2015 commits

Author SHA1 Message Date
Kurt
5ef1850e46 Disallow marks on GO encounters 2021-02-01 20:34:04 -08:00
Kurt
4e9908a53d Remove unnecessary logic 2021-02-01 20:17:17 -08:00
Kurt
9124a3c62b Improve handling of multi-nicknamed mystery gifts 2021-02-01 18:35:37 -08:00
Kurt
6d41d6a17c Fix casting issue for mystry seed fetch
rand32 -> int32 can yield negative, when modulo'd can be negative (bad index)
2021-02-01 10:53:40 -08:00
Kurt
8a2d115df3 Sanity check nature for Criteria parameter 2021-02-01 10:45:53 -08:00
Kurt
afbf1d997b Try to detect vc transferred species, don't assume most evolved 2021-02-01 09:52:25 -08:00
Kurt
7833d12f95 Simplify shared egg move array get 2021-01-31 23:07:14 -08:00
Kurt
a43f6aa71a Add february dist raids 2021-01-31 22:40:47 -08:00
Kurt
f3ef88a5e9 Respect ability from criteria 2021-01-31 21:53:11 -08:00
Kurt
2dbdd83952 Update NicknameVerifier.cs 2021-01-31 21:43:33 -08:00
Kurt
34ac8167f2 Update EncounterSlot.cs 2021-01-31 21:42:24 -08:00
Kurt
d2d20c13e0 Don't emit JP-BU as a random gameversion 2021-01-31 21:28:33 -08:00
Kurt
fa3fe0a380 Invert check, fix xmldoc descriptions 2021-01-31 20:12:46 -08:00
Kurt
1ece844f78 Partial match HA species without a HA possible
A captured metapod cannot have hidden ability via ability patch, but a captured caterpie evolved into metapod can, assuming it existed as caterpie.
2021-01-31 13:05:36 -08:00
Kurt
4456a9dc7a Update nickname rules for gen8/=>gen8
Add a setting so that can flag deceptive species nicknames (even though it may be possible).
2021-01-31 12:37:03 -08:00
Kurt
09e5dde609 Add gen6 key item arg logic 2021-01-31 10:53:41 -08:00
Kurt
d8e75ee85a Force Japanese language for JP-BU safe language fetch 2021-01-31 10:19:12 -08:00
Kurt
4d25214c8d Update EncounterEgg.cs 2021-01-31 01:20:35 -08:00
Kurt
332449f53d Fix erroneous yield counter increments
https://projectpokemon.org/home/forums/topic/58492-possible-legality-error-for-the-mon-from-pokemon-bank-using-ability-patch-with-the-new-update/
2021-01-31 01:12:20 -08:00
Kurt
a7f6c212f9 Permit gen2 moves on a vc1 transfer
feels dirty
2021-01-30 22:03:41 -08:00
Kurt
a524032f61 Add TR flags to emoveset generator 2021-01-30 21:49:45 -08:00
Kurt
6089268b53 Set valid nature for generated toxtricity 2021-01-30 19:58:05 -08:00
Kurt
09bfe5bd95 Enforce shadow locks when generating a ck3/xk3 from criteria 2021-01-30 19:42:58 -08:00
Kurt
62bf1c2755 Add stubs for verifying memories regarding items
Not implementing these, but at least setting up a clean area for anyone else to implement the logic
2021-01-30 19:15:39 -08:00
Kurt
3bb4553b24 Disallow encounter edge case moves when battleversion reset 2021-01-30 13:15:21 -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
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
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
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
944ff107b0 Add new distribution raids 2021-01-21 16:30:07 -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
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
3c42978afa Use IndexOf instead of FindIndex when possible 2021-01-16 12:47:02 -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
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
Kurt
c32b38a53c Minor annotation tweaks
no functional change
2021-01-12 22:26:08 -08:00