fix: Codegens potions and fixes a few minor bugs (#1347)
This commit is contained in:
parent
42bcf3c95a
commit
8c4aaeeda6
76 changed files with 1644 additions and 2095 deletions
|
|
@ -1,51 +1,38 @@
|
|||
using ModernUO.Serialization;
|
||||
using Server.Engines.ConPVP;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BasePoisonPotion : BasePotion
|
||||
{
|
||||
public abstract class BasePoisonPotion : BasePotion
|
||||
public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect)
|
||||
{
|
||||
public BasePoisonPotion(PotionEffect effect) : base(0xF0A, effect)
|
||||
}
|
||||
|
||||
public BasePoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract Poison Poison { get; }
|
||||
|
||||
public abstract double MinPoisoningSkill { get; }
|
||||
public abstract double MaxPoisoningSkill { get; }
|
||||
|
||||
public void DoPoison(Mobile from)
|
||||
{
|
||||
from.ApplyPoison(from, Poison);
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
DoPoison(from);
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
}
|
||||
|
||||
public BasePoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public abstract Poison Poison { get; }
|
||||
|
||||
public abstract double MinPoisoningSkill { get; }
|
||||
public abstract double MaxPoisoningSkill { get; }
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public void DoPoison(Mobile from)
|
||||
{
|
||||
from.ApplyPoison(from, Poison);
|
||||
}
|
||||
|
||||
public override void Drink(Mobile from)
|
||||
{
|
||||
DoPoison(from);
|
||||
|
||||
PlayDrinkEffect(from);
|
||||
|
||||
if (!DuelContext.IsFreeConsume(from))
|
||||
{
|
||||
Consume();
|
||||
}
|
||||
Consume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class DarkglowPotion : BasePoisonPotion
|
||||
{
|
||||
[Constructible]
|
||||
public DarkglowPotion() : base(PotionEffect.Darkglow) => Hue = 0x96;
|
||||
|
||||
/* public override Poison Poison => Poison.DarkGlow; // MUST be restored when prerequisites are done */
|
||||
public override Poison Poison => Poison.Greater;
|
||||
|
||||
public override double MinPoisoningSkill => 95.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
|
||||
public override int LabelNumber => 1072849; // Darkglow Poison
|
||||
}
|
||||
|
|
@ -1,33 +1,17 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class DeadlyPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public class DeadlyPoisonPotion : BasePoisonPotion
|
||||
[Constructible]
|
||||
public DeadlyPoisonPotion() : base(PotionEffect.PoisonDeadly)
|
||||
{
|
||||
[Constructible]
|
||||
public DeadlyPoisonPotion() : base(PotionEffect.PoisonDeadly)
|
||||
{
|
||||
}
|
||||
|
||||
public DeadlyPoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Deadly;
|
||||
|
||||
public override double MinPoisoningSkill => 95.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Deadly;
|
||||
|
||||
public override double MinPoisoningSkill => 95.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,17 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class GreaterPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public class GreaterPoisonPotion : BasePoisonPotion
|
||||
[Constructible]
|
||||
public GreaterPoisonPotion() : base(PotionEffect.PoisonGreater)
|
||||
{
|
||||
[Constructible]
|
||||
public GreaterPoisonPotion() : base(PotionEffect.PoisonGreater)
|
||||
{
|
||||
}
|
||||
|
||||
public GreaterPoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Greater;
|
||||
|
||||
public override double MinPoisoningSkill => 60.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Greater;
|
||||
|
||||
public override double MinPoisoningSkill => 60.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,17 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class LesserPoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public class LesserPoisonPotion : BasePoisonPotion
|
||||
[Constructible]
|
||||
public LesserPoisonPotion() : base(PotionEffect.PoisonLesser)
|
||||
{
|
||||
[Constructible]
|
||||
public LesserPoisonPotion() : base(PotionEffect.PoisonLesser)
|
||||
{
|
||||
}
|
||||
|
||||
public LesserPoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Lesser;
|
||||
|
||||
public override double MinPoisoningSkill => 0.0;
|
||||
public override double MaxPoisoningSkill => 60.0;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Lesser;
|
||||
|
||||
public override double MinPoisoningSkill => 0.0;
|
||||
public override double MaxPoisoningSkill => 60.0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class ParasiticPotion : BasePoisonPotion
|
||||
{
|
||||
[Constructible]
|
||||
public ParasiticPotion() : base(PotionEffect.Parasitic) => Hue = 0x17C;
|
||||
|
||||
/* public override Poison Poison => Poison.Parasitic; // MUST be restored when prerequisites are done */
|
||||
public override Poison Poison => Poison.Greater;
|
||||
|
||||
public override double MinPoisoningSkill => 95.0;
|
||||
public override double MaxPoisoningSkill => 100.0;
|
||||
}
|
||||
|
|
@ -1,33 +1,17 @@
|
|||
namespace Server.Items
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class PoisonPotion : BasePoisonPotion
|
||||
{
|
||||
public class PoisonPotion : BasePoisonPotion
|
||||
[Constructible]
|
||||
public PoisonPotion() : base(PotionEffect.Poison)
|
||||
{
|
||||
[Constructible]
|
||||
public PoisonPotion() : base(PotionEffect.Poison)
|
||||
{
|
||||
}
|
||||
|
||||
public PoisonPotion(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Regular;
|
||||
|
||||
public override double MinPoisoningSkill => 30.0;
|
||||
public override double MaxPoisoningSkill => 70.0;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public override Poison Poison => Poison.Regular;
|
||||
|
||||
public override double MinPoisoningSkill => 30.0;
|
||||
public override double MaxPoisoningSkill => 70.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue