Commit graph

27 commits

Author SHA1 Message Date
Kurt
a693ba87ba Update cosplay sprite handling
Cosplay are stuck on gen6, cap pikachu can interact with bank; make
Cosplay the oddball resource.
2018-07-22 12:06:43 -07:00
Kurt
c7175fbdb4 Misc reorg
bye bye SAVUtil and PKMUtil
2018-07-20 21:32:33 -07:00
Kurt
baac632218 Enable editing gen1/2 hidden power type 2018-07-14 10:56:11 -07:00
Kurt
5d20c79568 Add showdownset localization for slot previews
Localization only for game strings (not Ability/Nature/Stat/etc labels)
feels kinda goofy but it works
2018-07-13 19:13:25 -07:00
Kurt
98a1677d14 Fix property reference
oops
2018-07-12 20:36:59 -07:00
Kurt
296d1c20ed Use ITrainerInfo interface for trdata 2018-07-12 18:15:20 -07:00
Kurt
d20706dd70 Update xmldoc
le lenny goes here
2018-07-11 19:19:19 -07:00
Kurt
7f31fdf874 Simplify string trim
RemoveRange instead of while {remove last}
2018-07-10 17:54:05 -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
e588565657 Refactoring
reduce pk3/ck3/xk3 logic, share AbilityBit property within _K3, and when
loading, type check (favored over hardcoding individual load cases)
pull some non-gui code from PKMEditor to core/etc for general data
fetching
2018-07-06 17:37:07 -07:00
Kurt
e2fd00a27a Restore while loop
Yeah forgot that extremely bad RNG rolls (0,0,0,0,0) leaves 510
remaining, and the last EV can't have that much

rework loop to be simpler & quicker by checking the last IV for validity
only
(don't bother keeping it unrolled
2018-07-04 12:23:42 -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
e495883d87 Reorder marking for speed last
Closes #2040
2018-07-02 14:37:21 -07:00
Kurt
9f8edc89bf Refactoring
put some string[] behind IReadOnlyList to prevent any consumer from
modifying it
2018-06-30 09:59:48 -07:00
Kurt
e4a83dbbac Update GetPKMExtensions to support lower gens
gen1&2 are allowed for 1-2/7+, else the minimum is gen3.
2018-06-27 18:53:08 -07:00
Kurt
69cd79c6b5 Simplify GetUnownForm method
yeah lets not fetch a throwaway byte array to remove the need to
rightshift

use the GetRandomPID fetch.
2018-06-27 18:52:02 -07:00
Kurt
e29cf2a903 Rework secondary check flow
Checks.cs initially started out small, but over the years it has grown
to handle multiple types of checks. With all these checks next to
eachother, it's hard to see the overall groups. Splitting them up
(potentially further?) allows for more focused maintenance &
understanding.

Not sure if I'm happy with the overall bandaids used (checks no longer
done within LegalityAnalysis so variable repointing is excessively
used), but I'm happier the way it is now compared to the huge Checks.cs
2018-06-23 22:00:01 -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
9a0ddf1f5e Handle farfetch'd ’ nickname check case
https://projectpokemon.org/home/forums/topic/45837-g3%C2%A0farfetch’d-nickname/
Thanks Davil!
2018-06-17 11:34:39 -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
021ac7c54f Refactoring
where!contains -> except
relocate special tutor
2018-06-09 16:04:06 -07:00
Kurt
a5af7a443b Revert outer comparison
type check done in loop, whatever comes out of ConvertPKM is either the
desired type or null.
2018-06-04 21:32:15 -07:00
Kurt
59b4b8f755 Simplify pkm conversion
just loop instead of goto, let the jit handle optimization
src looks quite pretty now!
some tradeoffs made but much more maintainable now
2018-06-04 21:28:14 -07:00
Kurt
6cff642ff1 Skip format check on pk* init
also remove ck3/xk3 no-op call (no encryption for those formats, like
bk4).
2018-06-04 20:25:54 -07:00
Kurt
730709b33b Add entree forest abstractions
make cryptarray public
2018-05-27 14:19:19 -07:00
Kurt
c349ab8218 Relocate vc lang detect to pkx
reusable
2018-05-24 16:53:54 -07:00
Kurt
95b4d0820d Minor reorganization
amount of pkm obj classes is pretty high, move the static utility
classes to another folder

breaks usage of pkm.ShowdownText; removes a dependency from PKM.
2018-05-18 19:33:11 -07:00