* 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
See previous commit for discussion; it's easier to read and maintain
this rather than have the precomputed min/max comparisons.
LevelMin - minDecrease <= min && max <= LevelMax + maxIncrease;
See EncounterArea7b:
Since we know min and minDecrease (0) before doing the linq filter we
can precompute the lowbound, same for highbound; but this isn't
immediately obvious to the reader. The perf cost is pretty much
negligible in the big picture, so leave it in the more readable state.
Thanks @fattard & @ammako !
#2389
The inputs to "IsLevelWithinRange" are the highest value the
lowest-level can be, and the lowest value the highest level can be...
seems confusing (hence the original error).
If a slot is 6-7, with a wild encounter (flute), we can go +/-3 from
6-7, which is 3-10.
With an encounter of level 5, the inputs are: 5+3, and 5-3 (8, 2).
Since 8>lvlmin and 2<lvlhi, we can get a level 5 pkm from the slot
(using a negative flute yielding a -1 adjustment).
I could probably refactor it to be a 3-input signature (lvl, lvlneg,
lvlpos), and have it do LevelMin - lvlneg <= lvl && lvl <= LevelMax +
lvlpos
I should probably refactor these methods to do minLevel & maxLevel (so
baseSpecies.Level to CurrentLevel for pkm that lost their original met
data) but nothing needs the extra logic at this time.
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
Now logic is reasonably split, and each format of area has its own way
of yielding slots
Too much junk with checking flute boosts or catch combo applicability;
just let the area dictate how slots match.
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
split some methods with optional parameters=null
add more xmldoc
replace some magic numbers -> enum/const references
consolidate common array operations (span soon maybe?)
Closes#2381
Keep Raichu and Marowak at the end for ez referencing. Keep a separate
refence for alolan kanto stuff for futureproofing
Might want to improve the EncounterArea abstraction to do the
slot-finding labor themselves, but whatever, hardcode stuff until swsh
throws new monkey wrenches in. A good idea would be a dictionary with
level forcings [species | form << 10] = X and use the dictionary to
check on slot creation
Closes#2343 ty @WEERSOQUEER !
#2338 was referenced by
4d08e21126
, that commit was incorrect. Looks like these 2 have OT Gender female.
Instead of marking every trade MALE except for these two, just update
the handling (i'll probably regret this lol)
Check the OT length for the deferral
other encounters are more permissive than trades, hence why we defer
unless we know for certain. Same OTs are possible, except for the
too-long ones!
Closes#2338 , thanks @WEERSOQUEER !
Needs to be checked prior to the strict Array Index search, as we can't
have an exact string match.
can probably be revised to a StartsWith to only check for the specific
language match, but that's a little less obvious & extra work :)
#2338
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
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.