Commit graph

417 commits

Author SHA1 Message Date
Kurt
f4bfdb8311 Remove unnecessary empty array allocations
yay net 4.6
read more: http://justinvp.com/2015/07/20/array-empty/
2018-08-01 18:30:51 -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
b97e967304 Misc cleanup 2018-07-22 17:14:22 -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
614d2629ce Remove unnecessary ref passing
object is already passed byref, don't need to repoint the reference
2018-07-19 18:09:37 -07:00
Kurt
9a91619580 Update vc1 invalid transfer pruning
Closes #2065 Thanks @WEERSOQUEER !

Single evo species weren't getting flagged in the evolution verification
as they early returned (species matched), just move the sanity check
before that
2018-07-19 16:42:45 -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
1c75093e27 Specify altform for ranch shellos
1 not 0

https://projectpokemon.org/home/files/file/336-shellos/?do=findComment&comment=1290&tab=comments
2018-07-18 07:15:46 -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
Kurt
f8c43d4a06 Rework gen1 trade OT handling
convert all dictionaries to char-byte instead of string (saves 50KB on
compressed dll, lul)
update OT string comparison for pre/post transfer specimens

Showing "TRAINER" for all languages isn't correct, just show a mapped
character

Closes #2049 , thanks @egzonqj & @WEERSOQUEER !
2018-07-10 16:45:24 -07:00
Kurt
027d898f3d Update Yancy Curtis trade OT checks
Thanks paf!
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/
2018-07-10 12:37:40 -07:00
Kamron Batman
5ecd3b1875 Adds distribution for Negai Boshi Jirachi (#2043)
* Adds distribution for Negai Boshi Jirachi

* Updates negai boshi to have the proper game origins
2018-07-08 16:21:49 -07:00
Kurt
397de97f3c Remove excessive references to Util.Rand32()
all usages besides fetching a 32bit random value should use rand.next
remove unnecessary do-while loop for calculating random EVs (always
returns 510 in total)
2018-07-04 11:30:43 -07:00
Kurt
326522c76f Misc simplifications
cache splitbreed species as another class
reduce linq usage in evolution validity check
reuse egg hatch method
2018-07-04 09:15:20 -07:00
Kurt
d11a89d52d Move relearn required flag to checkmoveresult
reduce usage for non gen6+ relearn move cases
save contains result for later usage instead of recomputing the inverse
2018-07-01 21:34:17 -07:00
Kurt
bc6c361746 Reduce linq usage
reuse variables instead of re-fetching (pkm.Species)
add overload for HashSet<int> contains vs ICollection
merge BattleOnly to one hashset
2018-07-01 10:49:11 -07:00
Kurt
3cf78ff3a2 Permit metronome for Pokewalker Cleffa
Closes #2033
2018-06-25 19:15:37 -07:00
Kurt
ea6842e5eb Refactoring
improve readability
2018-06-23 12:37:01 -07:00
Kurt
0d3c6eef74 Refactoring
Relocate fixed OTs to core (iencounterable & checks now reference same
values)
2018-06-23 09:49:04 -07:00
Kurt
b502d11428 Replace evolution check
already have evolution obj from parsing moves, use it instead
2018-06-22 21:40:41 -07:00
Kurt
346c401727 Rework initial evochain trim
push unsaved IVTotal/EVTotal stuff from prior commit
rework exposed types for evo chain
initial trim now uses much less linq

can probably redo the get initial chain to provide a species to break
on...
2018-06-22 17:59:02 -07:00
Kurt
eb35d71fcc Flag East Gastrodon from Friend Safari... correctly
Closes #2023
2018-06-21 20:26:21 -07:00
Kurt
8387da64fb Disallow East Gastrodon friendsafari
Closes #2023
2018-06-21 20:22:14 -07:00
Kurt
2ef12f635f Continued refactoring
move sylveon check to requireslevelup
need to make this generic for transfer species gaps
2018-06-20 15:59:57 -07:00
Kurt
f10cc183a7 Refactoring
Relocate Evolution Chain logic
minor reorg of check arguments for nesting / grouping
2018-06-19 17:14:22 -07:00
Kurt
f3ef122214 Refactoring
continued simplification

core.cs is pretty much the following:
misc one-off junk
moveset fetch
encounter table fetch
evo chain fetch

might eventually move things around a bit further for cleanliness so
that misc meta junk is the only thing that remains in core.
2018-06-18 21:56:30 -07:00
Kurt
0c06506a8d Refactoring
remove some unneeded logic
moves in gen1/2 can be reordered, sequence match should be intersect
(full) contains match.
2018-06-18 19:57:32 -07:00
Kurt
2e1081086d Refactoring
Split evolution data specific DexLevel properties from DexLevel

use IReadOnlyList instead of IList for covariant collection
2018-06-18 19:10:21 -07:00
Kurt
f8a1d26694 Fill empty ability values with ability1
update handling that checked for this case to instead check for
equivalence to ability1 instead of 0

was generating a PGF with ability[1] = 0, which is not correct. Just fix
the binaries to behave and get rid of all the workarounds since future
tables don't have missing values.
2018-06-15 23:41:07 -07:00
Kurt
49c36e2173 Misc legality gen tweaks
bypass savefile language checks if no language set
fix gen2 static gift egg that is really a wild encounter -- egg flag was
set & not cleared -> no wild pkm, bad! Adds test case for this.
(probably isn't a better place to clear, enforces only once per
generation rather than on every yield/end of every static yield)
2018-06-15 18:47:17 -07:00
Kurt
cb5e1239ae Refactoring
Extract game value limits
Rearrange GameVersion util logic extensions
add better gameversion fetch for generator (equivalent to pkmeditor)
2018-06-15 16:00:28 -07:00
Kurt
b9652a835d Weaken gen2 egg species checks for pre-evos in gen1
VC can inhabit both gens

Add Tradeback setting setter for legality tests
Add GBCartEra setting setter for legality tests

Thanks @iiippppk !
2018-06-12 18:46:31 -07:00
Kurt
64a64b8ce1 Add special handling for gen1 encounter move fetch
Begin splitting of GetMovesLevelUp per-gen into per-version
2018-06-12 18:35:56 -07:00
Kurt
242fc295b4 Handle smeargle egg case
#1993
Just use precomputed array since it can only know sketch
2018-06-11 08:03:10 -07:00
Kurt
e105f2b589 Refactoring
fix b2w2 egg base levelup reference (not bw, b2w2!), doesn't really
matter much except for better indication (possibly?)
remove some unnecessary linq ToArray() calls
continue relocating code out of Core
2018-06-10 17:55:03 -07:00
Kurt
3f1195a2d4 Refactoring
Remove duplication of levelup fetch
relocate some stuff to a more appropriate area
2018-06-10 10:44:05 -07:00
Kurt
3b84f33776 Misc changes
Revert linq chain
Closes #1987

change encountermatch comparison (never null), add comparison for vc
output
remove unused strings (will get removed from translation files in later
update)
2018-06-10 00:26:33 -07:00
Kurt
021ac7c54f Refactoring
where!contains -> except
relocate special tutor
2018-06-09 16:04:06 -07:00
Kurt
ee3fda46f2 fix method name typo 2018-06-09 08:04:40 -07:00
Kurt
a494a6b37a Don't generate move check order for an invalid ver 2018-06-08 20:36:52 -07:00
Kurt
1202474cd5 Defer & flag VC korean unobtainable encounters
Closes #1985
2018-06-06 21:49:30 -07:00
Kurt
e52ae06721 Add version check
16 bits for version flags, should be more than enough.

should probably rework it from a packed ushort to a class...
2018-06-05 22:20:30 -07:00
Kurt
323db29374 Handle volt tackle special egg move
edge case turns the [] into an ienumerable, better than calling another
to-list.
2018-06-05 21:38:38 -07:00
Kurt
e7fc30ac7a Add mysterygift region/language restriction code
Closes #1317
Needs the events crew to produce serialized binaries with hash-flag data
for each generation before proceeding any further. I'm not really
interested in doing all the work for events since it doesn't impact
battle legality.
2018-06-05 18:27:08 -07:00
Kurt
ae3b6a7fa1 Simplify IContestStats usage
remove new[] creating for checking if any contest stats exist
(HasContestStats)
2018-06-02 21:19:03 -07:00