bypass savefile language checks if no language set
fix gen2 static gift egg that is really a wild encounter -- egg flag was
set & not cleared -> no wild pkm, bad! Adds test case for this.
(probably isn't a better place to clear, enforces only once per
generation rather than on every yield/end of every static yield)
fix b2w2 egg base levelup reference (not bw, b2w2!), doesn't really
matter much except for better indication (possibly?)
remove some unnecessary linq ToArray() calls
continue relocating code out of Core
Closes#1317
Needs the events crew to produce serialized binaries with hash-flag data
for each generation before proceeding any further. I'm not really
interested in doing all the work for events since it doesn't impact
battle legality.
nickname reset clears except for encountertrades (some have fixed
nicknames).
remove untraded check for HT memory verification, has to be traded if it
has a HT memory.
stored as wc3's, make "Version" from IVersion rather than int so that
"WasXD" recognizes it.
Update handling for fateful encounter trade-away cases.
#1970
Had relearnmoves defined but no current moves; better for generator to
spit out all moves rather than the special move (hold back)
store current moves for all link gifts
Remove edge case handling for level 2 blissey; updates over the past 2
(yay 2 years of legality checking) can now handle that case without
special handling.
Store 4g giratina held item for enc->pkm legality
revise usages of GetSaneGender
Rearrange some logic
Better handle impossible version encounters (gen4)
gen 1-5 done, stuck on 659 - bunnelby egg...?
* B2 has an error in the encounter table for Route 3 Corphish Special
water encounter; GF edited from Basculin-1 to Corphish-1 and forgot to
update the form to 0.
* Ranch Trade egg locations
* Trade gender-PID set correctly
* static roamer glitch does not apply for emerald
* Mirage Island wild Wynaut case now allowed (collision with Gift Wynaut
egg hatched on Mirage Island?)
gen1-3 done; now at 413 (Wormadam) which currently yields an
EncounterEgg AS wormadam, which isn't right...
* first case of EncounterLink, now works (version, ability, OT memory)
* handle gen2 gb events (not even sure if they pop up, just in case)
* handle gen3 ereader shadow mons
* handle gen4 spiky pichu PID type
* handle gen2 crystal egg met level
Handle Faraway Island Mew, handle DP Darkrai/Shaymin & Arceus, handle
not-distributed WC3s.
Now stopping at dex 154 -- one full generation of PKM species IDs can be
completely spawned directly from IEncounterable data!
Exeggutor Island has wild & one static with a fixed ability; the fixed
ability is returned first which causes wild lv40 exeggutors with
ability2 (1/2/H) to be flagged as illegal.
Fixes Krabby / etc.
Fix genderless encounterstatic gender set (Voltorb)
Now at 103, Exeggutor
pretty cool that over 100 species can have every single encounter
generate a legal pkm ;)
might be useful to add metrics to count how many encounters are
generated in a session
Graveler (SM Trade) -> Force applying handling trainer details for
ingame trades
Ponyta (Ranch Trade) Apply correct ability for encountertradePID
Up to 98 : Wild Gen2 Krabby (safari zone impossible location needs to
get filtered from possible encounters)
Fix/add missing gameversion references (BU instead of BW,
pokewalker=HGSS)
increase reuse of pidgenerator & add more generating methods.
seems like it's generating pkm fine besides the PID edge cases, which is
nice
version was set to Encounter_XD, which did not contain the miror b
encounters.
simplify XD check to be O(1) now that version is stored in the encounter
obj
Closes#1895 , re-verified with pkm provided in #1805
there's no shedinja gift, always is an evolution
seal some forms to remove virt call in constructor warning
egg moves also can be taught in gen1, which causes the learn source to
be locked to a tradeback (removing egg moves that have IDs greater than
RBY's moves). Simplify gen<=2 parse preference ordering with this
addition to force egg moves to be acknowledged.
only tested for gen7 egg->pkm (not to eventual set)
pretty sure a good chunk of the egg generation logic can be pulled out
for reuse in other IEncounterable generators (IEncounterable
extensions?)
Test parsing glaceon, input must equal output
Test generating encounters for a specific version (exists only on Moon)
Test generating encounters for the same version (add handling trainer
data to permit Tutors)
fixes error in VC generations-present fetch which allowed movesets from
generations 3-6 lul
exclude negative/invalid gameversions
party stats set when setting a slot to a save file
simplify set/delete slotchange duplicate logic
suggest better met locations beyond VC transfers
hatching a gen6 egg applies memories automatically
Two checks are performed for Gen 3 & 4:
A: Encounterability (wurmple, ball, ability)
B: RNG Compatibility (frame)
Original code only checked 'A'
Recent code ordered by 'A', but returned anything that matched 'B'. If
'B was not satisfied, an 'A' match would get deferred, allowing for an
eventual B & !A to be returned before a A & !B being returned.
yay bool logic
we want to prefer a RNGFrameMatch as well as a SlotCompatible match
original code (no RNG checks) retrieves with SlotCompatible just fine
recent adding in framematch resulted in deferring compatible if not RNG
frame, yielding !A matches before A & !B
maintain 3 queues (A & B get yielded immediately) to track A!B, !AB, and
!A!B
not necessary to check unown case anymore as it'll fall into the A!B
group. better performant to skip that check in favor of only adding for
fail.
thanks theSlayer!
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...
faster to do:
null check & comparison for each
vs
collection add (especially if growing collection)
don't evaluate all slots (faster), capturing the dexlevel[] object is
fine until the enumerable is discarded