Commit graph

82 commits

Author SHA1 Message Date
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
Kurt
93ca091eb8 Fix gen4 event location string name output
legalityanalysis spat out the unshifted value or none at all (bank 3000
was not returned)
2018-03-26 23:22:11 -07:00
Kurt
a6977af19a Pull out Contest Stat logic to interface 2018-03-24 10:36:48 -07:00
Kurt
e9a3b4acf1 Merge PIDType and bool? shiny property
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...
2018-03-16 19:35:55 -07:00
wwwwwwzx
c9a54307c4 Fix WC6/7 IV generation (#1857)
https://pastebin.com/bbpS6svw
IV lock doesn't work for IV3 case
2018-03-02 16:17:14 -08:00
Kurt
24982fe8c5 Misc simplifications 2018-02-28 21:05:50 -08:00
Kurt
c825d5919c Fix wc4->pgt crypt
array isn't encrypted in place (didn't use return value)
Closes #1835
2018-02-15 19:07:41 -08:00
Kurt
f1cd1d8b50 Fix pgt->pk4 obj usage
clone the data, don't reuse & tamper with pgt data...
thanks @ReignOfComputer !
2018-02-11 17:28:23 -08:00
Evan Dixon
5a4ddd685c Update Project Pokemon URLs in comment 2018-01-08 13:15:19 -06:00
Kurt
0f21fc2217 add location interface for verbose analysis output
indicates met location for transferred mons
most gen1/2 encounters won't show values due to the location not being
stored respective to the string tables (anyone wanna do a location remap
after initial load?)
2018-01-02 12:00:41 -08:00
Kurt
3445b46526 Remove unnecessary array cloning
new objects would always clone the input array; only clone on object
cloning (keep the original array reference on initial creation from
bytes)
2017-12-26 21:38:19 -08:00
Kurt
5e59e20ea1 Store matched encounter generation
previously was only defined for gen1/2, why not all gens
can now query encounters in Core for encounters per generation via
reflection; can help group encounters for data vis or be faster than
getting individual gen numbers
2017-12-18 16:17:21 -08:00
Kurt
e5aa39a6bb Refactoring
get language list now doesn't return new objects (or re-enumerate)
update rand usage to be inclusive for top bound, extend shuffle to
collections
remove unnecessary location overrides (already overriden in legal fetch)
2017-12-14 20:58:55 -08:00
Kurt
f1cabdfa25 Handle setting decrypted pgt pkm gift data 2017-12-11 10:13:08 -08:00
Kurt
6394dac19f Rework mysterygift pkm sprite generation
don't bother converting to pkm then generating the sprite off that; use
the overload with int/bool

removes sav/pkm dependency for generating gift descriptions, and
standardizes the names a little. maybe a PKMBase interface would be
useful...
2017-11-18 11:34:23 -08:00
Kurt
9ef4152736 add more xml docs 2017-11-06 22:44:51 -08:00
Kurt
4a6ea19a31 Cleanup 2017-11-06 17:12:59 -08:00
Kamron Batman
83e06b4436 Adds WC4 support. 2017-11-06 16:26:34 -08:00
Kurt
69cf1eaa9c add more pkhex.core xml documentation
adds a bunch of documentation useful for those unfamiliar with the core
library
2017-10-23 23:12:58 -07:00