Commit graph

3345 commits

Author SHA1 Message Date
pokecal
497f0c62b2 add BW2 FunfestMission controls
The entree level can display 9999 in game,
but fixed to 999 when it change.

MAX PassPowers require 9999 costs.
2017-06-03 14:35:24 +09:00
pokecal
c54cd30a3c add EventFlags resources BW2
resources about legendaries
2017-06-03 11:45:24 +09:00
Kurt
03f42ee19c Split gen3/4 encounter generators from default
Add exclusion for gen3/4 balls since met location requires a less
precise match; static encounters will never be in safari/sport balls.

Fix wurmple species ref, isn't smeargle
2017-06-02 16:56:38 -07:00
Kurt
6fee7052af Add box sorting by gender
Closes #1185
2017-06-02 08:54:08 -07:00
Kurt
f70bd02d69 Fix wurmple evo lockup
while loop wasn't checking the modified EC value, thus looping forever
standardize usage across core
2017-06-01 18:41:22 -07:00
ReignOfComputer
8f951211b4 Fix Link Gift Check if not Gen 6 (#1184)
* Skip Link Gift Check if not Gen 6

Prevents NullReferenceException if location is set in other Gen.
Reference:
https://projectpokemon.org/forums/forums/topic/40749-beautifly-and-dustox-re-roll-pidencryption-pkhex-becomes-unresponsive/

* Change Additional Pokemon Link Check

Based on @evandixon's direction :)
2017-06-01 18:10:19 -07:00
Kurt
2fb3cd5207 Fix template loading behavior
Closes #1181
move preview sprite fetch to the absolute end
2017-05-31 21:27:46 -07:00
Kurt
e522094679 Fix pkm editor behavior
Closes #1180
2017-05-30 20:50:15 -07:00
Kurt
11aab91eee Fix drag&drop exception
immediately after dropping the file, move the mouse outside of the box
slots
DoDragDrop re-performs the drop event at the same coordinate as the
mouse; if the mouse isn't outside of the box area it'll do nothing, thus
the need to create a new event to fire.

Closes #1178
2017-05-30 19:17:37 -07:00
Kurt
92ca1e2263 Fix eevee static encounter collision scenario
eevee gen7 egg has no moves; always generate eggs first for gen4+

Closes #1179
Closes #1176 (prior commit)

there's probably a better way to optimize this (don't check wild
encounters if 100% sure it's an egg); best left for future optimization
since it's working fine atm.
2017-05-30 18:42:50 -07:00
Kurt
f60f36081a Fix relearnmove suggestion for set relearn moves 2017-05-30 18:28:06 -07:00
Kurt
2e30878e8b Update 170530
Update event binaries
unban gen3 mega evo stones
fix a lil bit of behaviors
2017-05-29 22:34:45 -07:00
Kurt
3eedf1a6d5 Run database search async
disable button while searching, prevents GUI locking up when searching a
large database.
2017-05-29 19:18:18 -07:00
Kurt
c666183e6c Misc fixes
enhance evolution checking
add gen2 game corner static encounters
simplify relearn checking methods that did the same thing
2017-05-29 15:21:39 -07:00
Kurt
8b833c0c15 Add null check for invalid origin pkm
Closes #1173

info isn't set if the species is invalid or the origin generation is
invalid
lazy fix
2017-05-29 10:52:41 -07:00
Kurt
550153e3bc Improve gen3 sav detection
better detect RSE collisions
add auto-detection for japanese games
Closes #1172
2017-05-29 10:33:27 -07:00
Kurt
82750de1b8 Add initial gen3 event detection
egg events supported, only some gen3 event distros supported
will eventually flag for PIDIV type mismatching

@kamronbatman
2017-05-29 00:48:25 -07:00
Kurt
9a7dc9998c Misc fixes
Track gen1/2 origin game as well  as generation
fix pk2 gender setting (incorrect bitmask & wasn't set from tabs)
extend female gender check for gen2 to apply to GS encounters -- if met
location is missing, was traded to gen1 which clears gender.
2017-05-28 16:56:51 -07:00
Kurt
e01c8a5786 Misc gen3 related legal check fixes 2017-05-28 15:49:20 -07:00
Kurt
87e99bf183 Split reflection usage for winforms project
batch editor needs more powerful variant which can check the base
properties as well; just use the older code from before the .NET
standard commit.

Closes #1158
2017-05-28 14:49:36 -07:00
Kurt
8eed9f84ba Fix pk1 catch rate overwriting
CatchRateIsItem is always false, thus the catch rate was always
overwritten with the base species catch rate regardless of if the base
species was the encounter.
For species like Metapod who have different catch rates from their base
species, this would invalidate any Metapod capture. So all possible
catch rates are checked.

Instead of setting the catch rate to the base species catch rate, set it
to the current species. Allows user to set the exact catch rate by
toggling between a legendary and the target species...
2017-05-28 13:19:48 -07:00
Kurt
cbfa38b131 Rework encounter slot generating
Closes #1171

Calculate rejection scenarios, store rejected slots to spit out at the
end rather than returning them early.
2017-05-28 11:10:01 -07:00
Kurt
178017b104 Relocate female gender checks
Per discussion in #1170

Revise message descriptions
Gen1 err message now used
2017-05-28 10:35:41 -07:00
Kurt
92881e489c Merge pull request #1170 from javierhimura/master
Mark OT Female trainer from Gamecube and VC pokemon as invalid.
2017-05-28 10:27:58 -07:00
javierhimura
5cf870d73f Mark OT Female trainer from Gamecube and VC pokemon as invalid.
Gamecube games and generation 1 games do not have female player character.
Generation 2 is not checked because if the pokemon is in format 2 and have met location data stored that means it was caught in crystal where female player is allowed, checks are not included for generation VC2 pokemon
2017-05-28 16:02:57 +02:00
Kurt
61eaa7774d allow insta-hatch eggs
pelago can drain to 0, will hatch immediately on current gen
im sure there's some ways to force-walk to trip to 0 on prior gens, but
this is such a minor check and has no impact for online play

Thanks @Kirzi !
2017-05-27 22:50:10 -07:00
Kurt
74dbeb5cf6 Cleanup
throw in more c#7 lang sugar to checks

flag invalid hatch cycles (over species max || 0); existing wouldn't
flag for non-static encounters.
2017-05-27 22:40:21 -07:00
Kurt
db2d043199 unroll cxd seed completely
re-letter for clearer order of RNG results, don't unroll 3x to roll
forward 2x (just unroll 1,1 then 1).

Put origin seed in RNG Reporter => frame 1 result
Closes #1169
2017-05-27 22:18:04 -07:00
Kurt
2cd1a29b76 Fix platinum turnback giratina
if ko'd in the distortion world, it'll return to turnback cave; uses the
same encountertype as DP.

Closes #1156, Thanks @iKamus !
2017-05-27 21:20:13 -07:00
Kurt
858aa50689 Refactor encounter matching
exercise in deferred execution/state machine, only calculate possible
matches until a sufficiently valid match is obtained. Previous setup
would try to calculate the 'best match' and had band-aid workarounds in
cases where a subsequent check may determine it to be a false match.

There's still more ways to improve speed:
- precalculate relationships for Encounter Slots rather than iterating
over every area
- yielding individual slots instead of an entire area
- group non-egg wondercards by ID in a dict/hashtable for faster
retrieval

reworked some internals:
- EncounterMatch is always an IEncounterable instead of an object, for
easy pattern matching.
- Splitbreed checking is done per encounter and is stored in the
EncounterEgg result
- Encounter validation uses Encounter/Move/RelearnMove/Evolution to
whittle to the final encounter.

As a part of the encounter matching, a lazy peek is used to check if an
invalid encounter should be retained instead of discarded; if another
encounter has not been checked, it'll stop the invalid checks and move
on. If it is the last encounter, no other valid encounters exist so it
will keep the parse for the invalid encounter.

If no encounters are yielded, then there is no encountermatch. An
EncounterInvalid is created to store basic details, and the parse is
carried out.

Breaks some legality checking features for flagging invalid moves in
more detail, but those can be re-added in a separate check (if
splitbreed & any move invalid -> check for other split moves).

Should now be easier to follow the flow & maintain 😄
2017-05-27 21:17:57 -07:00
Kurt
56e11d920d Merge pull request #1168 from pokecal/master
Fix BW2 checksum offset
2017-05-27 20:21:04 -07:00
pokecal
1bb891a8a3 fix BW2 checksum offset
ExportSAV without changes will become export same data.
2017-05-28 11:01:27 +09:00
Kurt
25bdeb8053 Merge branch 'master' of https://github.com/kwsch/PKHeX 2017-05-27 14:25:12 -07:00
Kurt
5ee918d62c Fix form being altered during load
Closes #1167
Thanks @Odaxis !
2017-05-27 14:25:07 -07:00
Kurt
f368e963fb Merge pull request #1166 from pokecal/master
add BW2 KeySystem Unlock
2017-05-27 08:32:49 -07:00
pokecal
32815d0c4b add BW2 KeySystem Unlock
I excepted first 8 keys(used for check selected value),
they are very easy to edit in game.
2017-05-27 19:32:19 +09:00
Kurt
e44681fb66 Merge pull request #1165 from pokecal/master
add EventFlags resources BW
2017-05-26 07:49:43 -07:00
pokecal
0cae317770 add EventFlags resources BW
I recently noticed that some activation use TID/SID,
I will re-check past resources that have abnormal value(e.g.AzureFlute),
after researching BW2,Pt.
2017-05-26 19:17:28 +09:00
Kurt
113001f280 Temp gen2 met location filter bypass
#978
crystal location data => no location values to compare to
2017-05-23 22:38:21 -07:00
Kurt
be80a6b9da Fix HGSS wallpaper get/set & editing
the special wallpaper values are +0x10 (ie 0x20, 0x21... instead of
0x10, 0x11) from the contiguous sequence of regular box wallpaper IDs
(anti cheat probing?).

Xor tweak allows for single invert method; use this invert with the base
implementation's method.

Range check for setting the box wallpaper (just in case). The underlying
error was fixed; the 255 val was reading from the wrong offset (now
fixed).

Thanks Scarfy!

https://projectpokemon.org/forums/files/file/1-pkhex/?do=findComment&comment=344
2017-05-23 21:38:15 -07:00
Kurt
5f94a2e0f4 Update encountertrade ability legality check
check for encountertrade edge case first, then ability capsule

Closes #1163
2017-05-23 20:10:57 -07:00
Kurt
b8a799f7ed Fix gender ratio comparison
http://bulbapedia.bulbagarden.net/wiki/Personality_value#Gender
For a Pokémon with a 50/50 male/female gender ratio, there is actually a
129/256 (50.390625%) chance for the Pokémon to be male and 127/256
(49.609375%) chance for the Pokémon to be female.

remove unnecessary parameter passing

#1163
2017-05-23 18:48:16 -07:00
Kurt
7e30d863b0 Revert dexlevel evotree fetch + re-implement fix
check requireslevelup during evolution validity check, not during tree
generation as movepool fetch treats the 'level' as the max possible
level it was at (not the level it was encountered).

fix dropping pkm from external source causing exception (final return
false caused it to proceed with regular dragdrop operation from source
slot).

#1163
2017-05-23 18:35:32 -07:00
Kurt
a98c904168 Tweak level/exp changing events
move from validated to textchanged as the user expects the values to
live update
only use the value-cap on validation if the input is not associated with
another control's value
this is now consistent with the IV/EV updating stats

#1163
2017-05-23 17:46:32 -07:00
Kurt
2e1c0b9c48 misc loading fix
gen1/2 games with new pkm editor no longer cause an exception on init
load
2017-05-23 08:28:53 -07:00
Kurt
11b2dc35d7 Refactor main form into smaller pieces
pkm editor, sav editor, menus, and a manager to glue the storage slots
together
decouples the pkm/sav editors from a static savefile reference.

improves dragdrop/click view/set/delete indication, hides unavailable
contextmenuitems, and fixes a few incorrect references. Box Subviewer
slots now have all the indication/events that the main save editor slots
have.

pls report behavior bugs 👍
2017-05-22 21:55:12 -07:00
Kurt
db4f9ba9e7 Merge pull request #1162 from Mrtops/master
Update OS X to macOS
2017-05-22 08:55:46 -07:00
Mrtops
990345a7df Update OS X to macOS
macOS is the new official name for OS X
2017-05-22 11:04:19 -04:00
Kurt
468524064b Merge pull request #1157 from wwwwwwzx/master
Several minor fixes and update Chinese translation
2017-05-19 23:32:34 -07:00
wwwwwwzx
13be5201b1 Several minor fixes and update Chinese translation 2017-05-19 22:05:08 -07:00