Skip to content

Commit 2e70fe1

Browse files
Updated to version 1.0.0.0 Release
1 parent 5cb98b5 commit 2e70fe1

37 files changed

+493
-77
lines changed

PokemonManager.v11.suo

-29.5 KB
Binary file not shown.

PokemonManager/Items/MailBox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public void Reset() {
146146
listViewItems.Clear();
147147

148148
Mail defaultMail = new Mail();
149-
defaultMail.TrainerName = "TRIGGER";
150-
defaultMail.SetTrainerIDs(60000, 0);
149+
defaultMail.TrainerName = "Trigger";
150+
defaultMail.SetTrainerIDs(45465, 28557);
151151
defaultMail.MailItemID = 130;
152152
defaultMail.OriginalHolderDexID = 197;
153153

PokemonManager/PokeManager.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
using System.Threading.Tasks;
2525
using System.Windows;
2626
using System.Windows.Controls;
27+
using System.Windows.Documents;
2728
using System.Windows.Media;
2829
using System.Windows.Media.Imaging;
30+
using System.Windows.Navigation;
2931
using System.Xml;
3032

3133
namespace PokemonManager {
@@ -2315,6 +2317,15 @@ public static bool CanSwitchPokemon(IPokemon pokemon) {
23152317
public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
23162318
if (IsHoldingPokemon) {
23172319
bool needsNewLocation = pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave;
2320+
if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
2321+
if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
2322+
needsNewLocation = true;
2323+
else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
2324+
needsNewLocation = true;
2325+
else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
2326+
needsNewLocation = true;
2327+
}
2328+
23182329
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23192330
for (int j = 0; j < 30 && needsNewLocation; j++) {
23202331
if (pokemon.PokePC[i][j] == null) {
@@ -2330,6 +2341,8 @@ public static bool CanSwitchShadowPokemon(IPokemon pokemon) {
23302341
public static bool CanSwitchEgg(IPokemon pokemon) {
23312342
if (IsHoldingPokemon) {
23322343
bool needsNewLocation = pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD);
2344+
if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
2345+
needsNewLocation = true;
23332346
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23342347
for (int j = 0; j < 30 && needsNewLocation; j++) {
23352348
if (pokemon.PokePC[i][j] == null) {
@@ -2365,6 +2378,16 @@ public static void SwitchPokemon(IPokemon pokemon) {
23652378
// Try to make the pokemon drop in the current game. It's only required for shadow Pokemon though.
23662379
bool needsNewLocation = (pokemon.IsShadowPokemon && pokemon.GameSave != holdPokemon.Container.GameSave) ||
23672380
(pokemon.IsEgg && (holdPokemon.Container.GameType == GameTypes.Colosseum || holdPokemon.Container.GameType == GameTypes.XD));
2381+
if (holdPokemon.Container.GameSave.GameType == GameTypes.XD) {
2382+
if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Daycare)
2383+
needsNewLocation = true;
2384+
else if (pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
2385+
needsNewLocation = true;
2386+
else if (!pokemon.IsShadowPokemon && holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index == 0)
2387+
needsNewLocation = true;
2388+
}
2389+
if (pokemon.IsEgg && holdPokemon.Container.Type == ContainerTypes.Daycare)
2390+
needsNewLocation = true;
23682391
for (int i = 0; i < pokemon.PokePC.NumBoxes && needsNewLocation; i++) {
23692392
for (int j = 0; j < 30 && needsNewLocation; j++) {
23702393
if (pokemon.PokePC[i][j] == null) {
@@ -2400,6 +2423,8 @@ public static void DropPokemon() {
24002423
holdPokemon.Pokemon.IsMoving = false;
24012424
if (holdPokemon.Container.Type == ContainerTypes.Party)
24022425
((IPokeParty)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
2426+
else if (holdPokemon.Container.Type == ContainerTypes.Daycare && holdPokemon.Index < 2)
2427+
((IDaycare)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
24032428
else if (holdPokemon.Container.Type == ContainerTypes.Purifier && holdPokemon.Index > 0)
24042429
((XDPurificationChamber)holdPokemon.Container).AddPokemon(holdPokemon.Pokemon);
24052430
else

PokemonManager/PokemonDatabase.db

0 Bytes
Binary file not shown.

PokemonManager/PokemonManager.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,7 @@
14211421
<Content Include="Resources\Audio\Evolution.wav">
14221422
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
14231423
</Content>
1424+
<Resource Include="Resources\UI\Pokemon\BulbapediaIcon.png" />
14241425
<Resource Include="Resources\UI\Pokemon\PurifierWindow.png" />
14251426
<Resource Include="Resources\Splash\SplashVoltorb.png" />
14261427
<Resource Include="Resources\Splash\SplashUrsaring.png" />

PokemonManager/PokemonStructures/BoxPokemon.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ public BitmapSource Sprite {
190190
get {
191191
if (IsEgg)
192192
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
193+
if (DexID == 327)
194+
return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
193195
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
194196
}
195197
}

PokemonManager/PokemonStructures/ColosseumDaycare.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,19 @@ public IPokemon this[int index] {
8585
throw new ArgumentOutOfRangeException("Index outside of bounds for Daycare", new Exception());
8686
}
8787
}
88+
public void AddPokemon(IPokemon pokemon) {
89+
pokePC.GameSave.IsChanged = true;
90+
IPokemon pkm = (pokemon != null ? (pokemon is ColosseumPokemon ? pokemon : pokemon.CreateColosseumPokemon(((GCGameSave)GameSave).CurrentRegion)): null);
91+
pkm.GameType = GameType;
92+
pkm.PokeContainer = this;
93+
if (pokePC.GameSave != null)
94+
pokePC.GameSave.OwnPokemon(pkm);
95+
depositedPokemon = pkm as ColosseumPokemon;
96+
depositedPokemon = pkm as ColosseumPokemon;
97+
DaycareStatus = 1;
98+
InitialLevel = 0;
99+
InitialPurification = 0;
100+
}
88101
public int IndexOf(IPokemon pokemon) {
89102
if (pokemon == depositedPokemon)
90103
return 0;

PokemonManager/PokemonStructures/ColosseumPokemon.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ public BitmapSource Sprite {
166166
get {
167167
if (IsEgg)
168168
return PokemonDatabase.GetPokemonImageFromDexID(387, false);
169+
if (DexID == 327)
170+
return PokemonDatabase.GetSpindaSprite(Personality, IsShiny);
169171
return PokemonDatabase.GetPokemonImageFromDexID(DexID, IsShiny, FormID);
170172
}
171173
}

PokemonManager/PokemonStructures/Events/PokemonEventDistribution.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public override void GenerateReward(IGameSave gameSave) {
6060
pkm.DexID = DexID;
6161
pkm.Personality = (Personality.HasValue ? Personality.Value : (uint)random.Next());
6262
pkm.Experience = PokemonDatabase.GetExperienceFromLevel(pokemonData.ExperienceGroup, (IsEgg ? (byte)5 : Level));
63-
pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (pokemonData.HasTwoAbilities && random.Next(2) == 1)); // TODO: TESTING
63+
pkm.IsSecondAbility2 = (IsSecondAbility.HasValue ? IsSecondAbility.Value : (!pokemonData.CanOnlyHaveFirstAbility && random.Next(2) == 1));
6464
pkm.Nickname = (Nickname != null ? Nickname : pokemonData.Name.ToUpper());
6565
pkm.BallCaughtID = 4;
6666
pkm.MetLocationID = 255;

PokemonManager/PokemonStructures/GBADaycare.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,22 @@ public IPokemon this[int index] {
163163
}
164164
}
165165
}
166+
public void AddPokemon(IPokemon pokemon) {
167+
pokePC.GameSave.IsChanged = true;
168+
IPokemon pkm = (pokemon != null ? (pokemon is GBAPokemon ? pokemon : pokemon.CreateGBAPokemon(GameType)): null);
169+
int index = 0;
170+
for (index = 0; index < 3; index++) {
171+
if (originalPokemon[index] == null)
172+
break;
173+
}
174+
pkm.GameType = GameType;
175+
pkm.PokeContainer = this;
176+
if (pokePC.GameSave != null)
177+
pokePC.GameSave.SetPokemonOwned(pkm.DexID, true);
178+
finalPokemon[index] = pkm as GBAPokemon;
179+
originalPokemon[index] = pkm as GBAPokemon;
180+
SetGainedExperience(index, 0);
181+
}
166182
public int IndexOf(IPokemon pokemon) {
167183
for (int i = 0; i < finalPokemon.Length; i++) {
168184
if (finalPokemon[i] == pokemon)

0 commit comments

Comments
 (0)