Commit graph

2421 commits

Author SHA1 Message Date
Kurt
4baf745af8 Use some c#8 sugar
static local functions
switch expressions
using usings :)

nullable next?
2019-10-07 18:40:09 -07:00
Kurt
a792e58d49 Fix poketch logic
ushort poketch_def
{
enabled:1
unk1:1
unk2:1
color:3
unk40:1
unk80:1
unk:8
}
byte currentapp;
u825] unlockedflags
...app-specific data follows
2019-10-06 20:27:34 -07:00
Kurt
d249975895 Make current box reads s8 instead of s32
https://projectpokemon.org/home/forums/topic/55168-bug-report-pkhex-unable-to-load-pokemon-platinum-save/

saves with un-initialized boxes (FF'd) have 00 FF FF FF in the first 4
bytes
2019-10-05 14:32:40 -07:00
Kurt
40db929166 Re-add resources for inventory editor
Closes #2398
2019-10-04 21:23:54 -07:00
Kurt
87f43a47d8 Bump lang version to 8
some lang upgrades
2019-10-04 20:10:50 -07:00
Kurt
255cdc6ae0 Seal r2
https://www.reddit.com/r/csharp/comments/dd5c1o/til_sealed_override_modifier/

only a few instances for now
2019-10-04 15:56:22 -07:00
Kurt
d3b0c392b2 Minor tweaks
no functional change
2019-10-03 22:21:33 -07:00
Kurt
8d8adde2b1 sealed
sealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealedsealed
2019-10-03 19:09:02 -07:00
Kurt
ffe3a4ba15 Relocate resource naming for sprite fetch to draw 2019-10-03 18:23:40 -07:00
Kurt
39eedb1db2 Make PCBinary a method instead of get prop 2019-10-03 17:45:19 -07:00
Kurt
c0cdf81ca5 Default LGPE backgrounds to clean
Could iterate up and use the xy special backgrounds; just keep em simple
ty @sora10pls for pointing out this unintended behavior
2019-10-02 20:11:21 -07:00
Matt
72a751b9ce Update GO Shiny Banlist (#2397)
oddish family
2019-10-02 20:04:49 -07:00
Kurt
94baab1c45
Split off image generation to separate project (#2395)
With the approaching games, PKM sprites are a different size from the 3DS era (as already hinted by LGPE, which has 56x68). It'll be a little easier to manage with this portion of the library walled off from the rest of the codebase.

Eventually the net46 target will use fody or something to merge in these extra dependency dll's automatically to not disturb the usual exe/dll experience.
2019-09-29 09:47:06 -07:00
Kurt
03c3610eb5 Handle level20 transferred feebas edge case
Closes #2394 thanks @iiippppk !
2019-09-27 20:22:54 -07:00
Kurt
930f4a2062 Use format specific item IDs 2019-09-25 22:40:16 -07:00
Kurt
7013d4f0c8 add 7->8 transfer legality check
currently flags anything transferred as illegal, which is the right
thing to do until home is released.
2019-09-24 23:28:05 -07:00
Kurt
33649d4e02 Fix bitflag clearing for g6/7 gifts
https://projectpokemon.org/home/forums/topic/55092-recevied-list-in-mystery-gift/?tab=comments#comment-249220
ty tsubasa830 !
2019-09-23 19:01:37 -07:00
Kurt
825e06130e Add nullable reftype compiler checks to test proj
New in c# 8
Assert.True(check for null) doesn't give a hint that the obj isnt null
afterwards.
Assert.NotNull does have the compiler hint attribute
could probably use fluentexpression syntax, but resharper doesn't pick
up on the nonnullable hint like vs does.
GeneratorTests: swap FirstOrDefault to First, can keep the fluent style
and resharper gets the hint.

tl;dr : resharper doesn't look at external lib for hints, gotta use
Assert.NotNull or something that doesn't return null
2019-09-23 18:13:51 -07:00
Kurt
980a9874a3 Remove unused wrappers
I think I left these in so AutoLegality could function, but we already
have a couple breaking changes / build pause notice, so lets keep
cleaning our API 👍
2019-09-23 17:28:40 -07:00
Kurt
ab0b8979e9
Add swsh content placeholders (#2392)
placeholder content until real data is dumped
2019-09-23 16:56:47 -07:00
Kurt
7819c16792 Use slice operation instead of linq chain
Reuse IsRangeAll for smdemo detect
reset dragdrop on dropping folder (early returned)
2019-09-23 15:13:22 -07:00
Kurt
78b7409e77 Use start index for writing box binary
Closes #2390 ty @PKMWM1 !
2019-09-23 15:12:03 -07:00
Kurt
a60a73e9d5 Fix unintentional overflow
oops
2019-09-22 13:56:13 -07:00
Kurt
ea5b498f8f Fix sav4 stored slot redirect
all Get*Slot fetches are now used like the Set*Slot methods.

https://projectpokemon.org/home/forums/topic/55067-box-2-bug/?do=findComment&comment=249136
2019-09-21 10:42:54 -07:00
Kurt
02014273b8 Remove unused abstractions (slotview) 2019-09-21 10:31:59 -07:00
Kurt
8912f76726 Clean up super training medal checks
Futureproof with transfer considerations
This is just a guess; gen7 didn't update the medal count and if we
assume pk8 overhauls the structure for a new console, they'll drop old
data.

With c#8 later next week, will move SuperTrainingMedalCount() to a
default interface method ez.
2019-09-20 20:55:36 -07:00
Kurt
3c50983afd Use less efficient IsLevelWithinRange, for clarity
See previous commit for discussion; it's easier to read and maintain
this rather than have the precomputed min/max comparisons.

LevelMin - minDecrease <= min && max <= LevelMax + maxIncrease;
See EncounterArea7b:
Since we know min and minDecrease (0) before doing the linq filter we
can precompute the lowbound, same for highbound; but this isn't
immediately obvious to the reader. The perf cost is pretty much
negligible in the big picture, so leave it in the more readable state.

Thanks @fattard & @ammako !

#2389
2019-09-19 22:54:53 -07:00
Kurt
a4a0e3ac6e Fix flute level amp direction
The inputs to "IsLevelWithinRange" are the highest value the
lowest-level can be, and the lowest value the highest level can be...
seems confusing (hence the original error).

If a slot is 6-7, with a wild encounter (flute), we can go +/-3 from
6-7, which is 3-10.
With an encounter of level 5, the inputs are: 5+3, and 5-3 (8, 2).
Since 8>lvlmin and 2<lvlhi, we can get a level 5 pkm from the slot
(using a negative flute yielding a -1 adjustment).

I could probably refactor it to be a 3-input signature (lvl, lvlneg,
lvlpos), and have it do LevelMin - lvlneg <= lvl && lvl <= LevelMax +
lvlpos

I should probably refactor these methods to do minLevel & maxLevel (so
baseSpecies.Level to CurrentLevel for pkm that lost their original met
data) but nothing needs the extra logic at this time.
2019-09-19 22:37:56 -07:00
Kurt
7e70d83664 Add missing filter overrides
Were using default filter behavior, which needs to be tweaked to account
for the original met location/level not being present (ie skip the
minLevel bounds check).

Hardcode logic for HasOriginalMetLocation for simplicity

Closes #2389 , thanks @Ammako !
2019-09-19 16:19:07 -07:00
Kurt
b41f2a3062 Extract logic from PKX
Extract Species Name logic to SpeciesName
Extract Language logic to Language
Remove FormConverter wrapper for string[] fetch
Rearrange some logic to more appropriate locations, update access
modifiers / types
Move some pkm array methods to arrayutil, make generic

PKX.GetVCLanguage was a dupe of _K12.GuessedLanguage() so just expose
the method

PKX is now back to pkm data manip only
2019-09-18 19:58:23 -07:00
Kurt
712a9cf4a0 Update 19.09.19
Update event binaries with latest from the Event Gallery
2019-09-18 15:29:07 -07:00
Matt
84f72ed2b9 Unban GO Shiny Mewtwo (#2387)
Ultra Bonus Unlock (Week 3)
2019-09-16 15:04:52 -07:00
Kurt
b9246ece37 Extract y2k datetime logic, also wardrobe tweak
swsh gonna have wardrobe, so rename class and relocate some logic in for
better docs
2019-09-15 22:12:32 -07:00
Kurt
0fe42a1db3 Minor tweaks
no functional change
2019-09-14 11:48:07 -07:00
Kurt
229bb0d05d Merge dualbuffer into sav4
SAV3 has two general save chunks and storage

SAV4 also has the hall of fame block, which is a third block; no mo
silly names !
2019-09-14 11:39:48 -07:00
Kurt
972e35a289 Minor reorganization
Move the ea32->array creation to the actual class
2019-09-13 09:08:12 -07:00
Kurt
aa6f803ba9 fix g7sm trade strings
borked in a prior commit, nice string reference
2019-09-13 08:36:21 -07:00
Kurt
734aa33898 Split encounter areas, relocate slot finding to obj
Now logic is reasonably split, and each format of area has its own way
of yielding slots

Too much junk with checking flute boosts or catch combo applicability;
just let the area dictate how slots match.
2019-09-12 23:20:52 -07:00
Kurt
dc10c057a0 Use correct boxdata buffer when doing box manip
Closes #2386 ; guess I forgot to finish this.
2019-09-12 19:01:06 -07:00
Kurt
0d9c18e1c6 Minor clean
dual bounds check -> single check via uint cast
pkx: keep array reference for reuse in next check
format return to second line to stick out more; lines of code are cheap
:)
2019-09-11 22:17:16 -07:00
Kurt
477187a66c Split EncounterArea into game-specific classes
Generating encounters from an EncounterArea is getting a little stupid
without inheritance; each type can now have its own specific behavior
without checking for each individual type of generation pattern. Will
add the abstract method implementations in a future commit

Move some string[] array fetch (for all languages) to Util
2019-09-11 22:06:24 -07:00
Kurt
40cbbaa695 Relocate to more appropriate util class 2019-09-11 18:39:49 -07:00
Kurt
c5ebbbbe15 Minor clean
Magic number -> const usage
default(T) -> default (c#7.x feature)
remove some unused stuff
fix indentation in some spots
2019-09-10 22:07:50 -07:00
Kurt
62d08d7c30 Misc clean
split some methods with optional parameters=null
add more xmldoc
replace some magic numbers -> enum/const references
consolidate common array operations (span soon maybe?)
2019-09-10 00:21:51 -07:00
Kurt
74f8e312ca Merge branch 'master' of https://github.com/kwsch/PKHeX 2019-09-09 21:30:05 -07:00
Matt
5ab0005de7 Update GO Shiny Banlist (#2384)
Ultra Unlock Bonus, Week 2.
2019-09-09 21:07:30 -07:00
Kurt
02f36655a0 Reload box data cache on resetting slots
clear box and other calls to ResetSlots weren't reloading with the NEW
modified pkms.
2019-09-09 20:23:18 -07:00
Kurt
6d8ff992e2
Clean up / fix external drag in (#2383)
* stash

* Consolidate some logic
2019-09-03 19:54:41 -07:00
Kurt
edf36e8a34 Fix sav4 checksum calc
DPPt have a footer that's 0x14 bytes; HGSS is only 0x10 (first u32 was
removed from struct).
2019-09-03 18:16:10 -07:00
Kurt
4b8082be23 Add Pokegear number editing (hgss)
Closes #2379
2019-09-02 21:24:49 -07:00
Kurt
b81a1e1e29 Refactoring
Increase abstraction for arbitrary slot get/set operations, and fracture
SAV4 behavior for each game type.

Adds: Undo/Redo of party slot changes
Fixes: Fixed Gen5 daycare slot 2 reading, and EXP reading
Fixes: Some slot color glitchiness
Fixed: Box layout editor now hides the flag label if no flags are
present
Fixed: Gen7 box flags are now shown (unknown purpose lol)
Changed: savefile objects are generally smaller (removed a few shared
offset fields)
2019-09-02 19:30:58 -07:00
Matt
afd4ff25a5 Fix off-by-one (#2382) 2019-09-02 19:28:48 -07:00
Kurt
0fc9b4dd15 Fix lgpe init
oops prior commit
2019-09-02 19:07:20 -07:00
Kurt
ef5ff32c3c Add GO transfer restrictions for min level
Closes #2381

Keep Raichu and Marowak at the end for ez referencing. Keep a separate
refence for alolan kanto stuff for futureproofing

Might want to improve the EncounterArea abstraction to do the
slot-finding labor themselves, but whatever, hardcode stuff until swsh
throws new monkey wrenches in. A good idea would be a dictionary with
level forcings [species | form << 10] = X and use the dictionary to
check on slot creation
2019-09-02 18:38:12 -07:00
Kurt
a133abc615 Add pokegear caller ID enum
#2379
Cheat as requested in issue not implemented yet; pending future changes
to split sav4.
2019-08-27 16:17:29 -07:00
Kurt
f0df115ccd Fix box load on uninitialized box load
Closes #2376
probably will be rewritten at a later time; am reworking the slot info
messaging for drag/drop/display
2019-08-23 18:03:10 -07:00
Kurt
bf6c25eca7 Break up SlotChangeManager logic
A little bit cleaner when the logic is separated
Keep an abstraction of BoxEdit to cache the current box contents.
Already fetched to show sprites; any future fetches (for preview text /
hover sprite) can reuse the already fetched pkm data.

Should probably rewrite this stuff completely, but effort better spent
elsewhere
2019-08-20 19:50:28 -07:00
Kurt
d0ae47eb6c Update 19.08.19
Update event binaries with latest from the Event Gallery
2019-08-18 21:51:40 -07:00
Kurt
4f3745e3c6 Change enumerate -> array fetch to force eval
https://projectpokemon.org/home/forums/topic/54426-pkhex-error/
trycatch will trip here rather than be uncaught when evaluated later
tbh I don't like pkhex's method chain (enumerable, bool, throws), but
this fixes the error.
2019-08-14 16:45:21 -07:00
Kurt
cf574337e9 Rewrite encounter move suggestion logic
more straightforward logic flow, don't repeat same <= 2 comparison
2019-08-14 16:35:25 -07:00
Matt
d85a57ac1e Update Generation 3 Event Flags/Constants (#2374) 2019-08-12 15:26:00 -07:00
Matt
fb4a33ce7e
Unban GO Shiny Poliwag
Yokohama GO Fest
2019-08-05 21:06:57 -04:00
Kurt
8b49ddb0ad
Merge pull request #2372 from XxPhoenix1996xX/patch-13
Update lang_es.txt
2019-08-04 23:09:07 -07:00
Kurt
b81742c38c
Update MessageStrings_es.txt (#2371) 2019-08-04 23:08:58 -07:00
XxPhoenix1996xX
ec9ae87340 Update LegalityCheckStrings_es.txt (#2370) 2019-08-04 23:08:52 -07:00
XxPhoenix1996xX
e89c2f6d25
Update lang_es.txt 2019-08-04 19:13:56 -04:00
XxPhoenix1996xX
e2227cbddf
Update MessageStrings_es.txt 2019-08-04 18:50:34 -04:00
Kurt
9c58903f55 Fix blank sav3 : sapphire init
lol it's been this way for 7+mo
Closes #2369 ty @CorvusAtrox !
2019-08-04 00:59:59 -07:00
Kurt
f462f49eec Fix sav7 map data rw
https://projectpokemon.org/home/forums/topic/54197-issues-with-newest-version-of-pkhex/
2019-08-02 15:11:22 -07:00
ReignOfComputer
33ae5b3ac5 Add Realgam Tower to Colosseum Encounters (#2368)
https://github.com/kwsch/PKHeX/issues/2367
2019-07-30 08:43:30 -07:00
Kurt
7424cf6fb0 Remove GSC/C differentiation in PK2
Allows for no adjusting the game group
2019-07-28 13:26:39 -07:00
Matt
79127d02e4 Update GO Shiny banlist (#2365) 2019-07-26 15:33:19 -07:00
Riccardo Boninsegna
3e7be6832c Even more FR/LG stuff (#2364)
* corrections and styling
* FR/LG: some more story/item related variables
* FR/LG: More HMs and Oak's Aide's items
* FR/LG: League beaten flag fairly confirmed
* FR/LG: variables
2019-07-25 17:42:41 -07:00
Kurt
db632905fd Remove WasEgg setter
WasEgg (aka WasDefinitelyAnEgg) from stored properties is one thing,
WasEgg from encounter info is another; don't mix
2019-07-25 17:42:20 -07:00
Riccardo Boninsegna
8ffcdc9570 FR/LG: More variables! (#2363)
* FR/LG/E: Altering Cave variable

* FR/LG: Pokemon Tower related variables

* FR/LG: Pokedex/Oak/Rival (part 1) related variables

* FR/LG: more story related variables
2019-07-23 16:08:54 -07:00
Riccardo Boninsegna
c508d49f87 FR/LG flag names (#2362)
* FR/LG: Event flags for eventually reaching event-only places

(required to enable processing of the appropriate items; officially set by DLC scripts)

* FR/LG: Badge names and Running Shoes
2019-07-23 09:40:41 -07:00
Kurt
9ed47cc8fd Minor tweaks, no functional change 2019-07-21 12:30:21 -07:00
Matt
9cab2e366d Misc Let's Go updates (#2361) 2019-07-15 09:05:53 -07:00
Kurt
894237449b Allow differentiation between SAV2 blanks
Choosing G/S will initialize as GS
Choosing C will initialize as C
calling via their own code (GSC/GS) will choose the most recent (crystal
if possible).
Closes #2359
2019-07-14 15:13:13 -07:00
Kurt
a608e0b252 Minor clean
Remove some unnecessary properties from SaveFile
Enumerate checksum flag results for GC memcard checking
Remove unnecessary checks on savefile type
Add some documentation
Decapitalize some method parameters
2019-07-14 15:06:45 -07:00
Kurt
839500a7ee Fix medicine offset for AO 2019-07-13 17:43:29 -07:00
Kurt
c7eecf5976 Extract summary object to core 2019-07-13 17:43:05 -07:00
Kurt
82f305cd36 Fix dex gender set again
Closes #2356
update test case to actually set a genderless gender
2019-07-12 23:43:12 -07:00
Kurt
f37a587a1c Minor simplifications
move some pk3->pk4 stuff into object constructor
annotate pk3->pk4 string buffer (trash) quirks
split Heal into Party/PP method uses. Setting suggested stats no longer
refreshes PP
apply current level to Stat Level (wasn't being set previously)
2019-07-12 16:41:13 -07:00
Kurt
d153224af1 Add traded egg allowance for nickname
store bool for reuse, not any slower :)
Closes #2320
2019-07-11 22:55:41 -07:00
Kurt
face8d64a9 Fix gen5 dexflag set
Add unit tests to check
Closes #2356
2019-07-11 00:13:52 -07:00
Kurt
c64ff5dd76 Fix sav5 behavior
Closes #2356 ty @Ammako
2019-07-10 00:19:59 -07:00
Kurt
ab735de2d9 Revert "Decapitalize non-nicknamed on 4->5 transfer"
This reverts commit 904dc84b52.
2019-07-09 20:24:47 -07:00
Kurt
1de685c6d8 Add Happy Hour/Hold Hands
per confirmation from @PP-theSLAYER

https://projectpokemon.org/home/forums/topic/53818-these-events-are-flagged/?do=findComment&comment=246918
they probably won't release these two moves tho, LGPE has become stale
2019-07-08 22:18:15 -07:00
Kurt
90cc8ca3ec Add Celebrate for lgpe valid move filter
event move only
still haven't bothered finding the table in the exefs that results in
the pkm with an oob move being dummied. hardcoded based on data for now
:)
2019-07-08 22:14:21 -07:00
Kurt
3f4f02cee1 Add string quality tests
Expect no duplicates in met locations, items, or moves. These are arrays
with common duplicate strings (poor localizations).

Should help futureproof / help implementation for this type of err:

https://projectpokemon.org/home/forums/topic/53818-these-events-are-flagged/
2019-07-08 22:05:59 -07:00
Kurt
605b410d52
Make Distribution Super Training missions invalid
Was initially implemented as fishy during SM's initial implementation. Any nonzero value in this byte is invalid, don't even bother checking unused/count.

Now that Gen6 (and Gen7) are no longer current gen, any hope for them being released is the same as hoping for Gen4's Azure Flute Arceus. Thus we mark as invalid :)

Closes #2353 by effect of no longer flagging as Fishy. I think that my initial implementation of VC stuff had assumed the Generation==7, but later used 1/2 for factual correctness.
2019-07-08 12:12:16 -07:00
Kurt
cf0908a21e Remove check for impossible conditions
#2354
SUBE is never < 0 with the latest change (blank saves behave same as
retail saves).
2019-07-08 10:03:53 -07:00
NotTsunami
e29da1a8e8 Remove check for impossible condition in XY Save (#2354)
XY can't be ORASDEMO
2019-07-07 22:58:33 -07:00
Kurt
fef4dbb9dc More super training checks
Check the secret unlocked/complete flags for eggs
Check the count for VC, and flags too (even though they're checked
later, just do it here)
#2353
2019-07-07 15:04:58 -07:00
Kurt
15c44139c3 Fix record read offset
Closes #2353
first 100 are u32, second 100 are u16; shift accordingly
2019-07-07 14:54:38 -07:00
Kurt
8f88e630c2 Fix ORAS inventory class type
now no longer removes items from pouch

https://projectpokemon.org/home/forums/topic/53761-oras-item-problems-with-new-version/
2019-07-07 08:43:58 -07:00
Kurt
772a2715c0 Fix SecondsTo* read offset
copypasted from gen6's, oops
Thanks CreamatedReptile2018!
2019-07-07 08:43:04 -07:00
Kurt
f2ac29ff4e Relocate some logic
slightly reduces savefile.cs footprint
2019-07-05 22:02:29 -07:00
Kurt
9a61f0de0f Minor relocation of logic
and the gradual shift to full-oop continues
2019-07-05 21:39:47 -07:00
Kurt
c0eda5eb61 Add more dex bulk manip options
unused, not sure how an abstraction can work for all games (needs some
virtual methods to actually work, since 1-3 don't have langflags)
2019-07-05 18:49:43 -07:00
Kurt
aa94c70df2 Hide gen6 dex logic behind zukan class
Same as prior commit for gen5 & gen7
2019-07-05 18:04:36 -07:00
Kurt
adbb3e842a Hide gen7 dex logic behind zukan class
Same as prior commit for gen5
2019-07-05 17:05:42 -07:00
Kurt
79a9269fbe Hide gen5 dex logic in Zukan class
Didn't change any of the bulk modifications, but the data get/set is now
done via the Zukan object rather than raw data manipulation
2019-07-05 16:21:53 -07:00
Kurt
7f186048fb Really fix dex lang flag offset style
c345688f6d

base(x) -> base(x - y) resulted in incorrect offsets for LGPE. Great.
Just make PokeDexLanguageFlags a shift offset instead of absolute;
update all usages.

Closes #2348
2019-07-05 12:16:09 -07:00
Kurt
599ec4ed45 Fix checksum offset fetch
#2348
2019-07-05 11:57:40 -07:00
Kurt
810f7271c6 Clear boxes after initialize
Closes #2349
2019-07-05 11:53:13 -07:00
Kurt
808c1d2992 Update 19.07.05
Update event binaries with latest from the Event Gallery
2019-07-04 22:00:48 -07:00
pokecal
6b3d6999d1 update MailBoxEditor (#2344)
fixed FRLG offset, etc.
2019-07-04 21:48:18 -07:00
Kurt
5a8b421672 Add jp crystal eventflag offset
was pointing to an FF'd region, was added back via
e86b8c670f

Closes #2347
2019-07-04 15:07:37 -07:00
Kurt
7a2b27ebbe Provide min level to evochain fetch
Feels pretty brittle with all the optional parameters; if things get
funky for SW/SH it may warrant a rewrite of this portion

Closes #2345 ty @iiippppk !
2019-07-02 08:34:28 -07:00
Kurt
b5945624eb Add VC2 trade OT gender check
Closes #2343 ty @WEERSOQUEER !

#2338 was referenced by
4d08e21126
, that commit was incorrect. Looks like these 2 have OT Gender female.

Instead of marking every trade MALE except for these two, just update
the handling (i'll probably regret this lol)
2019-06-29 17:43:09 -07:00
Kurt
4eb3f8529b Filter Species & Moves for legal combobox display
LGPE will missingno your pokemon if it's not a Kanto/M&M, or one of its
moves is not obtainable. For the user's benefit, filter down these
sources to the non-baddata list.

Item filtering and ball filtering might be something to think about for
the future, but not much benefit vs effort.
2019-06-29 08:19:01 -07:00
Matt
08ea140f17 Update GO Shiny banlist for GO 3rd Anniversary (#2342)
* Update GO Shiny banlist for GO 3rd Anniversary
2019-06-28 11:04:23 -07:00
Kurt
c8747d4ede Apply OT mismatch deferral to gen2
Check the OT length for the deferral

other encounters are more permissive than trades, hence why we defer
unless we know for certain. Same OTs are possible, except for the
too-long ones!

Closes #2338 , thanks @WEERSOQUEER !
2019-06-27 21:38:24 -07:00
Kurt
4d08e21126 Explicitly check VC in-game trade gender
can't have Female ever, so check == 0
#2338
2019-06-27 21:24:08 -07:00
Kurt
da93a19c05 Add edge-case transfer OT cases
Needs to be checked prior to the strict Array Index search, as we can't
have an exact string match.
can probably be revised to a StartsWith to only check for the specific
language match, but that's a little less obvious & extra work :)
#2338
2019-06-26 21:19:37 -07:00
Kurt
7e0fc61428 Add unused character encodings to dictionary
Two of the inaccessible keyboard chars are used by Spanish trades, so
they aren't completely unused.

#2338
2019-06-26 21:16:18 -07:00
Kurt
71fdd01a93 Fix Stationary haxorus encounter gen
remove unnecessary %25 check (only applicable for gen4 encounters),
unneeded for gen5 method.

add a test case to generate a haxorus for all natures, verify shininess

Closes #2336
2019-06-26 20:37:26 -07:00
Matt
4ff5fcb25c Add SM Poké Ride flags (#2341) 2019-06-26 11:39:39 -07:00
Matt
a47036d2f4 Add USUM Poké Ride flags (#2337) 2019-06-26 06:35:27 -07:00
Kurt
444eab0756 Add mystry mew seed table
no validation for wc3 encounters yet, dunno when that will happen
2019-06-25 21:15:56 -07:00
Matt
7472ba8152 Encounters cleanup (#2335) 2019-06-25 10:55:35 -07:00
Kurt
6b18208ccb Fix g2 trade OT check
Closes #2332 thanks @WEERSOQUEER !
2019-06-24 15:45:52 -07:00
Kurt
59ddd4b3dd Add lure ball to ball color table 2019-06-22 20:00:17 -07:00
Kurt
c345688f6d Fix dex lang bitflag offset write
LangFlags is expected to be less than 0x500 or whatever, zero indexed to
the start of the dex block; NOT an absolute position.
I don't feel like making every usage consistent (gen5, gui editors)
which use the absolute position, so just adjust in the zukan
constructors
2019-06-22 16:53:25 -07:00
Kurt
cbd039b18c Extract datasource filtered lists to object
GameInfo has been the storage for the current Game Language environment
When using GameInfo, only one environment is tracked at a time, which is
initialized by the PKM editor (items, moves). Rework things to allow
multiple filtered sources to exist, and keep the filtering logic in
PKHeX.Core for reuse in other programs... ;)
2019-06-22 10:50:32 -07:00
Kurt
e81e5f31da Remove shadow info index shift
Thanks @PP-theSLAYER !

https://projectpokemon.org/home/forums/topic/53405-bug-oddity-with-shadow-recognition/?do=findComment&comment=246125
2019-06-20 20:39:34 -07:00
Kurt
63c705061d Add recognition for Method 3 encounters
Pass them as Legal for wild encounters similar to M1/M2/M4.
Add test cases & test pkm validation
Add pid generator support

I decided against checking these PIDIVs after all others; inlined
methods.

Closes #2328 , thanks @pokecal !
2019-06-19 19:15:06 -07:00
Kurt
dc813da2f7 Add DisplayTID/SID getset 2019-06-19 17:49:56 -07:00
Matt
08835d5d97 Fix ORAS held items/personal reference (#2329) 2019-06-19 12:18:09 -07:00
Kurt
5fbf9ba278 Fix cloning of a bad-checksum pk3 2019-06-18 20:55:35 -07:00
Kurt
e02f7ef30f Reduce allocation required for ability check 2019-06-18 20:54:59 -07:00
Kurt
523c36d982 Add qr parse util
used in pkhex.mobile, might as well migrate some logic into core
I'd rather not untangle the decode-api response parsing to use QRUtil.
2019-06-18 20:10:01 -07:00
Kurt
55d486af31 Extract event block diff logic 2019-06-18 18:10:48 -07:00
Kurt
de77f949da Prevent assert on non-exportable saves 2019-06-17 20:55:01 -07:00
Matt
59a7e247cb Update GO Shiny banlist (#2325) 2019-06-13 08:46:53 -07:00
Matt
186adca755 Unban GO Shiny Onix (#2323) 2019-06-10 22:33:34 -07:00
Kurt
7225b2b87b Add more sav1/2 option properties
Closes #2321
Closes #2322
no gui as SimpleTrainer is kinda getting overloaded; use linqpad or wait
for someone to make a GUI for the specific games
2019-06-09 14:15:42 -07:00
Kurt
455ab32722 Retain override version on clone
Also hide the pika friend label when YW features hidden #2283
2019-06-09 13:48:51 -07:00
Kurt
a30a00317f Add missing trainer location overrides
Was missing from #2319
2019-06-08 20:19:39 -07:00
Kurt
904dc84b52 Decapitalize non-nicknamed on 4->5 transfer
Closes #2320
2019-06-08 20:16:30 -07:00
Kurt
1b028198ad
Split gen5-7 saves with inheritance (#2319)
refer to pull request comments for summary
2019-06-08 19:56:11 -07:00
pokecal
84d1354e2f Update EncounterArea.cs (#2318)
fix FishingTable of Route12,13(same as R32), R14(water inaccessible).
Some issues about Qwilfish will be solved.
2019-06-07 19:24:59 -07:00
Kurt
de774ed131 readonly ComboItem
create once, never modified after
2019-06-01 19:12:41 -07:00
Kurt
2b8ef9236a use some explicit dex numbers as enum 2019-06-01 10:22:49 -07:00
Kurt
36114e6ff9 Update checksum on templating
pk3 loading tries to decrypt shuffle or something; this makes it work
2019-05-29 22:50:34 -07:00
Kurt
9cdbc46740 Relocate apply basic template out of gui 2019-05-29 22:40:39 -07:00
Kurt
a9152d36a4 Minor tweaks
make some enums non-int (in favor of byte etc)
return current nickname if desired
clamp nature top bound too
2019-05-29 22:40:07 -07:00
Kurt
5879cc8a18 Extract some pkm gui logic
probably won't stay this way if things are eventually rewritten; too
much business logic in the pkmeditor.cs, would need a ton of abstraction
2019-05-29 21:35:52 -07:00
Kurt
144a78d688 Relocate method 2019-05-29 16:42:48 -07:00
Kurt
8d781fd167 Simplify sorting to remove linq usage
create custom comparer to do the work
reorder some parameters
simplify gb hm set (All and FindIndex is duplicate work)

only usages of linq remaining are for the bulk action Where filtering
(ok)
2019-05-28 22:55:41 -07:00
Kurt
513648638f Fix incompatible hax conversion (1/2->3 etc) error
Shared base classes throw a new snag, where the property may be Declared
in the shared class.

eg:
PKM -> _K12 -> PK2

just filter all public ones that have a setter; works well enough idk
2019-05-28 16:52:59 -07:00
Kurt
a45cddd3ed Add missing hax item clamp early return
Closes #2281
remove unnecessary "else", and break for visual separation
2019-05-27 21:38:04 -07:00
Kurt
33a07a6fcd Try and force destination language on transfer
Closes #2314
2019-05-27 11:23:47 -07:00
PP-theSLAYER
88d7be62d9 Removed Special Funfest Poliwag & updated min Lvl. (#2315)
According to the link below, the official page states that Poliwag's announcement was a mistake, and they clarified it would not be appearing.
This message was echoed across various pages (Sapporo, Fukuoka, Tohoku), not just the Yokohama one.
https://voice.pokemon.co.jp/stv/yokohama/2013/08/post-2286.html

Additionally, based on tests from me and jojo, Funfest missions forces the grotto encounters to be max level (of the individual grottoes).
https://projectpokemon.org/home/forums/topic/39810-unlock-all-funfiesta-missions/?do=findComment&comment=245303
2019-05-27 00:39:36 -07:00
PP-theSLAYER
968f850138 Added Funfest week 3 encounters (#2312) 2019-05-21 23:37:47 -07:00
Kurt
6e8f7fe680 Fix pgf gender criteria roll
got stuck in an infinite loop for PID (gender invalid from the start)

https://projectpokemon.org/home/forums/topic/52873-pkhex-mystery-gift-database-not-working/
2019-05-20 18:35:57 -07:00
Kurt
9b8b8f784a Revert "Add another vc nature checks"
This reverts commit b51bdc9230.
2019-05-20 17:05:53 -07:00
Kurt
d1bc1d07c8 Disallow shiny aura
if hadou were here, it'd get the same anti treatment too
2019-05-17 17:48:45 -07:00
Kurt
827eb94f3c Add GameSync r/w for lgpe
https://projectpokemon.org/home/forums/topic/52797-request-lgpe-game-sync-like-value-to-be-added/

ty @PP-theSLAYER !
2019-05-16 22:26:51 -07:00
Kurt
7f9328e883 Fix vivillon comparisons
Fix template->pkm form fetch too; would return 0 for non-subregion
countries rather than the Country Specific form ID

https://projectpokemon.org/home/forums/topic/52800-invalid-internal-error-with-the-spewpa-evolution-line/
2019-05-16 22:01:11 -07:00
Kurt
73b61e5bf0 Add gender changed azurill evo pokewalker edge case
Closes #2311 , thanks @SpiredMoth !
2019-05-15 17:14:48 -07:00
Matt
25985f11e6 Fix Static/Gift IV method call (#2310) 2019-05-15 12:07:48 -07:00
Kurt
b7f024e3ea Fix arceus held item compare
https://projectpokemon.org/home/forums/topic/52771-bug-report-pkhex-20190515-arceus-forms-error/
2019-05-15 09:46:52 -07:00
ReignOfComputer
7625ab66b4 Fix Import Count on Load Boxes (#2308)
Calculation was wrong if non-overwrite is selected. Also fixed OCD-triggering extra space in output message.
2019-05-15 09:11:48 -07:00
Kurt
be8e8851e2 Update 19.05.15 2019-05-14 22:47:48 -07:00
Kurt
1d44136e54 Update xd fateful flag leniency
not enough documentation to know what every single flag does; just be
lenient

I assume that flags being present XK3->PK3 will set fateful, so we could
remove that logic...
Exposing bitflags for editing isn't fun for the editor, so just ignore
it behind the fateful bool get/set.

fateful required for all xk3 origin

#2289
2019-05-14 20:14:15 -07:00
Kurt
555e81205d Update fateful encounter read location
Closes #2289
2019-05-14 18:36:48 -07:00
Kurt
091b9e2281 Add g4 poffin editor (misc edits)
Thanks @sora10pls for docs!
https://pastebin.com/jNeVJQi0
2019-05-13 22:56:45 -07:00
Kurt
5140350ceb Bump to net standard 2 2019-05-13 22:33:24 -07:00
Kurt
76e3174d8c Add gen4 poffin logic
800 bytes starting at Offset = SAV.DP ? 0x5050 : 0x52E0;
8 bytes per poffin, 100 poffins.
2019-05-13 18:42:30 -07:00
ReignOfComputer
6c42e3b1bb Enhance Invalid Convert Error (#2305)
Makes it clearer for conversion failure with Pokemon files - prevent confusion with save files.
2019-05-13 15:38:33 -07:00
ReignOfComputer
2b39d75141 Allow Open WB7Full / WB7 (#2304) 2019-05-13 15:35:40 -07:00
ReignOfComputer
9d6127dfc2 Fix C# 7.2 Build Error (#2303)
Explicitly target LangVersion 7.2.
2019-05-13 15:35:19 -07:00
Kurt
15f93216bd Fix record flag clearing
yay missing ~, Closes #2301 ty @CanoeHope !
rewrite flag loading to not use linq
2019-05-12 15:08:04 -07:00
Kurt
bad16adcee Fix sav7b clone method
underlying data should be a different reference when cloned
2019-05-12 15:06:50 -07:00
Kurt
4703a3d364 Fix incorrect method call
IVs for regular trade gifts can have random IVs; only VC-era have purely
fixed IVs.
Closes #2300
2019-05-11 17:03:22 -07:00
Kurt
4b770e62d9 Simplify and relocate wurmple evo logic 2019-05-11 14:25:58 -07:00
Kurt
feb36f58b5 Minor simplification
#2298
#2299
2019-05-11 13:10:51 -07:00
Andrew Johnson
b1ad10d8ad Add shiny check for Ash-Greninja (#2299) 2019-05-11 13:08:22 -07:00
Kurt
21e7f4317e Minor updates
increase readability, simplifly some expressions
relocate hot path for legality report string creation
2019-05-11 10:12:14 -07:00
Kurt
332784d34b Misc updates
parameter name lowercase
simplify some comparisons/calcs
reuse comparison methods
wrap memory dump into readonly struct
2019-05-11 00:59:07 -07:00
Kurt
55189a6967 Extract most common location numbers to class 2019-05-10 20:46:49 -07:00
Kurt
72edb6aa72 Misc tweaks to 3->4+ branching
more lines, a little clearer
2019-05-09 22:47:37 -07:00
Kurt
b51bdc9230 Add another vc nature checks
transfer level exp and current exp not being different enough, which
limits the amount of natures possible. Could handle the 100&<=2 cases
the same way, but keep the branches for faster cases.

fix bad test cases
2019-05-09 01:56:44 -07:00
Matt
316430985a Unban Shiny Seel (#2293) 2019-05-01 14:23:08 -07:00
Kurt
042e5176a6 Remove hardy shuckie & version split
Not version specific; I'm assuming the 00020003 PID is a result of
hacking the save file to change OT gender. Legitimate saves haven't
yielded the Hardy PID. Changing gender probably results in a bad
pointer, fetching the wrong value.

Closes #2290
2019-04-30 17:03:12 -07:00
Kurt
520c9da5c9 Update string loading
Remove usage of linq for sorting, use array.sort for in-place sorting.
Wasteful creating temp sorted buffers then enumerating them to dump into
the list.
2019-04-29 21:55:43 -07:00
Kurt
7094132eac Fix b2w2 fr trade OT name
Closes #2291 ty @WEERSOQUEER
2019-04-29 17:42:39 -07:00
Kurt
be50830975 Relocate method to extension logic class
GetLocationString is now right below GetPotentialString
PKX no longer has extension methods aside from the two CopyTo sugar
2019-04-29 17:36:29 -07:00
Kurt
300ef4d60a Minor simplifications
Use "SetData" method to automatically apply the Edited flag
Use appropriate method for CopyTo
simplify expressions a tad
2019-04-29 17:21:19 -07:00
Kurt
7c380a29c3 Make sort skip delegate more general 2019-04-29 17:20:16 -07:00
Kurt
9838ea9a2b Merge branch 'master' of https://github.com/kwsch/PKHeX 2019-04-29 16:40:58 -07:00
Matt
091e64571b Update GO shiny banlist (#2292) 2019-04-29 15:32:17 -07:00
Kurt
0dc45c00ec Check block index before calculating
Missing/Duplicate blocks (???) result in -1, so skip them.

https://projectpokemon.org/home/forums/topic/52437-cant-export-unmodified-sav-file/

replace linq with manual allocation
2019-04-27 17:19:54 -07:00
Kurt
0bd6caf927 Fix male-only dex bit wiping
only wipe the index specific bits, don't wipe everything but the index
specific bits
2019-04-22 22:25:14 -07:00
Matt
963cb1aa99 Unban GO Shiny Lapras (#2287) 2019-04-17 22:49:58 -07:00
Kurt
d8f064409f Fix pk1->pk2 conversion parameters
https://projectpokemon.org/home/forums/topic/52273-replicable-issue-cant-inject-pk1-in-silvercrystal-save/

Thanks Maddaren!
2019-04-17 18:35:51 -07:00
Matt
b8c490ae2e Update GO shiny banlist (#2286) 2019-04-17 12:53:13 -07:00