├── .gitignore
├── App.config
├── Data
├── Abilities.cs
├── Ability.cs
├── Crystarium.cs
├── DataStores
│ ├── DataStoreAbility.cs
│ ├── DataStoreChara.cs
│ ├── DataStoreCrystarium.cs
│ ├── DataStoreEnemy.cs
│ ├── DataStoreEquip.cs
│ ├── DataStoreIDCrystarium.cs
│ ├── DataStoreItem.cs
│ ├── DataStoreShop.cs
│ ├── DataStoreTreasure.cs
│ └── DataStoreWDB.cs
├── Enemies.cs
├── Enemy.cs
├── Enums
│ └── Enums.cs
├── Item.cs
├── Items.cs
├── Party
│ ├── Member.cs
│ ├── Parties.cs
│ └── Party.cs
├── PassiveSet.cs
├── Passives.cs
├── Shop.cs
├── Shops.cs
├── Text
│ ├── TextDialog.cs
│ └── TextFile.cs
├── TieredAbilities.cs
├── TieredItems.cs
├── Treasure.cs
└── Treasures.cs
├── FF13Randomizer.csproj
├── FF13Randomizer.csproj.user
├── Flags
├── Flags.cs
└── Tweaks.cs
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── FormMain.Designer.cs
├── FormMain.cs
├── FormMain.resx
├── InputBox.cs
├── ItemChanceForm.Designer.cs
├── ItemChanceForm.cs
├── ItemChanceForm.resx
├── MathExtensions.cs
├── NumericRange.cs
├── NumericRangeMinMAx.cs
├── Plandos
├── AbilityPlando.Designer.cs
├── AbilityPlando.cs
├── AbilityPlando.resx
├── CrystariumPlando.Designer.cs
├── CrystariumPlando.cs
├── CrystariumPlando.resx
├── EnemyDebuffResistPlando.Designer.cs
├── EnemyDebuffResistPlando.cs
├── EnemyDebuffResistPlando.resx
├── EnemyDropPlando.Designer.cs
├── EnemyDropPlando.cs
├── EnemyDropPlando.resx
├── EnemyElementResistPlando.Designer.cs
├── EnemyElementResistPlando.cs
├── EnemyElementResistPlando.resx
├── EnemyStatsPlando.Designer.cs
├── EnemyStatsPlando.cs
├── EnemyStatsPlando.resx
├── EquipPassivesPlando.Designer.cs
├── EquipPassivesPlando.cs
├── EquipPassivesPlando.resx
├── EquipPlando.Designer.cs
├── EquipPlando.cs
├── EquipPlando.resx
├── ItemPlando.Designer.cs
├── ItemPlando.cs
├── ItemPlando.resx
├── PlandoFile.cs
├── RunSpeedPlando.Designer.cs
├── RunSpeedPlando.cs
├── RunSpeedPlando.resx
├── ShopOrderPlando.Designer.cs
├── ShopOrderPlando.cs
├── ShopOrderPlando.resx
├── ShopPlando.Designer.cs
├── ShopPlando.cs
├── ShopPlando.resx
├── TreasurePlando.Designer.cs
├── TreasurePlando.cs
└── TreasurePlando.resx
├── Program.cs
├── ProgressForm.Designer.cs
├── ProgressForm.cs
├── ProgressForm.resx
├── Randomizers
├── RandoAbilities.cs
├── RandoCrystarium.cs
├── RandoEnemies.cs
├── RandoEquip.cs
├── RandoItems.cs
├── RandoMusic.cs
├── RandoRunSpeed.cs
├── RandoShops.cs
└── RandoTreasure.cs
├── VersionOrder.cs
└── packages.config
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/Debug
2 | bin
3 | obj
4 | Properties
5 |
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Data/Ability.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 |
10 | public class Ability
11 | {
12 | public Role Role { get; }
13 | public bool Starting { get; private set; } = false;
14 | public string Name { get; }
15 | public Element[] Elements { get; private set; } = new Element[0];
16 | public Debuff[] Debuffs { get; private set; } = new Debuff[0];
17 | public class AbilityData : Identifier
18 | {
19 | public string Characters { get; set; }
20 |
21 | public bool HasCharacter(string character)
22 | {
23 | return Characters.Contains(character);
24 | }
25 | }
26 |
27 | private List list = new List();
28 |
29 | ///
30 | /// l=Lightning
31 | /// s=Snow
32 | /// v=Vanille
33 | /// z=Sazh
34 | /// h=Hope
35 | /// f=Fang
36 | ///
37 | ///
38 | ///
39 | ///
40 | public Ability(String name, Role role, string id, string characters = "lsvzhf", bool special = false)
41 | {
42 | this.Name = name;
43 | this.Special = special;
44 | Role = role;
45 | Add(id, characters);
46 | Abilities.abilities.Add(this);
47 | }
48 |
49 | public Ability Add(string id, string characters = "lsvzhf")
50 | {
51 | list.Add(new AbilityData() {ID = id, Characters = characters });
52 | return this;
53 | }
54 |
55 | public bool Special { get; }
56 |
57 | public bool HasCharacter(string character)
58 | {
59 | for (int i = list.Count - 1; i >= 0; i--)
60 | {
61 | if (list[i].HasCharacter(character))
62 | return true;
63 | }
64 | return false;
65 | }
66 |
67 | public string GetCharacters()
68 | {
69 | return string.Join("", list.SelectMany(a => a.Characters.ToCharArray()).Distinct().OrderBy(c => "lsvzhf".ToCharArray().ToList().IndexOf(c)).Select(c =>
70 | {
71 | switch (c)
72 | {
73 | case 'l':
74 | return "L";
75 | case 's':
76 | return "Sn";
77 | case 'v':
78 | return "V";
79 | case 'z':
80 | return "Sz";
81 | case 'h':
82 | return "H";
83 | case 'f':
84 | return "F";
85 | default:
86 | return "";
87 | }
88 | }));
89 | }
90 |
91 | public string GetAbility(string character)
92 | {
93 | for (int i = list.Count - 1; i >= 0; i--)
94 | {
95 | if (list[i].HasCharacter(character))
96 | return list[i].ID;
97 | }
98 | throw new Exception($"{GetName(character)} cannot have the {Name} ability!");
99 | }
100 |
101 | private Character GetName(string character)
102 | {
103 | switch (character)
104 | {
105 | case "l":
106 | return Character.Lightning;
107 | case "s":
108 | return Character.Snow;
109 | case "v":
110 | return Character.Vanille;
111 | case "z":
112 | return Character.Sazh;
113 | case "h":
114 | return Character.Hope;
115 | case "f":
116 | return Character.Fang;
117 | }
118 | return Character.Lightning;
119 | }
120 |
121 | public Ability SetStarting()
122 | {
123 | Starting = true;
124 | return this;
125 | }
126 |
127 | public Ability SetElements(params Element[] elements)
128 | {
129 | Elements = elements;
130 | return this;
131 | }
132 |
133 | public Ability SetDebuffs(params Debuff[] debuffs)
134 | {
135 | Debuffs = debuffs;
136 | return this;
137 | }
138 |
139 | public string[] GetIDs()
140 | {
141 | return list.Select(d => d.ID).ToArray();
142 | }
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/Data/Crystarium.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Crystarium
10 | {
11 | public static Dictionary GetDisplayNames(DataStoreWDB crystarium)
12 | {
13 | Dictionary names = new Dictionary();
14 | List ids = crystarium.IdList.Skip(4).ToList();
15 | ids.Sort((a, b) => a.CompareTo(b));
16 |
17 | int val = 0, node = 0;
18 | for (int i = 0; i < crystarium.DataList.Count; i++)
19 | {
20 | val++;
21 | if (i == 0 || ids[i].Node != ids[i - 1].Node)
22 | node++;
23 | if (i > 0)
24 | {
25 | if (ids[i].Stage > ids[i - 1].Stage || ids[i].Prefix != ids[i - 1].Prefix)
26 | {
27 | val = 1;
28 | node = 1;
29 | }
30 | }
31 |
32 | string dispName = $"{node}";
33 | if (ids[i].SubNode > 0)
34 | {
35 | int highestSub = ids.Where(id => id.Prefix == ids[i].Prefix && id.Stage == ids[i].Stage && id.Node == ids[i].Node).Select(id => id.SubNode).Max();
36 | int highestSubSub = ids.Where(id => id.Prefix == ids[i].Prefix && id.Stage == ids[i].Stage && id.Node == ids[i].Node).Select(id => id.SubSubNode).Max();
37 | if (highestSub > 1 || highestSubSub <= 1)
38 | dispName += $"-{ids[i].SubNode}";
39 | if (highestSubSub > 1)
40 | dispName += $"-{ids[i].SubSubNode}";
41 | }
42 |
43 | names.Add(ids[i], dispName);
44 | }
45 | return names;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreAbility.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreAbility : DataStore
11 | {
12 | public ushort ATBCost
13 | {
14 | get { return Data.ReadUShort(0xF4); }
15 | set { Data.SetUShort(0xF4, value); }
16 | }
17 |
18 | public override int GetDefaultLength()
19 | {
20 | return 0x120;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreChara.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreChara : DataStore
11 | {
12 | public byte RunSpeed
13 | {
14 | get { return Data.ReadByte(0x17); }
15 | set { Data.SetByte(0x17, value); }
16 | }
17 |
18 | public override int GetDefaultLength()
19 | {
20 | return 0x58;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreCrystarium.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreCrystarium : DataStore
11 | {
12 |
13 | public uint CPCost
14 | {
15 | get { return Data.ReadUInt(0x0); }
16 | set { Data.SetUInt(0x0, value); }
17 | }
18 |
19 | public string AbilityName { get; set; }
20 |
21 | protected uint AbilityPointer
22 | {
23 | get { return Data.ReadUInt(0x4); }
24 | set { Data.SetUInt(0x4, value); }
25 | }
26 |
27 | public ushort Value
28 | {
29 | get { return Data.ReadUShort(0x8); }
30 | set { Data.SetUShort(0x8, value); }
31 | }
32 |
33 | public CrystariumType Type
34 | {
35 | get { return (CrystariumType)Data.ReadByte(0xA); }
36 | set { Data.SetByte(0xA, (byte)value); }
37 | }
38 |
39 | public byte Stage
40 | {
41 | get { return (byte)(Data.ReadByte(0xB) / 0x10); }
42 | set { Data.SetByte(0xB, (byte)(value * 0x10 + (byte)Role)); }
43 | }
44 |
45 | public Role Role
46 | {
47 | get { return (Role)(Data.ReadByte(0xB) % 0x10); }
48 | set { Data.SetByte(0xB, (byte)(Stage * 0x10 + (byte)value)); }
49 | }
50 |
51 | public override int GetDefaultLength()
52 | {
53 | return 0xC;
54 | }
55 |
56 | public void SwapStats(DataStoreCrystarium other)
57 | {
58 | CrystariumType type = other.Type;
59 | ushort value = other.Value;
60 | other.Type = this.Type;
61 | other.Value = this.Value;
62 | this.Type = type;
63 | this.Value = value;
64 | }
65 |
66 | public void SwapStatsAbilities(DataStoreCrystarium other)
67 | {
68 | SwapStats(other);
69 | uint pointer = other.AbilityPointer;
70 | other.AbilityPointer = this.AbilityPointer;
71 | this.AbilityPointer = pointer;
72 |
73 | string abilityName = other.AbilityName;
74 | other.AbilityName = this.AbilityName;
75 | this.AbilityName = abilityName;
76 | }
77 |
78 | public override void UpdateStringPointers(DataStorePointerList list)
79 | {
80 | if (Type == CrystariumType.Ability)
81 | {
82 | UpdateStringPointer(list, AbilityName, AbilityPointer, v => AbilityName = v, v => AbilityPointer = v);
83 | }
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreIDCrystarium.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreIDCrystarium : DataStoreID
11 | {
12 | public string Prefix => ID.Substring(0, 7);
13 | public int Stage => Int32.Parse(ID.Substring(7, 2));
14 | public int Node => Int32.Parse(ID.Substring(9, 2));
15 | public int SubNode => Int32.Parse(ID.Substring(11, 2));
16 | public int SubSubNode => Int32.Parse(ID.Substring(13, 1));
17 |
18 | public int CompareNode(DataStoreIDCrystarium other)
19 | {
20 | if (this.Node >= 90 && other.Node < 90)
21 | return -1;
22 | if (this.Node < 90 && other.Node >= 90)
23 | return 1;
24 | int node = this.Node.CompareTo(other.Node);
25 | if (node != 0)
26 | return node;
27 | return 0;
28 | }
29 |
30 | public int CompareTo(DataStoreIDCrystarium other)
31 | {
32 | int prefix = this.Prefix.CompareTo(other.Prefix);
33 | if (prefix != 0)
34 | return prefix;
35 | int stage = this.Stage.CompareTo(other.Stage);
36 | if (stage != 0)
37 | return stage;
38 | int node = this.CompareNode(other);
39 | if (node != 0)
40 | return node;
41 | int subnode = this.SubNode.CompareTo(other.SubNode);
42 | if (subnode != 0)
43 | return subnode;
44 | int subsubnode = this.SubSubNode.CompareTo(other.SubSubNode);
45 | if (subsubnode != 0)
46 | return subsubnode;
47 | return 0;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreItem.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreItem : DataStore
11 | {
12 | public uint BuyPrice
13 | {
14 | get { return Data.ReadUInt(0xC); }
15 | set { Data.SetUInt(0xC, value); }
16 | }
17 | public uint SellPrice
18 | {
19 | get { return Data.ReadUInt(0x10); }
20 | set { Data.SetUInt(0x10, value); }
21 | }
22 | public byte SynthesisGroup
23 | {
24 | get { return Data.ReadByte(0x18); }
25 | set { Data.SetByte(0x18, value); }
26 | }
27 |
28 | public byte Rank
29 | {
30 | get { return Data.ReadNibbleLeft(0x19); }
31 | set { Data.SetNibbleLeft(0x19, value); }
32 | }
33 |
34 | public override int GetDefaultLength()
35 | {
36 | return 0x24;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreShop.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Runtime.ExceptionServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace FF13Data
10 | {
11 | public class DataStoreShop : DataStore
12 | {
13 | private byte[] header;
14 | private string[] itemIDs = new string[32];
15 |
16 | public override byte[] Data
17 | {
18 | get
19 | {
20 | byte[] itemData = new byte[itemPointers.Length * 4];
21 | for (int i = 0;i itemIDs.Where(id => !string.IsNullOrEmpty(id)).Count();
39 |
40 | private uint[] itemPointers = new uint[32];
41 |
42 | public override void LoadData(byte[] data, int offset = 0)
43 | {
44 | byte[] shopData = data.SubArray(offset, GetDefaultLength());
45 | header = shopData.SubArray(0, 0x18);
46 | itemPointers = Enumerable.Range(0, itemPointers.Length).Select(i => shopData.ReadUInt(0x18 + 0x4 * i)).ToArray();
47 | }
48 |
49 | public override int GetDefaultLength()
50 | {
51 | return 0x9C;
52 | }
53 |
54 | public override void UpdateStringPointers(DataStorePointerList list)
55 | {
56 | for (int i = 0; i < itemPointers.Length; i++)
57 | {
58 | UpdateStringPointer(list, itemIDs[i], itemPointers[i], v => itemIDs[i] = v, v => itemPointers[i] = v);
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreTreasure.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Data
9 | {
10 | public class DataStoreTreasure : DataStore
11 | {
12 | public string ItemID { get; set; }
13 |
14 | protected uint StartingPointer
15 | {
16 | get { return Data.ReadUInt(0x0); }
17 | set { Data.SetUInt(0x0, value); }
18 | }
19 |
20 | public uint Count
21 | {
22 | get { return Data.ReadUInt(0x4); }
23 | set { Data.SetUInt(0x4, value); }
24 | }
25 |
26 | protected uint EndingPointer
27 | {
28 | get { return Data.ReadUInt(0x8); }
29 | set { Data.SetUInt(0x8, value); }
30 | }
31 |
32 | public override int GetDefaultLength()
33 | {
34 | return 0xC;
35 | }
36 |
37 | public override void UpdateStringPointers(DataStorePointerList list)
38 | {
39 | UpdateStringPointer(list, ItemID, StartingPointer, v => ItemID = v, v => StartingPointer = v, v => EndingPointer = v);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Data/DataStores/DataStoreWDB.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace FF13Data
10 | {
11 | public class DataStoreWDB : DataStore where T : DataStore, new() where I : DataStoreID, new()
12 | {
13 | protected byte[] header;
14 |
15 | public DataStoreIDList IdList { get; set; }
16 |
17 | public DataStorePointerList StringList { get; set; }
18 |
19 | protected byte[] section;
20 |
21 | public DataStoreList DataList { get; set; }
22 |
23 | public T this[string id]
24 | {
25 | get { return DataList[IdList.IndexOf(id) - 4]; }
26 | }
27 | public T this[Identifier id]
28 | {
29 | get { return this[id.ID]; }
30 | }
31 | public T this[int index]
32 | {
33 | get { return DataList[index]; }
34 | }
35 |
36 |
37 | public override void LoadData(byte[] data, int offset = 0)
38 | {
39 | header = data.SubArray(0, 0x10);
40 | int stringStart = (int)data.ReadUInt(0x20);
41 | IdList = new DataStoreIDList();
42 | IdList.LoadData(data.SubArray(0x10, stringStart - 0x10));
43 |
44 | StringList = new DataStorePointerList(new DataStoreString() { Value = "" });
45 | StringList.LoadData(data.SubArray(IdList[0].Offset, IdList[0].DataSize));
46 |
47 | section = data.SubArray(IdList[1].Offset, IdList[4].Offset - IdList[1].Offset);
48 |
49 | DataList = new DataStoreList();
50 | DataList.LoadData(data.SubArray(IdList[4].Offset, data.Length - IdList[4].Offset));
51 | DataList.ForEach(d => d.UpdateStringPointers(StringList));
52 | }
53 |
54 | public override byte[] Data
55 | {
56 | get
57 | {
58 | DataList.ForEach(d => d.UpdateStringPointers(StringList));
59 | IdList["!!string"].DataSize = StringList.Length;
60 | IdList.UpdateOffsets();
61 | return header.Concat(IdList.Data).Concat(StringList.Data).Concat(section).Concat(DataList.Data);
62 | }
63 | }
64 |
65 | public override int GetDefaultLength()
66 | {
67 | return -1;
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Data/Enemy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public enum EnemyType
10 | {
11 | Normal,
12 | Rare, // Difficult or hard to find
13 | Boss, // Only fought once
14 | Eidolon
15 | }
16 |
17 | public class Enemy : Identifier
18 | {
19 | public static Dictionary PhysMapping = GetPhysMapping();
20 |
21 | public string Name { get; set; }
22 |
23 | public EnemyType Type { get; set; }
24 | public ElementProperty ElementProperty { get; set; }
25 |
26 | public Enemy ParentData { get; set; }
27 |
28 | public Party[] Parties { get; set; } = new Party[0];
29 |
30 | public Enemy(string name, string id, Enemy parentData = null, EnemyType type = EnemyType.Normal, ElementProperty property = ElementProperty.Normal)
31 | {
32 | this.Name = name;
33 | this.ID = id;
34 | this.Type = type;
35 | this.ParentData = parentData;
36 | this.ElementProperty = property;
37 | Enemies.enemies.Add(this);
38 | }
39 |
40 | public Enemy ForParties(params Party[] parties)
41 | {
42 | Parties = parties;
43 | return this;
44 | }
45 |
46 | private static Dictionary GetPhysMapping() {
47 | Dictionary mapping = new Dictionary();
48 | #region Set Physical Resistances
49 | mapping.Add(0x0D, ElementalRes.Weakness);
50 |
51 | mapping.Add(0x00, ElementalRes.Normal);
52 | mapping.Add(0x01, ElementalRes.Normal);
53 | mapping.Add(0x04, ElementalRes.Normal);
54 | mapping.Add(0x05, ElementalRes.Normal);
55 | mapping.Add(0x81, ElementalRes.Normal);
56 |
57 | mapping.Add(0x10, ElementalRes.Halved);
58 | mapping.Add(0x11, ElementalRes.Halved);
59 | mapping.Add(0x14, ElementalRes.Halved);
60 | mapping.Add(0x15, ElementalRes.Halved);
61 | mapping.Add(0x91, ElementalRes.Halved);
62 |
63 | mapping.Add(0x18, ElementalRes.Resistant);
64 | mapping.Add(0x19, ElementalRes.Resistant);
65 | mapping.Add(0x1C, ElementalRes.Resistant);
66 | mapping.Add(0x1D, ElementalRes.Resistant);
67 | mapping.Add(0x98, ElementalRes.Resistant);
68 |
69 | mapping.Add(0x20, ElementalRes.Immune);
70 | mapping.Add(0x21, ElementalRes.Immune);
71 | mapping.Add(0x24, ElementalRes.Immune);
72 | mapping.Add(0x25, ElementalRes.Immune);
73 | #endregion
74 | return mapping;
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Data/Enums/Enums.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public enum CrystariumType : byte
10 | {
11 | HP = 1,
12 | Strength = 2,
13 | Magic = 3,
14 | Accessory = 4,
15 | ATBLevel = 5,
16 | Ability = 6,
17 | RoleLevel = 7,
18 | Unknown = 0
19 | }
20 |
21 | public enum Role : byte
22 | {
23 | None = 0,
24 | Commando = 2,
25 | Ravager = 3,
26 | Sentinel = 1,
27 | Synergist = 4,
28 | Medic = 6,
29 | Saboteur = 5
30 | }
31 |
32 | public enum ElementalRes : byte
33 | {
34 | Weakness = 0,
35 | Normal = 1,
36 | Halved = 2,
37 | Resistant = 3,
38 | Immune = 4,
39 | Absorb = 5
40 | }
41 |
42 | public enum Element
43 | {
44 | Fire,
45 | Ice,
46 | Thunder,
47 | Water,
48 | Wind,
49 | Earth,
50 | Physical,
51 | Magical
52 | }
53 |
54 | public enum Debuff
55 | {
56 | Deprotect,
57 | Deshell,
58 | Poison,
59 | Imperil,
60 | Slow,
61 | Fog,
62 | Pain,
63 | Curse,
64 | Daze,
65 | //Provoke, Ignore as it is a hidden stat
66 | Death,
67 | Dispel
68 | }
69 |
70 | public enum ElementProperty
71 | {
72 | Normal,
73 | Bomb, // Absorb element does not change
74 | Skytank // Will ensure physical attacks are mapped to magic except Lightning's Attack
75 | }
76 |
77 | public enum Character
78 | {
79 | Lightning,
80 | Snow,
81 | Vanille,
82 | Sazh,
83 | Hope,
84 | Fang
85 | }
86 |
87 | public enum SynthesisGroup : byte
88 | {
89 | None = 0xC4,
90 | HighHPPowerSurge = 0x82,
91 | LowHPPowerSurge = 0x84,
92 | PhysicalWall = 0x86,
93 | MagicWall = 0x88,
94 | //PhysicalProofing = 0x8A, Wall but worse
95 | //MagicProofing = 0x8C, Wall but worse
96 | DamageWall = 0x8E,
97 | //DamageProofing = 0x90, Wall but worse
98 | EtherealMantle = 0x92,
99 | MagicDamper = 0x94,
100 | FireDamage = 0x96,
101 | IceDamage = 0x98,
102 | LightningDamage = 0x9A,
103 | WaterDamage = 0x9C,
104 | WindDamage = 0x9E,
105 | EarthDamage = 0xA0,
106 | DebraveDuration = 0xA2,
107 | DefaithDuration = 0xA4,
108 | DeprotectDuration = 0xA6,
109 | DeshellDuration = 0xA8,
110 | SlowDuration = 0xAA,
111 | PoisonDuration = 0xAC,
112 | ImperilDuration = 0xAE,
113 | CurseDuration = 0xB0,
114 | PainDuration = 0xB2,
115 | FogDuration = 0xB4,
116 | DazeDuration = 0xB6,
117 | ATBRate = 0xBC,
118 | RIC_GestaltTPBoost = 0xBE,
119 | BuffDuration = 0xC0,
120 | VampiricStrike = 0xC2
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Data/Item.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 |
10 | public class Item : Identifier
11 | {
12 | public string Name { get; set; }
13 | public Shop PreferredShop { get; set; }
14 |
15 | public Tuple EquipPassive { get; set; }
16 |
17 | public Item(string name, string id, Shop shop)
18 | {
19 | this.Name = name;
20 | this.ID = id;
21 | this.PreferredShop = shop;
22 | Items.items.Add(this);
23 | }
24 |
25 | public Item SetPassive(PassiveSet set, int tier)
26 | {
27 | EquipPassive = new Tuple(set, tier);
28 |
29 | return this;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Data/Party/Member.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Member
10 | {
11 | public Character Character { get; }
12 | public Role[] RolesAvailable { get; }
13 |
14 | public Member(Character character, params Role[] roles)
15 | {
16 | Character = character;
17 | RolesAvailable = roles;
18 | }
19 | public Member(Character character) :
20 | this(character, Role.Commando, Role.Ravager, Role.Sentinel, Role.Synergist, Role.Saboteur, Role.Medic)
21 | {
22 | }
23 |
24 | public List GetAbilitiesAvailable(int stage, DataStoreWDB crystarium, bool leader, bool skytank)
25 | {
26 | if(stage == 0)
27 | {
28 | List list = new List();
29 | list.Add(Abilities.Attack);
30 | if (Character == Character.Snow)
31 | list.Add(Abilities.HandGrenade);
32 | return list;
33 | }
34 |
35 | return crystarium.DataList.Where(c => c.Stage <= stage && RolesAvailable.Contains(c.Role) && c.Type == CrystariumType.Ability).Select(c => Abilities.GetAbility(Character.ToString().ToLower(), c))
36 | .Where(a => RolesAvailable.Contains(a.Role) && a.Starting).Select(a =>
37 | {
38 | if (skytank)
39 | {
40 | if (a == Abilities.Attack && Character != Character.Lightning)
41 | return Abilities.Ruin;
42 | if (a == Abilities.Flamestrike)
43 | return Abilities.Fire;
44 | if (a == Abilities.Aquastrike)
45 | return Abilities.Water;
46 | if (a == Abilities.Froststrike)
47 | return Abilities.Blizzard;
48 | if (a == Abilities.Sparkstrike)
49 | return Abilities.Thunder;
50 | }
51 | return a;
52 | }).ToList();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Data/Party/Parties.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Parties
10 | {
11 | public static List parties = new List();
12 |
13 | #region Role/Member Definitions
14 | private static Role[] rolesCh1_2 = new Role[] { Role.None };
15 | private static Role[] rolesAll = new Role[] { Role.Commando, Role.Ravager, Role.Sentinel, Role.Synergist, Role.Saboteur, Role.Medic };
16 |
17 | private static Member LCh3 = new Member(Character.Lightning, Role.Commando, Role.Ravager);
18 | private static Member VCh3 = new Member(Character.Vanille, Role.Ravager, Role.Medic);
19 | private static Member SzCh3 = new Member(Character.Sazh, Role.Ravager);
20 |
21 | private static Member SzCh4 = new Member(Character.Sazh, Role.Ravager, Role.Synergist);
22 |
23 | private static Member LPrimary = new Member(Character.Lightning, Role.Commando, Role.Ravager, Role.Medic);
24 | private static Member SnPrimary = new Member(Character.Snow, Role.Commando, Role.Ravager, Role.Sentinel);
25 | private static Member SzPrimary = new Member(Character.Sazh, Role.Commando, Role.Ravager, Role.Synergist);
26 | private static Member VPrimary = new Member(Character.Vanille, Role.Ravager, Role.Saboteur, Role.Medic);
27 | private static Member HPrimary = new Member(Character.Hope, Role.Ravager, Role.Synergist, Role.Medic);
28 | private static Member FPrimary = new Member(Character.Fang, Role.Commando, Role.Sentinel, Role.Saboteur);
29 | #endregion
30 |
31 | #region Ch1-2
32 | public static Party Ch1_2LSz = new Party(0, false, new Member(Character.Lightning, rolesCh1_2), new Member(Character.Sazh, rolesCh1_2));
33 | public static Party Ch1_2Sn = new Party(0, false, new Member(Character.Snow, rolesCh1_2));
34 | public static Party Ch2VH = new Party(0, false, new Member(Character.Vanille, rolesCh1_2), new Member(Character.Hope, rolesCh1_2));
35 | public static Party Ch1_2SnVH = new Party(0, false, new Member(Character.Snow, rolesCh1_2), new Member(Character.Lightning, rolesCh1_2), new Member(Character.Sazh, rolesCh1_2));
36 | public static Party Ch2LSnSz = new Party(0, false, new Member(Character.Lightning, rolesCh1_2), new Member(Character.Snow, rolesCh1_2), new Member(Character.Sazh, rolesCh1_2));
37 | #endregion
38 |
39 | #region Ch3
40 | public static Party Ch3LSnV = new Party(1, false, LCh3, SnPrimary, VCh3);
41 | public static Party Ch3LSzV = new Party(1, false, LCh3, SzCh3, VCh3);
42 | public static Party Ch3Sn = new Party(1, false, SnPrimary);
43 | #endregion
44 |
45 | #region Ch4
46 | public static Party Ch4LSzV = new Party(2, false, LCh3, SzCh4, VPrimary);
47 | public static Party Ch4St2LH = new Party(2, false, LCh3, HPrimary);
48 | public static Party Ch4St2SzV = new Party(2, false, SzCh4, VPrimary);
49 | public static Party Ch4SzVH = new Party(2, false, SzCh4, VPrimary, HPrimary);
50 | public static Party Ch4SzLV = new Party(2, false, SzCh4, LCh3, VPrimary);
51 | public static Party Ch4LH = new Party(3, false, LPrimary, HPrimary);
52 | public static Party Ch4SzV = new Party(3, false, SzPrimary, VPrimary);
53 | #endregion
54 |
55 | #region Ch5
56 | public static Party Ch5HL = new Party(3, false, HPrimary, LPrimary);
57 | public static Party Ch5LH = new Party(3, false, LPrimary, HPrimary);
58 | #endregion
59 |
60 | #region Ch6
61 | public static Party Ch6VSz = new Party(4, false, VPrimary, SzPrimary);
62 | #endregion
63 |
64 | #region Ch7
65 | public static Party Ch7LH = new Party(5, false, LPrimary, HPrimary);
66 | public static Party Ch7Sn = new Party(5, false, SnPrimary);
67 | public static Party Ch7SnH = new Party(5, false, SnPrimary, HPrimary);
68 | public static Party Ch7FL = new Party(5, false, FPrimary, LPrimary);
69 | public static Party Ch7FLH = new Party(5, false, FPrimary, LPrimary, HPrimary);
70 | public static Party Ch7LFH = new Party(5, false, LPrimary, FPrimary, HPrimary);
71 | #endregion
72 |
73 | #region Ch8
74 | public static Party Ch8SzV = new Party(6, false, SzPrimary, VPrimary);
75 | #endregion
76 |
77 | #region Ch9
78 | public static Party Ch9LFH = new Party(6, false, LPrimary, FPrimary, HPrimary);
79 | public static Party Ch9SzV = new Party(6, false, SzPrimary, VPrimary);
80 | public static Party Ch9All = new Party(6, false, LPrimary, FPrimary, HPrimary, SzPrimary, VPrimary, SnPrimary);
81 | #endregion
82 |
83 | #region Ch10+
84 | public static Party Ch10Pre2nd = new Party(7, false, LPrimary, FPrimary, HPrimary, SzPrimary, VPrimary, SnPrimary);
85 | public static Party Ch10PreCid = new Party(7);
86 | public static Party Ch10_11 = new Party(8);
87 | public static Party Ch10FLV = new Party(8, false, new Member(Character.Fang, rolesAll), new Member(Character.Lightning, rolesAll), new Member(Character.Vanille, rolesAll));
88 | public static Party Ch11NoH = new Party(8, Character.Hope);
89 | public static Party Ch11HLF = new Party(8, false, new Member(Character.Hope, rolesAll), new Member(Character.Lightning, rolesAll), new Member(Character.Fang, rolesAll));
90 | public static Party Ch11VF = new Party(8, false, new Member(Character.Vanille, rolesAll), new Member(Character.Fang, rolesAll));
91 | public static Party Ch12_13 = new Party(9);
92 | public static Party Ch12LSnV = new Party(9, false, new Member(Character.Lightning, rolesAll), new Member(Character.Snow, rolesAll), new Member(Character.Vanille, rolesAll));
93 | public static Party Ch13Post = new Party(10);
94 | #endregion
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/Data/Party/Party.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Party
10 | {
11 | public Member[] Members { get; }
12 |
13 | public int MaxStage { get; }
14 | public bool LeaderSwap { get; }
15 |
16 | public Party(int stage, bool leaderSwap, params Member[] members)
17 | {
18 | Members = members;
19 | MaxStage = stage;
20 | LeaderSwap = leaderSwap;
21 | Parties.parties.Add(this);
22 | }
23 | public Party(int stage) :
24 | this(stage, new Character[0])
25 | {
26 | }
27 | public Party(int stage, params Character[] excluded) :
28 | this(stage, true, new Member[] { new Member(Character.Lightning), new Member(Character.Snow), new Member(Character.Sazh), new Member(Character.Vanille), new Member(Character.Hope), new Member(Character.Fang) }.Where(m => !excluded.Contains(m.Character)).ToArray())
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Data/PassiveSet.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public enum PassiveType
10 | {
11 | Weapon,
12 | Accessory
13 | }
14 | public enum LockingLevel
15 | {
16 | Fixed,
17 | SameType,
18 | Any
19 | }
20 |
21 |
22 | public class PassiveSet
23 | {
24 | public string Characters { get; set; }
25 | public LockingLevel LockingLevel { get; set; }
26 | public PassiveType Type { get; set; }
27 |
28 | public class Passive : Identifier
29 | {
30 | public string Name { get; set; }
31 | public float StrengthModifier { get; set; }
32 | public float MagicModifier { get; set; }
33 | public string PassiveDisplayName { get; set; }
34 | public string PassiveHelp { get; set; }
35 | public short StatInitial { get; set; }
36 | public byte StatType1 { get; set; }
37 | public ushort StatType2 { get; set; }
38 | }
39 |
40 | private List list = new List();
41 |
42 | ///
43 | /// l=Lightning
44 | /// s=Snow
45 | /// v=Vanille
46 | /// z=Sazh
47 | /// h=Hope
48 | /// f=Fang
49 | ///
50 | ///
51 | public PassiveSet(PassiveType type, LockingLevel level = LockingLevel.Any, string characters = "lsvzhf")
52 | {
53 | this.Characters = characters;
54 | this.LockingLevel = level;
55 | this.Type = type;
56 | Passives.passives.Add(this);
57 | }
58 |
59 | public PassiveSet Add(string name, string id, float str, float mag, string dispName, string help, short statInit, byte type1, ushort type2)
60 | {
61 | list.Add(new Passive() { Name = name, ID = id, StrengthModifier = str, MagicModifier = mag, PassiveDisplayName = dispName, PassiveHelp = help, StatInitial = statInit, StatType1 = type1, StatType2 = type2 });
62 | return this;
63 | }
64 |
65 | public bool HasCharacter(string character)
66 | {
67 | for (int i = list.Count - 1; i >= 0; i--)
68 | {
69 | if (Characters.Contains(character))
70 | return true;
71 | }
72 | return false;
73 | }
74 |
75 | public string GetCharacters()
76 | {
77 | return string.Join("", list.SelectMany(a => Characters.ToCharArray()).Distinct().OrderBy(c => "lsvzhf".ToCharArray().ToList().IndexOf(c)).Select(c =>
78 | {
79 | switch (c)
80 | {
81 | case 'l':
82 | return "L";
83 | case 's':
84 | return "Sn";
85 | case 'v':
86 | return "V";
87 | case 'z':
88 | return "Sz";
89 | case 'h':
90 | return "H";
91 | case 'f':
92 | return "F";
93 | default:
94 | return "";
95 | }
96 | }));
97 | }
98 |
99 | public Passive GetPassive(string character, int tier, int tiers)
100 | {
101 | if (HasCharacter(character))
102 | {
103 | return GetPassiveDirect(tier, tiers);
104 | }
105 | throw new Exception($"{GetName(character)} cannot have the {list[0].Name} passive!");
106 | }
107 |
108 | public Passive GetPassiveDirect(int tier, int tiers)
109 | {
110 | if (tiers < list.Count)
111 | return list[list.Count - tiers + tier];
112 | else
113 | return list[Math.Min(list.Count - 1, tier)];
114 | }
115 |
116 | private Character GetName(string character)
117 | {
118 | switch (character)
119 | {
120 | case "l":
121 | return Character.Lightning;
122 | case "s":
123 | return Character.Snow;
124 | case "v":
125 | return Character.Vanille;
126 | case "z":
127 | return Character.Sazh;
128 | case "h":
129 | return Character.Hope;
130 | case "f":
131 | return Character.Fang;
132 | }
133 | return Character.Lightning;
134 | }
135 |
136 | public string[] GetIDs()
137 | {
138 | return list.Select(d => d.ID).ToArray();
139 | }
140 |
141 | public Passive[] GetPassives()
142 | {
143 | return list.ToArray();
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/Data/Shop.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Shop : Identifier
10 | {
11 | public string Name { get; set; }
12 | public int Tiers { get; set; }
13 |
14 | public Shop(string name, string id, int tiers)
15 | {
16 | this.Name = name;
17 | this.ID = id;
18 | this.Tiers = tiers;
19 | Shops.shops.Add(this);
20 | }
21 |
22 | public List GetAllIds()
23 | {
24 | return Enumerable.Range(0, Tiers).Select(i => ID + i.ToString()).ToList();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Data/Shops.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class Shops
10 | {
11 | public static List shops = new List();
12 |
13 | public static Shop bwOutfitter = new Shop("B&W Outfitters", "shop_acc_a", 9);
14 | public static Shop magicalMoments = new Shop("Magical Moments", "shop_acc_b", 5);
15 | public static Shop moogleworks = new Shop("Moogleworks", "shop_acc_c", 2);
16 | public static Shop sanctumLabs = new Shop("Sanctum Labs", "shop_acc_d", 1);
17 | public static Shop unicornMart = new Shop("Unicorn Mart", "shop_item_a", 6);
18 | public static Shop edenPharmaceuticals = new Shop("Eden Pharmaceuticals", "shop_item_b", 1);
19 | public static Shop creatureComforts = new Shop("Creature Comforts", "shop_mat_a", 4);
20 | public static Shop theMotherlode = new Shop("The Motherlode", "shop_mat_b", 4);
21 | public static Shop lenorasGarage = new Shop("Lenora's Garage", "shop_mat_c", 4);
22 | public static Shop rdDepot = new Shop("R&D Depot", "shop_mat_d", 1);
23 | public static Shop upInArms = new Shop("Up In Arms", "shop_wea_a", 3);
24 | public static Shop plautusWorkshop = new Shop("Plautus's Workshop", "shop_wea_b", 5);
25 | public static Shop gilgameshInc = new Shop("Gilgamesh, Inc.", "shop_wea_d", 1);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Data/Text/TextDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public class TextDialog
10 | {
11 | public string Text { get; set; }
12 | public string Singular { get; set; }
13 | public string Plural { get; set; }
14 |
15 | public string GetFormattedOutput(int id)
16 | {
17 | string output = "{dialog " + id;
18 |
19 | if (!String.IsNullOrWhiteSpace(Singular))
20 | output += ", singular=\"" + Singular.TrimEnd() + " \"";
21 | if (!String.IsNullOrWhiteSpace(Plural))
22 | output += ", plural=\"" + Plural.TrimEnd() + "\"";
23 | output += "}\n";
24 | output += Text + "\n";
25 | output += "{/dialog}\n\n";
26 | return output;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Data/Text/TextFile.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Text.RegularExpressions;
7 | using System.Threading.Tasks;
8 |
9 | namespace FF13Data
10 | {
11 | public class TextFile
12 | {
13 | public string Format { get; set; }
14 | public List Text { get; set; } = new List();
15 |
16 | public TextFile(string filePath)
17 | {
18 | string[] lines = File.ReadAllLines(filePath);
19 | Format = lines[0];
20 | string lineMode = "START";
21 | for (int l = 1; l < lines.Length; l++)
22 | {
23 | if (lineMode == "START")
24 | {
25 | Regex regex = new Regex("{dialog (\\d+)(?:, singular=\"([^\"]*)\")?(?:, plural=\"([^\"]*)\")?}");
26 | Match match = regex.Match(lines[l]);
27 | if (match.Success)
28 | {
29 | Text.Add(new TextDialog() { Singular = match.Groups[2].Value, Plural = match.Groups[3].Value });
30 | lineMode = "TEXT";
31 | }
32 | }
33 | else if (lineMode == "TEXT")
34 | {
35 | if (lines[l].Trim() != "{/dialog}")
36 | {
37 | if (String.IsNullOrEmpty(Text[Text.Count - 1].Text))
38 | Text[Text.Count - 1].Text = lines[l];
39 | else
40 | Text[Text.Count - 1].Text += "\n" + lines[l];
41 | }
42 | else
43 | lineMode = "START";
44 | }
45 | }
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Data/Treasure.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Data
8 | {
9 | public enum TreasureArea
10 | {
11 | TheHangingEdge,
12 | ThePulseVestige,
13 | LakeBresha,
14 | TheVilePeaks,
15 | GapraWhitewood,
16 | SunlethWaterscape,
17 | Palumpolum,
18 | Nautilus,
19 | ThePalamecia,
20 | FifthArk,
21 | VallisMedia,
22 | TheArchylteSteppe,
23 | Mahhabara,
24 | SulyyaSprings,
25 | TaejinsTower,
26 | Oerba,
27 | YaschasMassif,
28 | TheFaultwarrens,
29 | Eden,
30 | OrphansCradle,
31 | Mission,
32 | UnknownOrUnused
33 | }
34 |
35 | public class Treasure : Identifier
36 | {
37 | public string Name { get; set; }
38 | public TreasureArea Area { get; set; }
39 |
40 | public Treasure(string name, string id, TreasureArea area)
41 | {
42 | this.Name = name;
43 | this.ID = id;
44 | this.Area = area;
45 | Treasures.treasures.Add(this);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/FF13Randomizer.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 | ProjectFiles
13 |
14 |
--------------------------------------------------------------------------------
/Flags/Tweaks.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Rando;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FF13Randomizer
9 | {
10 | public class Tweaks
11 | {
12 | public static List tweaks = new List();
13 |
14 | public class Boosts
15 | {
16 | public static Flag ScaledCPCost = new Flag()
17 | {
18 | Text = "Scaled CP Cost",
19 | FlagID = "ScCPCost",
20 | DescriptionFormat = "CP Cost scales down as stage increases.\n" +
21 | "Stage 1 is 1x multiplier\n" +
22 | "Stage 5 is 0.7x multiplier\n" +
23 | "Stage 9 and 10 are 0.5x multiplier"
24 | }.Register(FlagType.Boost, true);
25 |
26 |
27 | public static Flag HalfSecondaryCPCost = new Flag()
28 | {
29 | Text = "Half Secondary CP Cost",
30 | FlagID = "HfSecCP",
31 | DescriptionFormat = "CP Cost is halved on secondary roles. Applies on top of Scaled CP Cost."
32 | }.Register(FlagType.Boost, true);
33 |
34 | public static FlagValue RunSpeedMultiplier = (FlagValue)new FlagValue(0,0,100)
35 | {
36 | Text = "Run Speed Multiplier",
37 | FlagID = "RunSpdMult",
38 | DescriptionFormat = "Increases the run speed of all characters by ${Value}%"
39 | }.Register(FlagType.Boost, true);
40 | }
41 |
42 | public class Challenges
43 | {
44 | public static FlagValue BoostLevel = (FlagValue)new FlagValue(0,0,100)
45 | {
46 | Text = "Boost Enemy Levels",
47 | FlagID = "BstLevels",
48 | DescriptionFormat = "Enemies' Levels will be effectively increased by ${Value} and affect HP, Strength, and Magic. In-game level is not changed!",
49 | }.Register(FlagType.Challenge, true);
50 |
51 | public static Flag Stats1StageBehind = new Flag()
52 | {
53 | Text = "Stats One Stage Behind",
54 | FlagID = "St1Bhnd",
55 | DescriptionFormat = "Stat node values are one stage behind\n" +
56 | "Stage 1 stat nodes are 0.\n" +
57 | "Stage 10 stat nodes are based on stage 9. So stage 10 stats are impossible."
58 | }.Register(FlagType.Challenge, true);
59 |
60 | public static Flag NoShops = new Flag()
61 | {
62 | Text = "No Shops",
63 | FlagID = "NoShop",
64 | DescriptionFormat = "All shops are empty."
65 | }.Register(FlagType.Challenge, true);
66 | }
67 |
68 | public Tweaks()
69 | {
70 | new Boosts();
71 | new Challenges();
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/InputBox.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 |
5 | namespace Utilities
6 | {
7 | public class InputBox
8 | {
9 | #region Interface
10 | public static string ShowDialog(string prompt, string title, string defaultValue = null, int? xPos = null, int? yPos = null)
11 | {
12 | InputBoxDialog form = new InputBoxDialog(prompt, title, defaultValue, xPos, yPos);
13 | DialogResult result = form.ShowDialog();
14 | if (result == DialogResult.Cancel)
15 | return null;
16 | else
17 | return form.Value;
18 | }
19 | #endregion
20 |
21 | #region Auxiliary class
22 | private class InputBoxDialog : Form
23 | {
24 | public string Value { get { return _txtInput.Text; } }
25 |
26 | private Label _lblPrompt;
27 | private TextBox _txtInput;
28 | private Button _btnOk;
29 | private Button _btnCancel;
30 |
31 | #region Constructor
32 | public InputBoxDialog(string prompt, string title, string defaultValue = null, int? xPos = null, int? yPos = null)
33 | {
34 | if (xPos == null && yPos == null)
35 | {
36 | StartPosition = FormStartPosition.CenterParent;
37 | }
38 | else
39 | {
40 | StartPosition = FormStartPosition.Manual;
41 |
42 | if (xPos == null) xPos = (Screen.PrimaryScreen.WorkingArea.Width - Width) >> 1;
43 | if (yPos == null) yPos = (Screen.PrimaryScreen.WorkingArea.Height - Height) >> 1;
44 |
45 | Location = new Point(xPos.Value, yPos.Value);
46 | }
47 |
48 | InitializeComponent();
49 |
50 | if (title == null) title = Application.ProductName;
51 | Text = title;
52 |
53 | _lblPrompt.Text = prompt;
54 | Graphics graphics = CreateGraphics();
55 | _lblPrompt.Size = graphics.MeasureString(prompt, _lblPrompt.Font).ToSize();
56 | int promptWidth = _lblPrompt.Size.Width;
57 | int promptHeight = _lblPrompt.Size.Height;
58 |
59 | _txtInput.Location = new Point(8, 30 + promptHeight);
60 | int inputWidth = promptWidth < 206 ? 206 : promptWidth;
61 | _txtInput.Size = new Size(inputWidth, 21);
62 | _txtInput.Text = defaultValue;
63 | _txtInput.SelectAll();
64 | _txtInput.Focus();
65 |
66 | Height = 125 + promptHeight;
67 | Width = inputWidth + 23;
68 |
69 | _btnOk.Location = new Point(8, 60 + promptHeight);
70 | _btnOk.Size = new Size(100, 26);
71 |
72 | _btnCancel.Location = new Point(114, 60 + promptHeight);
73 | _btnCancel.Size = new Size(100, 26);
74 |
75 | return;
76 | }
77 | #endregion
78 |
79 | #region Methods
80 | protected void InitializeComponent()
81 | {
82 | _lblPrompt = new Label();
83 | _lblPrompt.Location = new Point(12, 9);
84 | _lblPrompt.TabIndex = 0;
85 | _lblPrompt.BackColor = Color.Transparent;
86 |
87 | _txtInput = new TextBox();
88 | _txtInput.Size = new Size(156, 20);
89 | _txtInput.TabIndex = 1;
90 |
91 | _btnOk = new Button();
92 | _btnOk.TabIndex = 2;
93 | _btnOk.Size = new Size(75, 26);
94 | _btnOk.Text = "&OK";
95 | _btnOk.DialogResult = DialogResult.OK;
96 |
97 | _btnCancel = new Button();
98 | _btnCancel.TabIndex = 3;
99 | _btnCancel.Size = new Size(75, 26);
100 | _btnCancel.Text = "&Cancel";
101 | _btnCancel.DialogResult = DialogResult.Cancel;
102 |
103 | AcceptButton = _btnOk;
104 | CancelButton = _btnCancel;
105 |
106 | Controls.Add(_lblPrompt);
107 | Controls.Add(_txtInput);
108 | Controls.Add(_btnOk);
109 | Controls.Add(_btnCancel);
110 |
111 | FormBorderStyle = FormBorderStyle.FixedDialog;
112 | MaximizeBox = false;
113 | MinimizeBox = false;
114 |
115 | return;
116 | }
117 | #endregion
118 | }
119 | #endregion
120 | }
121 | }
--------------------------------------------------------------------------------
/ItemChanceForm.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Rando;
2 | using FF13Data;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Data;
7 | using System.Drawing;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace FF13Randomizer
14 | {
15 | public partial class ItemChanceForm : Form
16 | {
17 | List- blacklistedWeapons = new List
- ();
18 | public ItemChanceForm()
19 | {
20 | InitializeComponent();
21 |
22 | Items.items.ForEach(i => comboItem.Items.Add(i.Name));
23 | Items.items.ForEach(i =>
24 | {
25 | if (i.ID.StartsWith("wea_") && i.ID.EndsWith("_001"))
26 | blacklistedWeapons.Add(i);
27 | });
28 | }
29 |
30 | private void button1_Click(object sender, EventArgs e)
31 | {
32 | dataGridView1.Rows.Clear();
33 |
34 | Item item = Items.items.Where(i => i.Name == comboItem.Text).First();
35 | int rankAdj = Flags.ItemFlags.Treasures.Range.Value;
36 | if(radioEnemy.Checked)
37 | rankAdj = Flags.ItemFlags.Drops.Range.Value;
38 |
39 | Dictionary
- > table = new Dictionary
- >();
40 | // Low, High, Count
41 | RandomNum.SetRand(new Bartz24.Rando.Random());
42 | int times = 10000;
43 | for (int i = 0; i < times; i++)
44 | {
45 | Tuple
- newItem = GetItem(item, rankAdj);
46 | if (newItem != null)
47 | {
48 | if (!table.ContainsKey(newItem.Item1))
49 | {
50 | table.Add(newItem.Item1, new Tuple(newItem.Item2, newItem.Item2, 1));
51 | }
52 | else
53 | {
54 | Tuple tuple = table[newItem.Item1];
55 | int low = Math.Min(tuple.Item1, newItem.Item2);
56 | int high = Math.Max(tuple.Item2, newItem.Item2);
57 | table[newItem.Item1] = new Tuple(low, high, tuple.Item3 + 1);
58 | }
59 | }
60 | }
61 | RandomNum.ClearRand();
62 | table.Keys.ToList().ForEach(i => {
63 | dataGridView1.Rows.Add(
64 | i.Name,
65 | table[i].Item1 < table[i].Item2 ? $"{table[i].Item1} - {table[i].Item2}" : table[i].Item2.ToString(),
66 | table[i].Item3 / (float)times);
67 | });
68 | }
69 |
70 | private Tuple
- GetItem(Item item, int rankAdj)
71 | {
72 | int rank = TieredItems.manager.GetRank(item, radioEnemy.Checked ? 1 : (int)numericCount.Value);
73 | if (rank != -1)
74 | {
75 | if (rankAdj > 0)
76 | rank = RandomNum.RandInt(Math.Max(0, rank - rankAdj), Math.Min(TieredItems.manager.GetHighBound(), rank + rankAdj));
77 | int oldRank = rank + 0;
78 | Tuple
- newItem;
79 | do
80 | {
81 | newItem = TieredItems.manager.Get(rank, radioEnemy.Checked ? 1 : Int32.MaxValue, tiered => GetWeight(tiered, item));
82 | rank--;
83 | } while ((newItem.Item1 == null || blacklistedWeapons.Contains(newItem.Item1)) && rank >= 0);
84 | if (newItem.Item1 == null)
85 | return null;
86 | return newItem;
87 | }
88 | return null;
89 | }
90 |
91 | private int GetWeight(Tiered
- tiered, Item item)
92 | {
93 | if (radioTreasure.Checked)
94 | return RandoTreasure.GetTreasureWeight(tiered, false, false);
95 | else
96 | return RandoEnemies.GetDropWeight(tiered, (int)numericLevel.Value, SelectedType(), item.ID.StartsWith("it") && numericLevel.Value > 50);
97 | }
98 |
99 | private EnemyType SelectedType()
100 | {
101 | if (comboBox1.Text == "Boss")
102 | return EnemyType.Boss;
103 | if (comboBox1.Text == "Rare")
104 | return EnemyType.Rare;
105 | return EnemyType.Normal;
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/MathExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Randomizer
8 | {
9 | public class MathExtensions
10 | {
11 | // Sequence must only contain once of each value from [0, n)
12 | public static int EncodeNaturalSequence(int[] seq)
13 | {
14 | int n = seq.Length;
15 | return Enumerable.Range(0, n).Sum(i => seq[i] * (int)Math.Pow(n, i));
16 | }
17 |
18 | public static int[] DecodeNaturalSequence(int val, int n)
19 | {
20 | int[] seq = new int[n];
21 | for (int i = 0; i < n; i++)
22 | {
23 | int mod = val % (int)Math.Pow(n, i + 1);
24 | seq[i] = mod / (int)Math.Pow(n, i);
25 | val -= mod;
26 | }
27 |
28 | return seq;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/NumericRange.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Randomizer
8 | {
9 | public class NumericRange where T : IComparable
10 | {
11 | public EventHandler OnValueChanged, OnAnyValueChanged;
12 | private T val, min, max;
13 | public T MinRange
14 | {
15 | get => min;
16 | set
17 | {
18 | if (value.CompareTo(MaxRange) > 0)
19 | MaxRange = value;
20 | if (value.CompareTo(Value) > 0)
21 | Value = value;
22 | min = value;
23 | OnAnyValueChanged?.Invoke(this, null);
24 | }
25 | }
26 | public T Value {
27 | get => val;
28 | set
29 | {
30 | if (value.CompareTo(MaxRange) > 0)
31 | val = MaxRange;
32 | else if (value.CompareTo(MinRange) < 0)
33 | val = MinRange;
34 | else
35 | val = value;
36 | OnValueChanged?.Invoke(this, null);
37 | OnAnyValueChanged?.Invoke(this, null);
38 | }
39 | }
40 | public T MaxRange
41 | {
42 | get => max;
43 | set
44 | {
45 | if (value.CompareTo(MinRange) < 0)
46 | MinRange = value;
47 | if (value.CompareTo(Value) < 0)
48 | Value = value;
49 | max = value;
50 | OnAnyValueChanged?.Invoke(this, null);
51 | }
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/NumericRangeMinMAx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Randomizer
8 | {
9 | public class NumericRangeMinMax where T : IComparable
10 | {
11 | public EventHandler OnAnyValueChanged;
12 | public NumericRangeMinMax()
13 | {
14 | MinRange.OnAnyValueChanged += Any_OnValueChanged;
15 | MaxRange.OnAnyValueChanged += Any_OnValueChanged;
16 | MinRange.OnValueChanged += Min_OnValueChanged;
17 | MaxRange.OnValueChanged += Max_OnValueChanged;
18 | }
19 |
20 | private void Any_OnValueChanged(object sender, EventArgs e)
21 | {
22 | OnAnyValueChanged?.Invoke(this, null);
23 | }
24 |
25 | private void Max_OnValueChanged(object sender, EventArgs e)
26 | {
27 | if (MaxRange.Value.CompareTo(MinRange.Value) < 0)
28 | MinRange.Value = MaxRange.Value;
29 | if (MaxRange.Value.CompareTo(Value) < 0)
30 | Value = MaxRange.Value;
31 | }
32 |
33 | private void Min_OnValueChanged(object sender, EventArgs e)
34 | {
35 | if (MinRange.Value.CompareTo(MaxRange.Value) > 0)
36 | MaxRange.Value = MinRange.Value;
37 | if (MinRange.Value.CompareTo(Value) > 0)
38 | Value = MinRange.Value;
39 | }
40 |
41 | private T val;
42 | public NumericRange MinRange { get; set; } = new NumericRange();
43 | public T Value {
44 | get => val;
45 | set
46 | {
47 | if (value.CompareTo(MaxRange.Value) > 0)
48 | val = MaxRange.Value;
49 | else if (value.CompareTo(MinRange.Value) < 0)
50 | val = MinRange.Value;
51 | else
52 | val = value;
53 | MaxRange.MinRange = val;
54 | MinRange.MaxRange = val;
55 | OnAnyValueChanged?.Invoke(this, null);
56 | }
57 | }
58 | public NumericRange MaxRange { get; set; } = new NumericRange();
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Plandos/AbilityPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class AbilityPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // AbilityPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "AbilityPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/AbilityPlando.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using FF13Data;
11 | using System.IO;
12 | using System.Text.RegularExpressions;
13 | using Bartz24.Data;
14 |
15 | namespace FF13Randomizer
16 | {
17 | public partial class AbilityPlando : UserControl
18 | {
19 | public DataTable dataTable = new DataTable();
20 | public AbilityPlando()
21 | {
22 | InitializeComponent();
23 | AddEntries();
24 | }
25 | private void AddEntries()
26 | {
27 | dataTable.Columns.Add("Name", typeof(string));
28 | dataTable.Columns.Add("ATB/TP Cost", typeof(int));
29 |
30 | dataGridView1.AutoGenerateColumns = false;
31 |
32 | dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
33 | dataGridView1.Columns[0].HeaderText = "Name";
34 | dataGridView1.Columns[0].DataPropertyName = "Name";
35 | dataGridView1.Columns[0].ReadOnly = true;
36 | dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
37 |
38 | dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
39 | dataGridView1.Columns[1].HeaderText = "ATB/TP Cost (Full ATB = 6)";
40 | dataGridView1.Columns[1].DataPropertyName = "ATB/TP Cost";
41 | dataGridView1.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
42 |
43 | dataGridView1.DataSource = dataTable;
44 | }
45 |
46 | private void AddEntry(Ability ability)
47 | {
48 | dataTable.Rows.Add(ability.Name, -1);
49 | }
50 |
51 | public void ReloadData(FormMain main)
52 | {
53 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
54 | dataTable.Clear();
55 |
56 | DataStoreWDB abilities = new DataStoreWDB();
57 |
58 | abilities.LoadData(File.ReadAllBytes($"{main.RandoPath}\\original\\db\\resident\\bt_ability.wdb"));
59 |
60 | Abilities.abilities.Where(aID => abilities.IdList.IndexOf(aID.GetIDs()[0]) > -1).ForEach(a => AddEntry(a));
61 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
62 | }
63 |
64 | private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
65 | {
66 | if (e.ColumnIndex == 1)
67 | {
68 | int i = -1;
69 |
70 | if (!int.TryParse(Convert.ToString(e.FormattedValue), out i) || !(i == -1 || i >= 1 && i <= 6))
71 | {
72 | e.Cancel = true;
73 | MessageBox.Show("Must enter a number from 1-6 or -1");
74 | }
75 | }
76 | FormMain.PlandoModified = true;
77 | }
78 |
79 | public Dictionary GetAbilities()
80 | {
81 | Dictionary dict = new Dictionary();
82 | foreach (DataRow row in dataTable.Rows)
83 | {
84 | Ability ability = Abilities.abilities.Find(a => a.Name == row.Field(0));
85 | int cost = row.Field(1);
86 | if(cost > 0)
87 | {
88 | dict.Add(ability, cost);
89 | }
90 | }
91 | return dict;
92 | }
93 |
94 | public class JSONPlandoAbility
95 | {
96 | public string Name { get; set; }
97 | public int Cost { get; set; }
98 | }
99 |
100 | public List GetJSONPlando()
101 | {
102 | List list = new List();
103 |
104 | foreach (DataRow row in dataTable.Rows)
105 | {
106 | list.Add(new JSONPlandoAbility()
107 | {
108 | Name = row.Field(0),
109 | Cost = row.Field(1)
110 | });
111 | }
112 | return list;
113 | }
114 |
115 | public void LoadJSONPlando(List list, string version)
116 | {
117 | list = MigrateJSON(list, version);
118 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
119 | foreach (DataRow row in dataTable.Rows)
120 | {
121 | JSONPlandoAbility json = list.Find(j => j.Name == row.Field(0));
122 | row.SetField(1, json.Cost);
123 | }
124 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
125 | }
126 |
127 | private List MigrateJSON(List list, string version)
128 | {
129 | if (version == FormMain.Version)
130 | return list;
131 | List migrated = new List(list);
132 |
133 | if(VersionOrder.Compare(version, "1.8.0.Pre-3") == -1)
134 | {
135 | migrated.Where(j => j.Cost == 0).ForEach(j => j.Cost = -1);
136 | }
137 |
138 | return migrated;
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/Plandos/AbilityPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/CrystariumPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class CrystariumPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | this.comboBox1 = new System.Windows.Forms.ComboBox();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.comboBox2 = new System.Windows.Forms.ComboBox();
36 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
37 | this.SuspendLayout();
38 | //
39 | // dataGridView1
40 | //
41 | this.dataGridView1.AllowUserToAddRows = false;
42 | this.dataGridView1.AllowUserToDeleteRows = false;
43 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
44 | | System.Windows.Forms.AnchorStyles.Left)
45 | | System.Windows.Forms.AnchorStyles.Right)));
46 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
47 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
48 | this.dataGridView1.Location = new System.Drawing.Point(3, 30);
49 | this.dataGridView1.Name = "dataGridView1";
50 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
51 | this.dataGridView1.Size = new System.Drawing.Size(654, 586);
52 | this.dataGridView1.TabIndex = 0;
53 | this.dataGridView1.Visible = false;
54 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
55 | //
56 | // comboBox1
57 | //
58 | this.comboBox1.FormattingEnabled = true;
59 | this.comboBox1.Location = new System.Drawing.Point(57, 3);
60 | this.comboBox1.Name = "comboBox1";
61 | this.comboBox1.Size = new System.Drawing.Size(292, 21);
62 | this.comboBox1.TabIndex = 1;
63 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
64 | //
65 | // label1
66 | //
67 | this.label1.AutoSize = true;
68 | this.label1.Location = new System.Drawing.Point(3, 6);
69 | this.label1.Name = "label1";
70 | this.label1.Size = new System.Drawing.Size(53, 13);
71 | this.label1.TabIndex = 2;
72 | this.label1.Text = "Character";
73 | //
74 | // label2
75 | //
76 | this.label2.AutoSize = true;
77 | this.label2.Location = new System.Drawing.Point(355, 6);
78 | this.label2.Name = "label2";
79 | this.label2.Size = new System.Drawing.Size(29, 13);
80 | this.label2.TabIndex = 4;
81 | this.label2.Text = "Role";
82 | //
83 | // comboBox2
84 | //
85 | this.comboBox2.FormattingEnabled = true;
86 | this.comboBox2.Location = new System.Drawing.Point(390, 3);
87 | this.comboBox2.Name = "comboBox2";
88 | this.comboBox2.Size = new System.Drawing.Size(213, 21);
89 | this.comboBox2.TabIndex = 3;
90 | this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
91 | //
92 | // CrystariumPlando
93 | //
94 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
95 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
96 | this.Controls.Add(this.label2);
97 | this.Controls.Add(this.comboBox2);
98 | this.Controls.Add(this.label1);
99 | this.Controls.Add(this.comboBox1);
100 | this.Controls.Add(this.dataGridView1);
101 | this.Name = "CrystariumPlando";
102 | this.Size = new System.Drawing.Size(660, 619);
103 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
104 | this.ResumeLayout(false);
105 | this.PerformLayout();
106 |
107 | }
108 |
109 | #endregion
110 |
111 | private System.Windows.Forms.DataGridView dataGridView1;
112 | private System.Windows.Forms.ComboBox comboBox1;
113 | private System.Windows.Forms.Label label1;
114 | private System.Windows.Forms.Label label2;
115 | private System.Windows.Forms.ComboBox comboBox2;
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/Plandos/CrystariumPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/EnemyDebuffResistPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EnemyDebuffResistPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EnemyElementResistPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EnemyElementResistPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/EnemyDebuffResistPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/EnemyDropPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EnemyDropPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EnemyDropPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EnemyDropPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/EnemyDropPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/EnemyElementResistPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EnemyElementResistPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EnemyElementResistPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EnemyElementResistPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/EnemyStatsPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EnemyStatsPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EnemyStatsPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EnemyStatsPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/EnemyStatsPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/EquipPassivesPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EquipPassivesPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EquipPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EquipPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/EquipPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class EquipPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dataGridView1_CellBeginEdit);
50 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
51 | //
52 | // EquipPlando
53 | //
54 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
55 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
56 | this.Controls.Add(this.dataGridView1);
57 | this.Name = "EquipPlando";
58 | this.Size = new System.Drawing.Size(660, 619);
59 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
60 | this.ResumeLayout(false);
61 |
62 | }
63 |
64 | #endregion
65 |
66 | private System.Windows.Forms.DataGridView dataGridView1;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Plandos/EquipPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/ItemPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class ItemPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // EquipPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "EquipPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/ItemPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/PlandoFile.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Forms;
9 |
10 | namespace FF13Randomizer
11 | {
12 | public class PlandoFile
13 | {
14 | public class JSONPlandoGeneralInfo
15 | {
16 | public string Seed { get; set; }
17 | public string Flags { get; set; }
18 | public string Version { get; set; }
19 | }
20 |
21 | public static void Write(string path, FormMain main)
22 | {
23 | try
24 | {
25 | Dictionary data = new Dictionary();
26 |
27 | data.Add("general", new JSONPlandoGeneralInfo() { Flags = Flags.GetFlagString(), Seed = main.textBoxSeed.Text, Version = FormMain.Version });
28 |
29 | data.Add("crystarium", main.crystariumPlando1.GetJSONPlando());
30 | data.Add("treasures", main.treasurePlando1.GetJSONPlando());
31 | data.Add("shops", main.shopPlando1.GetJSONPlando());
32 | data.Add("shopOrder", main.shopOrderPlando1.GetJSONPlando());
33 | data.Add("abilities", main.abilityPlando1.GetJSONPlando());
34 | data.Add("enemyDrops", main.enemyDropPlando1.GetJSONPlando());
35 | data.Add("runSpeed", main.runSpeedPlando1.GetJSONPlando());
36 | data.Add("enemyStats", main.enemyStatsPlando1.GetJSONPlando());
37 | data.Add("enemyElemResists", main.enemyElementResistPlando1.GetJSONPlando());
38 | data.Add("enemyDebuffResists", main.enemyDebuffResistPlando1.GetJSONPlando());
39 | data.Add("equip", main.equipPlando1.GetJSONPlando());
40 | data.Add("equipPassives", main.equipPassivesPlando1.GetJSONPlando());
41 | data.Add("items", main.itemPlando1.GetJSONPlando());
42 |
43 | File.WriteAllText(path, JsonConvert.SerializeObject(data));
44 | }
45 | catch (Exception e)
46 | {
47 | MessageBox.Show("Failed to export plando data: " + e.Message);
48 | }
49 | }
50 | public static void Read(string path, FormMain main)
51 | {
52 | try
53 | {
54 | Dictionary data = JsonConvert.DeserializeObject>(File.ReadAllText(path));
55 |
56 | JSONPlandoGeneralInfo general = JsonConvert.DeserializeObject(data["general"].ToString());
57 | if (FormMain.Version != general.Version)
58 | MessageBox.Show($"This plando is version {general.Version} which may be incompatible with this version of rando. If it recent enough, it will be migrated to work in the current version.");
59 | Flags.Import(general.Flags, false);
60 | main.textBoxSeed.Text = general.Seed;
61 |
62 | LoadPlando(data, "crystarium", l => main.crystariumPlando1.LoadJSONPlando(l, general.Version), () => main.crystariumPlando1.ReloadData(main));
63 | LoadPlando(data, "treasures", l => main.treasurePlando1.LoadJSONPlando(l, general.Version), () => main.treasurePlando1.ReloadData(main));
64 | LoadPlando(data, "shops", l => main.shopPlando1.LoadJSONPlando(l, general.Version), () => main.shopPlando1.ReloadData(main));
65 | LoadPlando(data, "shopOrder", l => main.shopOrderPlando1.LoadJSONPlando(l, general.Version), () => main.shopOrderPlando1.ReloadData(main));
66 | LoadPlando(data, "abilities", l => main.abilityPlando1.LoadJSONPlando(l, general.Version), () => main.abilityPlando1.ReloadData(main));
67 | LoadPlando(data, "enemyDrops", l => main.enemyDropPlando1.LoadJSONPlando(l, general.Version), () => main.enemyDropPlando1.ReloadData(main));
68 | LoadPlando(data, "runSpeed", l => main.runSpeedPlando1.LoadJSONPlando(l, general.Version), () => main.runSpeedPlando1.ReloadData(main));
69 | LoadPlando(data, "enemyStats", l => main.enemyStatsPlando1.LoadJSONPlando(l, general.Version), () => main.enemyStatsPlando1.ReloadData(main));
70 | LoadPlando(data, "enemyElemResists", l => main.enemyElementResistPlando1.LoadJSONPlando(l, general.Version), () => main.enemyElementResistPlando1.ReloadData(main));
71 | LoadPlando(data, "enemyDebuffResists", l => main.enemyDebuffResistPlando1.LoadJSONPlando(l, general.Version), () => main.enemyDebuffResistPlando1.ReloadData(main));
72 | LoadPlando(data, "equip", l => main.equipPlando1.LoadJSONPlando(l, general.Version), () => main.equipPlando1.ReloadData(main));
73 | LoadPlando(data, "equipPassives", l => main.equipPassivesPlando1.LoadJSONPlando(l, general.Version), () => main.equipPassivesPlando1.ReloadData(main));
74 | LoadPlando(data, "items", l => main.itemPlando1.LoadJSONPlando(l, general.Version), () => main.itemPlando1.ReloadData(main));
75 | }
76 | catch (Exception e)
77 | {
78 | MessageBox.Show("Failed to import plando data: " + e.Message);
79 | }
80 | }
81 |
82 | private static void LoadPlando(Dictionary data, string id, Action
> success, Action failed)
83 | {
84 | if (data.ContainsKey(id))
85 | success.Invoke(JsonConvert.DeserializeObject>(data[id].ToString()));
86 | else
87 | failed.Invoke();
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/Plandos/RunSpeedPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class RunSpeedPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // RunSpeedPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "RunSpeedPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/RunSpeedPlando.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using FF13Data;
11 | using System.IO;
12 | using System.Text.RegularExpressions;
13 | using Bartz24.Data;
14 |
15 | namespace FF13Randomizer
16 | {
17 | public partial class RunSpeedPlando : UserControl
18 | {
19 | public DataTable dataTable = new DataTable();
20 | public RunSpeedPlando()
21 | {
22 | InitializeComponent();
23 | AddEntries();
24 | }
25 | private void AddEntries()
26 | {
27 | dataTable.Columns.Add("Name", typeof(string));
28 | dataTable.Columns.Add("Run Speed", typeof(int));
29 |
30 | dataGridView1.AutoGenerateColumns = false;
31 |
32 | dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
33 | dataGridView1.Columns[0].HeaderText = "Name";
34 | dataGridView1.Columns[0].DataPropertyName = "Name";
35 | dataGridView1.Columns[0].ReadOnly = true;
36 | dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
37 |
38 | dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
39 | dataGridView1.Columns[1].HeaderText = "Run Speed";
40 | dataGridView1.Columns[1].DataPropertyName = "Run Speed";
41 | dataGridView1.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
42 |
43 | dataGridView1.DataSource = dataTable;
44 | }
45 |
46 | private void AddEntry(Character character, int runSpeed)
47 | {
48 | dataTable.Rows.Add($"{character} (Default: {runSpeed})", -1);
49 | }
50 |
51 | public void ReloadData(FormMain main)
52 | {
53 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
54 | dataTable.Clear();
55 |
56 | DataStoreWDB characters = new DataStoreWDB();
57 | characters.LoadData(File.ReadAllBytes($"{main.RandoPath}\\original\\db\\resident\\charafamily.wdb"));
58 |
59 | ((Character[])Enum.GetValues(typeof(Character))).ForEach(c => AddEntry(c, characters[RandoRunSpeed.GetID(c)].RunSpeed));
60 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
61 | }
62 |
63 | private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
64 | {
65 | if (e.ColumnIndex == 1)
66 | {
67 | int i = -1;
68 |
69 | if (!int.TryParse(Convert.ToString(e.FormattedValue), out i) || !(i == -1 || i >= 1 && i <= 255))
70 | {
71 | e.Cancel = true;
72 | MessageBox.Show("Must enter a number from 1-255 or -1");
73 | }
74 | }
75 | FormMain.PlandoModified = true;
76 | }
77 |
78 | public Dictionary GetRunSpeeds()
79 | {
80 | Dictionary dict = new Dictionary();
81 | foreach (DataRow row in dataTable.Rows)
82 | {
83 | Character character = ((Character[])Enum.GetValues(typeof(Character)))[Enum.GetNames(typeof(Character)).ToList().FindIndex(n => row.Field(0).StartsWith(n))];
84 | int speed = row.Field(1);
85 | if(speed > 0)
86 | {
87 | dict.Add(character, speed);
88 | }
89 | }
90 | return dict;
91 | }
92 |
93 | public class JSONPlandoRunSpeed
94 | {
95 | public string Name { get; set; }
96 | public int Speed { get; set; }
97 | }
98 |
99 | public List GetJSONPlando()
100 | {
101 | List list = new List();
102 |
103 | foreach (DataRow row in dataTable.Rows)
104 | {
105 | list.Add(new JSONPlandoRunSpeed()
106 | {
107 | Name = row.Field(0),
108 | Speed = row.Field(1)
109 | });
110 | }
111 | return list;
112 | }
113 |
114 | public void LoadJSONPlando(List list, string version)
115 | {
116 | list = MigrateJSON(list, version);
117 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
118 | foreach (DataRow row in dataTable.Rows)
119 | {
120 | JSONPlandoRunSpeed json = list.Find(j => j.Name == row.Field(0));
121 | row.SetField(1, json.Speed);
122 | }
123 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
124 | }
125 |
126 | private List MigrateJSON(List list, string version)
127 | {
128 | if (version == FormMain.Version)
129 | return list;
130 | List migrated = new List(list);
131 |
132 | return migrated;
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/Plandos/RunSpeedPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/ShopOrderPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class ShopOrderPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
33 | this.SuspendLayout();
34 | //
35 | // dataGridView1
36 | //
37 | this.dataGridView1.AllowUserToAddRows = false;
38 | this.dataGridView1.AllowUserToDeleteRows = false;
39 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
40 | | System.Windows.Forms.AnchorStyles.Left)
41 | | System.Windows.Forms.AnchorStyles.Right)));
42 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
43 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
44 | this.dataGridView1.Location = new System.Drawing.Point(3, 3);
45 | this.dataGridView1.Name = "dataGridView1";
46 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
47 | this.dataGridView1.Size = new System.Drawing.Size(654, 613);
48 | this.dataGridView1.TabIndex = 0;
49 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
50 | //
51 | // ShopOrderPlando
52 | //
53 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
54 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
55 | this.Controls.Add(this.dataGridView1);
56 | this.Name = "ShopOrderPlando";
57 | this.Size = new System.Drawing.Size(660, 619);
58 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
59 | this.ResumeLayout(false);
60 |
61 | }
62 |
63 | #endregion
64 |
65 | private System.Windows.Forms.DataGridView dataGridView1;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Plandos/ShopOrderPlando.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Drawing;
5 | using System.Data;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using FF13Data;
11 | using System.IO;
12 | using System.Text.RegularExpressions;
13 |
14 | namespace FF13Randomizer
15 | {
16 | public partial class ShopOrderPlando : UserControl
17 | {
18 | public DataTable dataTable = new DataTable();
19 | public ShopOrderPlando()
20 | {
21 | InitializeComponent();
22 | AddEntries();
23 | }
24 | private void AddEntries()
25 | {
26 | dataTable.Columns.Add("id", typeof(string));
27 | dataTable.Columns.Add("Original Shop", typeof(string));
28 | dataTable.Columns.Add("New Shop", typeof(string));
29 |
30 | dataGridView1.AutoGenerateColumns = false;
31 |
32 | dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
33 | dataGridView1.Columns[0].HeaderText = "Original Shop";
34 | dataGridView1.Columns[0].DataPropertyName = "Original Shop";
35 | dataGridView1.Columns[0].ReadOnly = true;
36 | dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
37 |
38 | DataGridViewComboBoxColumn column = new DataGridViewComboBoxColumn();
39 | column.Items.AddRange(new string[] { "???" }.Concat(Items.items.Where(i=>i.ID.StartsWith("key_shop")).Select(i => i.Name).ToList()).ToArray());
40 | column.HeaderText = "New Shop";
41 | column.DisplayMember = "New Shop";
42 | column.ValueMember = "New Shop";
43 | column.DataPropertyName = "New Shop";
44 | column.SortMode = DataGridViewColumnSortMode.NotSortable;
45 | dataGridView1.Columns.Add(column);
46 |
47 | dataGridView1.DataSource = dataTable;
48 | }
49 |
50 | private void AddRowEntries()
51 | {
52 | for (int i = 1; i <= 13; i++)
53 | {
54 | string id = "key_shop_" + i.ToString("00");
55 | if (i == 4)
56 | continue;
57 | dataTable.Rows.Add(id, Items.items.Find(item => item.ID == id).Name, "???");
58 | }
59 | }
60 |
61 | public void ReloadData(FormMain main)
62 | {
63 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
64 | dataTable.Clear();
65 |
66 | AddRowEntries();
67 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
68 | }
69 |
70 | public Dictionary- GetShopReplacements()
71 | {
72 | Dictionary
- dict = new Dictionary
- ();
73 | foreach (DataRow row in dataTable.Rows)
74 | {
75 | Item origShop = Items.items.Find(i => i.ID == row.Field(0));
76 | Item newShop = Items.items.Find(i => i.Name == row.Field(2) || i.ID == row.Field(2));
77 | if (newShop != null)
78 | {
79 | dict.Add(origShop, newShop);
80 | }
81 | }
82 | return dict;
83 | }
84 |
85 | private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
86 | {
87 | FormMain.PlandoModified = true;
88 | }
89 |
90 | public class JSONPlandoShopOrder
91 | {
92 | public string ShopID { get; set; }
93 | public string NewShop { get; set; }
94 | }
95 |
96 | public List GetJSONPlando()
97 | {
98 | List list = new List();
99 |
100 | foreach (DataRow row in dataTable.Rows)
101 | {
102 | list.Add(new JSONPlandoShopOrder()
103 | {
104 | ShopID = row.Field(0),
105 | NewShop = row.Field(2)
106 | });
107 | }
108 | return list;
109 | }
110 |
111 | public void LoadJSONPlando(List list, string version)
112 | {
113 | list = MigrateJSON(list, version);
114 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
115 | foreach (DataRow row in dataTable.Rows)
116 | {
117 | JSONPlandoShopOrder json = list.Find(j => j.ShopID == row.Field(0));
118 | row.SetField(2, json.NewShop);
119 | }
120 | dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
121 | }
122 |
123 | private List MigrateJSON(List list, string version)
124 | {
125 | if (version == FormMain.Version)
126 | return list;
127 | List migrated = new List(list);
128 |
129 | return migrated;
130 | }
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/Plandos/ShopOrderPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/ShopPlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class ShopPlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | this.comboBox1 = new System.Windows.Forms.ComboBox();
33 | this.label1 = new System.Windows.Forms.Label();
34 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
35 | this.SuspendLayout();
36 | //
37 | // dataGridView1
38 | //
39 | this.dataGridView1.AllowUserToAddRows = false;
40 | this.dataGridView1.AllowUserToDeleteRows = false;
41 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
42 | | System.Windows.Forms.AnchorStyles.Left)
43 | | System.Windows.Forms.AnchorStyles.Right)));
44 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
45 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
46 | this.dataGridView1.Location = new System.Drawing.Point(3, 30);
47 | this.dataGridView1.Name = "dataGridView1";
48 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
49 | this.dataGridView1.Size = new System.Drawing.Size(654, 586);
50 | this.dataGridView1.TabIndex = 0;
51 | this.dataGridView1.Visible = false;
52 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
53 | //
54 | // comboBox1
55 | //
56 | this.comboBox1.FormattingEnabled = true;
57 | this.comboBox1.Location = new System.Drawing.Point(57, 3);
58 | this.comboBox1.Name = "comboBox1";
59 | this.comboBox1.Size = new System.Drawing.Size(292, 21);
60 | this.comboBox1.TabIndex = 1;
61 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
62 | //
63 | // label1
64 | //
65 | this.label1.AutoSize = true;
66 | this.label1.Location = new System.Drawing.Point(3, 6);
67 | this.label1.Name = "label1";
68 | this.label1.Size = new System.Drawing.Size(32, 13);
69 | this.label1.TabIndex = 2;
70 | this.label1.Text = "Shop";
71 | //
72 | // ShopPlando
73 | //
74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
76 | this.Controls.Add(this.label1);
77 | this.Controls.Add(this.comboBox1);
78 | this.Controls.Add(this.dataGridView1);
79 | this.Name = "ShopPlando";
80 | this.Size = new System.Drawing.Size(660, 619);
81 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
82 | this.ResumeLayout(false);
83 | this.PerformLayout();
84 |
85 | }
86 |
87 | #endregion
88 |
89 | private System.Windows.Forms.DataGridView dataGridView1;
90 | private System.Windows.Forms.ComboBox comboBox1;
91 | private System.Windows.Forms.Label label1;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Plandos/ShopPlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Plandos/TreasurePlando.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class TreasurePlando
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
32 | this.comboBox1 = new System.Windows.Forms.ComboBox();
33 | this.label1 = new System.Windows.Forms.Label();
34 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
35 | this.SuspendLayout();
36 | //
37 | // dataGridView1
38 | //
39 | this.dataGridView1.AllowUserToAddRows = false;
40 | this.dataGridView1.AllowUserToDeleteRows = false;
41 | this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
42 | | System.Windows.Forms.AnchorStyles.Left)
43 | | System.Windows.Forms.AnchorStyles.Right)));
44 | this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
45 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
46 | this.dataGridView1.Location = new System.Drawing.Point(3, 30);
47 | this.dataGridView1.Name = "dataGridView1";
48 | this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
49 | this.dataGridView1.Size = new System.Drawing.Size(654, 586);
50 | this.dataGridView1.TabIndex = 0;
51 | this.dataGridView1.Visible = false;
52 | this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
53 | //
54 | // comboBox1
55 | //
56 | this.comboBox1.FormattingEnabled = true;
57 | this.comboBox1.Location = new System.Drawing.Point(57, 3);
58 | this.comboBox1.Name = "comboBox1";
59 | this.comboBox1.Size = new System.Drawing.Size(292, 21);
60 | this.comboBox1.TabIndex = 1;
61 | this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
62 | //
63 | // label1
64 | //
65 | this.label1.AutoSize = true;
66 | this.label1.Location = new System.Drawing.Point(3, 6);
67 | this.label1.Name = "label1";
68 | this.label1.Size = new System.Drawing.Size(48, 13);
69 | this.label1.TabIndex = 2;
70 | this.label1.Text = "Location";
71 | //
72 | // TreasurePlando
73 | //
74 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
75 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
76 | this.Controls.Add(this.label1);
77 | this.Controls.Add(this.comboBox1);
78 | this.Controls.Add(this.dataGridView1);
79 | this.Name = "TreasurePlando";
80 | this.Size = new System.Drawing.Size(660, 619);
81 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
82 | this.ResumeLayout(false);
83 | this.PerformLayout();
84 |
85 | }
86 |
87 | #endregion
88 |
89 | private System.Windows.Forms.DataGridView dataGridView1;
90 | private System.Windows.Forms.ComboBox comboBox1;
91 | private System.Windows.Forms.Label label1;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Plandos/TreasurePlando.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace FF13Randomizer
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new FormMain());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ProgressForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FF13Randomizer
2 | {
3 | partial class ProgressForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
34 | this.SuspendLayout();
35 | //
36 | // progressBar1
37 | //
38 | this.progressBar1.Location = new System.Drawing.Point(12, 55);
39 | this.progressBar1.Name = "progressBar1";
40 | this.progressBar1.Size = new System.Drawing.Size(360, 23);
41 | this.progressBar1.TabIndex = 0;
42 | //
43 | // label1
44 | //
45 | this.label1.AutoSize = true;
46 | this.label1.Location = new System.Drawing.Point(12, 39);
47 | this.label1.Name = "label1";
48 | this.label1.Size = new System.Drawing.Size(63, 13);
49 | this.label1.TabIndex = 1;
50 | this.label1.Text = "Extracting...";
51 | //
52 | // backgroundWorker1
53 | //
54 | this.backgroundWorker1.WorkerReportsProgress = true;
55 | this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
56 | this.backgroundWorker1.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.backgroundWorker1_ProgressChanged);
57 | this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
58 | //
59 | // ProgressForm
60 | //
61 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
62 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
63 | this.ClientSize = new System.Drawing.Size(384, 121);
64 | this.Controls.Add(this.label1);
65 | this.Controls.Add(this.progressBar1);
66 | this.MaximumSize = new System.Drawing.Size(400, 160);
67 | this.MinimumSize = new System.Drawing.Size(400, 160);
68 | this.Name = "ProgressForm";
69 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
70 | this.Text = "Progress";
71 | this.TopMost = true;
72 | this.ResumeLayout(false);
73 | this.PerformLayout();
74 |
75 | }
76 |
77 | #endregion
78 |
79 | private System.Windows.Forms.ProgressBar progressBar1;
80 | private System.Windows.Forms.Label label1;
81 | private System.ComponentModel.BackgroundWorker backgroundWorker1;
82 | }
83 | }
--------------------------------------------------------------------------------
/ProgressForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace FF13Randomizer
12 | {
13 | public partial class ProgressForm : Form
14 | {
15 | Action action;
16 | public ProgressForm(string text, Action action)
17 | {
18 | InitializeComponent();
19 | this.Activate();
20 | this.ControlBox = false;
21 | this.Text = "";
22 | this.action = action;
23 |
24 | label1.Text = text;
25 |
26 | progressBar1.Maximum = 100;
27 | progressBar1.Step = 1;
28 | progressBar1.Value = 0;
29 | backgroundWorker1.RunWorkerAsync();
30 | }
31 |
32 | private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
33 | {
34 | action.Invoke(backgroundWorker1);
35 | }
36 |
37 | private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
38 | {
39 | progressBar1.Value = e.ProgressPercentage;
40 | }
41 |
42 | private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
43 | {
44 | if (e.Error != null)
45 | throw new Exception("Randomizer Error", e.Error);
46 | this.Close();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Randomizers/RandoAbilities.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using Bartz24.Rando;
3 | using FF13Data;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.ComponentModel;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace FF13Randomizer
14 | {
15 | public class RandoAbilities : Randomizer
16 | {
17 | DataStoreWDB abilities;
18 | FormMain main;
19 |
20 | public RandoAbilities(FormMain formMain, RandomizerManager randomizers) : base(randomizers) { main = formMain; }
21 |
22 | public override string GetProgressMessage()
23 | {
24 | return "Randomizing Abilities...";
25 | }
26 | public override string GetID()
27 | {
28 | return "Abilities";
29 | }
30 |
31 | public override void Load()
32 | {
33 | abilities = new DataStoreWDB();
34 | abilities.LoadData(File.ReadAllBytes($"{main.RandoPath}\\original\\db\\resident\\bt_ability.wdb"));
35 | }
36 | public override void Randomize(BackgroundWorker backgroundWorker)
37 | {
38 | Dictionary plando = main.abilityPlando1.GetAbilities();
39 | RandomizeATBCosts(plando);
40 | backgroundWorker.ReportProgress(90);
41 | RandomizeTPCosts(plando);
42 | backgroundWorker.ReportProgress(100);
43 | }
44 |
45 | private void RandomizeATBCosts(Dictionary plando)
46 | {
47 | if (Flags.AbilityFlags.ATBCost)
48 | {
49 | int variance = Flags.AbilityFlags.ATBCost.Range.Value;
50 | Flags.AbilityFlags.ATBCost.SetRand();
51 |
52 | RandoCrystarium crystarium = randomizers.Get("Crystarium");
53 | List startingAbilityNodes = crystarium.crystariums.Values.SelectMany(c => c.DataList).Where(node => node.CPCost == 0 && node.Type == CrystariumType.Ability).Select(node => node.AbilityName).ToList();
54 |
55 | Abilities.abilities.Where(a => a.Role != Role.None).ForEach(aID =>
56 | {
57 |
58 | if (abilities.IdList.IndexOf(aID.GetIDs()[0]) > -1)
59 | {
60 | int max = aID.GetIDs().Where(id => startingAbilityNodes.Contains(id)).Count() > 0 ? 3 : 6;
61 | if (aID == Abilities.Attack || aID == Abilities.HandGrenade)
62 | max = 2;
63 | int cost = plando.ContainsKey(aID) ? (plando[aID] * 10) : abilities[aID.GetIDs()[0]].ATBCost;
64 | if (cost > 0 && cost < 0xFFFF)
65 | {
66 | if (!plando.ContainsKey(aID))
67 | cost = RandomNum.RandInt(Math.Max(1, cost / 10 - variance), Math.Min(max, cost / 10 + variance)) * 10;
68 | if (cost == 60)
69 | cost = 0xFFFF;
70 | aID.GetIDs().ForEach(id =>
71 | {
72 | if (abilities.IdList.IndexOf(id) > -1)
73 | {
74 | abilities[id].ATBCost = (ushort)cost;
75 | }
76 | });
77 | }
78 | }
79 |
80 | });
81 |
82 | RandomNum.ClearRand();
83 | }
84 | }
85 | private void RandomizeTPCosts(Dictionary plando)
86 | {
87 | if (Flags.AbilityFlags.TPCost)
88 | {
89 | int variance = Flags.AbilityFlags.TPCost.Range.Value;
90 | Flags.AbilityFlags.TPCost.SetRand();
91 |
92 | Abilities.abilities.Where(a => a.Role == Role.None).ForEach(aID =>
93 | {
94 | if (abilities.IdList.IndexOf(aID.GetIDs()[0]) > -1)
95 | {
96 | int max = 5;
97 | int cost = plando.ContainsKey(aID) ? (plando[aID] * 10) : abilities[aID.GetIDs()[0]].ATBCost;
98 | if (!plando.ContainsKey(aID))
99 | cost = RandomNum.RandInt(Math.Max(1, cost / 10 - variance), Math.Min(max, cost / 10 + variance)) * 10;
100 |
101 | aID.GetIDs().ForEach(id =>
102 | {
103 | if (abilities.IdList.IndexOf(id) > -1)
104 | {
105 | abilities[id].ATBCost = (ushort)cost;
106 | }
107 | });
108 | }
109 | });
110 | RandomNum.ClearRand();
111 | }
112 | }
113 |
114 | public override void Save()
115 | {
116 | File.WriteAllBytes("db\\resident\\bt_ability.wdb", abilities.Data);
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/Randomizers/RandoRunSpeed.cs:
--------------------------------------------------------------------------------
1 | using Bartz24.Data;
2 | using Bartz24.Rando;
3 | using FF13Data;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.ComponentModel;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace FF13Randomizer
14 | {
15 | public class RandoRunSpeed : Randomizer
16 | {
17 | DataStoreWDB characters;
18 | FormMain main;
19 |
20 | public RandoRunSpeed(FormMain formMain, RandomizerManager randomizers) : base(randomizers) { main = formMain; }
21 |
22 | public override string GetProgressMessage()
23 | {
24 | return "Randomizing Run Speed...";
25 | }
26 | public override string GetID()
27 | {
28 | return "Run Speed";
29 | }
30 |
31 | public override void Load()
32 | {
33 | characters = new DataStoreWDB();
34 | characters.LoadData(File.ReadAllBytes($"{main.RandoPath}\\original\\db\\resident\\charafamily.wdb"));
35 | }
36 | public override void Randomize(BackgroundWorker backgroundWorker)
37 | {
38 | Dictionary plando = main.runSpeedPlando1.GetRunSpeeds();
39 | if (Flags.Other.RunSpeed)
40 | {
41 | Flags.Other.RunSpeed.SetRand();
42 | StatValues runSpeeds = new StatValues(6);
43 |
44 | Tuple[] bounds = runSpeeds.GetVarianceBounds(Flags.Other.RunSpeed.Range.Value);
45 | for (int i = 0; i < 6; i++)
46 | {
47 | if (plando.ContainsKey((Character)i))
48 | {
49 | bounds[i] = new Tuple(plando[(Character)i] * 100 / 0x60, plando[(Character)i] * 100 / 0x60);
50 | characters[GetID((Character)i)].RunSpeed = (byte)plando[(Character)i];
51 | }
52 | }
53 |
54 | runSpeeds.Randomize(bounds, bounds.Where(b => b.Item1 != b.Item2).Count() * Flags.Other.RunSpeed.Range.Value);
55 | for(int i = 0; i < 6; i++)
56 | {
57 | if (!plando.ContainsKey((Character)i))
58 | characters[GetID((Character)i)].RunSpeed = (byte)Math.Round(0x60 * runSpeeds[i] / 100f);
59 | }
60 | RandomNum.ClearRand();
61 | }
62 |
63 | if (Tweaks.Boosts.RunSpeedMultiplier)
64 | {
65 | for (int i = 0; i < 6; i++)
66 | {
67 | if (!Flags.Other.RunSpeed || !plando.ContainsKey((Character)i))
68 | characters[GetID((Character)i)].RunSpeed = (byte)Math.Round(characters[GetID((Character)i)].RunSpeed * (100 + Tweaks.Boosts.RunSpeedMultiplier.Range.Value) / 100f);
69 | }
70 | }
71 | }
72 |
73 | public static string GetID(Character character)
74 | {
75 | switch (character)
76 | {
77 | case Character.Lightning:
78 | return "fam_pc_light";
79 | case Character.Snow:
80 | return "fam_pc_snow";
81 | case Character.Vanille:
82 | return "fam_pc_vanira";
83 | case Character.Sazh:
84 | return "fam_pc_sazz";
85 | case Character.Hope:
86 | return "fam_pc_hope";
87 | case Character.Fang:
88 | return "fam_pc_fang";
89 | default:
90 | return "";
91 | }
92 | }
93 |
94 | public override void Save()
95 | {
96 | File.WriteAllBytes("db\\resident\\charafamily.wdb", characters.Data);
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/VersionOrder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FF13Randomizer
8 | {
9 | public class VersionOrder
10 | {
11 | private static List VersionHistory = new List() {
12 | "1.8.0.Pre",
13 | "1.8.0.Pre-2",
14 | "1.8.0.Pre-3",
15 | "1.8.0",
16 | "1.8.1",
17 | "1.8.2",
18 | "1.8.3",
19 | "1.8.4",
20 | "1.9.0.Pre",
21 | "1.9.0.Pre-2",
22 | "1.9.0.Pre-3",
23 | "1.9.0.Pre-4",
24 | "1.9.0.Pre-5",
25 | "1.9.0.Pre-6",
26 | "1.9.0.Pre-7",
27 | "1.9.0.Pre-8",
28 | FormMain.Version
29 | };
30 |
31 | public static int Compare(string a, string b)
32 | {
33 | return VersionHistory.IndexOf(a).CompareTo(VersionHistory.IndexOf(b));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------