Commit graph

2227 commits

Author SHA1 Message Date
Kurt
cce362b98a Relocate FFFF trim (and 0000) to same location 2019-03-20 22:13:09 -07:00
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
8bc949152d Enhance IEncounterable list summarization
separates by type (wild, egg, etc) then groups by generation, listing
the locations and games that can obtain it in that location
2019-03-19 22:05:13 -07:00
Kurt
fad5e4bdee Expand comboitem loading for simple cases
slightly less gc pressure, precompute capacity
2019-03-18 21:55:33 -07:00
Kurt
82a40cb965 Misc updates
add comboitem list to string[]
add regions list as cached comboitem list
lock resource cache on fetch
extract alola time list generating
2019-03-18 21:34:21 -07:00
Kurt
7e8154fa62 Make parsing flexible / diacritic insensitive
Flabébé if users manually type it :)
2019-03-18 18:09:48 -07:00
Kurt
53dbdf62f7 Add more test cases, case insensitive parse 2019-03-18 00:04:17 -07:00
Kurt
5e3b390fe1 Add learnability API and tests 2019-03-17 22:19:46 -07:00
Kurt
d975081a86 Add short/long name property differentiation 2019-03-17 22:19:37 -07:00
Kurt
9f7f9f9e75 Use glyph dictionary instead of creating 19 strings
muh optimization
2019-03-16 20:15:12 -07:00
Kurt
3eed1370c1 Minor simplification
if conditional checks >=3, and all subsequent checks require Valid; add
this to the continue condition, and remove unnecessary comparisons

update some comments
2019-03-16 20:07:30 -07:00
Kurt
99baca5f5e Use min parameter count
PK2 doesn't like getting passed null for the byte[] parameter (rightly
so); don't depend on the src code order having the first constructor
being the one with the least arguments

fix it in pk1/2 so that the first constructor has the least args, anyway
2019-03-16 20:04:44 -07:00
Kurt
8a08d32dff Simplify pkm constructors
remove Identifier param. 99% of the time, identifier is not provided,
resulting in a useless call

end result:
provide 'create new' and 'create from' constructors
2019-03-16 18:41:56 -07:00
Kurt
fb76032a39 Remove unnecessary null checks on constructors 2019-03-16 18:23:50 -07:00
Kurt
5765ce8229 Extract gc version IDs to separate logic 2019-03-16 16:48:38 -07:00
Kurt
ebc7c6ae29 Remove PKX.LCRNG method
Duplicate with RNG.LCRNG
reuse cryptarray for gen5 mysterygift r/w
2019-03-16 16:25:25 -07:00
Kurt
fc10fd3d60 Simplify transfer xor, extract glyph conversion 2019-03-16 16:19:00 -07:00
Kurt
9ca4ef1e09 Move pkx hidden power logic to HiddenPower.cs 2019-03-16 12:07:22 -07:00
Kurt
13a6d16cb9 Relocate checksum/dexform logic 2019-03-16 12:01:21 -07:00
Benjamin Sinkula
e4d59b8b98 Add PlayerNames and MatchDate to BV7 2019-03-15 14:35:55 -05:00
Kurt
41bc3f6182
Fix header'ed file export
For xd, getfinaldata returned a standard 344KB save, but then slapped it together with the inner savedata (0x28000 bytes) rather than using the GCI header. Don't use 'Data'
2019-03-15 10:26:16 -07:00
Kurt
94c80fd32c Update 19.03.11
update mgdb latest
2019-03-10 22:56:30 -07:00
Kurt
e0ca0ac1f4 Add decoration / unown puzzle flags
UnlockAllDecorations already exists in SAV2.cs , but expose these in the
GUI with names
2019-03-09 23:13:07 -08:00
Kurt
e8a5a55323 Add union/berry crush stat ids 2019-03-09 10:26:43 -08:00
Kurt
88e2bce495 Sync gs en flags
match zh/ja
2019-03-09 00:16:16 -08:00
Kurt
0d5ee9489b Fix memcard sav cloning
Closes #2267 , Thanks @PMArkive && @Subject21J !
2019-03-07 18:05:55 -08:00
Kurt
bd00680545 Fix incorrect block index ref
https://github.com/kwsch/PKHeX/issues/2267
Still doesn't fix the underlying issue
2019-03-07 17:30:50 -08:00
Kurt
ee787a0f71 Fix HoF size check
now matches the code in ChecksumsValid (< instead of <=)
2019-03-07 15:45:51 -08:00
Kurt
9b783dd047 Unban mankey/machop shiny pgo transfers
https://pokemongolive.com/en/post/battleshowdown2019/
Mar. 5, 2019, at 1:00 p.m. PST (GMT −8) to Mar. 12, 2019, at 1:00 p.m.
PDT (GMT −7)
2019-03-05 23:09:39 -08:00
Kurt
61bf82e2bd Add gs event flags
https://projectpokemon.org/home/forums/topic/49717-pkhex-flag-editing/?tab=comments#comment-240804

