Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
ee10efa
Add new enchantments from v. 1.3.4 update
nic0lette Apr 2, 2016
c940ed7
Minor UI improvements
nic0lette Apr 3, 2016
cf9b7cf
Hopefully fixing 1.3.5 resources files access
Apr 11, 2016
e3ea502
Merge pull request #1 from supercarotte/master
nic0lette Apr 11, 2016
2492b16
Merge remote-tracking branch 'refs/remotes/nic0lette/master'
Apr 11, 2016
c8464af
1.3.5 Update
Apr 11, 2016
8556815
Merge pull request #2 from supercarotte/master
nic0lette Apr 11, 2016
366eb5a
A few minor updates
nic0lette Apr 12, 2016
1f4ca5c
Ensure Pokémon levels don't overflow
nic0lette Apr 12, 2016
798cc9a
Minor UI tweak
nic0lette Apr 12, 2016
591981f
Merge remote-tracking branch 'refs/remotes/nic0lette/master'
Apr 13, 2016
c23050c
Merge remote-tracking branch 'refs/remotes/nic0lette/master'
Apr 13, 2016
008bbe6
OwnedBox Fix
Apr 15, 2016
030e480
WIP Mega-speedups
Apr 17, 2016
f4071c8
Mega Speedups alpha version
Apr 18, 2016
8334a2e
Mega Speedups 1.0
Apr 18, 2016
de60302
small commit
Apr 18, 2016
978305d
v1.3 draft
Apr 19, 2016
9b9b5d3
Pull latest from supercarrotte
Apr 20, 2016
3d98b6c
1.3 draft fix
Apr 20, 2016
0fbedc5
Merge branch 'master' of github.com:supercarotte/PSSE
Apr 20, 2016
cec4b3f
Legitimacy Enhanced
Apr 22, 2016
867c56c
Merge remote-tracking branch 'refs/remotes/nic0lette/master'
Apr 22, 2016
0a3d0ed
Useless fancy stuff
Apr 23, 2016
fc85e66
Stages update
Apr 23, 2016
a07ebcc
Did someone say cheats ?
Apr 25, 2016
9ec505d
Preparatory work
Apr 26, 2016
69c48e1
v1.3 initial release
Apr 29, 2016
d624713
v1.3.0-1
Apr 30, 2016
99f5882
Cleaning stuff
May 3, 2016
1ce911d
Small work
May 9, 2016
b55926f
Quick Fix
May 9, 2016
89f8b44
Great Refactor (and click events)
May 11, 2016
e3b9c70
Little Tweaks
May 12, 2016
e2a15b4
Keep refactoring
May 13, 2016
0728d7b
Another fix
May 13, 2016
686902b
Keep refactoring
May 17, 2016
dd19c73
1.3.10 Update
May 17, 2016
9945ecc
1.3.10 fix : pokemonAbility.bin
May 17, 2016
27ca2c0
stupidest fix ever
May 17, 2016
dd13ca2
Keep refactoring (again)
May 18, 2016
42c7ede
Re-re-re-re-re-refactoring
May 19, 2016
8e6e77e
Tab navigating through Items
May 30, 2016
dc80a22
Added skill+ level viewer
May 31, 2016
39d4e4e
Updated resource files to game's version 1.3.11
May 31, 2016
2267793
Fixes previous commit
May 31, 2016
5b1afe6
Quick fix for speedup handling
May 31, 2016
49133ca
Update README.md
May 31, 2016
a3e41f6
Quick fix for Lollipop and Skill sprites reset
May 31, 2016
751ebf9
Added Form to choose values
Jun 2, 2016
2ae1e5e
Fixed handling of mega forms
Jun 2, 2016
1211e92
Edit Pokathlon (dirty)
Jun 9, 2016
85d695e
Edit Pokathlon (better)
Jun 9, 2016
b8348e8
Small fix
Jun 9, 2016
dd3aa24
Team editor beta
Jun 9, 2016
ee1976c
Cleanup
Jun 10, 2016
0e6fe6e
English fix
Jun 10, 2016
b33b24e
Update bulit-in resource files to v1.3.13 of the game.
Jun 14, 2016
02a6539
Update README.md
Jun 14, 2016
4fec563
More options for StreetPass editing
Jun 15, 2016
d7ef6ae
Support for new Skill Swap item
Jun 28, 2016
9b0588f
Add Skill Swapper description and fixes a deadly bug.
Jun 29, 2016
216baaa
Added support for multiple skills
Jun 30, 2016
bfb6863
Fixed Shiny Gyarados editing
Jul 4, 2016
0a4f946
1.3.15 update + WIP Crystal hearts
Jul 12, 2016
64007d0
Mission cards support
Jul 12, 2016
bbb5836
Improved Mission cards support
Jul 13, 2016
b86139f
Mission cards & WIP crystal hearts improvements
Jul 15, 2016
727b4c4
1.3.15 release
Jul 20, 2016
afab6dd
Added verbose Skill output
Aug 12, 2016
66a88df
1.3.20 release
Sep 6, 2016
b408d7b
Fix for save canceling
Sep 14, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vs/
Pokemon Shuffle Save Editor/bin/
obj/

