Skip to content

Commit

Permalink
Cleans up scissor targeting
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Jun 17, 2024
1 parent 58ac29f commit 7d097f5
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions Projects/UOContent/Items/Skill Items/Tailor Items/Misc/Scissors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,9 @@ protected override void OnTarget(Mobile from, object targeted)
// Didn't your parents ever tell you not to run with scissors in your hand?!
from.SendLocalizedMessage(1063305);
}
else if (targeted is Item item && !item.Movable)
else if (targeted is Item item and IScissorable scissorable && (targeted is PlagueBeastInnard or PlagueBeastMutationCore || item.Movable))
{
if (item is IScissorable obj && obj is PlagueBeastInnard or PlagueBeastMutationCore)
{
if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
{
from.PlaySound(0x248);
}
}
}
else if (targeted is IScissorable obj)
{
if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
if (CanScissor(from, scissorable) && scissorable.Scissor(from, m_Item))
{
from.PlaySound(0x248);
}
Expand All @@ -84,13 +74,15 @@ protected override void OnTarget(Mobile from, object targeted)

protected override void OnNonlocalTarget(Mobile from, object targeted)
{
if (targeted is not (IScissorable obj and (PlagueBeastInnard or PlagueBeastMutationCore)))
if (targeted is not PlagueBeastInnard and not PlagueBeastMutationCore)
{
base.OnNonlocalTarget(from, targeted);
return;
}

if (CanScissor(from, obj) && obj.Scissor(from, m_Item))
var scissorable = (IScissorable)targeted;

if (CanScissor(from, scissorable) && scissorable.Scissor(from, m_Item))
{
from.PlaySound(0x248);
}
Expand Down

0 comments on commit 7d097f5

Please sign in to comment.