From 914492570e5f339435d7f1515021788fb9bd7b3a Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 20 Jan 2023 21:50:56 +0100 Subject: [PATCH] feat(data): add skill cost, item vnum, dash, upgrade --- .../Infos/ISkillInfo.cs | 29 +++++++++++++++++-- .../NosSmooth.Data.Abstractions.csproj | 4 +-- .../NosSmooth.Data.Database/Data/SkillInfo.cs | 15 ++++++++++ .../DatabaseMigrator.cs | 8 ++++- .../NosSmooth.Data.Database.csproj | 4 +-- .../NosSmooth.Data.NOSFiles.csproj | 4 +-- .../Parsers/SkillParser.cs | 16 ++++++++-- 7 files changed, 69 insertions(+), 11 deletions(-) diff --git a/Data/NosSmooth.Data.Abstractions/Infos/ISkillInfo.cs b/Data/NosSmooth.Data.Abstractions/Infos/ISkillInfo.cs index 35235ab..78bb9ae 100644 --- a/Data/NosSmooth.Data.Abstractions/Infos/ISkillInfo.cs +++ b/Data/NosSmooth.Data.Abstractions/Infos/ISkillInfo.cs @@ -52,7 +52,7 @@ public interface ISkillInfo : IVNumInfo /// /// Gets whether the skill uses secondary weapon, primary weapon is used if false. /// - public bool UsesSecondaryWeapon { get; } + bool UsesSecondaryWeapon { get; } /// /// Gets the mana points the skill cast costs. @@ -77,5 +77,30 @@ public interface ISkillInfo : IVNumInfo /// /// Gets the element of the skill. /// - public Element Element { get; } + Element Element { get; } + + /// + /// Gets the cost of the skill. + /// + int SpecialCost { get; } + + /// + /// Gets the upgrade skill. + /// + short Upgrade { get; } + + /// + /// Gets the upgrade type (morph). + /// + short MorphOrUpgrade { get; } + + /// + /// Gets the speed of the dash. + /// + short DashSpeed { get; } + + /// + /// Gets vnum of an item that is consumed by the skill. + /// + int ItemVNum { get; } } \ No newline at end of file diff --git a/Data/NosSmooth.Data.Abstractions/NosSmooth.Data.Abstractions.csproj b/Data/NosSmooth.Data.Abstractions/NosSmooth.Data.Abstractions.csproj index da6a62f..ca0a01f 100644 --- a/Data/NosSmooth.Data.Abstractions/NosSmooth.Data.Abstractions.csproj +++ b/Data/NosSmooth.Data.Abstractions/NosSmooth.Data.Abstractions.csproj @@ -7,9 +7,9 @@ 10 https://github.com/Rutherther/NosSmooth/ MIT - 2.2.0 + 2.2.1 net7.0 - Add new skill information: uses secondary weapon, attack type, element + Add skill morph, special cost, upgrade, dash speed, item vnum. diff --git a/Data/NosSmooth.Data.Database/Data/SkillInfo.cs b/Data/NosSmooth.Data.Database/Data/SkillInfo.cs index b9b9a60..92852a7 100644 --- a/Data/NosSmooth.Data.Database/Data/SkillInfo.cs +++ b/Data/NosSmooth.Data.Database/Data/SkillInfo.cs @@ -59,6 +59,21 @@ public class SkillInfo : ISkillInfo /// public Element Element { get; set; } + /// + public int SpecialCost { get; set; } + + /// + public short Upgrade { get; set; } + + /// + public short MorphOrUpgrade { get; set; } + + /// + public short DashSpeed { get; set; } + + /// + public int ItemVNum { get; set; } + /// public bool UsesSecondaryWeapon { get; set; } diff --git a/Data/NosSmooth.Data.Database/DatabaseMigrator.cs b/Data/NosSmooth.Data.Database/DatabaseMigrator.cs index 44f6c5d..20dd4e6 100644 --- a/Data/NosSmooth.Data.Database/DatabaseMigrator.cs +++ b/Data/NosSmooth.Data.Database/DatabaseMigrator.cs @@ -144,7 +144,13 @@ public class DatabaseMigrator ZoneRange = skill.ZoneRange, AttackType = skill.AttackType, Element = skill.Element, - UsesSecondaryWeapon = skill.UsesSecondaryWeapon + UsesSecondaryWeapon = skill.UsesSecondaryWeapon, + DashSpeed = skill.DashSpeed, + ItemVNum = skill.ItemVNum, + MorphOrUpgrade = skill.MorphOrUpgrade, + Name = skill.Name, + SpecialCost = skill.SpecialCost, + Upgrade = skill.Upgrade }; dbContext.Add(skillInfo); } diff --git a/Data/NosSmooth.Data.Database/NosSmooth.Data.Database.csproj b/Data/NosSmooth.Data.Database/NosSmooth.Data.Database.csproj index 578b972..4238333 100644 --- a/Data/NosSmooth.Data.Database/NosSmooth.Data.Database.csproj +++ b/Data/NosSmooth.Data.Database/NosSmooth.Data.Database.csproj @@ -7,9 +7,9 @@ 10 https://github.com/Rutherther/NosSmooth/ MIT - 2.1.0 + 2.1.1 net7.0 - Add new skill fields. + Add skill morph, special cost, upgrade, dash speed, item vnum. diff --git a/Data/NosSmooth.Data.NOSFiles/NosSmooth.Data.NOSFiles.csproj b/Data/NosSmooth.Data.NOSFiles/NosSmooth.Data.NOSFiles.csproj index 68e02be..2acf978 100644 --- a/Data/NosSmooth.Data.NOSFiles/NosSmooth.Data.NOSFiles.csproj +++ b/Data/NosSmooth.Data.NOSFiles/NosSmooth.Data.NOSFiles.csproj @@ -7,8 +7,8 @@ 10 https://github.com/Rutherther/NosSmooth/ MIT - 2.2.1 - Add new skill fields. + 2.2.2 + Add skill morph, special cost, upgrade, dash speed, item vnum. net7.0 diff --git a/Data/NosSmooth.Data.NOSFiles/Parsers/SkillParser.cs b/Data/NosSmooth.Data.NOSFiles/Parsers/SkillParser.cs index 07a0acf..76de4ee 100644 --- a/Data/NosSmooth.Data.NOSFiles/Parsers/SkillParser.cs +++ b/Data/NosSmooth.Data.NOSFiles/Parsers/SkillParser.cs @@ -34,9 +34,11 @@ public class SkillParser : IInfoParser var typeEntry = item.GetEntry("TYPE"); var targetEntry = item.GetEntry("TARGET"); var dataEntry = item.GetEntry("DATA"); + var costEntry = item.GetEntry("COST"); var vnum = item.GetEntry("VNUM").Read(1); var nameKey = item.GetEntry("NAME").Read(1); + result.Add ( vnum, @@ -55,7 +57,12 @@ public class SkillParser : IInfoParser typeEntry.Read(2), (TargetType)targetEntry.Read(1), (HitType)targetEntry.Read(2), - (Element)typeEntry.Read(6) + (Element)typeEntry.Read(6), + costEntry.Read(1), + dataEntry.Read(1), + dataEntry.Read(2), + dataEntry.Read(10), + dataEntry.Read(11) ) ); } @@ -78,6 +85,11 @@ public class SkillParser : IInfoParser short CastId, TargetType TargetType, HitType HitType, - Element Element + Element Element, + int SpecialCost, + short Upgrade, + short MorphOrUpgrade, + short DashSpeed, + int ItemVNum ) : ISkillInfo; } \ No newline at end of file -- 2.49.0