Commit graph

108 commits

Author SHA1 Message Date
Kurt
b1ead9e630 Split StringConverter into smaller pieces
reduces loading time (don't have to allocate conversion arrays when
launching a gen7 game), and separates things to easier to manage
locations

reworks gen3 string encode/decode, no longer does 3->4->5 and 5->4->3;
instead goes straight to the end result without an intermediary format.

String sanitization should probably be broken up rather than reused, oh
well.
2019-03-20 21:50:44 -07:00
Kurt
7c3e5aa83c Make RandomGender a method instead of property
See pkNX for similar change; the functionality is really *method*
2019-02-17 22:13:40 -08:00
Kurt
d1f6a5a3ff Misc clean
no functional change
2019-02-15 11:46:46 -08:00
Kurt
e79f46673c Refactoring iencounterable->pkm
SetPINGA{S}(pk, criteria) -> pid,iv, nature, gender, ability (stats
future?)
memes aside, this is where criteria data is forced

Split N encounterstatic (has fixed PID and special flag) from
EncounterStaticPID
2019-02-09 11:37:20 -08:00
Kurt
f481404503 Misc clean 2019-02-02 10:19:41 -08:00
Kurt
aa022fad40 Misc refactoring
remove some null usages, return an empty array instead
reduce as arg
2019-02-01 23:08:03 -08:00
Kurt
147b676d8c Misc api accessibility tweaks
disable GeneratePKMs from throwing an exception (it's a testing flag,
not to leak out if someone wants a debug dll I guess)
expose FixedGenderFromBiGender
expose ribbon interfaces
2019-01-26 14:48:32 -08:00
Kurt
8652677a79 Misc tweaks
showdownset: contains char instead of string
gameinfo: static readonly array instead of redefining new on update
legality: order of operation / value reuse / simplification / comments
pkx: compare char instead of single character string
header/footer: move assignment into method as an out instead of ref
2019-01-20 21:55:28 -08:00
Kurt
41a3989b53 Consolidate encounterlink into mysterygift
use synthetic wondercards to match link gifts
2019-01-12 23:50:31 -08:00
Kurt
4dad475fcd Fix colo lock check regression
oops; tests pass now
2019-01-04 00:10:44 -08:00
Kurt
90e5776dbc Update ereader 0IV detection
the ereader mons are nature/gender locked too, so unroll a little prior
to rechecking the overall team (with ereader mon included). Have to do
it this way as a lock can pop if the ereader data matches a prior spread
before the prior teammate can be generated.
2019-01-03 21:29:19 -08:00
Kurt
bd56999b20 Increase search flexibility
add more version fetch methods, add reset method to reset encounter
priority
#2219
2018-12-30 17:30:57 -08:00
Kurt
c2422d6927 Misc updates
possibly gonna update the iencounterable api for criteria
check/enforcement, rather than just generating random encounter data.
2018-12-29 22:19:44 -08:00
Kurt
2d75e93ef0 Move encounter matching logic to iencounterable
generator logic is now clean
2018-12-27 01:00:08 -08:00
Kurt
22b9da58e2 Add priority setting for yielding possible encs 2018-12-15 21:34:50 -08:00
Kurt
71f1e6238a Misc fixes 2018-11-23 10:15:49 -08:00
Kurt
58080f36c9 Add WB7 and legality detection logic
Derived from WC7 with minor alterations (dynamic OT/Nickname which is
stored in the Full data). Since the 0x108 is not stored in the save
file, just keep the full data around.
2018-11-21 12:24:41 -08:00
Kurt
67cc6bdead Account for wild catch combo/lure level boost
Route 4 sandshrew captured at level 13 (12 is max)
+1 for now, not sure if it can go higher
2018-11-18 16:17:39 -08:00
Kurt
830c2cbb29 Add GO encounter area/slots
Level ranges per species TBD
2018-11-14 17:40:41 -08:00
Kurt
f11fa8752c Use pkm format specific evolutions, gg deviations
GG has slightly different evos from usum, don't bother adding a new
binary.
2018-11-13 19:04:58 -08:00
Kurt
5abbe6dceb Add fetching for lgpe encounters (legality checks) 2018-11-11 22:46:03 -08:00
Kurt
101149eb2e Skip eggs for gg (like cxd) 2018-11-11 14:19:02 -08:00
Evan Dixon
9c87ad2977 Port tests to .Net Core (#2156)
* Rewrite tests with XUnit and .Net Core
* Add better "because" message
* Skipping test that was not ready & convert the fact to a theory
* Tweak casing
* Convert select date tests to theories
* Make the GetStringList load lock safer
2018-11-06 15:25:35 -08:00
Kurt
908c98b876 Switch lock checks to newer more complete check obj
Now accounts for the shiny locks & associated restrictions, abusing the
recursion by setting & unsetting the required CPU Trainer's shiny value.

Repoint all test methods to use the new obj methods
2018-10-29 22:49:04 -07:00
Kurt
afffaaa43c Enable full shadow lock checks
If you find any edge cases (the code does not account for shiny locks
yet) pls lmk, would be nice to have confirmed tests :) :)
2018-10-29 19:44:30 -07:00
Kurt
1b57acc6a7 Check all locks for legality checking
Single->All
2018-10-28 20:28:56 -07:00
Kurt
39f98a4a94 Misc qol updates
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
2018-10-27 21:59:31 -07:00
Kurt
ed3699fbb4 Update Ho-Oh mattle check
More languages than Italian have a rule-breaking name. Rework checks a
bit
Flag eggs more accurately
Update force hatch to move Link Trade met location to Egg Location

