Commit graph

34 commits

Author SHA1 Message Date
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
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
Matt
7472ba8152 Encounters cleanup (#2335) 2019-06-25 10:55:35 -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
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
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
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
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Kurt
f444c41ee3 Remove nick req on g5 gigalith trade
Closes #2114
2018-09-08 10:45:30 -07:00
Kurt
83e61923f7 Add bw/2 jellicent deferral case
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/?tab=comments#comment-233860

Thanks paf!
2018-07-13 13:48:27 -07:00
Kurt
027d898f3d Update Yancy Curtis trade OT checks
Thanks paf!
https://projectpokemon.org/home/forums/topic/46143-bug-in-last-update/
2018-07-10 12:37:40 -07:00
Kurt
bc6c361746 Reduce linq usage
reuse variables instead of re-fetching (pkm.Species)
add overload for HashSet<int> contains vs ICollection
merge BattleOnly to one hashset
2018-07-01 10:49:11 -07:00
Kurt
f8a1d26694 Fill empty ability values with ability1
update handling that checked for this case to instead check for
equivalence to ability1 instead of 0

was generating a PGF with ability[1] = 0, which is not correct. Just fix
the binaries to behave and get rid of all the workarounds since future
tables don't have missing values.
2018-06-15 23:41:07 -07:00
Kurt
4b8cb9b8fb Add entree forest editor & randomizer
ezpz

(clear trailing spaces from entree forest comments)
2018-05-28 08:26:52 -07:00
Kurt
7a77b4524f Add b2w2 route 23 amoonguss
https://projectpokemon.org/home/forums/topic/44798-bug-report-amoonguss-encount-error-b2w2/
Thanks smileynation!
2018-04-14 08:47:02 -07:00
Kurt
0597833899 Track version of slots/static/trades
I think I set the version at the appropriate times to get all encounter
objects
2018-03-30 21:38:57 -07:00
Kurt
1ca69965bf store encountertrade nick/ot within object
allows for ot/nick fetch for a given language
2018-03-26 22:23:11 -07:00
Kurt
e9a3b4acf1 Merge PIDType and bool? shiny property
Gen5 does not follow the same convention, 0 = non, 1 = rnd, 2 = always;
not gonna bother updating for just that one

bool? occupies 2 bytes; enum:byte is 1 byte.

should probably move validity checking logic into the IEncounterable
objects instead...
2018-03-16 19:35:55 -07:00
Kurt
7f21728e84 Add area->location references to remaining slots 2017-12-23 11:48:10 -08:00
Kurt
5e59e20ea1 Store matched encounter generation
previously was only defined for gen1/2, why not all gens
can now query encounters in Core for encounters per generation via
reflection; can help group encounters for data vis or be faster than
getting individual gen numbers
2017-12-18 16:17:21 -08:00
Kurt
80baaea3b7 add b2w2 n's pokemon PIDs
add b2w2 fixed PID encounters (N's Pokemon), move nsparkle to this class
redo static encounter cloning
2017-12-18 15:25:40 -08:00
Kurt
0b58d4ffe9 Add form/nature checks for gen5 trades
altform wasn't checked for EncounterTrade
nature wasn't checked for gen5 origin (decoupled from PID, but forced)
#1702
2017-12-16 14:09:03 -08:00
Kurt
2be84b6005 Rework encounterslot location fetch
store ref to area instead of location, useful for fetching sibling slots
from the parent.
2017-11-25 18:16:50 -08:00
Kurt
61c0bf5271 Fix italian/german b2w2 yancy/curtis OT swap
https://projectpokemon.org/home/forums/topic/42528-bw2-in-game-trades-yancycurtis-20171117/
2017-11-17 08:38:38 -08:00
Kurt
d7300ce68f Cleanup
add amoongus route22 encounter
fix typos in comments
resharper suggestions for recent pr
2017-11-02 21:37:28 -07:00
Kurt
d2ebb6340e Add gen5 nick/OT info (trades)
#1249
appears b2w2 is the first game with fixed nature & nonfixed PID (based
on RoC's specimens), so can't filter by PID on those.
2017-10-28 21:43:47 -07:00
Kurt
69cf1eaa9c add more pkhex.core xml documentation
adds a bunch of documentation useful for those unfamiliar with the core
library
2017-10-23 23:12:58 -07:00
Kurt
a53e8ddb7e Fix grotto mienfoo level range
Thanks paf!
2017-10-18 21:16:52 -07:00
Kurt
47ca69f92b Legality edge case fixes
Some incorrect IDs, some additions (unbreedable hidden abilities in
genV)

https://projectpokemon.org/forums/forums/topic/41407-pkhex-legality-errors-on-gen-6-updated/?tab=comments#comment-219459
2017-09-05 18:28:38 -07:00
Kurt
2344098745 Refactoring
Add more docs, clearer code
Fixes gen2 national park / route 14 swapped strings in EncounterVerifier
2017-07-31 17:09:16 -07:00
Kurt
c15cfdc52d Fix b2w2 reference
yay copypaste
Closes #1373
2017-07-30 15:13:45 -07:00
Kurt
d3a30ebf35 Refactoring +docs
Add some documentation for the high-level encounter finding
Fix encounterstatics not being filtered for the associated game version
(closes #1372)
was a side effect of refactoring this week
2017-07-30 12:31:17 -07:00
Kurt
68aa9aeec9 Relocate encounter data loading to separate files
shifts encounter data from Legal's split tables to individual files for
easier maintenance and initialization. Legal Core's init is so much
simpler now.

fix resource name typo
2017-07-25 00:28:43 -07:00