Commit graph

10408 commits

Author SHA1 Message Date
Kurt
231b3ffe57 IEncounterable: Add down-level interface 2024-11-18 21:58:09 -06:00
Kurt
8c37d9b4b5 Slot3/4: Filter met level on generate 2024-11-18 21:19:53 -06:00
Kurt
c30a335404 Update EncounterCriteria.cs 2024-11-18 20:46:50 -06:00
Kurt
594d133fae Update WA8.cs 2024-11-18 20:40:03 -06:00
Kurt
0b686d428b Change EncounterCriteria to use Level Range 2024-11-18 20:33:33 -06:00
Kurt
52351bf0e7 Generator: Gen3/4 slots w/ IVs & not-min level
Previously would only generate with minimum levels when IVs are provided
Now that it generates not-min levels, need to set the correct level.

Might be possible in the future to have IV-spec also respect a Level request, but for now it's only forceMin which nobody currently uses (no usage of the setter).
2024-11-18 18:56:18 -06:00
Kurt
5c338f5f74 Misc tweaks
Extract better signatures for BallApplicator.ApplyBallLegalRandom
Slot1: swap interface order (consistency with other classes, no impact)
IEncounterTemplate vs IEncounterable interface usage
2024-11-18 14:12:57 -06:00
Kurt
61526fad8d Add missing IV interface tag to trades 2024-11-17 21:15:07 -06:00
Kurt
4af95f63b3 Update BallApplicator.cs 2024-11-17 20:59:54 -06:00
Kurt
1a5d06d0d0 Update BallVerifier.cs 2024-11-17 18:52:42 -06:00
Kurt
076bbbbd77 Update BallApplicator.cs 2024-11-17 15:12:09 -06:00
Kurt
ceb669c112
Update to .NET 9, c# 13 (#4390) 2024-11-17 13:13:58 -06:00
Kurt
adb67922c5 Set dex skin active flag on import 2024-11-17 12:47:38 -06:00
Kurt
8b071073d8 Improve BallApplicator performance
Previous logic would check a new LegalityAnalysis for each ball attempted, and would additionally allocate a new PKM for testing the balls.

With the refactoring to BallVerifier, we can just pass in the template and ball and get a truth, skipping the entire re-check. There might be a deficiency when the current ball invalidates the encounter (GO) but I don't think that's worth considering at this time.
2024-11-17 12:08:22 -06:00
Kurt
b5e3e17987 Update BallVerifier.cs
No longer need to assign ball, can be used to check if ball can be assigned.
2024-11-17 08:59:48 -06:00
Kurt
89e705c6ae Extract ball verification result 2024-11-15 23:39:33 -06:00
Kurt
55b75e8061 Merge branch 'master' of https://github.com/kwsch/PKHeX 2024-11-15 23:07:11 -06:00
9Bitdo
46739891e7
Add Patrick's Pelipper date (#4389) 2024-11-15 10:25:05 -06:00
sora10pls
d028cb0aed Add latest distribution raid data 🐢🌲 2024-11-14 19:03:08 -05:00
Lusamine
1959eb34a5 Further refine memory 29 restrictions in SWSH 2024-11-12 21:10:21 -06:00
Lusamine
bf0e0e2a4b Further refine memory 29 restrictions in SWSH 2024-11-12 18:43:15 -06:00
Kurt
cccce007b8 Update EncounterSlot7GO.cs 2024-11-12 12:08:11 -06:00
Kurt
5955319883 Add expected PP check for stored-healed slots 2024-11-12 10:33:34 -06:00
Kurt
b60c6e5f14 Update 24.11.11 2024-11-11 23:25:02 -06:00
Cynthia Coan
f2a6abbb6c
validate nickname characters within gen4 (#4382)
pkmnclassic has recently had some pokemon traded that cause game
crashes when viewing the pokemon's information, or when trying to
remove the pokemon for these boxes. most of these pokemon were reported
legal by pkhex however. this fixes the biggest use of these we've seen
actively traded (some of the other checks require more validation, as
they seemed to be buggy, we intend to validate those & send more PRs if
needed).

this check effectively covers "NULL Bytes" within the trainers name,
or the pokemon's nickname. We have attached an example pk4 that was
traded through our service that exhibits this issue, a couple notes:

- Generation 5+ seem to not be affected and replace character names with
  '?'
- Not all screens crash inside of Generation 4, the big ones our users
  noticed were viewing the pokemons information, and removal from the
  boxes.
- I also got a crash in pokemon ranch, but my testing setup was pretty
  hacky, and I'm not confident it wasn't something else, but we know
  it's potentially possible.

- We check for the terminator character '\uffff' which the pkhex string
  converter inserts implicitly when encountering an invalid character,
  but the actual underlying character when performing a hex dump is
  `\0`.
2024-11-11 22:28:01 -06:00
Kurt
fced599119 Fix HGSS box saving (empty->not)
HGSS tracks each box if it is changed, to skip writing it on in-game save. PKHeX (and other editors) weren't updating these bitflags, so when empty boxes had Pokémon added and saved once in-game, the save file would corrupt as it was copying the checksum but not the box's data.

Saving twice in-game will cause the checksums to get updated even without the flags being set. I don't think we understand it fully, but this hacky workaround of noting all boxes as "changed" will cause the first-save to properly copy all contents of the boxes to the new primary save section. Rather than tracking which boxes we are reading/writing slots for, or fixing/comparing against a backup -- we need to account for API usage where people might write directly into the save (pcdata.bin/boxdata.bin too). Best to play it safe and let the game fix it.

Most wouldn't have noticed this issue as the box they're modifying is usually their most-recently-changed in-game box.

Closes #4368
2024-11-11 22:25:34 -06:00
Kurt
6153d6c851 Restrict gen3 PCNY OTs further
last 4 sets were only on the D memcard
add notes regarding Dragon runs using B memcard (staff)
https://pokemonhistorian.com/pcny-project/pcny-preservation-records/
2024-11-11 15:17:01 -06:00
Kurt
b0a2c7911e Fix Met tab startup binding
`ListControl._dataManager` is null until some event fires, which never happens until the Visible state is normally triggered by flipping to that tab.

The met tab Version/Location can skip Visibility changes on startup, resulting in never being initialized by the GUI framework, thus ignoring any calls to change SelectedValue. Really weird, but setting the BindingContext here forces it to create a `_dataManager` when setting a new `DataSource`.

Closes #4384
2024-11-11 15:11:47 -06:00
Kurt
5d4976303d Add manual handling for Mainland China gifts
Closes #4375
ty manu for clarifying transfer restrictions on discord
2024-11-11 10:05:17 -06:00
Kurt
52437d1712 Gen3 PCNY: remove OT gender checks
Same as PCJP, uses the recipient's save file gender. Not random.
2024-11-11 08:16:58 -06:00
Eelen
4414b34fe7
Update lang_zh.txt (#4387) 2024-11-11 00:00:34 -06:00
Kurt
8b09d9467d Misc fixes 2024-11-10 19:22:59 -06:00
Kurt
de57e197ad Fix gen3 reversal exploration for 50% of seeds
line 340 - variable reuse!

In looking at the emerald disassembly, when Pressure/Hustle/Vital Spirit fails, it reduces the max level of the slot by 1 so that the max level doesn't randomly appear. Essentially 50% flat for the max to appear, for varied slots, not 50% + (1/range). Thus we require a separate branch of logic to check for this scenario.

f8119bedd4/src/wild_encounter.c (L298)

DPPt (and assumedly HGSS) do not decrease the random range on failure.

ty TFS for bringing this to my attention on discord
2024-11-10 19:11:30 -06:00
Kurt
d1a51797c7 Fix encdb search pane scroll, pkmdb overlap 2024-11-10 18:08:58 -06:00
Kurt
947bbc7274 Fix Sirfetch'd deferral, add Tera deferral
Marill and Azurill need deferral cases as they change primary type
(normal-fairy => fairy || water-fairy => water)
2024-11-10 15:32:57 -06:00
Kurt
e4e3d929a0 Handle Gift method2 eggs better
Set PID correctly
Defer on fateful (wynaut egg clash, hot springs)
2024-11-10 15:16:19 -06:00
Kurt
c8726c4e2d Fix T2/Channel jirachi enc->pk3 generating 2024-11-10 15:00:31 -06:00
Kurt
1ffbd46e3c Extract some logic, deduplicate 2024-11-10 13:25:30 -06:00
Kurt
3c574a45f1 Revise enc1/2 -> pk1/2 nickname set
Skip the IsNicknamed evaluation, saving at least 1 string allocation on ctor. Remember the IsNicknamed state when we set false.
GUI: provide the selected language rather than recalculate
2024-11-10 09:32:33 -06:00
Kurt
51464fb4af Update PK9.cs 2024-11-09 22:34:33 -06:00
Kurt
d77d6b7ce6 Fix MethodJ enc->pkm nature check
silly differences; MethodJ should have been /A3E not %25
Make GetNature public, and have the MethodK esv modulo be uint instead of long for better clarity.
2024-11-09 21:37:03 -06:00
Pasquale Nardiello
38756b44c7
Added Lilycove museum manipulation (#4385)
* Added method to extract pokémon data from lilycove museum and experimental way to set paintings active and change their subject in order to obtain 2nd trainer star and crystal decoration
2024-11-09 18:58:23 -06:00
Squid
62b58f78e7
Labels for Gen 5 Trainer Records (plus renamed flag) (#4362) 2024-11-09 09:08:57 -06:00
Professor Dirty
4bad2e3cdf
Add CHS Event Flag translations (#4383) 2024-11-06 10:59:20 -06:00
sora10pls
50ff039c1b Adjust HOME Tandemaus gift date range
Like with Shiny Zeraora in the past, the only limitation is the distribution of the gift itself. Once added to your Gift Box, it can then be claimed at any time, giving it no end date.
2024-11-01 09:30:04 -04:00
9Bitdo
26fd23a338
Add PokéCenter Birthday Tandemaus date (#4379)
submitting the date based on

- hard copy serial code issued out at Pokemon center in japan on 1st Nov 2024 1000hr (JST)(operating hous : 1000hr), hence countries in the UTC-11 would be able to redeem it on 31th oct 2024 1400hr earliest

- Serial code expiry date is from 1st Nov 2024 - 31th Jan 2026 (JST) or 1st Feb 2026 (UTC+11 )
2024-11-01 09:28:15 -04:00
sora10pls
56bd4e6486 Add latest distribution raid data 🐊💥 2024-10-31 20:02:09 -04:00
santacrab2
2cd9632c4a
MailBox fix (#4377)
* Catches Out Of Bounds error on ListBox SelectedIndex for when the B_PartyDown_Click event is triggered and the current Selection is in LB_PCBOX.
2024-10-28 18:21:44 -05:00
sora10pls
e2d73eb866 Add latest distribution raid/outbreak data 👻🎃🍭 2024-10-27 20:05:52 -04:00
Easy World
ff24892ec2
Update and revise zh-Hans translations (#4376) 2024-10-27 00:09:11 -05:00