Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

Commit 61a3554

Browse files
committed
Synced with game version 1.049
1 parent ec16c1e commit 61a3554

6 files changed

Lines changed: 59 additions & 18 deletions

File tree

ChasmDeserializer/JSONConverters/ItemConverter.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
3434
var ID = o.TryGetValue("ID", StringComparison.OrdinalIgnoreCase, out x) ? (string)x : string.Empty;
3535
var Count = o.TryGetValue("Count", StringComparison.OrdinalIgnoreCase, out x) ? (int)x : 0;
3636
var Experience = o.TryGetValue("Experience", StringComparison.OrdinalIgnoreCase, out x) ? (int)x : 0;
37-
var tier = o.TryGetValue("UnlockTier", StringComparison.OrdinalIgnoreCase, out x) ? (int)x : 0;
38-
var UnlockTier = (UnlockTier)tier;
37+
var tier = o.TryGetValue("Rarity", StringComparison.OrdinalIgnoreCase, out x)
38+
? (int)x
39+
: o.TryGetValue("UnlockTier", StringComparison.OrdinalIgnoreCase, out x)
40+
? (int)x
41+
: 0;
42+
var Rarity = (ItemRarity)tier;
3943
if (o.Count > 4)
4044
{
4145
if (String.Equals(ID, "sword_assassins", StringComparison.OrdinalIgnoreCase))
4246
{
43-
var aItem = new AssassinsSword() { ID = ID, Count = Count, Experience = Experience, UnlockTier = UnlockTier };
47+
var aItem = new AssassinsSword() { ID = ID, Count = Count, Experience = Experience, Rarity = Rarity };
4448
JToken a;
4549
var CurrentKills = o.TryGetValue("CurrentKills", StringComparison.OrdinalIgnoreCase, out a) ? (int)x : 0;
4650
var Level = o.TryGetValue("Level", StringComparison.OrdinalIgnoreCase, out a) ? (int)x : 0;
@@ -50,7 +54,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
5054
}
5155
else if (familiars.Contains(ID, StringComparer.OrdinalIgnoreCase))
5256
{
53-
var fItem = new FamiliarItem() { ID = ID, Count = Count, Experience = Experience, UnlockTier = UnlockTier };
57+
var fItem = new FamiliarItem() { ID = ID, Count = Count, Experience = Experience, Rarity = Rarity };
5458
JToken f;
5559
var Position = o.TryGetValue("Position", StringComparison.OrdinalIgnoreCase, out f) ? JsonConvert.DeserializeObject<Vector2>(f.ToString(), new XNAVector2Converter()) : default(Vector2);
5660
var LVL = o.TryGetValue("LVL", StringComparison.OrdinalIgnoreCase, out f) ? (int)f : 0;
@@ -63,7 +67,7 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
6367
return fItem;
6468
}
6569
}
66-
return new Item() { ID = ID, Count = Count, Experience = Experience, UnlockTier = UnlockTier };
70+
return new Item() { ID = ID, Count = Count, Experience = Experience, Rarity = Rarity };
6771
}
6872
}
6973
}

