Sets a default parameter for OnHit. More casting cleanup.

This commit is contained in:
Kamron Batman 2018-09-09 08:54:10 -07:00
parent 74f498c1c8
commit d6c0bf2d4c
96 changed files with 350 additions and 579 deletions

View file

@ -59,10 +59,8 @@ namespace Server.Items
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
}
else if ( targeted is TranslocationItem )
else if ( targeted is TranslocationItem transItem )
{
TranslocationItem transItem = (TranslocationItem)targeted;
if ( transItem.Charges >= transItem.MaxCharges )
{
MessageHelper.SendLocalizedMessageTo( m_Powder, from, 1054137, 0x59 ); // This item cannot absorb any more powder of translocation.
@ -88,10 +86,10 @@ namespace Server.Items
m_Powder.Delete();
}
if ( transItem is Item )
if ( transItem is Item item )
{
// The ~1_translocationItem~ glows with green energy and absorbs magical power from the powder.
MessageHelper.SendLocalizedMessageTo( (Item)transItem, from, 1054139, transItem.TranslocationItemName, 0x43 );
MessageHelper.SendLocalizedMessageTo( item, from, 1054139, transItem.TranslocationItemName, 0x43 );
}
}
}
@ -120,4 +118,4 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
}
}
}
}