fix: Streamlines potion drink effect (#1851)

This commit is contained in:
Kamron Batman 2024-07-03 16:29:05 -07:00 committed by GitHub
parent d40041d631
commit cbaa349a87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 2 additions and 44 deletions

View file

@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
namespace Server.Items;
@ -34,11 +33,6 @@ public abstract partial class BaseAgilityPotion : BasePotion
if (DoAgility(from))
{
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}
}

View file

@ -174,7 +174,7 @@ public abstract partial class BasePotion : Item, ICraftable, ICommodity
public abstract void Drink(Mobile from);
public static void PlayDrinkEffect(Mobile m)
public void PlayDrinkEffect(Mobile m)
{
m.RevealingAction();
@ -182,6 +182,7 @@ public abstract partial class BasePotion : Item, ICraftable, ICommodity
if (!DuelContext.IsFreeConsume(m))
{
Consume();
m.AddToBackpack(new Bottle());
}

View file

@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
using Server.Spells.Necromancy;
@ -71,11 +70,6 @@ public abstract partial class BaseCurePotion : BasePotion
from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
from.PlaySound(0x1E0);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{

View file

@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
namespace Server.Items;
@ -50,11 +49,6 @@ public abstract partial class BaseHealPotion : BasePotion
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
Timer.StartTimer(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
}
}

View file

@ -28,7 +28,6 @@ public partial class InvisibilityPotion : BasePotion
return;
}
Consume();
Timer.StartTimer(TimeSpan.FromSeconds(2), () => Hide(from), out var timerToken);
m_Table[from] = timerToken;
PlayDrinkEffect(from);

View file

@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
namespace Server.Items;
@ -22,11 +21,6 @@ public partial class NightSightPotion : BasePotion
from.PlaySound(0x1E3);
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{

View file

@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
namespace Server.Items;
@ -25,10 +24,5 @@ public abstract partial class BasePoisonPotion : BasePotion
DoPoison(from);
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}

View file

@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
namespace Server.Items;
@ -19,11 +18,6 @@ public abstract partial class BaseRefreshPotion : BasePotion
from.Stam += Scale(from, (int)(Refresh * from.StamMax));
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{

View file

@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
namespace Server.Items;
@ -34,11 +33,6 @@ public abstract partial class BaseStrengthPotion : BasePotion
if (DoStrength(from))
{
PlayDrinkEffect(from);
if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}
}