# Xamarin
*.userprefs
10 changes: 6 additions & 4 deletions Pokemon Shuffle Save Editor.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pokemon Shuffle Save Editor", "Pokemon Shuffle Save Editor\Pokemon Shuffle Save Editor.csproj", "{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}"
EndProject
Global
Expand All @@ -9,8 +11,8 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Debug|x86.ActiveCfg = Release|x86
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Debug|x86.Build.0 = Release|x86
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Debug|x86.ActiveCfg = Debug|x86
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Debug|x86.Build.0 = Debug|x86
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Release|x86.ActiveCfg = Release|x86
{09C7AD6C-267B-4AFF-A56B-22474BD3D5D4}.Release|x86.Build.0 = Release|x86
EndGlobalSection
Expand Down
291 changes: 243 additions & 48 deletions Pokemon Shuffle Save Editor/Cheats.Designer.cs

Large diffs are not rendered by default.

476 changes: 397 additions & 79 deletions Pokemon Shuffle Save Editor/Cheats.cs

Large diffs are not rendered by default.

345 changes: 345 additions & 0 deletions Pokemon Shuffle Save Editor/Cheats.resx

Large diffs are not rendered by default.

185 changes: 185 additions & 0 deletions Pokemon Shuffle Save Editor/Database.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Pokemon_Shuffle_Save_Editor
{
public class Database
{
#region Properties

public byte[] MegaStone { get; private set; }
public byte[] MonAbility { get; private set; }
public byte[] MonData { get; private set; }
public byte[] MonLevel { get; private set; }
public byte[] StagesEvent { get; private set; }
public byte[] StagesExpert { get; private set; }
public byte[] StagesMain { get; private set; }
public byte[] MissionCard { get; private set; }

public bool[][] HasMega { get; private set; } // [X][0] = X, [X][1] = Y
public int[] Forms { get; private set; }
public int[][] PokathlonRand { get; private set; } // [step][0] = min, [step][1] = max
public bool[][] Missions { get; private set; }
public string[] MonsList { get; private set; }
public string[] PokathlonList { get; private set; }
public string[] SpeciesList { get; private set; }
public string[] SkillsList { get; private set; }
public string[] SkillsTextList { get; private set; }
public Tuple<int, int>[] Megas { get; private set; } //monsIndex, speedups
public Tuple<int, int, bool, int, int, int[], int, Tuple<int, int>>[] Mons { get; private set; } //specieIndex, formIndex, isMega, raiseMaxLevel, basePower, skills, type, Rest
public Tuple<int, int>[] Rest { get; private set; } //stageNum, skillsCount
public List<int> MegaList { get; private set; } //derivate a List from Megas.Item1 to use with IndexOf() functions (in UpdateForms() & UpdateOwnedBox())

public int MegaStartIndex { get; private set; } // Indexes of first mega & second "---", respectively,...
public int MonStopIndex { get; private set; } //...should allow PSSE to work longer without needing an update.

#endregion Properties

public Database()
{
MonData = Properties.Resources.pokemonData;
StagesMain = Properties.Resources.stageData;
StagesEvent = Properties.Resources.stageDataEvent;
StagesExpert = Properties.Resources.stageDataExtra;
MegaStone = Properties.Resources.megaStone;
MonLevel = Properties.Resources.pokemonLevel;
MonAbility = Properties.Resources.pokemonAbility;
MissionCard = Properties.Resources.missionCard;
string resourcedir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar + "resources" + Path.DirectorySeparatorChar;
if (!Directory.Exists(resourcedir))
Directory.CreateDirectory(resourcedir);
byte[][] files = { MegaStone, MonData, StagesMain, StagesEvent, StagesExpert, MonLevel, MonAbility, MissionCard };
string[] filenames = { "MegaStone.bin", "pokemonData.bin", "stageData.bin", "stageDataEvent.bin", "stageDataExtra.bin", "pokemonLevel.bin", "pokemonAbility.bin", "MissionCard.bin" };
for (int i = 0; i < files.Length; i++)
{
if (!File.Exists(resourcedir + filenames[i]))
File.WriteAllBytes(resourcedir + filenames[i], files[i]);
else
{
files[i] = File.ReadAllBytes(resourcedir + filenames[i]);
switch (i)
{
case 0:
MegaStone = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 1:
MonData = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 2:
StagesMain = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 3:
StagesEvent = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 4:
StagesExpert = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 5:
MonLevel = File.ReadAllBytes(resourcedir + filenames[i]);
break;

case 6:
MonAbility = File.ReadAllBytes(resourcedir + filenames[i]);
break;
case 7:
MissionCard = File.ReadAllBytes(resourcedir + filenames[i]);
break;
}
}
}
SpeciesList = Properties.Resources.species.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries);
MonsList = Properties.Resources.mons.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries);
PokathlonList = Properties.Resources.pokathlon.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries);

