Commit graph

1304 commits

Author SHA1 Message Date
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
2b8ef9236a use some explicit dex numbers as enum 2019-06-01 10:22:49 -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
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
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
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
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
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
Matt
091e64571b Update GO shiny banlist (#2292) 2019-04-29 15:32:17 -07:00
Matt
963cb1aa99 Unban GO Shiny Lapras (#2287) 2019-04-17 22:49:58 -07:00
Matt
b8c490ae2e Update GO shiny banlist (#2286) 2019-04-17 12:53:13 -07:00
Kurt
35851fcf5c Simplify and enhance expression
cache fetch of PersonalInfo (avoid re-fetching)
If event, the pkm wasn't bred with ditto
If genderless or male-only (except nido/volb), assume ditto
2019-04-16 23:07:47 -07:00
Kurt
ab64eb5850 Trim unused 2019-04-16 22:58:37 -07:00
Kurt
86d10af78b Minor clean
cache Generation value, store arceus stuff as ushort
2019-04-16 22:14:21 -07:00
Kurt
9736efd332 Updates continued
Use clone track bool
could instead track the result for each pkm step instead, for extending
functionality to mass-delete any flagged entry (cleanup).
2019-04-14 16:04:36 -07:00
Kurt
34ea56c2a7 Minor updates
Fresh day, fresh tests of the new code :)
Fix assert conditions
Add extra considerations
Detected clones should be skipped for PID/EC/TID checks -- should
probably detect this a different way rather than checking a computed
string (bool array of flags for the clone check results)
2019-04-14 09:06:43 -07:00
Kurt
3d60bea245 Add savefile-wide pkm legality checks
clone checks, duplicate PID/EC/TID
untested & no gui access for now
2019-04-14 01:06:34 -07:00
Kurt
74a45c436a Remove machoke trade catchrate restriction
reverts to 90
Closes #2282, also evident in RoC's PC files (as 90 catch rate).
2019-04-12 22:46:05 -07:00
Kurt
289a36cbd4 Relocate tables to folder
less overpopulated folders
2019-04-12 14:12:30 -07:00
Kurt
ba2b9ace8d Use byte for pp value storage
more appropriate storage; for 3887 indexes -> saves 11.3KB
2019-04-10 22:05:57 -07:00
Kurt
054d498619 Add vc transfer nature checks
Closes #2279 thanks @SadisticMystic !
2019-04-03 20:13:35 -07:00
Matt
21e7d82468 Update GO shiny banlist (#2278) 2019-04-02 13:59:43 -07:00
Kurt
86db3e85e7 Unban HA g7 monkeys
https://twitter.com/SerebiiNet/status/1111223652178112513
bank gift can breed to pass on HA
2019-03-28 21:44:46 -07:00
Kurt
e83f313281 Remove unnecessary abstraction
less objects with only 1 property/field, less objects created = faster
2019-03-23 18:59:45 -07:00
Kurt
55c7bf9858 Remove unnecessary abstraction
EvolutionSet was just an object that hides an array, with no logic
was planning to use the EvolutionSet to do the evolution checks, but
EvolutionTree was required to connect the evolution chains together
2019-03-23 10:36:28 -07:00
Kurt
41e066c562 Consolidate duplicate logic
Reformat g1/2 evolution data binaries for easy loading
precomputed count => no unnecessary allocation/resizing
2019-03-23 10:05:33 -07:00
Kurt
20f023e619 Reduce allocations
GetMethod used to create new array every time; reuse static hashset
(same arrays)

use scan approach to allocate required count
2019-03-23 01:01:04 -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
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
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
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
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
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
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
17f954b4e8 Xmldoc
Reorder to match parameter order
add more xmldoc
2019-02-23 14:57:35 -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
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
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
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
d1f6a5a3ff Misc clean
no functional change
2019-02-15 11:46:46 -08:00
Kurt
7acdf0d16d Expose parse results for external consumption 2019-02-14 20:14:46 -08:00
Matt
7538a33c81 Update GO shinies (#2260) 2019-02-14 10:49:37 -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
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
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
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
6353e8d84d Add special set operation for alph rocksmash
closes #2253
ty @Subject21J & @ReignOfComputer
2019-01-27 11:08:21 -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
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
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
Kurt
41a3989b53 Consolidate encounterlink into mysterygift
use synthetic wondercards to match link gifts
2019-01-12 23:50:31 -08:00
Kurt
4f1375ad6a Add route 1 to sky location table
Closes #2241 ty @Ninjistix !
2019-01-12 17:21:57 -08:00
Kurt
c591d2a69d Misc updates
condense some logic
2019-01-11 17:44:51 -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
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
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
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
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
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
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
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
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
d5a8d29088 Misc updates
reduce some allocs, clearer names/enum usage
2018-12-27 20:24:24 -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
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
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
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
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
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
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
2c2e5f60b3 Fix AV message for go transfers
formatted now
2018-12-02 09:08:42 -08:00
Kurt
d41197828b Misc fixes
apply version after adding (was previously left as Unknown version ID)
add Route 9 to rarespawn flying list (thanks @sora10pls )
2018-11-29 16:06:25 -08:00
Kurt
35a85670b3 Set height/weight dex values
Closes #2167
Based off sub_71001D16A0 with shortcut modifications:
* code marks new entries for evolution processing later using the low
bit (hence the << 1); in save files I can't see any bits set, but I
can't see anywhere in the code that DOESNT set this bit. Thus the
assumption of post-processing.

As noted in gameplay, a new capture doesn't set Min and Max; it only
sets it if it is above the usual sizing values.

Megas apparently don't set until seen in battle, so don't worry about
setting the other forme based indexes.
2018-11-27 22:05:36 -08:00
Kurt
76a2e4f527 Add AltForm parameter to exp/level fetch
Starter Pikachu & Eevee have different growth rates than their base
forms (seriously WHY?)

remove old api surface in PKX as a breaking change as adding the
parameter is necessary.
2018-11-26 16:55:16 -08:00
Kurt
5f0d1d423b Disallow volt tackle tutor for pb7 2018-11-25 19:44:19 -08:00
Kurt
71f1e6238a Misc fixes 2018-11-23 10:15:49 -08:00
Kurt
f358c0e4cf Handle all deviating met location string versions 2018-11-22 10:11:51 -08:00
Kurt
58080f36c9 Add WB7 and legality detection logic
Derived from WC7 with minor alterations (dynamic OT/Nickname which is
stored in the Full data). Since the 0x108 is not stored in the save
file, just keep the full data around.
2018-11-21 12:24:41 -08:00
Kurt
0ebfb38717 Add Route 20 to sky encounter rarespawn list
Thanks @ReignOfComputer !
2018-11-20 23:00:16 -08:00
Kurt
7bd3bfc52e Update rarespawn restrictions for birds 2018-11-20 13:38:49 -08:00
Kurt
3e711acd05 Disallow egg moves in suggestions for cxd/gg encs
https://projectpokemon.org/home/forums/topic/48547-remove-eggmoves-from-green-learnables-move-in-lets-go/
2018-11-20 13:38:05 -08:00
Kurt
ba1a7c2bcf Fix broken tests
rework getblank for version specific
2018-11-19 16:14:49 -08:00
Kurt
4022d7fea9 Add check for invalid pgo shiny transfer
Thanks @sora10pls !
2018-11-19 13:07:21 -08:00
Kurt
70fe7f58ee Remove eevee, revert porygon 2018-11-18 20:39:15 -08:00
Kurt
67cc6bdead Account for wild catch combo/lure level boost
Route 4 sandshrew captured at level 13 (12 is max)
+1 for now, not sure if it can go higher
2018-11-18 16:17:39 -08:00
Kurt
b818aff48a Remove evo tree sanitization
Evo data doesn't provide evolution values for these, fortunately.
2018-11-18 15:25:03 -08:00
Kurt
17348c1808 Add bird rare spawns 2018-11-18 10:36:28 -08:00
Kurt
1c0b2488ef Update lapras/porygon gift locationIDs
Thanks Asia81!
2018-11-18 09:41:52 -08:00
Kurt
edce01a857 More strict egg nickname length check
only fishy if it was traded & within bounds
2018-11-17 18:29:05 -08:00
Kurt
029e0e0a08 Manually add rare slot locations
placeholder; hopefully this isn't permanent
2018-11-17 15:12:32 -08:00
Kurt
d3534781db Allow premier ball for captures 2018-11-16 18:59:18 -08:00
Kurt
1c26c7713f Fix starter bypass
lol oops, hotfix inc
2018-11-16 18:17:01 -08:00
Kurt
013bc70ed9 Add more pb7 legality checks
can give nicknames to chinese mons now! Encoding looks the same
@wwwwwwzx :)
2018-11-16 17:42:50 -08:00
Kurt
a2eef9deae Misc fixes
it is version exclusive; fix magikarp speed IV
2018-11-16 16:44:25 -08:00
Kurt
ea4d9861c8 Disallow starter friendship move in learnset
Joycon shake only, never actually in moveset
2018-11-16 14:56:20 -08:00
Kurt
720e04ff91 Allow 7b trades to be shiny
remove the todo, thanks twittersphere

remove version exclusivity for puppycat (can be done on either ver)
2018-11-16 14:20:06 -08:00
Kurt
dae4a0a0ae Add EV/AV verification for pb7 2018-11-16 14:19:24 -08:00
Kurt
7da46623b8 Ignore ball check for invalid encounters
Defaulting to pokeball isn't entirely appropriate
2018-11-15 18:40:08 -08:00
Kurt
ed5abbd686 Add puppycat NPC location
Thanks (twitter) thelostdogg!
2018-11-15 18:39:30 -08:00
Kurt
94b924fdfc Add ingame trade IVs and random AV notes
exclusive maximum, not inclusive
2018-11-15 17:35:34 -08:00
Kurt
93ff395875 Add more succinct go park IV check string 2018-11-15 17:35:11 -08:00
Kurt
43a9d4eb99 Add gg evolution tree
turns out it was totally needed; am glad I didn't do the silly stuff of
past gen evo tables (gen6/7 is just raw evo data)
2018-11-15 17:34:54 -08:00
Kurt
22063d3907 Add ingame trade met locations 2018-11-14 23:04:40 -08:00
Kurt
a64d08e7e9 Add GO transfer IV verification 2018-11-14 18:25:43 -08:00
Kurt
830c2cbb29 Add GO encounter area/slots
Level ranges per species TBD
2018-11-14 17:40:41 -08:00
Kurt
adb6b345be Treat GameVersion.GO like other GG vers 2018-11-14 17:40:11 -08:00
Kurt
0b9b0d5317 Add bulbasaur candy to valid candies
oops
2018-11-14 17:06:13 -08:00
Kurt
24c541eeef Get savefile-context sensitive pkm
Generating a IEncounterable -> SAV for pb7 can't start with pk7
2018-11-13 19:19:20 -08:00
Kurt
28fec9882b Add pkm variant for beluga 2018-11-13 19:10:31 -08:00
Kurt
f11fa8752c Use pkm format specific evolutions, gg deviations
GG has slightly different evos from usum, don't bother adding a new
binary.
2018-11-13 19:04:58 -08:00
Kurt
6495dc41af Add move/enc/loc references 2018-11-11 22:49:17 -08:00
Kurt
5abbe6dceb Add fetching for lgpe encounters (legality checks) 2018-11-11 22:46:03 -08:00
Kurt
101149eb2e Skip eggs for gg (like cxd) 2018-11-11 14:19:02 -08:00
Kurt
9d2be1da9f Add beginnings for 7b encounter asset fetch 2018-11-11 13:12:24 -08:00
Kurt
1827b32d8f Add init function for wc7 gg files
pretty sure these will pop up soon as the pball plus doesn't send the
mew itself
2018-11-11 13:09:04 -08:00
Kurt
f38c46f5ec Misc updates 2018-11-10 21:07:31 -08:00
Kurt
010134f6ff Add references for GG tutoring
Only pikachu/eevee forms so far, probably none else
2018-11-10 21:04:48 -08:00
Kurt
94c8b348c8 Add legal tables for gg
field_pocket.dat ez pouch indexes
2018-11-10 20:58:41 -08:00
Kurt
453f43edd8 Allow shiny xd duking gifts
https://projectpokemon.org/home/forums/topic/48279-issue-with-ribbon-legality-shiny-dukings-and-japanese-text/
2018-11-08 18:58:52 -08:00
Evan Dixon
9c87ad2977 Port tests to .Net Core (#2156)
* Rewrite tests with XUnit and .Net Core
* Add better "because" message
* Skipping test that was not ready & convert the fact to a theory
* Tweak casing
* Convert select date tests to theories
* Make the GetStringList load lock safer
2018-11-06 15:25:35 -08:00
Kurt
d5c22b1e51 Add gen3 wc3 fixed OT egg length case
unhatched egg:
https://projectpokemon.org/home/forums/topic/48226-pichu-event-ilegal/
2018-11-03 12:44:03 -07:00
Kurt
daf41da91b Add more pokewalker moves
Thanks theSlayer!
2018-11-03 12:42:11 -07:00
Admiral-Fish
69b6ea57a3 More nature lock data (#2154)
* Fix lock data

Don't have data on Speal phenac, Spheal post, and Ursaring from colo so can't verify that.

* Fix e-reader data
2018-11-01 22:38:33 -07:00
Kurt
fe989d48fe Misc prep updates
Update comments / xmldoc
Add a savefile storage compressor (ie array[] with empty interstitials
-> list); return true if the compression moved anything (repopulate
views), and the count of occupied slots in the list.
Add saveblock base class; I haven't really liked how SAV6/7 do all the
logic; I'll still expose properties that will then point to a saveblock.
Cuts down clutter.
Add template Dex manipulator, with gen6/7 implementations
Speculate sequential gp/ge gameversion IDs
2018-11-01 15:38:09 -07:00
Admiral-Fish
6a5ee7bf6d Fix Electabuzz data (#2151) 2018-10-31 23:16:13 -07:00
Kurt
8f9cc6cd7e Fix xmldoc ampersands 2018-10-31 13:52:09 -07:00
Kurt
7a021781e0 Add xmldoc, misc fixes
Fix compile error (lol github editing)
Add XD check CPU-PSV for nonshiny.
rename l->current for clearer intent
2018-10-30 17:45:21 -07:00
Kurt
bc788beef0
Fix spelling mistake in var name
Unused after assignment, but if I rework the validation check to return the teamlock result instead of a bool I can spit out the Species-PID generated list as extra info. Helps identify the as-generated conditions if there are multiple teamlocks possible for an encounter (multiple shadow mons, seen vs unseen).
2018-10-30 09:21:32 -07:00
Kurt
908c98b876 Switch lock checks to newer more complete check obj
Now accounts for the shiny locks & associated restrictions, abusing the
recursion by setting & unsetting the required CPU Trainer's shiny value.

Repoint all test methods to use the new obj methods
2018-10-29 22:49:04 -07:00
Kurt
ef16e7037a Add lock check result object
A lot of internal information is nice to have saved; create a copy of
the static class's logic and pepper in some state variables (Required
CPU Shiny Value) to account for the weird edge cases.

Code is essentially the same as the static methods, except for more
fleshed out logic in the AllLock interrupt checking and the eventual
Trainer checks.
2018-10-29 21:28:22 -07:00
Kurt
b124a6e70d Extract seedframe to separate file
soon tm
2018-10-29 21:03:29 -07:00
Kurt
afffaaa43c Enable full shadow lock checks
If you find any edge cases (the code does not account for shiny locks
yet) pls lmk, would be nice to have confirmed tests :) :)
2018-10-29 19:44:30 -07:00
Kurt
35143630a0 Add ereader locks 2018-10-29 19:43:32 -07:00
Kurt
1b57acc6a7 Check all locks for legality checking
Single->All
2018-10-28 20:28:56 -07:00
Kurt
a728e97d40 Fix Butterfree lock
Ninetales is female
2018-10-28 20:28:02 -07:00
Kurt
7c0a74337e Update shadow lock checks
Passes all 3 lock3 cases in addition to some bulk checks
(VerifyPIDResults).
Lock4 has an issue on one; will have to investigate why.
2018-10-28 20:10:35 -07:00
Kurt
4268239c12 Continue work on shadow lock checks
Now gets count=2 tests working

yield return new SeedFrame { FrameID = ctr + (l.Seen ? 5 : 7), PID = pid
};
used to be ctr + 6, needs to alternate even-odd
all 2 lock cases pass, but didn't make lock3's pass. Something else is
still amiss :)

break out some classes for the solidified lock objects
2018-10-28 11:15:40 -07:00
Kurt
39f98a4a94 Misc qol updates
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
2018-10-27 21:59:31 -07:00
Kurt
ed3699fbb4 Update Ho-Oh mattle check
More languages than Italian have a rule-breaking name. Rework checks a
bit
Flag eggs more accurately
Update force hatch to move Link Trade met location to Egg Location

fix Ho-oh -> Ho-Oh text strings (correctness is key!)
2018-10-27 16:06:06 -07:00
Kurt
a3e7c4837e Rewrite trade OT/Nick verification, g4 shuckie
Shuckie in HG is not the same as Shuckie in SS.
Use the relatively-recent Nick/OT properties instead of digging through
the encounter table & strings. Ends up being slightly faster.

Thanks theSlayer!

https://projectpokemon.org/home/files/file/3048-kirks-shuckie/?tab=comments#comment-1424
2018-10-27 13:37:03 -07:00
Kurt
ed180f1b5f Allow traded eggs when checking g6+ receivability
As noted in the EncounterEgg generator, Gen6+ update the origin game to
the OT's when hatched.
Thanks Zaskarel!
2018-10-27 09:44:47 -07:00
Kurt
f91a1c1d31 Add gg species / maximum placeholder
Will eventually have to fill these in during gg update
pretty sure they've revealed all the new species; total move/item count
still unknown
2018-10-27 09:08:39 -07:00
Kurt
359a529870 Misc updates
Move some logic around, fix style warnings
2018-10-27 08:53:09 -07:00
Kurt
e8ad1e227f Update shadow lock table
Thanks @ijuintekka ! Closes #2148
Will check later for commented out tests that should pass.

May end up turning on the first-shadow-lock check feature prior to
release.
2018-10-26 11:14:42 -05:00
Kurt
3d0d8fa649 Add first shadow lock check
Currently toggled off, can be optionally toggled on (I'm not sure that
it's perfect? Random save files have stuff flagged since they don't
match the lock; will have to investigate later)
2018-10-21 21:07:33 -05:00
Kurt
8c4a17335f Add first shadow lock test method
Everything should always pass the first lock check; will add shortly to
any cxd encounter checks
2018-10-21 20:55:02 -05:00
Kurt
c0aae6ab78 Add cxd lock check info & begin troubleshooting
commented out test calls = not working
will have to debug in more detail later; the first lock is always
working at least.

data sourced from
https://github.com/ijuintekka/Eligor/blob/master/Eligor/Spread.cs , not
sure if it's perfect.

can't cleanly condense deviating team appearances as double-shadow leads
can't be selectively encountered. didn't feel like modding lockfinder's
recursive algo to be smarter.
2018-10-20 21:03:04 -05:00
Kurt
06cca185e4 Add edge case for pidiv kor g4 pichu
Closes #2144
미케나 pichu 12179/20300
2018-10-19 22:27:18 -05:00
Kurt
93af3e61b7 Add handling for Mt Battle Ho-Oh (italian) edgecase
https://projectpokemon.org/home/forums/topic/47917-colosseum-italian-ho-oh/

there's no shadow ID, so it can have both the short (transferred back)
or full name (never transferred) as CK3 without side effects.

allow 10chars in pkmeditor
2018-10-13 08:07:15 -07:00
Kurt
f7f5d78beb Misc perf tweaks
hopefully resolves the image corruption issue (dont use unsafe?)
remove some linq
2018-10-13 08:02:55 -07:00
Kurt
b7acb7fa1d Add memory rarity table 2018-10-12 17:45:52 -07:00
Kurt
e8552affca More gb restriction relocations 2018-10-10 16:32:02 -07:00
Kurt
2db8daa07b Add specified ability no-hidden check
ability=0 allowed abil1/2 but not 4; catch that scenario
2018-10-10 16:31:40 -07:00
Kurt
2ad103dd46 Extract gb specific core logic to separate class 2018-10-09 21:07:13 -07:00
Kurt
0a62506e11 Micro optimization
wow such use
length eq to max will always pass
2018-10-09 19:28:18 -07:00
Kurt
b481358e92 Add number count check for OT/nick
https://projectpokemon.org/home/forums/topic/47850-legality-issue-names-with-multiple-numbers/
let me know if there's any implications for transferred content (name
reset on 1-3=>n?)
2018-10-08 17:57:34 -07:00
Kurt
47f20b8c0e Update fixed ability comparison for 6+
4aa44c90c1 only updated it for gens 3-5
Closes #2136
2018-10-08 15:26:43 -07:00
Kurt
f65bc2e984 Reduce allocations for gen1 move parse
use shared interfaces
2018-10-07 15:36:32 -07:00
Kurt
4aa44c90c1 Update fixed ability comparison
ignores <= 0 now
2018-10-07 15:36:04 -07:00
Kurt
fd1009476e Minor logic simplifications
reduce size of encountermoves, split into separate object
only execute gb movedata adjustments for gb
2018-10-06 19:44:50 -07:00
Kurt
4deb5080d1 Misc tweaks
rearrange getmove with respect to tutors; verifycurrentmoves was getting
tutor moves in levelup
extract not-found hint fetch
Expose gen5 block objects (so I can play with saves in linqpad)
2018-10-06 18:45:15 -07:00
Kurt
dc839333b7 Add more parse settings
allows consumers to tweak debatable settings
2018-10-06 13:43:05 -07:00
Kurt
66faa43e03 Add gen6+ fixed ability hot path
Closes #2135
2018-10-06 11:24:46 -07:00
Kurt
f507ab7081 Misc parse settings reorg
makes it more centralized for defining parsing settings, maybe can have
flags to change severity of certain preferential checks
2018-10-05 19:58:30 -07:00
Kurt
59af7fef35 Remove unnecessary properties 2018-10-05 19:57:45 -07:00
Kurt
ce9d3abbe4 Misc reorganization
Move logical checks using encounter data out of Core.cs

might be possible to excise legality checking objects from
Legal/PKHeX.Core so that a 'slimmer' core can be made
2018-10-04 18:52:00 -07:00
Kurt
03a05364ab Update colo suicune ++
location ID was originally added by:

afde4514e2 (diff-83a32d69355a64376bc77bd07e338a33R446)

I
have another save file that uses met location 110 (like this one) so I
assume it was originally a copypaste error from Sudowoodo.

Change Trade strings to not allocate separate empty arrays.
2018-10-04 08:14:53 -07:00
Kurt
4bbb1f54b9 Change burned tower suicune encounter type
was initially set by this commit

0e3815b048

field test resulted in Cave/HoO type
https://projectpokemon.org/home/files/file/2953-burned-tower-suicune/
2018-10-03 16:46:55 -07:00
Kurt
5d6c932353 Spit out move learn generation on verbose
helps indicate any restrictions on learn source outside of the current
format
2018-09-30 11:50:08 -07:00
Kurt
db30fea38c Remove gsc dodrio trade OT trailing space
Closes #2126
Rewrite trade OT validation by using the trade's OTs property
2018-09-19 19:09:29 -07:00
Kurt
d5816795bf Remove split gsc trade levels for tradeevo species
#2126
Receiving a lower leveled species from GSC will evolve it away from the
required species, ruling it unavailable.
Receiving a Machoke will evolve it, so can't reuse for Haunter trade
2018-09-19 19:08:10 -07:00
Kurt
65272d460a stricter mysterygift references
results in:
- precomputed GetTable() reference
- no casting when iterating for matches
- no db null checks, as they are initally Array.Empty<T>();

reduces noise a little & slightly faster
2018-09-15 16:22:07 -07:00
Kurt
df321d14b5 Reorder checks
most common path is now first
2018-09-15 16:13:17 -07:00
Kurt
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Matt
165757d590 Fix Meteorite/Mega Cuff mixup (#2120)
Meteorite (2) is legal, Mega Cuff is not.
2018-09-12 22:10:13 -07:00
Kurt
ff25e3cbd0 Remove illegal items from legal key items 2018-09-12 21:52:09 -07:00
Kurt
d511fccdb4 Move basement key item ID to illegal group
no functional change, item is unobtainable but still can be 'give all'
and in permitted list
2018-09-12 21:30:24 -07:00
Matt
fc91819410 Add XY Magikarp trade IVs (#2117)
* Add XY Magikarp trade IVs

* Add Cosplay Pikachu IVs
2018-09-12 11:02:11 -07:00
Kurt
0c02a0cbbc Add splitbreed mantine to pastgen alolanoffspring
thanks kr, beast ball now recognized as legal
2018-09-09 17:19:50 -07:00
Kurt
f444c41ee3 Remove nick req on g5 gigalith trade
Closes #2114
2018-09-08 10:45:30 -07:00
Kurt
d02b87a7b2 Expose checkresult properties
can now check individual strings / identifiers in a LegalityAnalysis
object by:

var la = new LegalityAnalysis(pkm);
var parse = la.Info.Parse;
if (parse.Any(z => ReferenceEquals(z.Comment, LegalityCheckStrings.X))
...
should be faster than doing string.Contains
2018-09-05 21:27:52 -07:00
Kurt
1750c69b01 Update pcd version distro check
some events have fixed version IDs in the gift data

https://projectpokemon.org/home/forums/topic/47365-vgc-shiny-milotic-usa-pkhex/
2018-09-05 16:09:30 -07:00
Kurt
cc20bb38d7 misc updates
use arrays instead of list when capacity known
use enums for const decoration
remove unnecessary aliases
2018-09-01 19:55:08 -07:00
Kurt
91c37ab573 Update legality check message string style
V### names weren't enjoyable to work with; use similar verbose style as
the program message strings.

updating the translation files with the remapped variable names shortly

remap list: https://pastebin.com/jybkVDAK
2018-09-01 14:11:12 -07:00
Kurt
1fe304e78f Rework mg nick/lang checks
add common interface

https://projectpokemon.org/home/forums/topic/47295-bug-event-golduck-name-not-matching-species/
2018-08-30 18:09:52 -07:00
Kurt
c6e4c39bc5 Fix gen1 single chain for gen2 tradeback scenario
invalid mon -> make sure array is big enough for later move parsing

https://projectpokemon.org/home/forums/topic/47283-unhandled-exception-when-importing-set-from-clipboard-after-opening-gen-i-save-file/
2018-08-29 21:58:44 -07:00
Kurt
ebae14e6ad Add unnicknamed forced languageID wc7 handling
https://projectpokemon.org/home/forums/topic/47295-bug-event-golduck-name-not-matching-species/
another edge case
2018-08-29 20:36:32 -07:00
Kurt
f89d9ca323 Split apart headbutt tree logic
precompute Index & make readonly when initializing as we use Index at
least once when initializing the treesarea
2018-08-28 15:10:08 -07:00
Kurt
f74c1e321a no mo go to yo
pull goto default into 'when' so other cases continue to default

this is a goto free codebase ( ͡° ͜ʖ ͡°)
2018-08-27 20:48:57 -07:00
Kurt
4dc04cb4b9 Add pelago status value check + etc
0, [9,19] are set (didn't see 15), but there's also a switch case which
references all values 0-19.

these values are used by a 80 sbyte array (4*20) in the Resort.cro

remove usages of "goto case"
2018-08-27 20:44:26 -07:00
Kurt
102430ebf5 Update trade nickname check
reorder for simplicity, add test
Thanks ThePunish3D!
2018-08-26 18:32:39 -07:00
Kurt
4656909d98 Misc reorg
use shared class for pk1/2 setnotnicknamed
fix extendedeurope values (copypaste from extendedAmericas)
move ball out of verifiers, move nature/movetype with ball
2018-08-26 16:29:52 -07:00
Kurt
f7b5a5579d sync missing content
yay rename
2018-08-26 11:29:47 -07:00
Kurt
7f87d43c41 Add enum for ball; use in checks
Increases readability instead of using hex IDs
2018-08-26 11:15:32 -07:00
Kurt
6a225ad091 Add mr mime to usum additions for egg balls 2018-08-26 09:43:11 -07:00
Kurt
a9f65a4617 add lock for cross thread dictionary manip
could use concurrentdictionary but after reading some perf drawbacks vs
manual locks, just do it manually. regex checking is the real slow part,
whatever
add some comments to describe
2018-08-25 10:48:37 -07:00
Kurt
5fe9226c62 Ignore fixed language trades for gen4 korean check
Closes #2103
Thanks @Narithegreat !
2018-08-22 22:36:56 -07:00
Kurt
7ccaf8783b Unban bred HA sableye
yeah totally genderless

https://projectpokemon.org/home/forums/topic/47101-gen-v-hidden-ability-sableye/
2018-08-20 20:08:42 -07:00
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