ChasmDeserializer/Model/Enums.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,12 @@ public enum GameMode
159159
Normal,
160160
Arcade
161161
}
162-
public enum UnlockTier
163-
{
164-
None,
165-
Tier1,
166-
Tier2,
167-
Tier3
168-
}
162+
public enum ItemRarity
163+
{
164+
Common,
165+
Unique,
166+
Legendary
167+
}
169168
public enum ClassMode
170169
{
171170
Off,

ChasmDeserializer/Model/SaveGameData/Item.cs

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@ public class Item
1212
public string ID;
1313
public int Count;
1414
public int Experience;
15-
public UnlockTier UnlockTier;
15+
public ItemRarity Rarity;
16+
public int Mod_CON;
17+
public int Mod_HP;
18+
public int Mod_INT;
19+
public int Mod_LCK;
20+
public int Mod_MP;
21+
public int Mod_STR;
1622

23+
[JsonIgnore]
24+
private bool UncommonRarity => Rarity > ItemRarity.Common;
1725
[JsonIgnore]
1826
private static readonly string[] familiars = { "head_birdhat", "head_birdhat_blue", "head_swordhat" };
1927

@@ -32,7 +40,16 @@ public static Item Load(BinaryReader reader, float saveVersion)
3240
: item;
3341
item.ID = id;
3442
item.Count = reader.ReadInt32();
35-
item.UnlockTier = (UnlockTier)reader.ReadInt32();
43+
item.Rarity = (ItemRarity)reader.ReadInt32();
44+
if (item.Rarity > ItemRarity.Common)
45+
{
46+
item.Mod_CON = reader.ReadInt32();
47+
item.Mod_HP = reader.ReadInt32();
48+
item.Mod_INT = reader.ReadInt32();
49+
item.Mod_LCK = reader.ReadInt32();
50+
item.Mod_MP = reader.ReadInt32();
51+
item.Mod_STR = reader.ReadInt32();
52+
}
3653
if (saveVersion >= 1.76f)
3754
{
3855
item.Experience = reader.ReadInt32();
@@ -50,11 +67,28 @@ public virtual void Save(BinaryWriter writer)
5067
}
5168
writer.Write(ID);
5269
writer.Write(Count);
53-
writer.Write((int)UnlockTier);
70+
writer.Write((int)Rarity);
71+
if (this.Rarity > ItemRarity.Common)
72+
{
73+
writer.Write(this.Mod_CON);
74+
writer.Write(this.Mod_HP);
75+
writer.Write(this.Mod_INT);
76+
writer.Write(this.Mod_LCK);
77+
writer.Write(this.Mod_MP);
78+
writer.Write(this.Mod_STR);
79+
}
5480
writer.Write(Experience);
5581
}
5682

57-
public virtual void LoadCustom(BinaryReader reader){}
83+
public virtual void LoadCustom(BinaryReader reader) {}
84+
85+
public bool ShouldSerializeMod_CON() => UncommonRarity;
86+
public bool ShouldSerializeMod_HP() => UncommonRarity;
87+
public bool ShouldSerializeMod_INT() => UncommonRarity;
88+
public bool ShouldSerializeMod_LCK() => UncommonRarity;
89+
public bool ShouldSerializeMod_MP() => UncommonRarity;
90+
public bool ShouldSerializeMod_STR() => UncommonRarity;
91+
5892
}
5993

6094
public class AssassinsSword : Item

ChasmDeserializer/Model/SaveGameData/WorldSaveState.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class WorldSaveState : IBinarySaveLoad
3737
public OverWorldSaveState OverWorldSaveState;
3838
public string GameBuildVersion;
3939
public ClassMode ClassMode;
40+
4041
[JsonIgnore]
4142
private byte[] OverWorldSaveStateBytes;
4243

ChasmDeserializer/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace ChasmDeserializer
2020
public class Program
2121
{
2222
// No, I'm not using NDesk or Mono.Options, bite me.
23-
private const string version = "\nCurrent version: v0.6 (22 Dec 2018) KZ";
24-
private const string gameVer = "\nSupported game version: v1.040 (from 11 Nov 2018)";
23+
private const string version = "\nCurrent version: v0.61 (02 Jan 2019) KZ";
24+
private const string gameVer = "\nSupported game version: v1.049 (from 01 Jan 2019)";
2525
private const string helpMsg =
2626
"\nUSAGE:\n" +
2727
"ChasmDes.exe [action] [type] [inputFile] <outputFile>\n" +

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ TYPES:
2727
```
2828

2929
# CHANGELOG
30+
Jan 02/19 v0.61
31+
- Added support for latest patch 1.049 as of 01.01.2019
32+
3033
Dec 22/18 v0.6
3134
- Added support for latest patch 1.042 as of 22.12.2018
3235
- Backwards compatibility for UserStats in Userinfo.cfg

0 commit comments

Comments
 (0)