Commit graph

1102 commits

Author SHA1 Message Date
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