From 9b6aa1deed1c6990bbaa758050ee7450f7b621df Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:27:42 -0800 Subject: [PATCH] fix: Fixes missed codegen for potions (#1359) --- .../Potions/Cure Potions/GreaterCurePotion.cs | 31 +++++-------------- .../Poison Potions/BasePoisonPotion.cs | 4 --- .../Strength Potions/StrengthPotion.cs | 4 --- .../Server.Items.GreaterCurePotion.v0.json | 4 +++ 4 files changed, 12 insertions(+), 31 deletions(-) create mode 100644 Projects/UOContent/Migrations/Server.Items.GreaterCurePotion.v0.json diff --git a/Projects/UOContent/Items/Skill Items/Magical/Potions/Cure Potions/GreaterCurePotion.cs b/Projects/UOContent/Items/Skill Items/Magical/Potions/Cure Potions/GreaterCurePotion.cs index 4130f5b30..a8ba51696 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Potions/Cure Potions/GreaterCurePotion.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Potions/Cure Potions/GreaterCurePotion.cs @@ -1,8 +1,11 @@ +using ModernUO.Serialization; + namespace Server.Items; -public class GreaterCurePotion : BaseCurePotion +[SerializationGenerator(0, false)] +public partial class GreaterCurePotion : BaseCurePotion { - private static readonly CureLevelInfo[] m_OldLevelInfo = + private static readonly CureLevelInfo[] _oldLevelInfo = { new(Poison.Lesser, 1.00), // 100% chance to cure lesser poison new(Poison.Regular, 1.00), // 100% chance to cure regular poison @@ -11,7 +14,7 @@ public class GreaterCurePotion : BaseCurePotion new(Poison.Lethal, 0.25) // 25% chance to cure lethal poison }; - private static readonly CureLevelInfo[] m_AosLevelInfo = + private static readonly CureLevelInfo[] _aosLevelInfo = { new(Poison.Lesser, 1.00), new(Poison.Regular, 1.00), @@ -25,23 +28,5 @@ public class GreaterCurePotion : BaseCurePotion { } - public GreaterCurePotion(Serial serial) : base(serial) - { - } - - public override CureLevelInfo[] LevelInfo => Core.AOS ? m_AosLevelInfo : m_OldLevelInfo; - - public override void Serialize(IGenericWriter writer) - { - base.Serialize(writer); - - writer.Write(0); // version - } - - public override void Deserialize(IGenericReader reader) - { - base.Deserialize(reader); - - var version = reader.ReadInt(); - } -} \ No newline at end of file + public override CureLevelInfo[] LevelInfo => Core.AOS ? _aosLevelInfo : _oldLevelInfo; +} diff --git a/Projects/UOContent/Items/Skill Items/Magical/Potions/Poison Potions/BasePoisonPotion.cs b/Projects/UOContent/Items/Skill Items/Magical/Potions/Poison Potions/BasePoisonPotion.cs index 8c5275b00..1fddd3791 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Potions/Poison Potions/BasePoisonPotion.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Potions/Poison Potions/BasePoisonPotion.cs @@ -10,10 +10,6 @@ public abstract partial class BasePoisonPotion : BasePotion { } - public BasePoisonPotion(Serial serial) : base(serial) - { - } - public abstract Poison Poison { get; } public abstract double MinPoisoningSkill { get; } diff --git a/Projects/UOContent/Items/Skill Items/Magical/Potions/Strength Potions/StrengthPotion.cs b/Projects/UOContent/Items/Skill Items/Magical/Potions/Strength Potions/StrengthPotion.cs index 833a0b5d0..dca7c1b94 100644 --- a/Projects/UOContent/Items/Skill Items/Magical/Potions/Strength Potions/StrengthPotion.cs +++ b/Projects/UOContent/Items/Skill Items/Magical/Potions/Strength Potions/StrengthPotion.cs @@ -11,10 +11,6 @@ public partial class StrengthPotion : BaseStrengthPotion { } - public StrengthPotion(Serial serial) : base(serial) - { - } - public override int StrOffset => 10; public override TimeSpan Duration => TimeSpan.FromMinutes(2.0); } diff --git a/Projects/UOContent/Migrations/Server.Items.GreaterCurePotion.v0.json b/Projects/UOContent/Migrations/Server.Items.GreaterCurePotion.v0.json new file mode 100644 index 000000000..c079035fd --- /dev/null +++ b/Projects/UOContent/Migrations/Server.Items.GreaterCurePotion.v0.json @@ -0,0 +1,4 @@ +{ + "version": 0, + "type": "Server.Items.GreaterCurePotion" +} \ No newline at end of file