Commit graph

342 commits

Author SHA1 Message Date
Kurt
eb7ed44b29 Finish splitting gen1/2 encounter types from parent class
Results in a little more code, but each path is less tangled
simplify some expressions
remove RBDragonair content in favor of a strict filter for catch rate

Move gen1 trade trainer names to stringconverter, since pk1/pk2 shouldn't refer to legality classes
2020-07-19 13:32:40 -05:00
Kurt
e4092e64df Relocate gen3 ereader berry logic 2020-07-18 22:51:55 -05:00
Kurt
acd97c6287 Pass evolution chain for generation memory check
chain details are already computed; pass them in
2020-07-18 21:57:15 -05:00
Kurt
705822c965 Abstract some gen1/2 encounter types from their parent class 2020-07-18 15:36:30 -05:00
Kurt
e04b96a9b3 Fix dizzy punch egg recognition & gen2 hatch conter verification
Closes #2939
Fixes #2938

Inline some logic where appropriate for egg levels
2020-07-12 20:58:07 -05:00
Kurt
255498b2f8 Allow chatelaine memory ^ skillful check on format >= 8
Check the memory for RibbonTowerMaster; if the memory is present, permit the lack of ribbon if it was granted via past gen and has the other ribbon.

Simplify !(x || !y) to !x && y

Closes #2926 ty @randomdice101
2020-07-09 22:53:57 -05:00
Kurt
993673f0de Minor clean
no functional change
2020-06-27 23:36:53 -05:00
Kurt
a7ba178005 Remove unreachable/const logic
Earlier compares result in some logic being unnecessary

The Gen7 level up move compare was actually an oversight, so it's a worthwhile fix :)
2020-06-27 22:44:14 -05:00
Kurt
ce5a09055a Merge branch 'master' of https://github.com/kwsch/PKHeX 2020-06-24 18:59:30 -05:00
Kurt
1ae9cb7602 Handle pika/meow soup evolutions
Can lose gmax flag if its current species is able to eat soup, or its origin species could eat soup

this handles stuff like charmander->charizard, as charmeleon would not pass

