Commit graph

194 commits

Author SHA1 Message Date
Kurt
e4210e2b3e Misc api improvements
extract common nature amp logic
generic ienumerable copyto which now returns count of elements copied
(maybe useful later). prior usages never tried to copy an enumerable
larger than the dest array (now length checked).
2018-02-28 21:50:50 -08:00
Kurt
1411933e27 Relocate pkm stat controls to separate usercontrol
splits the logic up
change hypertrain from ctrl (prevents 30/31 setting) to shift (allows)
2018-02-26 21:22:35 -08:00
Kurt
016b75fe83 Fix necrozma showdown->short names
closes #1848 , had deleted short->showdown conversion

Thanks @architdate !
2018-02-21 20:40:06 -08:00
Kurt
26ca111630 Fix SetHPIVs order
speed IV last -> speed IV first
closes #1844
2018-02-18 09:54:17 -08:00
Kurt
e6a74b0145 Only skip nickname set if currently same
Closes #1842
2018-02-17 17:42:00 -08:00
Kurt
2b49ab0034 Fix return value for forme parsing
false => failed to parse
Closes #1834
2018-02-15 18:59:38 -08:00
Kurt
68c782e661 Handle version mega import/export
Closes #1832
2018-02-12 17:36:15 -08:00
Kurt
dae038d59c Use hidden power spread with most 31IVs w/guessing
#1826 (HP Ice with ATK=0 now prefers flaws in only defense rather than
HP and defense).
2018-02-09 21:27:57 -08:00
Kurt
033d5baa06 Check EC-PID same for gen1/2 transfers
Fix PID->EC on gen<3 transfers

https://projectpokemon.org/home/forums/topic/43779-about-vc-pokemons-pid-and-encryptionconstant/
2018-02-08 18:47:52 -08:00
Kurt
22a2056a91 Fix showdownset IV HPtype export
no need to reshuffle IVs since the pkm->showdownset defines the IVs in
the speed-first order
Closes #1824
2018-02-07 20:59:36 -08:00
Kurt
93fd47a8e5 Rework hidden power IV setting
If the Hidden Power set doesn't match what is required (missing Hyper
Trained IVs), will need to adjust IVs.

Compute the first matching hidden power IV set by permuting flawless IVs
to flawed.

Closes #1821
2018-02-07 18:28:56 -08:00
Kurt
8695666044 Fix showdown set form import off by 1
closes #1811
2018-02-04 09:44:19 -08:00
Kurt
118a213b6c Fix backwards conversion copy order
reflection (now only used for backwards conversion) will use destination
order instead of source order so that the destination can order itself
for quirks

redo method call (probably breaks someone if they update, maybe pk2pk)
2018-02-03 15:32:45 -08:00
Kurt
886398184f Add pk4/bk4 shared class
reflection no longer used for official transfers
2018-02-03 15:31:35 -08:00
Kurt
c5655166bf Add shared pk3/xk3/ck3 class
standard generation 3 pkm content & interactions
generic inter-converter (more efficient than reflection)

update conversion methods; specific format conversion is now in the
object's src file now.

may be worth doing for gen4 pk4<->bk4
2018-02-03 12:42:06 -08:00
Kurt
84a0381050 Add Italian to gb languages
https://projectpokemon.org/home/forums/topic/43655-pokemon-crystal-egg-mark-as-not-legit/
2018-01-30 20:34:11 -08:00
Kurt
c4865c6c0a Fix kommo-o-totem detection
psim lexing sucks lul
Closes #1796
2018-01-30 16:18:39 -08:00
Kurt
7063ea2971 Remove vc1 pay day mewtwo restriction
Closes #1794
2018-01-30 09:38:45 -08:00
Kurt
d7eae51c1f Use showdown specific gender culture for formID
Closes #1793 , the form was returning -1 because it was expecting ♀ not
F
2018-01-29 17:20:12 -08:00
Kurt
9085dfd950 Allow backwards conversion on hax
works somewhat on drag&drop individual files, not guaranteed to work for
all pkm formats
https://i.imgur.com/v3i3ON9.png

Closes #1792
2018-01-28 22:47:03 -08:00
Kurt
9e7a4d01ab Update blank constructor
first declared constructor is a static constructor, skip that one by
filtering out !static
2018-01-28 21:40:42 -08:00
Kurt
bfe4f3222d Don't update HP IVs if IVs already provided
Closes #1786
2018-01-27 20:18:38 -08:00
Kurt
802105d22d Allow pay day mewtwo, disallow dizzy punch
#1772
transfer pk1->pk2->pk7 for mewtwo knowing dizzy punch, just so we can
keep Pay Day
2018-01-25 19:17:42 -08:00
Kurt
1db5161a59 Add shiny star to pk1 filename export
closes #1770
2018-01-25 08:50:17 -08:00
Kurt
b229a947f2 Fix pt/hgss egg location handling 4->5
Closes #1766
pt/hgss egg location data is lost on transfer, retaining faraway place
only.
2c8e2176e9 fix was incorrect
2018-01-21 11:57:34 -08:00
Kurt
c751c987a9 Add DebutGeneration get
https://projectpokemon.org/home/forums/topic/43378-generation-search-in-pkmdb-andor-batch-editor/

