More cast conversion fixes
This commit is contained in:
parent
3f45bd57b9
commit
aba9452161
46 changed files with 359 additions and 506 deletions
|
|
@ -77,10 +77,8 @@ namespace Server.Items
|
|||
|
||||
public virtual void SetTubHue( Mobile from, object state, int hue )
|
||||
{
|
||||
if ( state is DyeTub )
|
||||
if ( state is DyeTub tub )
|
||||
{
|
||||
DyeTub tub = state as DyeTub;
|
||||
|
||||
tub.DyedHue = hue;
|
||||
|
||||
/* dyes.m_UsesRemaining--; let this change ride till the overhaul */
|
||||
|
|
@ -89,10 +87,8 @@ namespace Server.Items
|
|||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is DyeTub )
|
||||
if ( targeted is DyeTub tub )
|
||||
{
|
||||
DyeTub tub = (DyeTub) targeted;
|
||||
|
||||
if ( tub.Redyable )
|
||||
{
|
||||
if ( tub.MetallicHues ) /* OSI has three metallic tubs now */
|
||||
|
|
|
|||
|
|
@ -71,20 +71,16 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage( 1063305 ); // Didn't your parents ever tell you not to run with scissors in your hand?!
|
||||
}
|
||||
else if ( targeted is Item && !((Item)targeted).Movable )
|
||||
else if ( targeted is Item item && !item.Movable )
|
||||
{
|
||||
if ( targeted is IScissorable && ( targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore ) )
|
||||
if ( item is IScissorable obj && ( obj is PlagueBeastInnard || obj is PlagueBeastMutationCore ) )
|
||||
{
|
||||
IScissorable obj = (IScissorable) targeted;
|
||||
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
}
|
||||
else if ( targeted is IScissorable )
|
||||
else if ( targeted is IScissorable obj )
|
||||
{
|
||||
IScissorable obj = (IScissorable)targeted;
|
||||
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
|
|
@ -96,10 +92,8 @@ namespace Server.Items
|
|||
|
||||
protected override void OnNonlocalTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is IScissorable && ( targeted is PlagueBeastInnard || targeted is PlagueBeastMutationCore ) )
|
||||
if ( targeted is IScissorable obj && ( obj is PlagueBeastInnard || obj is PlagueBeastMutationCore ) )
|
||||
{
|
||||
IScissorable obj = (IScissorable) targeted;
|
||||
|
||||
if ( CanScissor( from, obj ) && obj.Scissor( from, m_Item ) )
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
|
|
@ -110,7 +104,7 @@ namespace Server.Items
|
|||
|
||||
public static bool CanScissor( Mobile from, IScissorable obj )
|
||||
{
|
||||
if ( obj is Item && ( (Item)obj ).Nontransferable )
|
||||
if ( obj is Item item && item.Nontransferable )
|
||||
{
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue