Commit graph

82 commits

Author SHA1 Message Date
Kurt
ce17fd4050 Minor tweaks
Enc static 4 should check met location, since locations are flexible for roamers
Simplify expressions
Disallow 0 moves in "needed moves" list.
2020-11-19 15:34:06 -08:00
Kurt
0af0c05bac Update go slot list yield and move fetch 2020-11-18 21:34:40 -08:00
Kurt
037db7b8a3 Add xmldoc for new obj/func related to GO legality 2020-11-16 21:17:45 -08:00
Kurt
26e0f31c95 Include date legality parameters for LGPE
Extract common abstract class for GO transferred encounters
Clamp minlevel instead of met level
Add optional parameter for GO IV randomization
Update go legality binaries with latest
2020-11-16 15:32:22 -08:00
Kurt
d7dc69104b Fix year check
still testing
2020-11-15 18:12:58 -08:00
Kurt
760adb4945 Check date legality 2020-11-15 08:31:48 -08:00
Kurt
377ec02c9b Minor clean
Remove GoPark as a "Type" since it is now baked into the encounter object type
2020-11-14 12:55:30 -08:00
Kurt
ad9e9ddfa0 Relocate go encounter maintenance outside of pkhex.core
PKHeX.Core now accepts generated pkl binaries from PoGoEncounterTool (PGET).

Refer to pporg's repo. This will be treated like event data; occasionally updated.
2020-11-14 12:51:24 -08:00
Kurt
5e22c119be Continued refinements 2020-11-13 08:20:51 -08:00
Kurt
f366d27bdb Revert Mothim form 2020-11-12 22:00:02 -08:00
Kurt
01c597cba7 GO checks round 2 2020-11-12 20:41:01 -08:00
Kurt
915727ed67 Add g-kanto formes
Probably will refactor things when shiny/ball legality is detailed
2020-11-11 13:27:08 -08:00
Lusamine
86096201e8
Add Route 3 -> Motostoke City crossover (#3085)
Not related to the location glitch; whistle to lead Zigzagoon.

Co-Authored-By: tehvik <40148574+tehvik@users.noreply.github.com>
2020-11-10 22:11:19 -08:00
Kurt
7654ce2123 Add initial legality checks for GO->HOME transfers
took me less than an hour to do these changes, and i can flag bad form movesets no problemo

Expect tightening of restrictions (ball, level, shininess) later
if someone wants to curate met date restrictions, go ahead!
2020-11-10 22:10:53 -08:00
Kurt
227efc1fc3 Only allow checking if lvl60 when lvl<60 2020-11-05 21:17:13 -08:00
Kurt
51c872f4e1 Move more logic closer to where it's used 2020-11-02 14:46:26 -08:00
Lusamine
d5e5df802e
Add Ballimere Lake -> Lakeside Cave crossover (#3069) 2020-10-31 22:29:08 -07:00
Kurt
c9ee07e9b9 Update form for friendsafari vivillon
Closes #3066
2020-10-30 22:23:13 -07:00
Lusamine
5e92b7b5f7
Add crossover and static encounters for CT (#3050)
* Add crossover encounters for CT

* Old Cemetery -> Giant's Foot

* Add some static encounters

* Add Frostpoint Field -> Freezington crossover
2020-10-27 22:08:49 -07:00
Kurt
2e4af1afc5 Update legality comparisons for Crown Tundra
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2020-10-24 11:16:01 -07:00
Kurt
52a67f2425 Add Stadium2 Support
Introducing a new PKM format: SK2
Split ICaughtData2 off of PK2 so it can be shared with SK2 when type-checks occur
Add conversion for PK2<->SK2
Split the split-buffer handling for GBPKM to GBPKML (what a name), so that I can reuse shared accessor logic for SK2.
2020-10-02 18:08:40 -07:00
Kurt
ce5897ff94 Move version value from Slot to Area to reduce member size & value passing
Restrict some setters to protected only
2020-08-30 11:08:21 -07:00
Kurt
6ee7a8724b
Offload EncounterSlot loading logic to reduce complexity (#2980)
* Rework gen1 slot loading

Slot templates are precomputed from ROM data and just loaded straight in, with tight coupling to the encounter area (grouped by slot types).

* Revise fuzzy met check for underleveled wild evos

Example: Level 23 poliwhirl in RBY as a level 50 poliwhirl, will assume the chain is 25-50 for poliwhirl (as poliwag evolves at 25). Instead of revising the origin chain, just ignore the evo min level in the comparison.

Previous commit fixed it for gen1.

* Rework gen2-4 slot loading

Gen4 not finished, Type Encounter data and some edge encounters not recognizing yet...

* Add feebas slots for old/good encounters

* Begin moving properties

Great news! Gen5-7 need to be de-dumbed like Gen1-4.

Then I can remove the bang (!) on the Area accessor and ensure that it's never null!

* Split off XD pokespot slot encounter table type

* Set area in constructor

* Deduplicate g3 roaming encounters

* Deduplicate xd encounter locations (rebattle)

Only difference is met location; no need to create 500 extra encounter objects. A simple contains check is ok (rarely in gen3 format).

* Make all slots have a readonly reference to their parent area

* Minor clean

* Remove "Safari" slot type flag

Can be determined via other means (generation-location), allows us to reduce the size of SlotType member to a byte

Output of slot binaries didn't preserve the Safari flag anyway.

* Update SlotType.cs

* Handle type encounters correctly

* Merge safari area into regular xy area

* Merge dexnav accessor logic

* fix some logic so that tests pass again

rearrange g5 dw init to be done outside of static constructor (initializer instead)
PIDGenerator: friend safari slots now generate with required flawless IV count

* Add cianwood tentacool gift encounter

* Remove unnecessary abstractions

Fake area just returned a slot; since Slots have a non-null reference to the area, we can just return the slot and use the API to grab a list of possible slots for the chain.

Increase restrictiveness of location/type get-set operations

* Minor tweaks, pass parameters

DexNav observed state isn't necessary to use, only need to see if it's possible to dexnav. Now that we have metadata for slots, we can.

* Remove unused legality tables
2020-08-30 10:23:22 -07:00
Kurt
780e8bf2bf Branch to specific iterator
Similar to fuzzy matches for gen3/4 iterators
2020-08-22 14:52:17 -07:00
Kurt
42453bdcd8 Update EncounterArea8.cs 2020-08-22 14:12:16 -07:00
Kurt
a62324a5a1
Refactoring some IEncounterable-type'd object initialization and original-generation evo chain (#2974) 2020-08-21 16:35:49 -07:00
Kurt
a6a3c6eaaa Refactoring
change some expressions for better perf/readability
2020-07-19 17:48:45 -05:00
Kurt
40ce63873d Reduce gen1 encounter legality startup alloc by 5KB
Use precomputed counts to remove the need to store a cache of read values

rename some variables in ReadSlots1FishingYellow
2020-07-19 14:08:56 -05:00
Kurt
eb7ed44b29 Finish splitting gen1/2 encounter types from parent class
Results in a little more code, but each path is less tangled
simplify some expressions
remove RBDragonair content in favor of a strict filter for catch rate

Move gen1 trade trainer names to stringconverter, since pk1/pk2 shouldn't refer to legality classes
2020-07-19 13:32:40 -05:00
Lusamine
fdfa10e881
Add a few static/crossover encounters (#2932) 2020-07-08 22:59:08 -05:00
Kurt
a7ba178005 Remove unreachable/const logic
Earlier compares result in some logic being unnecessary

The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
2020-06-27 22:44:14 -05:00
Kurt
3138fb20c6 Refactor some method signatures
vs -> chain (clarity on what it is; an evolution chain, rather than e.v.o.s - vs)
Clamp origin chain for transferred where we can use the max origin level
2020-06-27 22:18:29 -05:00
Lusamine
565c9a590e
Add some cross boundary encounters (#2910) 2020-06-26 23:31:23 -05:00
Lusamine
bc1538efa5
Add some IoA cross-boundary encounters (#2902) 2020-06-24 07:34:26 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
db30170cc5 Update EncounterArea7g.cs
Kinda ugly but works for now
Closes #2861
2020-06-16 22:40:43 -05:00
Kurt
6aab8ca449 Minor renaming/type change of passed args
Next commit will have more changes where we remove some reliance on PKM.GenNumber, in favor of the passed encounter's generation
2020-05-31 12:12:07 -07:00
Kurt
67e9809ecd Require exact form matching 2020-04-12 19:41:03 -07:00
Archit Date
e3e46209e9
add back watchtower as a legal location (#2796)
made an oopsie, Watchtower Ruins also apparently includes 2 extra dens that can spawn encounters that are not 8NC. Den 17 is locked to 8NC encounters only, but location-wise there is no difference between Den 15,16,17
2020-03-20 07:22:44 -07:00
Kurt
c8343e9f5d Update EncounterArea8.cs 2020-03-19 22:15:01 -07:00
Kurt
72e0fbe225 Update EncounterArea8.cs 2020-03-19 21:06:46 -07:00
Kurt
94d8125574 Split up Friend Safari checks & generator
removes one GetEnumerator call for non-fsafari encounters
2020-03-14 11:32:27 -07:00
Kurt
509e2f1fa3 Handle more evolution/form checks
Closes #2726
1. Add variant evolutions to form-match cases
2. Ban LGPE origin alolan raichu
3. Add egg form check for unavailable regional forms
4. Previous commit fixed mew (remove ribbon interface from WB7)

Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
2020-02-20 22:11:48 -08:00
Kurt
ebf20d927b More transfer implications
Totems are downsized to regular
araquanid, togedemaru, and ribombee totems can't transfer (at the moment)
2020-02-11 20:11:33 -08:00
Kurt
5ac9782320 Form check wild unown
Closes #2682
2020-02-04 17:38:35 -08:00
Kurt
522dbdbe32 Flute boost/decrease 3->4
Closes #2678 ty @Rayqo
dat level 1 wild pokemon 👍
2020-02-03 18:40:31 -08:00
Kurt
108233b45f Add glalie/skuntank locations
#2570
2019-12-10 19:54:26 -08:00
Kurt
c85c8ded5c Fix crossover location compare, add formchange
Rotom can change forms, first time it's available in the wild. Fun.
Fix crossover location comparison (was always returning false).
2019-12-09 19:28:28 -08:00
Kurt
eac3804c7b Clean up dexlevel/evocriteria constructor usage
DexLevel was the initial abstraction, which was expanded/reused for
evolution details

I should probably merge the two classes since everything is passed as
EvoCriteria
The encounter generators do some silly form fuzzy match which can now be
more accurately checked since I've moved Form to DexLevel... maybe a
future commit can clean that up.

encounterarea2 was reusing this class, just use a throwaway readonly
struct as our temp value storage
2019-12-05 23:04:24 -08:00
Kurt
f25b36a306 Minor tweaks
Remove unused stuff
add some comments/xmldoc
Move Trainer1 to classes that use it
2019-11-28 14:00:55 -08:00