Skip to content

Commit

Permalink
fix: Streamlines potion drink effect (#1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman authored Jul 3, 2024
1 parent d40041d commit cbaa349
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;

namespace Server.Items;
Expand Down Expand Up @@ -34,11 +33,6 @@ public override void Drink(Mobile from)
if (DoAgility(from))
{
PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ private void Deserialize(IGenericReader reader, int version)

public abstract void Drink(Mobile from);

public static void PlayDrinkEffect(Mobile m)
public void PlayDrinkEffect(Mobile m)
{
m.RevealingAction();

m.PlaySound(0x2D6);

if (!DuelContext.IsFreeConsume(m))
{
Consume();
m.AddToBackpack(new Bottle());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;
using Server.Spells.Necromancy;

Expand Down Expand Up @@ -71,11 +70,6 @@ public override void Drink(Mobile from)

from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist);
from.PlaySound(0x1E0);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;

namespace Server.Items;

Expand Down Expand Up @@ -50,11 +49,6 @@ public override void Drink(Mobile from)

PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}

Timer.StartTimer(TimeSpan.FromSeconds(Delay), from.EndAction<BaseHealPotion>);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public override void Drink(Mobile from)
return;
}

Consume();
Timer.StartTimer(TimeSpan.FromSeconds(2), () => Hide(from), out var timerToken);
m_Table[from] = timerToken;
PlayDrinkEffect(from);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;

namespace Server.Items;

Expand All @@ -22,11 +21,6 @@ public override void Drink(Mobile from)
from.PlaySound(0x1E3);

PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;

namespace Server.Items;

Check notice on line 3 in Projects/UOContent/Items/Skill Items/Magical/Potions/Poison Potions/BasePoisonPotion.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Namespace does not correspond to file location

Namespace does not correspond to file location, must be: 'Server.Items.Skill_Items.Magical.Potions.Poison_Potions'

Expand All @@ -25,10 +24,5 @@ public override void Drink(Mobile from)
DoPoison(from);

PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ModernUO.Serialization;
using Server.Engines.ConPVP;

namespace Server.Items;

Expand All @@ -19,11 +18,6 @@ public override void Drink(Mobile from)
from.Stam += Scale(from, (int)(Refresh * from.StamMax));

PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using ModernUO.Serialization;
using Server.Engines.ConPVP;
using Server.Spells;

namespace Server.Items;

Check notice on line 5 in Projects/UOContent/Items/Skill Items/Magical/Potions/Strength Potions/BaseStrengthPotion.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Namespace does not correspond to file location

Namespace does not correspond to file location, must be: 'Server.Items.Skill_Items.Magical.Potions.Strength_Potions'
Expand Down Expand Up @@ -34,11 +33,6 @@ public override void Drink(Mobile from)
if (DoStrength(from))
{
PlayDrinkEffect(from);

if (!DuelContext.IsFreeConsume(from))
{
Consume();
}
}
}
}

0 comments on commit cbaa349

Please sign in to comment.