via pret repo; looks like 2000 event flags, and 0x100 event
consts/work-vals (byte)
add more rebattle toggles
2019-03-05 23:06:05 -08:00
Kurt
8d49400b07 Change SecondsTo* from int to uint
having a year > 2050 can result in a 32bit seconds value (top bit set);
instead of being negative, keep it as a 32bit number.
2019-03-05 15:55:26 -08:00
Kurt
bb2c7e22cb Add HoF checksum verification and saving
Thanks @av🥑cado#0315 (discord)
2019-03-02 09:16:03 -08:00
Kurt
174f9758a1
Fix gen1 hm index check
Closes #2266
2019-02-28 10:01:28 -08:00
Kurt
e8ade4dd63 Add swsh placeholders
no point adding for legality until much closer to game release
2019-02-27 06:37:11 -08:00
Kurt
fb818f203d Add gb pp/stat calc test
refer #2265
2019-02-25 17:39:41 -08:00
Russell Jones
2909c4afef
Update _K12.cs 2019-02-26 01:26:19 +00:00
Kurt
51bdd7d67c Unban shiny rattata & pidgey
available on pokemon day 2019
https://twitter.com/SerebiiNet/status/1100138566833852421
2019-02-25 17:09:03 -08:00
Kurt
925167bd33 Fix Invalid/Missing Ribbon string format swap
Thanks TORNADO (discord)
2019-02-24 22:20:02 -08:00
Kurt
28823bd437 Split optional into overload 2019-02-24 22:16:30 -08:00
Kurt
30e36579be Misc updates
add more xmldoc
revise some comments for clarity
redo a little bit of logic for perf
rename some methods for better description
2019-02-24 13:57:10 -08:00
Kurt
993bb00a61 Remove powersave unused logic
unused & deprecated in favor of using cfw (powersaves price >>>
ntrboot-b9s flashcart)
2019-02-23 18:02:50 -08:00
Kurt
7ba21c5d8c Use subsection fetch 2019-02-23 17:59:46 -08:00
Kurt
52dd2d6701 Misc tweaks
replace linq for Encrypt/Decrypt pkmdata fetch with faster length check
& optional resize (Span pls!?)
update pk6 comment for why affection is not cleared
2019-02-23 16:05:01 -08:00
Kurt
d792c0d3a0 use u/L
use 'u' to denote uint values, so that less IL ops are required
~(21->17) in the case of IVs
no functional change, just a fun exercise looking at generated IL and
finding ways to use less ops
2019-02-23 15:36:26 -08:00
Kurt
5b29e71954 Misc tweaks
no functional change, just rewrite some logic for better flow
fix subform popup count restriction (OwnedForms requires forms to be
added/removed manually; it doesn't automatically update)

sanitize box names when dumping boxes with separate folders (and bad box
names)
2019-02-23 14:58:48 -08:00
Kurt
17f954b4e8 Xmldoc
Reorder to match parameter order
add more xmldoc
2019-02-23 14:57:35 -08:00
Kurt
ca51edbdcf Change sav.LoadBoxes to return int
make MysteryGift specific method flexible so that any IEncounterable
enumerable can be passed.
2019-02-23 14:37:06 -08:00
Kurt
a339cc9289 Extract pouch manipulation logic
add overloads for API syntactic sugar
make ItemConverter internal again
2019-02-22 22:48:34 -08:00
Kurt
05ba7c519c Misc simplifications
removed duplicate sorting GUI logic
extract grid fetch method
2019-02-21 23:17:50 -08:00
Kurt
df94afa711 Misc updates
extract some enums to core, use Enum.GetNames to do string fetch
make stamp listbox taller
clean up Display*ID setters
2019-02-21 21:54:41 -08:00
Kurt
5f4241063f Misc verbosity reductions
hide enum name
2019-02-21 20:44:31 -08:00
Kurt
c9e894a46d Misc reductions
hide setters for LegalInfo outside assembly (shouldn't overwrite the
stored values)
update GenNumber to Gen* if appropriate; GenNumber checks for first Gen*
to match, is a little more explicit and quicker than calling twice when
checking a range
2019-02-21 20:41:04 -08:00
Kurt
ba65580a8c Rename parameter names for consistency
pkm->pk
2019-02-20 22:23:54 -08:00
Kurt
f30b2766cb Use Heal methods 2019-02-20 22:16:38 -08:00
Kurt
941b1b5c47 Extract some reused logic
Put the methods in Tables4; kinda breaks the 'only arrays here' rule but
they only reference values in this file(partial class).
2019-02-20 22:10:15 -08:00
Kurt
1b221e052c Add PP Heal method 2019-02-20 22:08:28 -08:00
Kurt
cffa6e681d Add OT name setter 2019-02-20 21:52:22 -08:00
Kurt
ba6a958a1d Add xmldoc, make manip not fetch all BoxData 2019-02-20 19:39:49 -08:00
Kurt
d3dd4fb2a5 Track slot modified count on sort/delete/mod
Sorting will always show multiples of boxcount since it repositions
empty slots
2019-02-20 17:59:54 -08:00
Kurt
72ec264f4c Prevent g7 silvally from learning fire/water pledge
https://bulbapedia.bulbagarden.net/wiki/Silvally_(Pok%C3%A9mon)#Trivia
has the two bitflags set but the game only tutors the first bitflag it
sees
2019-02-19 22:57:07 -08:00
Kurt
40963c012a Add sav3 BP Earned editing
misc editor, first tab (main)
2019-02-19 20:59:47 -08:00
Kurt
fa4318ae2f Add gen3 record editing
in misc edits window
2019-02-19 20:46:58 -08:00
Kurt
fb8aa3bba0 Lowercase parameter 2019-02-19 20:26:20 -08:00
Kurt
a385a8481d Misc tweak to savefile export
Use flags to request header/footer in the output
gets rid of the DSV/GCI bool arguments
2019-02-18 21:59:57 -08:00
Kurt
726f69240a Update translations
no localization for new settings/sort options, just expanding from
csharp->english
2019-02-18 19:09:31 -08:00
Kurt
fdc97885c5 Speed up clone detection purge
override Execute's default behavior to use a HashSet
2019-02-18 17:19:25 -08:00
Kurt
98b21eaaa8 Add clone deletion quick action
kinda slow, if a save has 900 mons, it has to check 900*900 which is
O(n^2), takes a few seconds
as opposed to just doing a hashset checking contains, would be O(n)
gotta do some fun stuff to make it faster
2019-02-18 17:00:16 -08:00
Kurt
9171055fd4 Add box sort by encounter type
grabs encounter name and orders by that (Egg/Static/Wild etc)
2019-02-18 15:34:55 -08: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
258f0f0ad4 Minor refactoring
clean up some gc logic, no functional changes
2019-02-17 10:42:43 -08:00
Kurt
202f911d45 Tidy up comboitem fetch naming 2019-02-15 11:47:35 -08:00
Kurt
d1f6a5a3ff Misc clean
no functional change
2019-02-15 11:46:46 -08:00
Kurt
9c521919e5 Reverse array in place 2019-02-15 11:46:02 -08:00
Kurt
858760fa28 Misc updates
relocate program language enum
test that test case is proper
move getcompatible & gettemplate to core
remove catch rate changing for pk1 (catchrate editor now used instead)
2019-02-15 00:50:23 -08:00
Kurt
7acdf0d16d Expose parse results for external consumption 2019-02-14 20:14:46 -08:00
Kurt
3d01617c93 Fix safari unlock
dat 0 -> o
Closes #2262
2019-02-14 18:17:16 -08:00
Kurt
c67b774e1e use enum to decorate rather than comments 2019-02-14 18:12:25 -08:00
Matt
7538a33c81 Update GO shinies (#2260) 2019-02-14 10:49:37 -08:00
Kurt
e7486e4534 Update gender check
showdownset now no longer leaks nulls
2019-02-13 15:50:48 -08:00
Kurt
e82b4de657 Misc clean
replace Friendship control click to match shortcut description (used to
do nothing)
Remove some duplicate translation strings
fix gameselect string formatting
apparently systemsounds changed in a recent win10 update, Question is
now silent?? Exclamation is now the same as Asterisk (same as Beep?) Use
hand instead of Exclamation.
only use asterisk for notifications
2019-02-11 22:39:12 -08:00
Kurt
684191772f Misc refactoring (showdownset null)
Set default values to prevent any properties from being null
extract ClearNickname logic for hot path & reusable method
extract item conversion and move to appropriate logic class
2019-02-11 21:49:05 -08:00
Kurt
2498b6bf50 Misc updates
Simplify unknown gen expression
allow mutation of FormIndex if desired
2019-02-10 21:31:27 -08:00
Kurt
304203262d Add species & ability enumerations
remove hardcoded 810 in unit test, add ability test too
2019-02-10 21:28:32 -08:00
Kurt
182348526c Add display TID/SID get/set 2019-02-10 10:31:20 -08:00
Kurt
9715a08342 Fix custom hex parse
hurr dont write your own parsers
Closes #2256
2019-02-10 10:19:05 -08:00
Kurt
a39f917f84 Simplify expression
ternary with a null check and long method signature is pretty ugly
2019-02-09 23:22:22 -08:00
Kurt
54ba9a0312 Update file->open for pb7 filtering
add pb7 to pkm extension list, ignore it in gen7 (sm/usum), update gg
filtering (allow pb7, not bk7)
add comments indicating format source game
2019-02-09 20:33:37 -08:00
Kurt
e96ef76dcd Add xmldoc
no code changes
2019-02-09 20:24:38 -08:00
Kurt
48e2bbcfed Refactor DumpBox to return 1 value
count < 0 implies an error; values >= 0 can be used to indicate actual
dumped count
2019-02-09 20:19:55 -08:00
Kurt
9a93b20515 Minor rework
use hashset instead of new[] every call
precompute empty arr
allow criteria input for better gen requests
2019-02-09 20:07:15 -08:00
Kurt
ec1d3069a5 Remove SaveFile dependency for wallpaper data fetch
reusability++
2019-02-09 20:05:32 -08:00
Kurt
dc5cdc34d7 Remove FieldsInitialized and rename check method 2019-02-09 17:07:44 -08:00
Kurt
cb98c83bd2 Remove references to Stat_HPMax
use computed value to check if Party Stats are present
maybe I want to use Span and stop resizing all pkm arrays to party
format years from now idk
2019-02-09 13:17:00 -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
cda06bc701 Increase custom parse speed
remove double string replace (now less allocations); only add up values
if they're valid numbers.

builtin int.Parse throws with "1 2", but users can type stupid stuff
like that in the program (so we parse as 12).
2019-02-08 18:29:26 -08:00
Kurt
383d4b7700 "" -> string.Empty
be explicit that the string is empty rather than possibly missing
disallow encrypted export for BK4 (they're not encrypted), removes type
check
simplify replaceall in showdownset (don't call ReplaceAll 4x, just get
valid chars and rebuild)
simplify get ribbon sprite name (precompute ToLower and appended values
2019-02-07 21:40:20 -08:00
Kurt
3474d97fb2 Weaken float comparison for weight/height
ThePunish3D was able to find examples with less precise calcs

https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?do=findComment&comment=240188
assuming these were unmodified
2019-02-07 16:57:17 -08:00
Dixon, Evan
8f8e8020b7 Add NuGet metadata 2019-02-07 17:39:15 -06:00
Kurt
59b41937e1 Misc variable name changes
readability++
2019-02-06 23:28:02 -08:00
Kurt
d03ff30140 Fix ita traded lgpe diglett OT
ty ThePunish3D!

https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?do=findComment&comment=240159
2019-02-05 17:09:47 -08:00
Kurt
a97ae79086 Unban m&m go shinies
https://twitter.com/SerebiiNet/status/1092892163782991873
2019-02-05 15:33:59 -08:00
Kurt
29253ed636 More cleaning 2019-02-03 20:28:03 -08:00
Kurt
264c7d1cbc Replace null return val
Closes #2255
2019-02-03 20:01:56 -08:00
Kurt
893f98d667 Misc clarity
no functional change
make batch editor prefix list readonly
2019-02-03 10:28:33 -08:00
Kurt
2eef523475 Misc clean
meh
2019-02-02 15:20:08 -08:00
Kurt
f481404503 Misc clean 2019-02-02 10:19:41 -08:00
Kurt
6ed9f979de Continued refactoring
removing null results as indicators of no data (c# 8 sooooon)
2019-02-01 23:26:43 -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
d29f670840 Add QRPK7 to PK7
roughly converts the data into a PK7
2019-01-29 21:07:42 -08:00
Kurt
8cfd6d5a63 Expose SetBoxData 2019-01-27 21:57:33 -08:00
Kurt
6353e8d84d Add special set operation for alph rocksmash
closes #2253
ty @Subject21J & @ReignOfComputer
2019-01-27 11:08:21 -08:00
PMArkive
5cb93be681 add legendary pokemon to wormhole slots (#2252)
changed slot numbering from 0-4 to 1-15
fixed drapion's pokedex number in wormhole slot table
2019-01-27 10:40:19 -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
0b5429ebbc Relocate wormhole edit logic to separate class
#2250
make arrays static (only spin up one copy ever)
2019-01-25 19:58:00 -08:00
PMArkive
3f0a5b3ffa Add USUM Wormhole functions (#2250)
The current wormhole's shiny flag & pokemon can be changed with these functions.

The flags & offsets were found by @PP-theSLAYER https://projectpokemon.org/home/forums/topic/39433-gen-7-save-research-thread/?page=3&tab=comments#comment-239090
2019-01-25 19:52:46 -08:00
Kurt
a7323ef484 Misc updates
Reuse some code in netutil for fetching stream (provide useragent for
all uses)
make sav4ranch use dynamicly read offsets to handle both variants
(quicker) #2248
2019-01-25 16:51:58 -08:00
PMArkive
194ddb7c18 add offsets & save-size for ranch's platinum update (#2248)
I don't know yet if the OT offset is the same though
2019-01-25 15:24:01 -08:00
Kurt
7bb3f14e1f Add wishmkr flag fetch
rs only
thx @PMArkive !
2019-01-22 22:28:30 -08:00
Kurt
c033fe2741 Increase precision for cp/size calc
still isn't close enough, but removes the usage of decimals for cp calc.
redd.it/ahac9i

CP calc doesn't flag anything I have that is legal, but the calc is
still off by 2 bits at most... whyyyy? Even the same code run in cpp
results in the same inaccuracy? Maybe this is some arm64 difference?
2019-01-22 21:08:48 -08:00
Kurt
13c13d5f49 Update 1MB invalid savefile message
trickles down to memcard, which is still invalid. Use a more generic
message if a memcard is the same size as a regular savefile.
2019-01-22 19:32:22 -08:00
Kurt
13090c0ced misc gen1 updates
sav1: assign personal table based on (detected/provided) version
catchrate editor: allow to use savefile personal
remove gb era prompt whenever gb/blank loaded; have it as a setting (can
be overridden for VC now). keep allowgbera as autodetect
personaltable: track format for debugging purposes/info

update translations
2019-01-21 20:06:02 -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
ShadowMario3
3f759058ce Update SAV3.cs (#2247)
Fix PC max item count in RSE
2019-01-16 12:13:58 -08:00
Kurt
53b2ca93b8 Update blank sav3 behavior
can now be selected & loaded without exception/hassle
2019-01-15 22:14:19 -08:00
Kurt
b6261e57a3 update structure docs 2019-01-15 16:47:54 -08:00
Kurt
ae6010f169 Add ranch r(/w?) support
not gonna edit the metadata

properly handle an irregular sized display box
2019-01-14 21:31:53 -08:00
Kurt
f0d9e3f2e5 Fix encounter link wc6's
Closes #2244 thanks @kamronbatman & @NinFanBoyFTW !
2019-01-14 18:53:05 -08:00
Kurt
2969a42ad4 add missing ot name check
Closes #2246, needed to mirror wc7 via this commit but failed

41a3989b53
2019-01-14 18:33:00 -08:00
Kurt
ab33f7123b add null check for invalid relearn scenarios
Closes #2245
2019-01-14 16:39:11 -08:00
Kurt
d62a69a6a7 Misc fixes
Provide gen1/2 gb only version origin fetch for personal/moves ty
shadowmario (i assume this fixes things)
make listbox use ingame font for special characters

2f6e30bb3c (r31924945)
ty @pmarkive
2019-01-13 18:12:31 -08:00
Kurt
41a3989b53 Consolidate encounterlink into mysterygift
use synthetic wondercards to match link gifts
2019-01-12 23:50:31 -08:00
Kurt
ce11bda416 Update mystery gift database 2019-01-12 23:49:16 -08:00
Kurt
f60926d200 Add slotview stuff
future implementation
2019-01-12 20:53:50 -08:00
Kurt
4f1375ad6a Add route 1 to sky location table
Closes #2241 ty @Ninjistix !
2019-01-12 17:21:57 -08:00
Kurt
b5cf02a933 Add more party related properties/methods 2019-01-12 10:54:38 -08:00
Kurt
ca0e012c5c Add Heal, make status_condition a pkm property
also split out battle box slot offset fetch
if anyone finds where colo&xd store their status bits, lmk 👍
2019-01-11 22:25:48 -08:00
Kurt
c591d2a69d Misc updates
condense some logic
2019-01-11 17:44:51 -08:00
Kurt
ec76bd6b03 Fix ability bit inversion
one of these was not like the other
ty TORNADO (discord)
2019-01-11 08:09:52 -08:00
Kurt
19f49eb4a7 Misc update
remove duplicate pb7 method (present in _K6); note that the fixed length
should not be changed to SIZE_STORED
comment out useless assignment
2019-01-09 21:11:14 -08:00
Kurt
e08ecb21c1 Bypass tradeevo check for gen1 if sav gen >= 3
Closes #2237
2019-01-09 08:52:56 -08:00
Kurt
3bbde6fc19 Merge branch 'master' of https://github.com/kwsch/PKHeX 2019-01-08 18:35:29 -08:00
Kurt
d85bb76208 Mirror order of operations from pb7
see prior commit; this doesn't make any difference since
CurrentFriendship isn't being called; but we're just matching the flow.
Closes #2235
2019-01-08 18:35:26 -08:00
Kurt
fef80d5a05 Fix pb7 trade logic
Update handler after friendship update (CurrentHandler needs to update
afterwards)
Fix argument order (gender & nonpresent region data)
#2235 side effect
2019-01-08 18:32:42 -08:00
Kurt
bc8b48eb88 Fix sort writeback for locked slots
clear flag, update properties
#2235
2019-01-08 18:31:14 -08:00
Kurt
6bd0e87ea3 Fix copyto discarding elements
don't continue; instead seek forward
#2235 part 1, need surgery for part 2 (starter/locked prevents writing
data to the slot, but the slot can still be swapped)
2019-01-08 16:45:16 -08:00
Mitsuki
3c552cc1e7 Update for Latest Berry Event (#2234)
Because the Berry are now Released on Gen7, allow Items now on Legality Check: Enigma, Micle, Custap, Jaboca
2019-01-08 06:14:41 -08:00
Kurt
c1fa7d3916 Fix fish slot read
oops, final slot was dropped
Closes #2231
2019-01-07 15:41:20 -08:00
Kurt
f97417fe85 Remove some unused bitflag regions
cuts down memory footprint by quite a bit (bool[] is 4bytes per bool)
2019-01-06 22:21:25 -08:00
Kurt
c42c019149 Fix split-evolution regression
Closes #2230
ty @NinFanBoyFTW !
2019-01-06 22:18:14 -08:00
Kurt
1095fd0811 misc alloc reductions
scan the data to determine the size of the result array
prevents list buffer resizing-copy (many times) and the final ToArray()
2019-01-06 21:00:27 -08:00
Kurt
950ddcf9fd Reduce npclock object size
24 bytes per object -> 16 bytes
2,624 objects are made for legality checking; reduces from 73KB to 41KB
removing unnecessary clone recreation -> count from 2624 -> 414 (41KB to
6.6KB)
yay 10x reduction; not huge in the big picture but a fun exercise
2019-01-06 20:58:57 -08:00
Kurt
2a8b43d9c7 Remove temporary test
Shadow lock checks were finished; teams with 5 locks are working.
Relocate member data to the full team verifier.
2019-01-06 20:58:17 -08:00
Kurt
75202c7a89 Misc updates
reducing allocations, increasing clarity by removing some magic numbers
probably can rewrite some of the evo loading/checking for even less, but
good for now.
2019-01-06 16:22:45 -08:00
Kurt
744646e30d Add gold bottle cap bypass for LGPE
All IVs are flagged in LGPE even if they're perfect :(
Might have to revisit this for future games and if LGPE transfer out and
maintain these bad flags (this is bad for inspecting parents before
breeding).

Closes #2229 , thanks @SteelPhase (report) and @sora10pls (verified)!
2019-01-06 16:21:34 -08:00
Kurt
0cdaae1d51 Update cxd antishiny tracking
check antishiny rerolls as required, reduce allocations
2019-01-06 01:26:18 -08:00
Kurt
154f122369 Allow changing of default savefile type
kinda have to restrict these to 'valid' choices; should be enough of a
selection->result to be adequate for changing version

restart the program after changing the setting; won't take effect until
rebooted.
2019-01-05 15:42:20 -08:00
Kurt
9a4f12c279 Misc updates
rearrange pkm version groups for clear break between
twins/siblings/family
clear pokelist for sav7b on non-exportable saves (prevents b1s1 from
showing markings)
rename horohoro (pgo) to non romaji lol, hide daycare/party tabs on
nonexportable save
remove some unnecessary operations
rewrite getallcontrolsoftype to remove ToList() and make generic
2019-01-05 15:40:25 -08:00
Kurt
435c429dfc Allow colo to be a blank savefile 2019-01-05 15:37:06 -08:00
Kurt
174eb81986 Fix xmldoc comment 2019-01-05 15:36:44 -08:00
Kurt
e028214eab Update dex form handling for dex4
still not sure if it's entirely right, but at least there's no more
exceptions
https://projectpokemon.org/home/forums/topic/48288-pokedex-error-gen-4/
2019-01-05 12:37:41 -08:00
Kurt
0c9b760470 Move GetIV to pkm, misc simplifications
remove linq for characteristic calc (get max IV) and others
remove some reliance on new[] for iv/ev
pk5 replace bitmagic with property get->set copy for cleanliness
2019-01-05 10:51:41 -08:00
Kurt
4dad475fcd Fix colo lock check regression
oops; tests pass now
2019-01-04 00:10:44 -08:00
Kurt
7ab42e7cc2 Misc improvements
remove alloc on gc key advancement; advance keys in place
make g6 sizes an explicit comparison instead of new[].Contains
replace Any/Count with Array.Find calls (removes linq dependency from
savetype detection!)
2019-01-04 00:07:37 -08:00
Kurt
bdcabfa573 Update gen4 save detection
footer is different for Korean saves; checked JP/EN and they use the
2006 date. Probably the same for everyone-but-KO.

Simplify check further, only check the 0x4.... sav as it's the first
region saved to. No point wasting time checking the other!

a previous commit alluded to general/storage being initialized in
different slots
e8644280a1
, gonna ignore what was stated as I can't find any proof with the few
tests I did today (all init on second, and found no backups from that
time)
2019-01-03 23:37:49 -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
272a29a641 Differentiate DP/Pt Shaymin
fateful isn't on dp shaymin even though it's an illegal encounter
2019-01-03 17:04:32 -08:00
Kurt
bd6494d8c7 recognize gen12 italian trade OT
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?page=3
Thanks ThePunish3D!
2019-01-03 15:47:41 -08:00
Kurt
e99c9a0999 Add pokestock gst/stk (3 & 4) bulk r/w
ezpz @kamronbatman
2019-01-02 21:56:33 -08:00
Kurt
8c05b9f391 add g3 hall of fame r/w
no GUI

var sav3 = new SAV3(File.ReadAllBytes(path));
var hof = HallFame3Entry.GetEntries(sav3);
hof.Dump();
2019-01-02 18:15:29 -08:00
Kurt
81a660c2dc Update 2019.01.02
Update event binaries with latest from the Event Gallery
2019-01-01 20:52:25 -08:00
Kurt
b5f82f6535 Update translations with latest 2019-01-01 20:27:00 -08:00
Kurt
6929b637cc Misc clean
refactor some common operations
2019-01-01 20:05:36 -08:00
Kurt
80ef196468 fix info output off by one 2019-01-01 20:05:00 -08:00
Kurt
552e7a1a39 Fix pokewalker pid check for female-only
pidGender check failed as 0xFE (female only) returned male if pid ended
in 0xFE or 0xFF
jump out early if the pkm is fixed gender rather than genderless only

https://projectpokemon.org/home/forums/topic/48956-pokewalker-happiny-pid-mismatch/
Thanks Taargüs Taargüs!
2019-01-01 20:04:29 -08:00
Kurt
2b5272a395 Simplify gen4 save type detection
footer identifiers work just fine for any legitimately created save
file; I might have had the checksum check code for pokesav blank
savefiles

dropping support for bad-blanks in favor of a non-negligible speedup is
favorable :)
2019-01-01 11:16:31 -08:00
Kurt
7ba2860db8 more block details 2019-01-01 00:57:51 -08:00
Kurt
8129e91694 Add more detailed block offset docs 2018-12-31 22:19:40 -08:00
Kurt
92d633e8ad Allow IsPokeStar=false 2018-12-31 21:04:13 -08:00
Kurt
5fcd8541ba Add pokestar studio fame / star stat pk5[0x87]
how did this get forgotten so easily lol
added legality check; eggs can't participate in pokestar studio.

not editable from GUI, use ExtraBytes editor.
Re-add 0x86 (array was copied from pk4?) and reorder/comment
2018-12-31 21:01:58 -08:00
XxPhoenix1996xX
ede44aaa1b Update text_Ribbons_es.txt (#2225) 2018-12-31 16:07:34 -08:00
Kurt
6c4fdfa559
Merge pull request #2224 from XxPhoenix1996xX/patch-9
Update lang_es.txt
2018-12-31 16:07:22 -08:00
Kurt
758ec7f55b
Update MessageStrings_es.txt (#2223) 2018-12-31 16:07:06 -08:00
XxPhoenix1996xX
fe57789160 Update LegalityCheckStrings_es.txt (#2222) 2018-12-31 16:06:59 -08:00
XxPhoenix1996xX
31b5b4eea4
Update lang_es.txt 2018-12-31 19:30:29 -03:00
XxPhoenix1996xX
f6c9c7b265
Update MessageStrings_es.txt 2018-12-31 18:50:00 -03: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
2ecd3f1f30 Replace IV3 with FlawlessIVCount
Other games may vary the flawless IV count so best to have consistent
declarations
(the vc transfer encounter has 5 or 3 depending if it's a mew/celebi)
2018-12-30 10:33:00 -08:00
Kurt
82eae79823 Remove cosplay fixed IV
Was added a few months ago
https://github.com/kwsch/PKHeX/pull/2117

Game ignores the fixed IVs and instead does 3 flawless IVs
2018-12-30 01:10:53 -08:00
Kurt
bf1a56af9d Add xmldoc 2018-12-29 23:38:59 -08:00
Kurt
4fcee0ae7a Move wr7 to mysterygift folder 2018-12-29 23:34:34 -08:00
Kurt
e7531dca30 Add wr7->pkm
Not sure if one of the 'level' fields is a move ID instead. Pound=1,
Level=1
Maybe a Chansey record would shed more light.
2018-12-29 23:33:36 -08:00
Kurt
78ff441e8b Update iencounterable api with new criteria arg
rearrange some logic for clearer function (extract some methods)
2018-12-29 22:24:34 -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
03ad20dd16 Improve card title/filename logic
mystery gift editor still fails to generate a description (heldItem < 0
-> exception), the fallback behavior is fine I guess.
2018-12-29 22:15:40 -08:00
Kurt
8a33a95974 Add mystery gift record getset
Mystery Gift button now appears for GG, doesn't work yet
2018-12-29 22:09:59 -08:00
Kurt
f5e3358aaf Split up WR7 to separate files
settled on the class name; looks like it'll be roughly readable as a
mystery gift so inherit some properties. maybe can get r/w in the
mystery gift editor :)
2018-12-29 22:09:27 -08:00
Kurt
71dc944cbd Add wb7 gift record rw
another block documented ;)

https://projectpokemon.org/docs/gen-7/lets-go-pikachu-eevee-wonder-card-album-r109/

names subject to change
2018-12-29 21:24:38 -08:00
Kurt
6f22599baf Prevent slot overwriting on bulk import
https://projectpokemon.org/home/forums/topic/48912-how-to-batch-import-pokemon-boxes-without-erasing-existing-pokemon/
2018-12-28 17:58:13 -08:00
Kurt
3e05e9655e Store hidden power type 2018-12-28 16:54:01 -08:00
Kurt
d5a8d29088 Misc updates
reduce some allocs, clearer names/enum usage
2018-12-27 20:24:24 -08:00
Kurt
d90f099a68 Next unoccupied after starting position 2018-12-27 13:10:55 -08:00
Kurt
f9eb1746ea Add NextOpenBoxSlot fetch for empty slot overwrites
< 0 is storage full
2018-12-27 01:08:42 -08:00
Kurt
2d75e93ef0 Move encounter matching logic to iencounterable
generator logic is now clean
2018-12-27 01:00:08 -08:00
Kurt
3481780e06 Add initial sizes
maximum is always 3; sometimes we know the max size so specify.
bcl has default size = 0, which then resizes to 4 on first addition
wow such optimization
2018-12-26 22:13:04 -08:00
Kurt
988e71bec5 Remove QRText property
removes PKM<-QRPKM class dependency
fix invalid value oob exception (nature & ability fuzz)
2018-12-26 17:31:23 -08:00
Kurt
950d0a8525 Add nature bounds check & legality
expand string array check to cast and check against length; batch editor
Nature>=25 causes problems in hover tooltips. Previous commit fixed for
pb7 stat calcs for invalid natures, pretty sure the actual game is
exploitable for stat calcs and invalid natures (bad access), but isn't
exploitable as it's only used to retrieve an enum to switch against.
2018-12-25 22:59:52 -08:00
Kurt
9db771c0d5 Split out common 6+ pkm format to abstract class
Didn't really feel like pulling out the shared structure get/set
operations, only the derived properties & overall fixer methods. Should
be easier to maintain if any handling updates.

Clean up pb7 unused stuff; removes ribbon logic since none are used.

c# 8.0 interface defaults can maybe pull out more logic (ex making
FixRelearn and relearn moves into an interface); multiple inheritance
can be useful as features are added/dropped between generations.
2018-12-25 22:56:32 -08:00
Kurt
69a3272036 Remove fossils from key item (count==1) list
Closes #2215
can't depend on 'key item' item flag since the game allows you to get
multiples
2018-12-25 12:31:13 -08:00
Kurt
2cef99e444 Add setter for pk1/2 Language
https://projectpokemon.org/home/forums/topic/48873-batch-editor-language-is-not-working/
2018-12-22 14:47:31 -08:00
Kurt
75d2b8d0bc Split out location bank fetch
Getting a little congested in one method
2018-12-22 14:45:47 -08:00
Kurt
f7cf96be65 Add version name fetch
only for pkm game IDs that have already been localized; not game
groupings.
use version name long description if hide-savefile details is enabled.
2018-12-22 13:16:16 -08:00
Kurt
ec140431c0 Fix box sort for empty locked slot(s) 2018-12-22 13:13:06 -08:00
Kurt
0da3fd2aec Add resource include references for new fr xlation
#2206
2018-12-20 20:34:51 -08:00
Ntonio36
2e698d99da Add French translations for ORAS, BW flags (#2206)
* Add French ORAS Flags
* Add French BW Flags
2018-12-20 20:30:23 -08:00
Kurt
2e6466c132 fix wc6full date set
Closes #2213
2018-12-20 20:30:01 -08:00
Kurt
24e5f70144 Differentiate colo card key
Closes #2212
2018-12-20 15:23:57 -08:00
Kurt
2d774ac7cc Allow dynamic default savefile type load
Make extrabytes a pkm property (don't mutate array pls)
reconfigure startup loading to only initialize after initial load of sav
& pkm (using blanks if not provided)
2018-12-19 22:10:32 -08:00
Kurt
d7a501c168 Relocate some logic to interfaces 2018-12-18 17:15:35 -08:00
Kurt
ff649009ca Misc tweaks
misc perf adjustments
add utility for slot locked check (without box argument, absolute slot
index)
localize dragdrop strings
increase dragdrop file delete delay (dropping files into discord waits
until you confirm; 10s gives enough time to hit confirm)
2018-12-17 11:17:19 -08:00
Kurt
22b9da58e2 Add priority setting for yielding possible encs 2018-12-15 21:34:50 -08:00
Kurt
ea07b9636d Speed up pkm data present check for pk3 format
see
6dbeb24b6f

ensure bad egg flag isn't set, and the species flag is set.
2018-12-15 19:37:19 -08:00
Kurt
269524849e Fix crystal-only base move case
Qwilfish has crystal-only move for the encounter, and the encounter is
available on G,S,C. Check both origin games always, better to be
complete & exhaustive than faster & incorrect :)

Thanks Brittany!

https://projectpokemon.org/home/forums/topic/48802-bugemerald-eggs-crystal-learnsets/
2018-12-15 15:10:20 -08:00
Kurt
5d5259ddd2 edge case for egg OT name length
https://projectpokemon.org/home/forums/topic/48802-bugemerald-eggs-crystal-learnsets/
2018-12-14 23:30:21 -08:00
Kurt
6dbeb24b6f Clarify mystery flags
thanks pret!

0ad332124e/include/pokemon.h (L277-L279)
2018-12-14 23:26:46 -08:00
Kurt
fb10a1f983 add size rating indications when viewing pkm data 2018-12-13 21:10:38 -08:00
Kurt
fc65a65fd9 Add go random IVs method
https://projectpokemon.org/home/forums/topic/48779-go-park-melmetal/
2018-12-12 18:06:39 -08:00
Kurt
96ec0ff28b Fix broken tests
some gen6 cards have bad data? trickled out to tests which failed to
generate a celebi
revert to old code, add in some year-set safety checks
2018-12-12 18:00:26 -08:00
Kurt
f6da84b699 add batch editor cp/h/w suggest routes
https://projectpokemon.org/home/forums/topic/48773-problem-with-lets-go-pikachueevee-batch-editor/
2018-12-11 22:27:42 -08:00
Kurt
2c1717a409 Misc updates
extract programlanguage to enum
fix parse fail for settings' version; old syntax fails to parse
delete unused file from recent pull
2018-12-10 20:48:21 -08:00
Kurt
efb9b7eba2 Misc cleanup
removes clickonce logic/reference
2018-12-10 20:32:08 -08:00
Kurt
8a0b9cd88c Add indication for party/starter slots 2018-12-09 23:18:37 -08:00
Kurt
7054b38e44 Fix bw volcarona spawn flag
Closes #2201
2018-12-08 10:04:59 -08:00
Kurt
3038c1eedb Fix pb7 zh string handling
no remapping ok
2018-12-08 10:02:37 -08:00
Ntonio36
89028b8a41 French Translation update (#2205)
* translation update

* shorten problematic fields
2018-12-08 09:17:59 -08:00
Kurt
d84ceabe93 speculate on unused stat
there's a value in trainer pokes that gets set to an unused pkm byte
this byte is fetched in the stat/cp calc, but is never used (param
unused)
plans for future? it's right next to friendship in trpoke7b, maybe there
might be another stat amp?
https://www.serebii.net/magikarpjump/trainerrank.shtml
stronger trainer => stronger monz /speculation
2018-12-06 22:58:35 -08:00
Kurt
8a98a89f6e Add height/weight and float->scalar
pgo transfer logic disassembly
FF 83 02 D1 FC 6F 04 A9  FA 67 05 A9 F8 5F 06 A9
2018-12-06 21:03:33 -08:00
Kurt
eb69e86722 Unban go sandshrew/slash & shiny
https://twitter.com/serebiinet/status/1070583259875237888?s=21
2018-12-06 07:10:39 -08:00
Kurt
20e3da7e5f Add pb7 evo check continuation
oops
Closes #2202
2018-12-05 20:55:57 -08:00
Kurt
06d8b6609b Add outsider evo check for beluga
Closes #2200
2018-12-05 18:38:05 -08:00
Kurt
71fab815bf Provide more slot information
remove lockedslots, store & save all teamslots for sav7
differentiate locked slots from overwrite protected slots by emitting an
enum containing info about the slot

locked = can't be replaced, period.
starter/battleteam = can't be pasted over by bulk-pastes

can eventually show more specific sprite layers to denote party
indexes/team#/starter
2018-12-04 22:59:28 -08:00
Kurt
4c1232855f Add getstring method with non-sav data 2018-12-04 22:00:57 -08:00
Kurt
cb8585f423 Minor optimization
2d array -> 1d
skip copy by cloning instead
eliminate %24 (number is 0-31) by duplicating 0-7 as 24-31

dropping a modulo, >1 bounds check, and a half loop unroll should be
less cpu cycles :)
2018-12-03 23:12:54 -08:00
Kurt
cc59c3cbe8 Remove variable naming hiding
new property named Stats
update sav7b/pb7 to delete unused handling trainer parameters too
2018-12-03 20:59:48 -08:00
Kurt
1d76d799fd Add stats get/set and batch editor suggest
Closes #2196
2018-12-03 20:53:37 -08:00
Kurt
7229ca76f6 Update party stat level on level max mod
Closes #2194 , pb7 are always stored in party format -- also PK1/2 store
it in their box format
2018-12-03 15:40:09 -08:00
Kurt
3d7f3caef8 Add status condition prop to all mainline formats
Closes #2160 , use Batch Editor to modify slots; it's not worth GUI
presence as it's only saved for party format mons and is undocumented
for anything besides affliction flags
2018-12-02 21:23:10 -08:00
Kurt
ec4088b1fe Cleanly lay out hgss swarm data 2018-12-02 14:46:17 -08:00
Kurt
77a4691a58 Add remainder of relicanth swarm data
https://projectpokemon.org/home/forums/topic/48702-bug-ss-relicanth-encounter-error/
Thanks finalevil151!
2018-12-02 14:39:24 -08:00
Kurt
5750eabcc8 Add user protection for moved starters
Closes #2191
2018-12-02 11:48:44 -08:00
Kurt
2c2e5f60b3 Fix AV message for go transfers
formatted now
2018-12-02 09:08:42 -08:00