Skip to content

Commit

Permalink
Add support for SamabakeScramble (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco authored Aug 30, 2024
1 parent 0b1ae3e commit b875069
Show file tree
Hide file tree
Showing 19 changed files with 396 additions and 148 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using MessagePack;

namespace KKManager.Data.Cards.AI
namespace KKManager.Data.Cards
{
[MessagePackObject(true)]
public class BlockHeader
Expand Down
15 changes: 13 additions & 2 deletions src/KKManager.Core/Data/Cards/CardLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using KKManager.Data.Cards.KK;
using KKManager.Data.Cards.KKS;
using KKManager.Data.Cards.RG;
using KKManager.Data.Cards.SVS;
using KKManager.Data.Plugins;
using KKManager.Data.Zipmods;
using KKManager.Util;
Expand Down Expand Up @@ -159,9 +160,7 @@ public static Card ParseCard(FileInfo file)
{
var loadProductNo = reader.ReadInt32();
//if (loadProductNo > 100)
//{
// return null;
//}

var marker = reader.ReadString();
var gameType = GetGameType(marker, true);
Expand Down Expand Up @@ -195,13 +194,18 @@ public static Card ParseCard(FileInfo file)
card = HoneyCoomCard.ParseHCPChara(file, reader, gameType);
break;

case CardType.SamabakeScramble:
card = SamabakeCard.ParseSvsChara(file, reader, gameType);
break;

case CardType.KoikatuClothes:
card = KoiCoordCard.ParseKoiClothes(file, reader, gameType);
break;
case CardType.AiSyoujyoClothes:
card = AiCoordCard.ParseAiClothes(file, reader, gameType);
break;

case CardType.SamabakeScrambleClothes:
case CardType.Unknown:
default:
throw new ArgumentOutOfRangeException($"GameType={gameType} is not supported");
Expand Down Expand Up @@ -256,13 +260,20 @@ private static CardType GetGameType(string marker, bool throwOnUnknown)
return CardType.HoneyCome;
case "【HCPChara】":
return CardType.HoneyComeccp;
case "【SVChara】":
return CardType.SamabakeScramble;

// todo differnt format, saved at very end of data
//case "【KStudio】":
// return CardType.KoikatuStudio;

case "【KoiKatuClothes】":
return CardType.KoikatuClothes;
case "【AIS_Clothes】":
return CardType.AiSyoujyoClothes;
case "【SVClothes】":
return CardType.SamabakeScrambleClothes;

default:
if (throwOnUnknown)
throw new ArgumentOutOfRangeException($"Unknown game tag: {PathTools.SanitizeFileName(marker.Left(20))}");
Expand Down
2 changes: 2 additions & 0 deletions src/KKManager.Core/Data/Cards/CardType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public enum CardType
RoomGirl,
HoneyCome,
HoneyComeccp,
SamabakeScramble,
KoikatuClothes,
AiSyoujyoClothes,
SamabakeScrambleClothes,
}
}
28 changes: 0 additions & 28 deletions src/KKManager.Core/Data/Cards/EC/BlockHeader.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/KKManager.Core/Data/Cards/HC/BlockHeader.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/KKManager.Core/Data/Cards/KK/BlockHeader.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/KKManager.Core/Data/Cards/KKS/BlockHeader.cs

This file was deleted.

25 changes: 0 additions & 25 deletions src/KKManager.Core/Data/Cards/RG/BlockHeader.cs

This file was deleted.

22 changes: 22 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/About.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.ComponentModel;
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class About
{
[IgnoreMember] public static readonly string BlockName = "About";
[IgnoreMember] public static readonly Version CurrentVersion = new Version("0.0.0");
public Version version { get; set; }

public string dataID { get; set; }

public int language { get; set; }

public string userID { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/ChaFileExtended.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
public class ChaFileExtended
{
[IgnoreMember] public static readonly string BlockName = "KKEx";
}
}
20 changes: 20 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/GameInfo_SV.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GameInfo_SV
{
[IgnoreMember] public static readonly string BlockName = "GameInfo_SV";
[IgnoreMember] public static readonly Version CurrentVersion = new Version("0.0.0");

public Version version { get; set; }

// TODO Empty class? Check contents once metadata is available
}
}
51 changes: 51 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/GameParameter_SV.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System;
using System.ComponentModel;
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class GameParameter_SV
{
[IgnoreMember] public static readonly string BlockName = "GameParameter_SV";
[IgnoreMember] public static readonly Version CurrentVersion = new Version("0.0.0");
public Version version { get; set; }

[Browsable(false)] public byte[] imageData { get; set; } // Profile picture

public int job { get; set; }
public int sexualTarget { get; set; }
public int lvChastity { get; set; }
public int lvSociability { get; set; }
public int lvTalk { get; set; }
public int lvStudy { get; set; }
public int lvLiving { get; set; }
public int lvPhysical { get; set; }
public int lvDefeat { get; set; }
public int[] belongings { get; set; }
public bool isVirgin { get; set; }
public bool isAnalVirgin { get; set; }
public bool isMaleVirgin { get; set; }
public bool isMaleAnalVirgin { get; set; }
public Individuality individuality { get; set; }
public PreferenceH preferenceH { get; set; }

[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Individuality
{
public int[] answer { get; set; }
}

[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class PreferenceH
{
public int[] answer { get; set; }
}
}
}
22 changes: 22 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/Graphic.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.ComponentModel;
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Graphic
{
[IgnoreMember] public static readonly string BlockName = "Graphic";
[IgnoreMember] public static readonly Version CurrentVersion = new Version("0.0.0");
public Version version { get; set; }

public int RampID { get; set; }

public float ShadowDepth { get; set; }

public float LineWidth { get; set; }
}
}
27 changes: 27 additions & 0 deletions src/KKManager.Core/Data/Cards/SVS/Parameter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.ComponentModel;
using MessagePack;

namespace KKManager.Data.Cards.SVS
{
[MessagePackObject(true)]
[ReadOnly(true)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Parameter
{
[IgnoreMember] public static readonly string BlockName = "Parameter";
[IgnoreMember] public static readonly Version CurrentVersion = new Version("0.0.0");
[IgnoreMember] public string fullname => lastname + " " + firstname;
public byte birthDay { get; set; }
public byte birthMonth { get; set; }
public byte bloodType { get; set; }
public string firstname { get; set; }
public bool isFutanari { get; set; }
public string lastname { get; set; }
public int personality { get; set; }
public byte sex { get; set; }
public Version version { get; set; }
public float voicePitch { get; set; }
public float voiceRate { get; set; }
}
}
Loading

0 comments on commit b875069

Please sign in to comment.