fix: Codegens potions and fixes a few minor bugs (#1347)

This commit is contained in:
Kamron Batman 2023-02-24 18:06:59 -08:00 • committed by GitHub
parent 42bcf3c95a
commit 8c4aaeeda6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 1644 additions and 2095 deletions

View file

@ -1,44 +1,28 @@
namespace Server.Items
using ModernUO.Serialization;
namespace Server.Items;
[SerializationGenerator(0, false)]
public partial class LesserCurePotion : BaseCurePotion
{
public class LesserCurePotion : BaseCurePotion
private static readonly CureLevelInfo[] _oldLevelInfo =
{
private static readonly CureLevelInfo[] m_OldLevelInfo =
{
new(Poison.Lesser, 0.75), // 75% chance to cure lesser poison
new(Poison.Regular, 0.50), // 50% chance to cure regular poison
new(Poison.Greater, 0.15) // 15% chance to cure greater poison
};
new(Poison.Lesser, 0.75), // 75% chance to cure lesser poison
new(Poison.Regular, 0.50), // 50% chance to cure regular poison
new(Poison.Greater, 0.15) // 15% chance to cure greater poison
};
private static readonly CureLevelInfo[] m_AosLevelInfo =
{
new(Poison.Lesser, 0.75),
new(Poison.Regular, 0.50),
new(Poison.Greater, 0.25)
};
private static readonly CureLevelInfo[] _aosLevelInfo =
{
new(Poison.Lesser, 0.75),
new(Poison.Regular, 0.50),
new(Poison.Greater, 0.25)
};
[Constructible]
public LesserCurePotion() : base(PotionEffect.CureLesser)
{
}
public LesserCurePotion(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();
}
[Constructible]
public LesserCurePotion() : base(PotionEffect.CureLesser)
{
}
public override CureLevelInfo[] LevelInfo => Core.AOS ? _aosLevelInfo : _oldLevelInfo;
}