fix: Removes PoolOfAcid (#1310)
## BREAKING CHANGES You will receive a deserialization error saying cannot find type PoolOfAcid. This is ok, just hit yes to delete all.
This commit is contained in:
parent
801f139568
commit
e855ca1e61
5 changed files with 24 additions and 22 deletions
|
|
@ -36,6 +36,7 @@ public class BufferReader : IGenericReader
|
|||
private int _position;
|
||||
|
||||
public long Position => _position;
|
||||
public long BufferSize => _buffer.Length;
|
||||
|
||||
public BufferReader(byte[] buffer, Dictionary<ulong, string> typesDb = null, Encoding encoding = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ namespace Server.Mobiles
|
|||
}
|
||||
|
||||
public override Item NewHarmfulItem() =>
|
||||
new PoolOfAcid(TimeSpan.FromSeconds(10), 25, 30)
|
||||
new Acid(TimeSpan.FromSeconds(10), 25, 30)
|
||||
{
|
||||
Name = "gooey nasty pumpkin hummus",
|
||||
Hue = 144
|
||||
|
|
|
|||
|
|
@ -1,26 +1,31 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
using Server.Collections;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
[ManualDirtyChecking]
|
||||
[TypeAlias("Server.Items.AcidSlime")]
|
||||
public class PoolOfAcid : Item
|
||||
[SerializationGenerator(0)]
|
||||
public partial class Acid : Item
|
||||
{
|
||||
private readonly TimeSpan _duration;
|
||||
private readonly int _maxDamage;
|
||||
private readonly int _minDamage;
|
||||
private TimeSpan _duration;
|
||||
private int _maxDamage;
|
||||
private int _minDamage;
|
||||
private TimerExecutionToken _timerToken;
|
||||
private bool _drying;
|
||||
|
||||
[Constructible]
|
||||
public PoolOfAcid() : this(TimeSpan.FromSeconds(10.0), 2, 5)
|
||||
public Acid() : this(TimeSpan.FromSeconds(10.0), 2, 5)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public PoolOfAcid(TimeSpan duration, int minDamage, int maxDamage) : base(0x122A)
|
||||
public Acid(TimeSpan duration, int minDamage, int maxDamage) : this(duration, TimeSpan.FromSeconds(1), minDamage, maxDamage)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Acid(TimeSpan duration, TimeSpan tickRate, int minDamage, int maxDamage) : base(0x122A)
|
||||
{
|
||||
Hue = 0x3F;
|
||||
Movable = false;
|
||||
|
|
@ -29,11 +34,7 @@ public class PoolOfAcid : Item
|
|||
_maxDamage = maxDamage;
|
||||
_duration = duration;
|
||||
|
||||
Timer.StartTimer(TimeSpan.Zero, TimeSpan.FromSeconds(1), OnTick, out _timerToken);
|
||||
}
|
||||
|
||||
public PoolOfAcid(Serial serial) : base(serial)
|
||||
{
|
||||
Timer.StartTimer(TimeSpan.Zero, tickRate, OnTick, out _timerToken);
|
||||
}
|
||||
|
||||
public override string DefaultName => "a pool of acid";
|
||||
|
|
@ -54,6 +55,7 @@ public class PoolOfAcid : Item
|
|||
return;
|
||||
}
|
||||
|
||||
// Dries half way through duration
|
||||
if (!_drying && age > _duration - age)
|
||||
{
|
||||
_drying = true;
|
||||
|
|
@ -64,7 +66,8 @@ public class PoolOfAcid : Item
|
|||
|
||||
foreach (var m in GetMobilesInRange(0))
|
||||
{
|
||||
if (m.Alive && !m.IsDeadBondedPet && (m is not BaseCreature bc || bc.Controlled || bc.Summoned))
|
||||
if (m.AccessLevel == AccessLevel.Player &&
|
||||
m.Alive && !m.IsDeadBondedPet && (m is not BaseCreature bc || bc.Controlled || bc.Summoned))
|
||||
{
|
||||
queue.Enqueue(m);
|
||||
}
|
||||
|
|
@ -87,11 +90,9 @@ public class PoolOfAcid : Item
|
|||
m.Damage(Utility.RandomMinMax(_minDamage, _maxDamage));
|
||||
}
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Deserialize(IGenericReader reader)
|
||||
[AfterDeserialization(false)]
|
||||
private void AfterDeserialization()
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
|
@ -4072,7 +4072,7 @@ namespace Server.Mobiles
|
|||
kappa+acidslime, grizzles+whatever, etc.
|
||||
*/
|
||||
|
||||
public virtual Item NewHarmfulItem() => new PoolOfAcid(TimeSpan.FromSeconds(10), 30, 30);
|
||||
public virtual Item NewHarmfulItem() => new Acid(TimeSpan.FromSeconds(10), 30, 30);
|
||||
|
||||
public virtual void StopFlee()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace Server.Mobiles
|
|||
base.OnDamage(amount, from, willKill);
|
||||
}
|
||||
|
||||
public override Item NewHarmfulItem() => new PoolOfAcid(TimeSpan.FromSeconds(10), 5, 10)
|
||||
public override Item NewHarmfulItem() => new Acid(TimeSpan.FromSeconds(10), 5, 10)
|
||||
{
|
||||
Name = "slime"
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue