Commit graph

8085 commits

Author SHA1 Message Date
Lusamine
ab33df2fc9
Enforce weather legality for SWSH (#3221)
* Add weather types by location

Creates a dictionary of possible weather types for each SWSH location.
Unlisted locations may only have Normal weather or do not have any
encounter slots.

* Prune unused weather from static encounters

Some encounters were too permissive with weather, e.g. Sandstorm in
Fields of Honor and Challenge Beach; Snowstorm at Dyna Tree Hill.

A few crossover areas that would have limited the possible weathers were
marked with a "(c)". An example is Nidorina from Giant's Bed crossing
to Frostpoint Field, where Raining and Thunderstorm do not occur.

This additionally organizes encounters by location.

* Move location-weather dictionary to EncounterArea8

* Verify weather marks on encounterslot/static encounters

* Adds some static encounters available through weather bleed

Weathers aren't normally available, but these static encounters are
close enough to the boundary that the weather in an adjacent area can be
used to spawn them.

- Frostpoint Field Snorlax with Raining/Thunderstorm from Giant's Bed
- Snowslide Slope Amaura with Raining/Thunderstorm from Giant's Bed
- Frigid Sea Carracosta with Intense_Sun from Three-Point Pass
- Frigid Sea Magmortar with Intense_Sun from Three-Point Pass
- Ballimere Lake Corviknight with Snowstorm from Giant's Bed
- Ballimere Lake Cryogonal with Snowstorm from Giant's Bed
- Ballimere Lake Tyrunt with all weather from Giant's Bed
- Lakeside Cave Ferrothorn with all weather from Ballimere Lake
- Tunnel to the Top Golbat with all weather from Path to the Peak

* Defer weather marks if incompatible, enforce encounterslot weather

This uses the area weather to check fishing slots and tentatively adds
some tables for weather bleed encounterslots.

* Warm-Up Tunnel gets weather bleed from Training Lowlands

* Update for base PKHeX

* Handle weather bleed for SWSH encounter slots

Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>

* Minor clean

Having duplicate weather marks is illegal, so just auto-partial match them instead of checking the other marks.

* Rearrange slot weather check logic

* Claim reserved byte in SWSH pkl

* No need for two variable names now

* Valid weather marks on tree/fishing should return with main weather

* Fix tree/fishing deferral and add another surf slot weather bleed

* Disallow tree/fishing encounters from using bleed tables

None are currently known at this time, and only hidden grass encounters
have a weather bleed table

* Condense bleed expression, combine tree/fish flag check

* Move weather-bleed check into EncounterArea8

Makes the dictionaries private instead of internal.

Co-authored-by: Skadiv <62726360+Skadiv@users.noreply.github.com>
2021-07-26 14:28:05 -07:00
Kurt
c9640f8561 Comments: forme->form 2021-07-26 14:14:39 -07:00
Kurt
9c8bee19ca Gen5: Add give all musical props, b/w entree level changing
Abstract some things into their parent save block structure.
2021-07-25 23:44:03 -07:00
Kurt
a6176dc3d0 Add fused & gts slot indications for gen5 2021-07-24 17:23:58 -07:00
Kurt
9215cc129b Allow readonly slots to be dragged out from
Show hand symbol on all draggable slots
Still disallow swap operation for readonly slots.
2021-07-24 00:16:51 -07:00
Kurt
7bd844d5c5 Move min level check for gen1/2 closer to move adder
Check per-evolution min level rather than basing it on the original encounter data.

Correctly parses stuff like a captured level 23 Nidorina that immediately evolves into Nidoqueen, then learns Body Slam.

Passing zero is better than passing 1, as 0 requires no value pushing.

tidy up method signatures in MoveLevelUp so that species is followed by form, and the lookups are textually aligned. Clarify "maxLevel" instead of max/lvl, same as min.
2021-07-22 21:25:15 -07:00
Kurt
e961694bdb Minor tweaks
Pass evo chain to memory learning machine move
Pass minimum level for GB encounters if present, rather than enc min level
2021-07-22 19:08:56 -07:00
sora10pls
ee004865bd Add fossil distribution raids 2021-07-22 20:08:14 -04:00
Kurt
b265c349ca Remove unnecessary null check
No paths into the method are null parameters
2021-07-21 00:58:30 -07:00
Kurt
4ee72b0020 Extract pass power enum from gui logic 2021-07-21 00:58:09 -07:00
Kurt
51616cc7f9 Handle off by 1 for box/slot differently
Does the opposite as was implemented in 16c8a18928 by updating all downstream users -- batch filters only.
2021-07-20 23:53:33 -07:00
Kurt
5615d24c9c Fix conditional PID->EC copy on UpdateShiny
Should check 3-5, not 1-5, as VC transfers have separate ECs.
Replace the .Visible check; if the control isn't on the current tab page, it might report itself as invisible, and not update the text.
2021-07-16 08:40:53 -07:00
Kurt
6bed33f7f1 Minor tweaks 2021-07-15 20:40:00 -07:00
Kurt
3351e0a66f Update wc8.pkl
Update wc8.pkl
2021-07-15 20:40:00 -07:00
Kurt
8e5e4487ba Change interface for method call to less restricted
Don't need "Name" or "LongName" for these methods.
2021-07-13 18:22:04 -07:00
sora10pls
34c401b7a0 Revise IsHOMEGift, check Card ID for gift date range
Currently, HOME gifts present in wc8.pkl will not be flagged for invalid dates due to them missing their respective Card IDs. This will be fixed with the next stable release, so this works for now.
2021-07-13 18:22:04 -07:00
Kurt
46f50a3a56 Use named consts for magic gender values
More personal magic value comparisons
2021-07-13 18:22:04 -07:00
Kurt
f5090e3ae7 Fix cgear png import
Closes #3231

Symptoms observed:
- Tiles were too dark (not high enough RBG value due to >>3; keep 8bit color here.
- Red/Blue channel inverted, swap R & B. Works? Hope this isn't something related to png storing rgb vs bgr and we'd need to check input pixel format?
- Tiles were misplaced slightly, off by 1. Fix order of operations so that the tile choice value is correct.
2021-07-10 19:32:10 -07:00
Kurt
6ee552b860 Compare propertyvalue for Legal batch
seal the classes, no need to derive (nothing virtual)
2021-07-10 13:45:14 -07:00
Kurt
aeb83c8269 Update EncounterSlot8.cs
Closes #3232
2021-07-09 10:09:57 -07:00
sora10pls
85c500529e Add Curry distribution raids 2021-07-08 20:06:30 -04:00
Kurt
3fa311f6ed Misc tweaks
more annotations - all bool->out ? are annotated now
fix gender symbol inversion (forgot to set text)
extract some methods to reduce nesting
2021-07-06 08:42:15 -07:00
Kurt
de8e855116 Replace MC->MemoryCard
Simplify some interactions to be more clear
2021-07-05 14:32:09 -07:00
Kurt
5a769312fd Finish renaming EncounterType->GroundTile
Update the localization for GroundTile for english (and Italian, which is untranslated)
2021-07-03 23:25:09 -07:00
Kurt
09ff78ba71 Simplify memory list creation 2021-07-03 22:10:45 -07:00
Kurt
8188208ca3 Add TMs to Item param list
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2021-07-03 13:18:51 -07:00
Kurt
9e665034b7 Implement "Can Buy Item" memory check
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
2021-07-03 13:12:46 -07:00
Kurt
4452c10beb Close popups when opening saves
Works around loading saves with different import/view permissions (Gen8 content not in Gen7, etc).
2021-07-03 12:46:52 -07:00
Kurt
0e9d0886a9 Fix BCC if-else slot loading
Not all slots were being loaded.

Thanks jazpersona !
https://projectpokemon.org/home/forums/topic/57375-pkhex-new-update-legality-errors-contribution-page/?do=findComment&comment=267494
2021-07-03 11:35:28 -07:00
Kurt
16c8a18928 Show box/slot offset by 1 when loading as SlotCache
Closes #3229
also revises parsing to not ToString(), and doesn't add a skip if the slot is empty
2021-07-03 09:28:35 -07:00
Kurt
f2183f985f Tighten up memory 71 permissions 2021-06-30 15:56:08 -07:00
Kurt
600f4a550a Allow urshifu for gen8 dynamax memory 2021-06-30 13:37:40 -07:00
Kurt
103aa9aa4b
Revise EncounterArea and EncounterType for clarity (#3228)
EncounterArea now stores a more specific type'd array for encounter slots. Better iteration and less casting, as the nonspecific `Slots` fetch is rarely referenced.

EncounterType renamed to GroundTile to reflect how it actually works in Gen4. Was previously an ambiguous field that was clarified a little; we can describe it a little better now. Keep the GUI the same to not scare the end users.

Change Trash Byte properties to get/set a Span. Trash Byte legality checking easier on the garbage collector?
2021-06-29 20:58:06 -07:00
Kurt
9cd617708d Fix const size reference (same value)
Same value, but different name. Cosmetic, but prevents future confusion.
2021-06-29 16:04:05 -07:00
Kurt
764e506ab5 Set language for gen3 eggs prior to applying nickname
The sav.ApplyTo call above tries to set the current savefile language, but gen3 savs do not have a Language ID saved.

Just mimic what the encounter slots/static/etc do.
2021-06-27 15:43:35 -07:00
Kurt
b7f849cb42 Allow Charm type to be valid for pokewalker if same PID result
Closes #3227
Thanks @HappyLappy1 !
2021-06-25 13:10:39 -07:00
Kurt
595966b090 Improve range checks 2021-06-24 23:48:35 -07:00
sora10pls
285f86d7b2 Add squid distribution raids
You're a kid now, you're a squid now
2021-06-24 20:04:07 -04:00
Kurt
49488bb503 Use invariant culture for ToUpper/ToLower
Turkish is quite the language; let's try to prevent any errors down the road for internal/game string case changes.
2021-06-24 09:16:36 -07:00
JDox
742ade78f6
Update MessageStrings_es.txt (#3225) 2021-06-24 08:28:00 -07:00
Kurt
a10b35190c Minor tweaks
off by 1 max range for gen2 slot -> pk2
SetRandomIVs already sets IVs inside the method, retval is for knowing what the new value sare
show WC8 restricted version rather than defaulting to SH
pass the rand object rather than fetching for the current thread every loop for Unown & random IV shuffling
Use ToLowerInvariant for resource fetching, should resolve the turkish issue
Check typeof(T) first, not that we check for ToolStripItem or ContextMenuStrip with this function.
2021-06-24 00:36:04 -07:00
Kurt
285876dcf7 Update SAV_Encounters.cs 2021-06-23 09:35:29 -07:00
Kurt
401ab98f42 Fix inlined check 2021-06-22 23:30:40 -07:00
Kurt
3e7775fc44
Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately (#3222)
* Track a PKM's Box,Slot,StorageFlags,Identifier metadata separately

Don't store within the object, track the slot origin data separately.

Batch editing now pre-filters if using Box/Slot/Identifier logic; split up mods/filters as they're starting to get pretty hefty.

- Requesting a Box Data report now shows all slots in the save file (party, misc)
- Can now exclude backup saves from database search via toggle (separate from settings preventing load entirely)
- Replace some linq usages with direct code

* Remove WasLink virtual in PKM

Inline any logic, since we now have encounter objects to indicate matching, rather than the proto-legality logic checking properties of a PKM.

* Use Fateful to directly check gen5 mysterygift origins

No other encounter types in gen5 apply Fateful

* Simplify double ball comparison

Used to be separate for deferral cases, now no longer needed to be separate.

* Grab move/relearn reference and update locally

Fix relearn move identifier

* Inline defog HM transfer preference check

HasMove is faster than getting moves & checking contains. Skips allocation by setting values directly.

* Extract more met location metadata checks: WasBredEgg

* Replace Console.Write* with Debug.Write*

There's no console output UI, so don't include them in release builds.

* Inline WasGiftEgg, WasEvent, and WasEventEgg logic

Adios legality tags that aren't entirely correct for the specific format. Just put the computations in EncounterFinder.
2021-06-22 20:23:48 -07:00
BlackShark
350383cf51
Updated German translation (#3223)
* updated german language files

* added german readme
2021-06-22 20:12:15 -07:00
Kurt
1bd1c287fa Centralize gender label text/color update calls 2021-06-22 20:06:05 -07:00
Kurt
8bac5c259a Trycatch sound stop, only stop if a sound has been played
Closes #3224

mono's impl of soundplayer is different, hence the need to be a little safer here.
bdd772531d/mcs/class/System/System.Media/SoundPlayer.cs (L255)
https://referencesource.microsoft.com/#System/sys/system/Media/SoundPlayer.cs,455
2021-06-22 17:06:30 -07:00
Exorcism
3fecea9e29
Update some file for the FR language (#3220)
* Update some file for the FR language

* Update README.md

* Update MessageStrings_fr.txt

* Add files via upload

* Add files via upload

* Create text_ItemsG3Colosseum_fr.txt

* Update lang_fr.txt

* Create text_ItemsG1_ko.txt

* Create text_ItemsG1_it.txt
2021-06-18 22:10:39 -07:00
Kurt
87ac1cbcc9 Unban Sgr7348 encounter 2021-06-18 22:07:27 -07:00
Kurt
412bd18139 Decouple incompatible conversion routes from HaX, make setting 2021-06-17 22:48:31 -07:00