Commit graph

100 commits

Author SHA1 Message Date
Kurt
f0d9e3f2e5 Fix encounter link wc6's
Closes #2244 thanks @kamronbatman & @NinFanBoyFTW !
2019-01-14 18:53:05 -08:00
Kurt
2969a42ad4 add missing ot name check
Closes #2246, needed to mirror wc7 via this commit but failed

41a3989b53
2019-01-14 18:33:00 -08:00
Kurt
41a3989b53 Consolidate encounterlink into mysterygift
use synthetic wondercards to match link gifts
2019-01-12 23:50:31 -08:00
Kurt
bf1a56af9d Add xmldoc 2018-12-29 23:38:59 -08:00
Kurt
4fcee0ae7a Move wr7 to mysterygift folder 2018-12-29 23:34:34 -08:00
Kurt
e7531dca30 Add wr7->pkm
Not sure if one of the 'level' fields is a move ID instead. Pound=1,
Level=1
Maybe a Chansey record would shed more light.
2018-12-29 23:33:36 -08:00
Kurt
78ff441e8b Update iencounterable api with new criteria arg
rearrange some logic for clearer function (extract some methods)
2018-12-29 22:24:34 -08:00
Kurt
d5a8d29088 Misc updates
reduce some allocs, clearer names/enum usage
2018-12-27 20:24:24 -08:00
Kurt
2d75e93ef0 Move encounter matching logic to iencounterable
generator logic is now clean
2018-12-27 01:00:08 -08:00
Kurt
9db771c0d5 Split out common 6+ pkm format to abstract class
Didn't really feel like pulling out the shared structure get/set
operations, only the derived properties & overall fixer methods. Should
be easier to maintain if any handling updates.

Clean up pb7 unused stuff; removes ribbon logic since none are used.

c# 8.0 interface defaults can maybe pull out more logic (ex making
FixRelearn and relearn moves into an interface); multiple inheritance
can be useful as features are added/dropped between generations.
2018-12-25 22:56:32 -08:00
Kurt
2e6466c132 fix wc6full date set
Closes #2213
2018-12-20 20:30:01 -08:00
Kurt
96ec0ff28b Fix broken tests
some gen6 cards have bad data? trickled out to tests which failed to
generate a celebi
revert to old code, add in some year-set safety checks
2018-12-12 18:00:26 -08:00
Kurt
efb9b7eba2 Misc cleanup
removes clickonce logic/reference
2018-12-10 20:32:08 -08:00
Kurt
76a2e4f527 Add AltForm parameter to exp/level fetch
Starter Pikachu & Eevee have different growth rates than their base
forms (seriously WHY?)

remove old api surface in PKX as a breaking change as adding the
parameter is necessary.
2018-11-26 16:55:16 -08:00
Kurt
2a51eb1745 Update wb7 def
AV offsets were incorrect
sub_71001C79E0
2018-11-25 15:52:30 -08:00
Kurt
6a62075c47 Fix version check
Encounter browser entered infinite loop waiting for valid version
2018-11-22 10:10:25 -08:00
Kurt
cfbdb7c26c Add parameter-less constructors
Removes null check for hot path where data is actually provided
2018-11-21 14:15:48 -08:00
Kurt
58080f36c9 Add WB7 and legality detection logic
Derived from WC7 with minor alterations (dynamic OT/Nickname which is
stored in the Full data). Since the 0x108 is not stored in the save
file, just keep the full data around.
2018-11-21 12:24:41 -08:00
Kurt
39f98a4a94 Misc qol updates
Check max case for level first, then iterate upwards (eliminates inner
if)
change wc* nature to sbyte (update comparisons, 0xFF too magic-y)
use Rand.Next(x) instead of (0, x)
2018-10-27 21:59:31 -07:00
Kurt
59af7fef35 Remove unnecessary properties 2018-10-05 19:57:45 -07:00
Kurt
1fe304e78f Rework mg nick/lang checks
add common interface

https://projectpokemon.org/home/forums/topic/47295-bug-event-golduck-name-not-matching-species/
2018-08-30 18:09:52 -07:00
Kurt
d3ec969187 Style updates
split pcd/pgt
add more xmldoc
2018-08-09 21:53:39 -07:00
Kurt
1486b7f14a Misc style & minor tweaks
Remove move combobox flicker hack (no longer necessary)
Add more Array.Empty usages
cache mysterygift sizes
seal some classes

no functionality changes
2018-08-02 20:11:42 -07:00
Kurt
f4bfdb8311 Remove unnecessary empty array allocations
yay net 4.6
read more: http://justinvp.com/2015/07/20/array-empty/
2018-08-01 18:30:51 -07:00
Kurt
3fd21db51e Style & function extracting 2018-07-29 16:39:15 -07:00
Kurt
96484eceb5 Update version logic
Fixes broken tests (glaceon card can only be received by SM, was getting
set to UM).
2018-07-29 11:34:27 -07:00
Kurt
c46924d220 Use wcxfull version/language restriction data
some cards may permit being recieved on incorrect games