fix Ho-oh -> Ho-Oh text strings (correctness is key!)
2018-10-27 16:06:06 -07:00
Kurt
3d0d8fa649 Add first shadow lock check
Currently toggled off, can be optionally toggled on (I'm not sure that
it's perfect? Random save files have stuff flagged since they don't
match the lock; will have to investigate later)
2018-10-21 21:07:33 -05:00
Kurt
93af3e61b7 Add handling for Mt Battle Ho-Oh (italian) edgecase
https://projectpokemon.org/home/forums/topic/47917-colosseum-italian-ho-oh/

there's no shadow ID, so it can have both the short (transferred back)
or full name (never transferred) as CK3 without side effects.

allow 10chars in pkmeditor
2018-10-13 08:07:15 -07:00
Kurt
e8552affca More gb restriction relocations 2018-10-10 16:32:02 -07:00
Kurt
4deb5080d1 Misc tweaks
rearrange getmove with respect to tutors; verifycurrentmoves was getting
tutor moves in levelup
extract not-found hint fetch
Expose gen5 block objects (so I can play with saves in linqpad)
2018-10-06 18:45:15 -07:00
Kurt
dc839333b7 Add more parse settings
allows consumers to tweak debatable settings
2018-10-06 13:43:05 -07:00
Kurt
66faa43e03 Add gen6+ fixed ability hot path
Closes #2135
2018-10-06 11:24:46 -07:00
Kurt
f507ab7081 Misc parse settings reorg
makes it more centralized for defining parsing settings, maybe can have
flags to change severity of certain preferential checks
2018-10-05 19:58:30 -07:00
Kurt
ce9d3abbe4 Misc reorganization
Move logical checks using encounter data out of Core.cs

might be possible to excise legality checking objects from
Legal/PKHeX.Core so that a 'slimmer' core can be made
2018-10-04 18:52:00 -07:00
Kurt
db30fea38c Remove gsc dodrio trade OT trailing space
Closes #2126
Rewrite trade OT validation by using the trade's OTs property
2018-09-19 19:09:29 -07:00
Kurt
65272d460a stricter mysterygift references
results in:
- precomputed GetTable() reference
- no casting when iterating for matches
- no db null checks, as they are initally Array.Empty<T>();

reduces noise a little & slightly faster
2018-09-15 16:22:07 -07:00
Kurt
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Kurt
91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00
Kurt
1486b7f14a Misc style & minor tweaks
Remove move combobox flicker hack (no longer necessary)
Add more Array.Empty usages
cache mysterygift sizes
seal some classes

no functionality changes
2018-08-02 20:11:42 -07:00
Kurt
c46924d220 Use wcxfull version/language restriction data
some cards may permit being recieved on incorrect games

some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely

tested flagging USUM rockruff & zeraora

might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
2018-07-27 22:26:27 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
75801e22e0 Update egg location -> encounter generating checks
WasEgg only checks for EncounterEgg valid locations; check for any value
instead.
2018-07-26 14:55:49 -07:00
Kurt
1ff8ebf777 Misc overload add/use
Some values are already computed; pass them in to overloads for quicker
execution
2018-07-19 19:38:44 -07:00
Kurt
ff4ca47ebe Remove GBEncounterData boxing
Interfaces implement enough detail, so can simplify
extract local methods (likely will be inlined)

less obj allocations = faster!
2018-07-18 16:37:21 -07:00
Kurt
a100488142 add gen12 generator kadabra catch rate case
https://projectpokemon.org/home/forums/topic/46259-yellow-kadabra/

Thanks Cloud AC !

update misc verifier for catchrate to better indicate for
any->nontradeback scenarios
2018-07-17 16:54:23 -07:00
Kurt
fe7fea877b Replace boolean OrderBy with DeferBy
orderby consumes the entire input enumerable in 'sorting' the list;
since we don't care about the order besides a yes/no, just manage the
yield order ourselves.

don't bother using this method more than the spot it's in; was a fun
exercise but other spots are set up for easier debugging
(overall flow is where->deferby->yield), could make things easier to
read but meh
2018-07-17 16:28:42 -07:00
Kurt
7ec1cab9a7 Update gen1/2 trade generator to emit gen1 if match
Closes #2060
2018-07-16 15:22:40 -07:00
Kurt
83e61923f7 Add bw/2 jellicent deferral case
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?tab=comments#comment-233860

Thanks paf!
2018-07-13 13:48:27 -07:00