Commit graph

328 commits

Author SHA1 Message Date
Kurt
d7f39ea343 Extract pkm searching to separate classes
search logic can now be reused by core projects

adds option to provide extra filters run at the end (prior to clone
check)
2018-08-16 20:06:40 -07:00
Kurt
e366f9a93d Misc tweaks
only have one empty forme array object
rename method for clarity
show version ID for hidden savefile program window titles
2018-08-15 21:15:06 -07:00
Kurt
f079f62956 Remove fullness/enjoyment check
Although bank 6->7 deletes the values for these fields, Pokémon Refresh
can still reintroduce new values.

Closes #2090 , thanks @Lusamine !
2018-08-14 16:45:51 -07:00
Kurt
fc73eee570 Extract PokemonList* to inherited class
Logic is essentially identical; implement a base class and have the
generation specific structures implment the differences.

Reduce the verbosity a little
2018-08-05 17:28:54 -07:00
Kurt
4c96efb9b7 Update pk2->pk1 party stat transfer logic
pk1 boxdata stores current level & current hp, which is only present in
pk2 party data.
if the user drops in pk2(boxdata), the transfer leaves 0 for both
values, which isn't correct.
detect stat_level to determine if values should be regenerated or not.

Thanks HaxAras for finding this :)
2018-07-31 14:29:47 -07:00
Kurt
f35712fcf2 Extract experience logic to separate file
add exp bar logic, unused.
2018-07-29 17:43:30 -07:00
Kurt
d916be1020 Style updates 2018-07-29 13:27:48 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
f0090669bb Update catch rate related logic
#2071
2018-07-24 19:33:42 -07:00
Kurt
279f44a645 Simplify GB stat calc, fix pk2->pk1 xfer fainting
Remove unnecessary floor operation, don't fetch stat arrays for each
stat

Current HP is a box stat in pk1 format (offset 0x1), which isn't stored
in box pk2's. If the hp is zero, set it to the current HP.

Thanks HaxAras for the conversion tip!
2018-07-24 16:41:18 -07:00
Kurt
64284eafef Add pk1/pk2 direct import checks
dragdrop: check
import files from folder: check
no other paths convert afaik

Closes #2074
2018-07-24 15:49:00 -07:00
Kurt
81355dfaf4 Update translatables for pkm conversion 2018-07-24 15:36:46 -07:00
Kurt
b97e967304 Misc cleanup 2018-07-22 17:14:22 -07:00
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
0c5c9bc33c Misc clean / xmldoc updates
remove unused label in QR (use window Font)
escape & -> & for xmldoc proper style
2018-07-21 19:20:11 -07:00
Kurt
c7175fbdb4 Misc reorg
bye bye SAVUtil and PKMUtil
2018-07-20 21:32:33 -07:00
Kurt
f27f11bfc8 Clean up pk7/sav6/sav7 simple methods
extract GetFormDuration to method, remove unused GetIsCompatible
specialized variant (there's a generalized version in SAVUtil.cs,
IsPKMCompatible -- might do another round of WinForms->Core absorption
2018-07-20 20:25:28 -07:00
Kurt
cc509de83c Add lgpe properties 2018-07-14 21:55:45 -07:00
Kurt
cb80c02011 Check Yellow catchrates when updating species
https://projectpokemon.org/home/forums/topic/46259-yellow-kadabra/
2018-07-14 18:08:51 -07:00
Kurt
baac632218 Enable editing gen1/2 hidden power type 2018-07-14 10:56:11 -07:00
Kurt
625a77589b Extract geolocation logic to interface
mixins would be nice but I guess extensions cover this
2018-07-14 10:34:34 -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
01323c0ee8 Add id7 setters
can now set TrainerID7 / TrainerSID7 via batch editor
2018-07-10 21:25:03 -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
3674a11cfe Misc simplifications
absorb verifier calls into the parsing methods
2018-07-01 17:07:29 -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
dc3cdd4491 Fix gen1/2 gender detect
gender: take top 4 bits of gr:
31 = 0x1F = 1
63 = 0x3F = 3
127 = 0x7F = 7
191 = 0xBF = 11

See the pattern? If we change the compares from >= to >, we -1. All
numbers match except for the 25/75 ratio pkm... which unveils the
problem.

Simplify the calc for these using the logic above, which fixes the error
and makes the code easier to read!

Thanks SystemError for assisting :)
2018-06-27 18:31:24 -07:00
Kurt
ed099916b5 Simplify g1/2 shinify action, better retain gender
easy modification which isn't 'random' resulting in a slightly higher
chance of retaining the current gender if possible. threshold values can
change genders (1f:7m), but is slicker overall
2018-06-27 18:14:19 -07:00
Kurt
fba8adb32f Add XY wild undiscovered egg group IV check
Closes #2025
add misc updates/simplifications (personal stuff used in pkNX)
2018-06-24 21:55:00 -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
7591f54de3 Misc updates
Add safari min flawless IVs to reroll (can expand if #2025 is required
for egg group15)
Use EV/IVTotal (faster, not linq array based)
Fix missing pumpkaboo form regression, Closes #2026
Relocate swapbits to appropriate class, unneeded in PKM.cs
2018-06-22 06:24:33 -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
efe77e3b5c Don't clear unown forme on pk4->bk4
Closes #2011
2018-06-16 10:29:36 -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
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
9faba26e90 Add egg base move branch
Closes #1991
Thanks @iiippppk  !

Improve pk2 version detect to better provide gs vs c egg base moves
2018-06-11 07:23:48 -07:00
Kurt
021ac7c54f Refactoring
where!contains -> except
relocate special tutor
2018-06-09 16:04:06 -07:00
Kurt
450d40535d Relocate hypertraining properties to interface
lessen temp array creation, speed++
2018-06-05 21:31:42 -07:00