hopefully there's never a mid-stage evo that has a gmax form, and its final evo doesn't... (don't get any ideas, gamefreak)
2020-06-24 18:59:26 -05:00
Matt
a5b72bd1ce
Update VerifyVersionEvolution for Gen 8 Lycanroc (#2903)
SWSH changed Rockruff->Lycanroc to only depend on time of day, not Version as well. Cosmoem still needs both, though.
2020-06-24 07:34:55 -05:00
Kurt
17f8ad97a9 Fix neutral mint index
hardy is index 0. and isn't a mint
2020-06-20 15:05:34 -05:00
Chris
63add7d929
Fix Master Rank Ribbon (#2874) 2020-06-19 23:20:19 -05:00
Kurt
6002dfb739 Revise master rank ribbon again
ty terry & chris
2020-06-19 21:51:57 -05:00
Kurt
69dbde1bb4 Check battleversion state for past-gen master rank ribbon 2020-06-19 21:24:58 -05:00
Kurt
36dd5ece21 Initial Isle of Armor support
Co-Authored-By: sciresm <sciresm@users.noreply.github.com>
Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
Co-Authored-By: Archit Date <architdate@gmail.com>
2020-06-19 18:51:15 -05:00
Kurt
27cce4dcd2 Disallow galar master rank ribbon on legends
Closes #2858
2020-06-16 22:16:21 -05:00
Kurt
f51e3673da Update AbilityVerifier.cs
incorrectly edited (ability number needs to be bit0/1/2 not none/any other permutation)
Closes #2860
2020-06-16 22:13:21 -05:00
Kurt
2cdb5d26db Clean up some method signatures
rename things to be a little more consistent in naming conventions
2020-06-16 21:46:22 -05:00
Kurt
ff849b9c5b Allow fullness values for format8
ty anubis
this totally isn't fullness, but the toys increase the value (saturation?)
2020-05-31 13:29:13 -07:00
Kurt
3fcb29e68a Remove some reliance on GenNumber 2020-05-31 12:12:48 -07:00
Kurt
7c6ea78c63 Add fullness legality check
Closes #2836

Co-Authored-By: Matt <sora10pls@users.noreply.github.com>
2020-05-24 20:00:32 -07:00
Kurt
d8cd75908b Handle gen2 gift egg collision with low hatch cycle req
Closes #2824
ty @KR1dude !

change miscverifier to use OT_Friendship instead of CurrentFriendship.
2020-05-24 10:46:08 -07:00
Kurt
6164884700 Merge IGeneration into IEncounterable
all but egg exposed it; now, just make egg expose it and remove the unnecessary interface

we still need to Set generation for non-eggs/mgift, so have a separate Settable interface for internal purposes.
2020-05-17 12:32:28 -07:00
Kurt
4f40330af9 Add Dynamax Level = 10 to showdownset if legal
Closes #2835 ; zacian/zamazenta/eternatus can't have a DynamaxLevel other than 0.

Co-Authored-By: Mikewando <mikewando@users.noreply.github.com>
2020-05-16 15:15:41 -07:00
Kurt
9b0e74dd2a Update ContestStatVerifier.cs 2020-05-11 16:51:10 -07:00
Kurt
4decaa73f7 Verify Contest stats on gen5 origin
extract to separate logic class; only gen3+ call this (was originally called by gen6+); only really needs to include gen5
2020-05-09 20:47:32 -07:00
Kurt
8650b5ceb2 Verify g4 tower ribbons as invalid on >=g5 origin
https://projectpokemon.org/home/forums/topic/57026-gen-5-contest-stats-ribbons-bugissue/
2020-05-09 20:45:19 -07:00
Kurt
3100471299 Strip out some unnecessary logic
notnull => no need to check for null manually
2020-04-16 12:58:48 -07:00
Kurt
b8814d2448 Split GG into LGPE (GP/GE), GG (LGPE||GO)
Update usages
2020-04-16 12:48:18 -07:00
Kurt
40d000fdce Extract reusable method 2020-04-14 10:08:02 -07:00
Kurt
0ada4cbd77 Remove some unnecessary null checks 2020-04-12 13:20:40 -07:00
Kurt
a94c754c3f More shedinja edge cases
Don't allow shedinja evolution moves if it wasn't evolved in that generation
2020-04-12 11:28:03 -07:00
Kurt
8ac61d7ff7 Allow antishiny CXD spreads for some checks 2020-04-11 23:14:16 -07:00
Kurt
4d061c561a Add initial marking checks 2020-04-06 16:32:23 -07:00
Chris
f6ad77ab04
Fix item check for silvally (pixie plate)
Remove the comparison, was a copy/paste from Arceus 3y ago
a7339ae26f
2020-03-27 12:15:22 -07:00
Kurt
9e8858ac51 Allow traded gen8 eggs to have OT linktrade mem
Stupid lacking game checks
2020-03-25 19:18:52 -07:00
Kurt
aaf6642d31 Rename Data -> BinLinker 2020-03-20 15:18:59 -07:00
Kurt
799e4852cf Minor clean 2020-03-20 13:33:15 -07:00
Kurt
27d1feafd7 Revise egg wc3 fateful check to return instead of break
Emerald has the same met locations too, which doesn't clear fateful. So if it was hatched in an RS(E) location, we can't know for sure.

Closes #2790 , but keep in mind the posted file is illegal anyways -- can't get egg move aromatherapy with wish.
2020-03-19 17:05:16 -07:00
Kurt
3aaf318035 Update event database, handle HOME gifts horribly 2020-03-14 14:22:45 -07:00
Kurt
b5f1fc71c4 Use original PID for xor flip check
swap pkm.PID -> pkm.EncryptionConstant, simplify comparison

Co-Authored-By: Lusamine <lusamine@users.noreply.github.com>
2020-03-11 20:09:09 -07:00
Kurt
eccfb61839 Update BallVerifier.cs 2020-03-10 22:59:46 -07:00
Kurt
9dbc3cd418 Permit galar native species to inherit past-gen balls 2020-03-10 17:53:56 -07:00
Kurt
ee38e6890b Disallow gen7 ribbons on lgpe origin 2020-02-16 17:41:38 -08:00
Kurt
0d4cff81c6 Clean 2020-02-15 14:29:23 -08:00
Kurt
5e65df6758 Update egg ball check for galar non-natives
pretty rough check, but flags the old starters in bad balls now
2020-02-15 14:22:37 -08:00
Kurt
21eb9cb499 Remove gen7b trade evo if HT present requirement
lgpe->HOME->lgpe can set the HT details, but it isn't a trade.
2020-02-15 13:43:58 -08:00
Kurt
3e4bb9f320 Ignore keldeo resolute form check on gen8+
can mismatch in gen8+ as the form activates in battle when knowing the move; outside of battle can be either state.
2020-02-15 13:30:50 -08:00
Kurt
9e16df4970 Only check g6 contest ribbon affection in g6/7
Affection is discarded on PK7->PK8 in favor of friendship, which can be lowered.
2020-02-15 11:43:21 -08:00
Kurt
b9e3ddf612 Disallow regular slowpoke
Closes #2708
Can't be moved into the game (no sprites yet).

To be removed or handled a better whenever DLC comes out.
2020-02-14 14:52:05 -08:00
Kurt
0c83c48cef Add MrMime-1 check for past gen origin
permit mime jr evolving to mr mime-1
2020-02-13 20:00:41 -08:00
Kurt
f62b6e33f3 handle alolan meowth origin in gen8
https://projectpokemon.org/home/forums/topic/56267-checks-associated-with-events-or-forms/
2020-02-13 17:05:06 -08:00
Kurt
c855bb8bcc Expose method for reuse in other projects 2020-02-12 20:42:45 -08:00
Kurt
6346444db7 Extract home tracker to interface 2020-02-12 18:52:48 -08:00
Kurt
3d6846eb3e Permit more HA breeding
Remove non-galar species from gen8 banlist
Add Ban_NoHidden8Apricorn -- all of these aren't even breedable in-game anyways, but futureproof for DLC? ;)
2020-02-12 18:40:41 -08:00
Kurt
63044cd3f9 Add tracker unique text & setting 2020-02-12 18:10:24 -08:00
Kurt
3e9262efbb Only check memory feeling restriction if gen6
dunno restrictions for gen8 memories.
2020-02-11 22:25:50 -08:00
Kurt
d97db1cc40 Allow pk7->pk8 pikachu cap transfer 2020-02-11 20:36:10 -08:00
Kurt
ebf20d927b More transfer implications
Totems are downsized to regular
araquanid, togedemaru, and ribombee totems can't transfer (at the moment)
2020-02-11 20:11:33 -08:00
Kurt
217156d2b9 Continued comparisons & implications
pk7->pk8 doesnt assign height/weight (zero), require zero for legal
p*7->pk8 assigns a tracker value, enforce something is present for legal
copy OT friendship (oops)
2020-02-11 18:35:54 -08:00
Kurt
7523639b48 Unbanana galar transfers
Initial restriction removal, probably more implications

Need to reverse transfer logic
2020-02-11 17:29:10 -08:00
Kurt
b94430a89f Ban bred HA voltorb in beast ball
https://projectpokemon.org/home/forums/topic/56212-legality-ha-voltorb-in-beast-ball/
https://www.reddit.com/r/BankBallExchange/comments/7boi0h/new_apricorn_and_beast_ball_combinations_for_usum/dpwu5in/

ty Prophet丶W
2020-02-08 20:24:02 -08:00
Kurt
4656978a43 Enforce toxtricity encounters to have restricted nature 2020-02-08 15:08:12 -08:00
Kurt
8e5876b96f Expose item->form methods 2020-02-07 21:34:25 -08:00
Kurt
6e5ef9667f Add female gender check for stadium
Closes #2687
2020-02-06 21:25:13 -08:00
Kurt
867f62c555 Check multi lang stadium OTs
Closes #2671
really wish the gen1-3 event data was serialized ;)
2020-02-03 20:10:07 -08:00
Archit Date
c8a16a1f71
fix yamask/runerigus form handling (#2669)
fixes #2668
2020-01-29 16:11:56 -08:00
Kurt
9c28ffacc0 Simplify N's pkm encounter handling
Readonly PID; sparkle is True always, so it's a const instead of a mutable property.
2020-01-25 12:31:56 -08:00
Kurt
d9c162b5cf Fix criteria comparison
Closes #2651
2020-01-21 09:05:39 -08:00
Kurt
5bb51b07ac Check Footprint Ribbon for gen8
gen7 used same as gen6, we just need to restrict gen!=8
add placeholder LGPE origin check; that'll likely throw a wrench into things when HOME happens (next month?).
2020-01-20 23:09:28 -08:00
Kurt
63ea57436f Make the template IV/contest stat array readonly
See prior commits
no longer need to clone subarrays, they're shared immutable
2020-01-18 19:11:29 -08:00
Kurt
c739af4767 Extract item restrictions to separate class
Move similar classes to folder
2020-01-16 19:27:29 -08:00
Kurt
baf46f9a3a cache form/species/format on first get
very minor perf consideration, since those values are immutable (except for cross thread shenanigans)
2020-01-16 19:23:29 -08:00
Kurt
3b5c7062ac Minor perf improvement
pass in, don't constantly fetch
helps generated IL code be slightly more efficient
2020-01-12 16:49:12 -08:00
Kurt
a8c28369b6 Add Yamask-1 max hp calc for formArg compare
Closes #2632 ty @CanoeHope
2020-01-12 16:22:56 -08:00
Kurt
d3f6d5935f Add form argument legality checks
Closes #2611 (Alcremie)
Closes #2604 (Runerigus)
2020-01-10 16:33:40 -08:00
Kurt
fdd321dd8c Make memory 6 fishy if textvar present
Closes #2621
2020-01-10 16:08:34 -08:00
Kurt
51d2fc9d93 Update with slowpoke-1/new raid data
TransferVerifier: Revise transfer check to allow slowpoke-1 (slowpoke-0 is flagged via next check)
2020-01-09 18:44:45 -08:00
Kurt
3d581283c2 Minor clean
move Text.cs manual Courier new() to the designer, have it dispose when form is disposed. Set it as the numericupdown's font and just reuse that :)
2020-01-05 18:46:30 -08:00
Kurt
5cb3556eee Add Move PP verification
Eggs already had it, adding now for regular pkm
Closes #2602
2019-12-26 14:28:01 -08:00
Kurt
6c7065fb7b Fix bool compare
oops
https://github.com/kwsch/PKHeX/issues/2600#issuecomment-569134146
ty @slp32 !
2019-12-26 13:12:10 -08:00
Kurt
420307d4bf Make non-exportable saves (fake) act as VC saves
https://github.com/kwsch/PKHeX/issues/2600#issuecomment-569125853
2019-12-26 12:21:35 -08:00
Kurt
7edfe4543f Flag eggs with HT string
Closes #2586
Modify PKM Info already clears it, but if disabled, will be flagged.
2019-12-21 16:01:51 -08:00
Kurt
8309060298 Add more egg verification for statnature/techrecord 2019-12-21 14:51:52 -08:00
Kurt
d7bc68d7a5 Add HT case for capture memory check
#2570
https://github.com/kwsch/PKHeX/issues/2570#issuecomment-568149050
2019-12-20 19:47:40 -08:00
Kurt
506e64186a Rearrange & re-do "CanHaveMemory" value check
Closes #2581
2019-12-11 19:37:57 -08:00
Kurt
281c1ae744 Skip SWSH untraded link trade eggs if trade-memory
just read the comments & code, this one is an annoying oversight
untraded pkm /should/ never have HT memory data, but sometimes it do be
like that

Closes #2571
2019-12-09 16:23:29 -08:00
Kurt
aa2241ba66 Fix unchangeable OT friendship to compare correctly
Closes #2572 ty @sora10pls for confirming that evo chains are necessary
for VC transfer
2019-12-09 15:50:03 -08:00
Kurt
8acb336d51 Use enum for species comparisons
slightly easier to read with named values
2019-12-08 17:39:19 -08:00
Kurt
c6ef2a845d Fix ribbon compare
oops
2019-12-07 23:39:32 -08:00
Kurt
4611146807 Update memory verifier
Adds handling for SW/SH quirks
Closes #2545
2019-12-07 23:36:39 -08:00
Kurt
19b1564eb2 Split history and memory verifiers
Rewrite a bunch of the history verification stuff
Fix a few test cases with incorrect OT Friendship (transferred), and
missing GeoCountry

Need to rewrite memory verification next
(All test cases currently pass)
#2545
2019-12-07 18:12:31 -08:00
Kurt
34452c2818 Add gen8 ribbon verification 2019-12-07 11:58:56 -08:00
Kurt
2b1aee7c38 Gen8: Update rules for having BestFriends ribbon
Closes #2562
ty @iiippppk
2019-12-06 20:22:23 -08:00
Kurt
786d9c8f18 Handle shedinja encounter balls
nincada -> spawn shedinja = pokeball (wild encounter rules if gen3)
shedinja encounter = wild encounter rules
2019-12-05 16:40:14 -08:00
Kurt
d3f7e7bf07 Minor simplifications
format >= 6 is always true (early return in entry)
don't double-flag/check memory presence in OTs from gen5 and below (hist
and OT verifier)

rename method; I'll probably rework the flow of things for gen6
verification and gen8 verification since the rules are slightly
different
2019-12-02 16:36:53 -08:00
Kurt
2ee6fbb7e9 Only flag bred stuff for no-breed
Closes #2542
2019-11-29 18:54:07 -08:00
Matt
bc9be36123 Add more Gen 8 static encounter locations (#2540)
Also add West Sea Shellos/Gastrodon to transfer form banlist
2019-11-29 10:03:35 -08:00
Matt
faf936bceb Update Gen 8 transfer banlist (#2536)
Alolan Forms can't be obtained yet, same with Hoenn Zigzagoon/Linoone and Unova Stunfisk.
2019-11-28 18:42:22 -08:00
Kurt
2c0b85ef21 Add form banlist for g8
Weezing-0 has no de-evolution path (nothing evolves to it)
Just ban these forms existence in SW/SH
2019-11-28 12:09:55 -08:00
Kurt
f0cf28fbad Flag bred transfer mons
#2416
2019-11-28 11:51:23 -08:00
Kurt
f5307c142b Use format sensitive move knowable check
Closes #2534
2019-11-27 23:07:41 -08:00
Kurt
907f036956 Disregard OT memory values on gen7 origin 2019-11-27 16:01:12 -08:00
Kurt
08e293dadc Add SimpleTrainerInfo constructor
zeroes out console region data if not present in game
2019-11-26 16:55:28 -08:00
Kurt
15ef6555a8 Add WC8 memory & fix fallthrough
ty @sora10pls
2019-11-26 11:22:01 -08:00
Kurt
ef425af835 Add memory / console region checks for pb7/pk8
yeah your initial hacks were hacks

It appears there's a bug (in the game) for link trade memories --
applied to the OT memory instead of HT memory?? Fun!
2019-11-26 11:01:09 -08:00
Kurt
f30a14ebf0 Disallow dynamax level on story legends
ty @sora10pls
2019-11-20 18:15:21 -08:00
Kurt
a368b81519 Minor clean 2019-11-18 22:48:03 -08:00
Kurt
2b76fe148d Fix property reference for Darmanitan-G
lul
Closes #2453
2019-11-18 19:29:05 -08:00
Kurt
f20f6cd4bb Only check east asian script chars on gen7&below
Closes #2437 thanks @iiippppk !
2019-11-16 17:47:26 -08:00
Kurt
31c09c52e8 Add initial nieve check for ball inheritance
Closes #2438
2019-11-16 17:45:51 -08:00
Kurt
451694da28 Flag past gen transfers
not valid yet
2019-11-15 19:37:04 -08:00
Kurt
cefb56a749 Sword/Shield Update 2019-11-15 17:52:08 -08:00
Kurt
e3efa65160 Cleanup
handle messages for dirty cleaning :)
2019-10-26 12:33:58 -07:00
Kurt
02420d3e93
PKHeX.Core Nullable cleanup (#2401)
* Handle some nullable cases

Refactor MysteryGift into a second abstract class (backed by a byte array, or fake data)
Make some classes have explicit constructors instead of { } initialization

* Handle bits more obviously without null

* Make SaveFile.BAK explicitly readonly again

* merge constructor methods to have readonly fields

* Inline some properties

* More nullable handling

* Rearrange box actions

define straightforward classes to not have any null properties

* Make extrabyte reference array immutable

* Move tooltip creation to designer

* Rearrange some logic to reduce nesting

* Cache generated fonts
* Split mystery gift album purpose
* Handle more tooltips
* Disallow null setters
* Don't capture RNG object, only type enum

* Unify learnset objects
Now have readonly properties which are never null
don't new() empty learnsets (>800 Learnset objects no longer created,
total of 2400 objects since we also new() a move & level array)
optimize g1/2 reader for early abort case

* Access rewrite
Initialize blocks in a separate object, and get via that object
removes a couple hundred "might be null" warnings since blocks are now readonly getters
some block references have been relocated, but interfaces should expose all that's needed
put HoF6 controls in a groupbox, and disable

* Readonly personal data
* IVs non nullable for mystery gift
* Explicitly initialize forced encounter moves
* Make shadow objects readonly & non-null
Put murkrow fix in binary data resource, instead of on startup
* Assign dex form fetch on constructor
Fixes legality parsing edge cases
also handle cxd parse for valid; exit before exception is thrown in FrameGenerator

* Remove unnecessary null checks
* Keep empty value until init
SetPouch sets the value to an actual one during load, but whatever

* Readonly team lock data
* Readonly locks
Put locked encounters at bottom (favor unlocked)

* Mail readonly data / offset
Rearrange some call flow and pass defaults
Add fake classes for SaveDataEditor mocking
Always party size, no need to check twice in stat editor
use a fake save file as initial data for savedata editor, and for
gamedata (wow i found a usage)
constrain eventwork editor to struct variable types (uint, int, etc),
thus preventing null assignment errors
2019-10-16 18:47:31 -07:00
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
87f43a47d8 Bump lang version to 8
some lang upgrades
2019-10-04 20:10:50 -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
ab0b8979e9
Add swsh content placeholders (#2392)
placeholder content until real data is dumped
2019-09-23 16:56:47 -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
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
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
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
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
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
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
2b8ef9236a use some explicit dex numbers as enum 2019-06-01 10:22:49 -07:00
Kurt
9b8b8f784a Revert "Add another vc nature checks"
This reverts commit b51bdc9230.
2019-05-20 17:05:53 -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
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
Kurt
054d498619 Add vc transfer nature checks
Closes #2279 thanks @SadisticMystic !
2019-04-03 20:13:35 -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
925167bd33 Fix Invalid/Missing Ribbon string format swap
Thanks TORNADO (discord)
2019-02-24 22:20:02 -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
2eef523475 Misc clean
meh
2019-02-02 15:20:08 -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
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