MegaStartIndex = MonsList.ToList().IndexOf("Mega Venusaur");
MonStopIndex = MonsList.ToList().IndexOf("---", 1);
int entrylen = BitConverter.ToInt32(MonData, 0x4);
Megas = new Tuple<int, int>[BitConverter.ToUInt32(MegaStone, 0) - 1];
for (int i = 0; i < Megas.Length; i++)
{
int monIndex = BitConverter.ToUInt16(MegaStone, 0x54 + i * 4) & 0x3FF;
string str = "Mega " + MonsList[monIndex];
if (monIndex == 6 || monIndex == 150)
str += (monIndex != (BitConverter.ToUInt16(MegaStone, 0x54 + (i - 1) * 4) & 0x3FF))
? " X"
: " Y";
byte[] data = MonData.Skip(0x50 + entrylen * MonsList.ToList().IndexOf(str)).Take(entrylen).ToArray();
int maxSpeedup = (BitConverter.ToInt32(data, 0xA) >> 7) & 0x7F;
Megas[i] = new Tuple<int, int>(monIndex, maxSpeedup);
}
MegaList = new List<int>();
for (int i = 0; i < Megas.Length; i++)
MegaList.Add(Megas[i].Item1);
Forms = new int[SpeciesList.Length];
HasMega = new bool[MonsList.Length][];
for (int i = 0; i < MonsList.Length; i++)
HasMega[i] = new bool[2];
Mons = new Tuple<int, int, bool, int, int, int[], int, Tuple<int, int>>[BitConverter.ToUInt32(MonData, 0)];
Rest = new Tuple<int, int>[Mons.Length];
for (int i = 0; i < Mons.Length; i++)
{
byte[] data = MonData.Skip(0x50 + entrylen * i).Take(entrylen).ToArray();
bool isMega = i >= MegaStartIndex && i <= MonsList.Count() - 1;
int spec = (isMega && i <= MegaStartIndex + Megas.Length - 1)
? SpeciesList.ToList().IndexOf(MonsList[Megas[i - MegaStartIndex].Item1].Replace("Shiny", "").Replace("Winking", "").Replace("Smiling", "").Replace(" ", "")) //crappy but needed for IndexOf() to find the pokemon's name in specieslist (only adjectives on Megas names matter)
: (BitConverter.ToInt32(data, 0xE) >> 6) & 0x7FF;
int raiseMaxLevel = (BitConverter.ToInt16(data, 0x4)) & 0x3F;
int basePower = (BitConverter.ToInt16(data, 0x3)) & 0x7; //ranges 1-7 for now (30-90 BP), may need an update later on
int[] skill = new int[5];
int j = 0;
int skillCount = 0;
foreach (int adr in new int[] { 0x02, 0x20, 0x21, 0x22, 0x23})
{
skill[j] = data[adr] & 0x7F; //ranges 1-~100 for now ("Opportunist" to "Transform"), ordered list in MESSAGE_XX/message_PokedexXX.bin
skillCount += (skill[j] != 0 ? 1 : 0);
j++;
}
skillCount = Math.Max(skillCount, 1);
int type = (BitConverter.ToInt16(data, 0x01) >> 3) & 0x1F; //ranges 0-17 (normal - fairy) (https://gbatemp.net/threads/psse-pokemon-shuffle-save-editor.396499/page-33#post-6278446)
int index = (BitConverter.ToInt16(data, 0)) & 0x3FF; //ranges 1-999, it's the number you can see on the team selection menu
Rest[i] = new Tuple<int, int>(index, skillCount); //Mons has more than 7 arguments so 8th one and beyond must be included in another Tuple
Mons[i] = new Tuple<int, int, bool, int, int, int[], int, Tuple<int, int>>(spec, Forms[spec], isMega, raiseMaxLevel, basePower, skill, type, Rest[i]);
Forms[spec]++;
}
for (int i = 0; i < Megas.Length; i++)
HasMega[BitConverter.ToUInt16(MegaStone, 0x54 + i * 4) & 0x3FF][(MegaStone[0x54 + (i * 4) + 1] >> 3) & 1] = true;
PokathlonRand = new int[PokathlonList.Length / 2][];
for (int i = 0; i < PokathlonRand.Length; i++)
{
PokathlonRand[i] = new int[2];
Int32.TryParse(PokathlonList[2 * i], out PokathlonRand[i][0]);
Int32.TryParse(PokathlonList[1 + 2 * i], out PokathlonRand[i][1]);
}
Missions = new bool[BitConverter.ToInt32(MissionCard, 0)][];
for(int i = 0 ; i < Missions.Length; i++)
{
Missions[i] = new bool[10];
int ientrylen = BitConverter.ToInt32(MissionCard, 0x4);
byte[] data = MissionCard.Skip(BitConverter.ToInt32(MissionCard, 0x10) + i * ientrylen).Take(ientrylen).ToArray();
for (int j = 0; j < Missions[i].Length; j++)
Missions[i][j] = BitConverter.ToInt16(data, 0x8 + 2 * j) != 0;
}
byte[] HexValue = Properties.Resources.messagePokedex_US;
string StrValue = "";
List<string> List = new List<string>();
for (int i = 0; i < HexValue.Length; i += 2)
{
if (BitConverter.ToChar(HexValue, i) == '\0' && StrValue != "" && !(StrValue.EndsWith("\u0001ă\u0001\u0003\u0003慮敭") || StrValue.EndsWith("\u0001ă\u0001\u0003\u0005敭慧慎敭")))
{
List.Add(StrValue.Replace("\u0001ă\u0001\u0003\u0003慮敭\0", "[name]").Replace("\u0001ă\u0001\u0003\u0005敭慧慎敭\0", "[name]"));
StrValue = "";
}
else StrValue += BitConverter.ToChar(HexValue, i);
}
SkillsList = List.Skip(List.IndexOf("Opportunist")).Take(List.IndexOf("Attacks can occasionally deal\ngreater damage than usual.") - List.IndexOf("Opportunist")).ToArray();
SkillsTextList = List.Skip(List.IndexOf("Attacks can occasionally deal\ngreater damage than usual.")).Take(List.IndexOf("Attacks can occasionally deal\ngreater damage than usual.") - List.IndexOf("Opportunist")).ToArray();
}
}
}
Loading