Commit graph

36 commits

Author SHA1 Message Date
Kurt
1d44136e54 Update xd fateful flag leniency
not enough documentation to know what every single flag does; just be
lenient

I assume that flags being present XK3->PK3 will set fateful, so we could
remove that logic...
Exposing bitflags for editing isn't fun for the editor, so just ignore
it behind the fateful bool get/set.

fateful required for all xk3 origin

#2289
2019-05-14 20:14:15 -07:00
Kurt
555e81205d Update fateful encounter read location
Closes #2289
2019-05-14 18:36:48 -07:00
Kurt
b1ead9e630 Split StringConverter into smaller pieces
reduces loading time (don't have to allocate conversion arrays when
launching a gen7 game), and separates things to easier to manage
locations

reworks gen3 string encode/decode, no longer does 3->4->5 and 5->4->3;
instead goes straight to the end result without an intermediary format.

String sanitization should probably be broken up rather than reused, oh
well.
2019-03-20 21:50:44 -07:00
Kurt
8a08d32dff Simplify pkm constructors
remove Identifier param. 99% of the time, identifier is not provided,
resulting in a useless call

end result:
provide 'create new' and 'create from' constructors
2019-03-16 18:41:56 -07:00
Kurt
fb76032a39 Remove unnecessary null checks on constructors 2019-03-16 18:23:50 -07:00
Kurt
5765ce8229 Extract gc version IDs to separate logic 2019-03-16 16:48:38 -07:00
Kurt
13a6d16cb9 Relocate checksum/dexform logic 2019-03-16 12:01:21 -07:00
Kurt
ca0e012c5c Add Heal, make status_condition a pkm property
also split out battle box slot offset fetch
if anyone finds where colo&xd store their status bits, lmk 👍
2019-01-11 22:25:48 -08:00
Kurt
ec76bd6b03 Fix ability bit inversion
one of these was not like the other
ty TORNADO (discord)
2019-01-11 08:09:52 -08:00
Kurt
2d774ac7cc Allow dynamic default savefile type load
Make extrabytes a pkm property (don't mutate array pls)
reconfigure startup loading to only initialize after initial load of sav
& pkm (using blanks if not provided)
2018-12-19 22:10:32 -08:00
Kurt
085a6e2a2b Misc cxd format updates
fix friendship for xk3
fix colo fateful read
2018-11-26 19:21:48 -08:00
Kurt
b280ffcfef style updates
should be pretty much it
2018-09-14 22:37:47 -07:00
Kurt
e588565657 Refactoring
reduce pk3/ck3/xk3 logic, share AbilityBit property within _K3, and when
loading, type check (favored over hardcoding individual load cases)
pull some non-gui code from PKMEditor to core/etc for general data
fetching
2018-07-06 17:37:07 -07:00
Kurt
6cff642ff1 Skip format check on pk* init
also remove ck3/xk3 no-op call (no encryption for those formats, like
bk4).
2018-06-04 20:25:54 -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
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
49d92758c5 xd ribbon fix
lol
2018-03-17 10:36:37 -07:00
Kurt
c5655166bf Add shared pk3/xk3/ck3 class
standard generation 3 pkm content & interactions
generic inter-converter (more efficient than reflection)

update conversion methods; specific format conversion is now in the
object's src file now.

may be worth doing for gen4 pk4<->bk4
2018-02-03 12:42:06 -08:00
Kurt
a1f2f8708a Refactoring
pass identifier on cloning pkm
remove unnecessary ref for passing Data (not modifying array reference)
const some magic numbers
2017-12-27 16:36:24 -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
18796d6f92 Misc tweaks
fix bk4 ribbon checks (lacked interface inheritance)
change MN -> UM for get blank save (unused in PKHeX solution)
prevent inheriting from derived pkm classes
2017-12-16 14:11:41 -08:00
Kurt
f9946368a0 Remove usage of LegalityAnalysis from PK*
CK3<->XK3 transfers to PK3 first now (no direct transfer legally)
2017-12-06 21:28: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
Kurt
515a694afa Add LanguageID enum
no functional change, just less-magic-numbers for easier to understand
src
2017-10-22 21:01:08 -07:00
Kurt
6bd0e7ce72 sync remaining
pls revoke my access
2017-10-03 18:20:31 -07:00
Kurt
a9892203c7 Refactoring
extract pkm loading routines to smaller methods
reduce code duplication (rely on empty setters to ignore some calls)

should be much easier to understand the load/save process; the original
setup (pk6) was following the structure from 0x00-end, no point still
doing that as everything is now abstracted.
2017-10-02 23:13:40 -07:00
Kurt
ed1b934374 Misc refactoring
expose some useful IEnumerable methods (sorting / bin->pkm / copy) to
simplify some common operations
change some explicit arrays to IList for flexibility
remove old memecrypto bool (no longer necessary as XP is not supported)
rename some methods for more clarity
2017-09-28 22:20:27 -07:00
Kurt
496cc35f97 Fix mew male gender
Closes #1489
2017-09-23 22:44:54 -07:00
Kurt
84cc366803 Swap markings in gen3
Closes #1463
2017-09-17 13:07:12 -07:00
Kurt
80196f75ef Refactoring
split Core.PKX into smaller classes, only StringConverter is exposed for
outside namespaces
2017-07-31 23:03:51 -07:00
Kurt
6921a2ebee Initial ribbon refactor
remove legality check's use of reflection which checked individual
properties; add interfaces to interact with the ribbons of each PKM
type. With this, every ribbon attribute is accessible via its
corresponding interface (cast)

will have to add checks for individual interfaces as per #1250

I didn't feel like adding much documentation, is pretty straightforward.
Cast a pkm object to the desired ribbon set; if not null, can access
ribbons regardless of pkm format.
2017-06-19 21:43:44 -07:00
Kurt
3f38b123a3 Refactoring
mostly renaming things, includes a little bit of added sugar and
splitting methods to simplify the codebase.

all methods are now PascalCase
2017-06-17 18:37:19 -07:00
Kurt
81534c4645 Update gen3 fateful encounter checks
Closes #1230
Colosseum pokemon do not get fateful encounter, all pkm from XD (except
the starters) are fateful.
Add requirement for National ribbon if shadow CK3 is transferred to XK3
and vice versa; actually check for national ribbon during CK3/XK3
(RibbonSet1 interface)
2017-06-14 21:07:42 -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
a70a4d5e3f Switch to c# 7 get/set expressions
Add gen5 battle box locked flags
no functional change otherwise, just shorter
2017-05-12 20:32:43 -07:00
Evan Dixon
52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00
Renamed from PKHeX/PKM/XK3.cs (Browse further)