some wcxfulls permit games they shouldn't (tapu koko flags permit USUM
but games released after the distribution window)
lots of wcx lacking restrictions completely

tested flagging USUM rockruff & zeraora

might be worth discarding MysteryGiftVerifier and instead just using
unused fields for prior formats to supply the data.
2018-07-27 22:26:27 -07:00
Kurt
c8563a3737 Respacening
Style guidelines, handle a bunch of files
no functional change
2018-07-26 19:34:27 -07:00
Kurt
5fbf132615 Add handling for pgt ranger manaphy
skip out on load if pgt
extract pgt pid gen method
set gender & PID if rangeregg since PID == 0 not 1.
Closes #2075
yay 5k!
2018-07-25 07:34:48 -07:00
Kurt
397de97f3c Remove excessive references to Util.Rand32()
all usages besides fetching a 32bit random value should use rand.next
remove unnecessary do-while loop for calculating random EVs (always
returns 510 in total)
2018-07-04 11:30:43 -07:00
Kurt
8e950e83b3 Rewrite ability verification
Closes #2040 , adds test cases:

invalid bulbasaur.wc3: hidden ability
invalid charmander.pcd: hidden ability
valid camerupt: gen3->4 unevolved mismatch
valid leafeon: pcd mismatch -> evolved now matching

should be much easier to maintain; methods are reused with less overall
nesting
2018-07-02 20:34:41 -07:00
Kurt
e4a281b0d9 Generate pgf moves if none present
Closes #2037
not sure if the cards are hacked, whatever
2018-06-30 21:28:20 -07:00
Kurt
177604e2cb Refactoring
Simplify some verifier logic
2018-06-30 15:01:16 -07:00
Kurt
e29cf2a903 Rework secondary check flow
Checks.cs initially started out small, but over the years it has grown
to handle multiple types of checks. With all these checks next to
eachother, it's hard to see the overall groups. Splitting them up
(potentially further?) allows for more focused maintenance &
understanding.

Not sure if I'm happy with the overall bandaids used (checks no longer
done within LegalityAnalysis so variable repointing is excessively
used), but I'm happier the way it is now compared to the huge Checks.cs
2018-06-23 22:00:01 -07:00
Kurt
88b5277062 Misc mg gen fixes
Fixed gender PCD with dynamic PID needs to check gender validity (some
korean card had it)
Fixed wc3 generated force-hatching to unflag fateful for non-frlg and to
hatch on the designated game just in case

stuck on a PGF issue where ability doesn't match PID, need to revisit
that PID creation...
Card #: 0002 - がくえんさい×ポケモンプレゼント
2018-06-15 22:00:51 -07:00
Kurt
f2f2b8aa00 Toggle fateful for xd wc3s
created as pk3 thus the xk3->pk3 setting fateful has already happened.
#1972
2018-05-27 15:04:21 -07:00
Kurt
a57cdb5f48 Update fateful handling
#1970
add files as test cases
2018-05-27 14:38:03 -07:00
Kurt
4c1e014a53 Fix mgdb viewing cxd gifts
Closes #1972
2018-05-27 14:16:56 -07:00
Kurt
6a3b422a14 Fix xd fateful gift pkm
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
2018-05-27 10:11:01 -07:00
Kurt
ca14b43b62 Relocate memory specific data to own file
allows easier handling for memory interactions
2018-05-19 10:04:07 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
ea357cd57a Add GetRandomFeeling
fixes tests & transfers where an explicit range is not legal
2018-04-28 12:59:11 -07:00
Kurt
7a245278ea Relocate mg description parse to core 2018-04-21 09:55:27 -07:00
Kurt
420efb72bb Misc refactoring
use common edits to set pp
2018-04-07 11:40:01 -07:00
Kurt
9d3f7250a5 Clamp language values
pk3->pk4 threw errors

https://projectpokemon.org/home/forums/topic/44719-about-channel-jirachi/

should probably work that logic into a more generic getsafelanguage
2018-04-06 23:37:24 -07:00
Kurt
bdb6b7a2f1 Add shiny indication for wc3 in mgdb search
https://projectpokemon.org/home/forums/topic/44675-about-event-database/

also fix some xml comments
2018-04-04 09:53:48 -07:00
Kurt
1e13220e6e Add IEncounterable -> pkm interface method
egg,slot,static,link,trade need to be implemented later

remove IEncounterable from PL6
2018-03-28 20:38:07 -07:00
Kurt
35e699cffa Misc mg updates
pgf/wc6/wc7 received on future game -> random version
could eventually be replaced with a get-sane-version which checks if
OriginGame == 0.

fix wc3 random RS giving E (R+1=E)
2018-03-28 17:46:37 -07:00
Kurt
a0eb658ef2 Extract minimum trainer information requirements
If one wanted to extend ConvertToPKM to other IEncounterables, this
would be the provided obj containing the receiver's info

allows pkm gen without a savefile, which is nice?
2018-03-28 15:55:19 -07:00