(less than) < and (greater than) > not currently supported (no plan to
add, would need to rewrite value eval logic)
2018-01-10 15:40:33 -08:00
Kurt
8cf97f3761 Add pom-pom edge case
dash was stripped out during conversion
closes #1744
2018-01-06 09:40:30 -08:00
Kurt
6a9e2ed4b9 Refactoring
improve speed for resource fetch, add optional Shiny parameter
(currently unused)
#1735
2018-01-02 16:53:39 -08:00
Kurt
e79a35d387 Fix long OT name length setting
StringLength is the raw buffer size, needs to be offset by 1 as the
string length enforced does not consider the terminator

12char OT name in sav7 loaded to tabs -> load gen1/2 save = exception
(now fixed)
2018-01-01 11:27:45 -08:00
Kurt
14821dfb82 Fix catchrate set auto-fix
https://projectpokemon.org/home/forums/topic/43252-pk1-pokémon-files-arent-holding-items-when-imported-to-gen-2/?tab=comments#comment-225459
2017-12-30 10:40:28 -08:00
Kurt
ca20e78269 pkm crypto Refactoring r2
condense repeated logic, reduce overall operations
removes 1 array alloc for pkm encryption (shuffle clones the array, so
don't clone->clone)
removes 1 array alloc for pkm decryption (mutate encrypted array), be
aware that no current use cases input an encrypted region and expect the
reference to stay encrypted (always was a temp array).
remove duplicate bounds checks (early return & for loop)
2017-12-29 15:29:31 -08:00
Kurt
1d405d63c8 speed up pkm crypt
GetBytes returns an array that is immediately discarded (GC pressure)
reduces overhead when loading large pkm collections from save files
(shaved off a couple seconds from my loading from 200+ bak saves)

could probably go faster with unsafe code to r/w ushort directly
then again im profiling under debug but i'd assume the improvements made
actually do improve speed for release builds
2017-12-28 23:24:12 -08:00
Kurt
dccad6c2f4 Simplify/fix UnSanitizeString
Species and Nicknamed params were never used; foreign always resulted in
true for cases when it actually mattered.

Filter to the non-fullwidth characters, check the char type (latin base
vs jp/zh/ko) in order to determine if the full/half symbols should be
squished

could be faster replacing char instead of string, so change those

add two test cases for half width & full width string
sanitization/unsanitization
2017-12-28 22:50:32 -08:00
Kurt
a1f2f8708a Refactoring
pass identifier on cloning pkm
remove unnecessary ref for passing Data (not modifying array reference)
const some magic numbers
2017-12-27 16:36:24 -08:00
Kurt
3445b46526 Remove unnecessary array cloning
new objects would always clone the input array; only clone on object
cloning (keep the original array reference on initial creation from
bytes)
2017-12-26 21:38:19 -08:00
Kurt
dbe000d08e Add some overloads for non-specified generation
fetches current gen if used without generation parameter
2017-12-26 18:54:07 -08:00
Kurt
5580d6a7d4 Extend set obj to apply to pkm data
var psimSet = new ShowdownSet(Clipboard.GetText());
psimSet.ApplyToPKM(pkm);
2017-12-26 18:54:07 -08:00
Kurt
18796d6f92 Misc tweaks
fix bk4 ribbon checks (lacked interface inheritance)
change MN -> UM for get blank save (unused in PKHeX solution)
prevent inheriting from derived pkm classes
2017-12-16 14:11:41 -08:00
Kurt
e5aa39a6bb Refactoring
get language list now doesn't return new objects (or re-enumerate)
update rand usage to be inclusive for top bound, extend shuffle to
collections
remove unnecessary location overrides (already overriden in legal fetch)
2017-12-14 20:58:55 -08:00
wwwwwwzx
6c4a4ff4ec Fix chinese language ID check
Some species have the same unicode name in CHS and in CHT, so it will lose language info after converting from a in-game string to textbox (The game will use different fonts to distinguish them, bad GF)
This change will give CHT encoding a higher priorty if the pkm is in CHT, although it's possible to get CHS encoding default species name with CHT language ID.
Also fixed previous editing error
2017-12-14 19:30:59 -08:00
Kurt
b5640de538 Misc tweaks
reorder some args, reuse some standard methods;
add spanish for gen1/2 egg name case
2017-12-14 16:16:47 -08:00
Kurt
a9ff74059a Misc perf tweaks
checking untraded should just check for the first character (rather than
creating string object)
hashset for wild6 balls
2017-12-13 16:12:53 -08:00
Kurt
f9946368a0 Remove usage of LegalityAnalysis from PK*
CK3<->XK3 transfers to PK3 first now (no direct transfer legally)
2017-12-06 21:28:34 -08:00
Kurt
55c2a603d7 Purge non-dp data for BK4 transfer
#1690
2017-12-03 13:10:14 -08:00
Kurt
805efdbdfa Add missing bk4 property for abilitynum
used in legality analysis, was returning 0 (invalid)
Closes #1690
2017-12-03 12:40:10 -08:00
Kurt
593612740f Fix bk4 IV read order
still pending ability mismatch
#1690
2017-12-03 12:35:51 -08:00
pokecal
0f52f94222 fix MailBoxEditor
add Mail5, almost same as Mail4.
2017-12-04 00:00:14 +09:00
pokecal
c4ca3aba75 add MailBox Editor
I just wanted to fix PK3 heldMailID.
2017-12-03 07:21:07 +09:00
Kurt
0aa4dad921 Add species parse edge case
dashes in species name && dash for forme name, handle edge case.
Closes #1673
2017-11-30 18:24:31 -08:00
Kurt
a7866d3ed0 Simplify crystal detection
any crystal-only data => crystal
no change in overall function for legal pkms being transferred
2017-11-24 18:12:30 -08:00