Sets a default parameter for OnHit. More casting cleanup.
This commit is contained in:
parent
74f498c1c8
commit
d6c0bf2d4c
96 changed files with 350 additions and 579 deletions
|
|
@ -26,8 +26,8 @@ namespace Server.Items
|
|||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
|
||||
if ( from is PlayerMobile )
|
||||
list.Add( new LockKarmaEntry( (PlayerMobile)from, Addon as AnkhOfSacrificeAddon ) );
|
||||
if ( from is PlayerMobile mobile )
|
||||
list.Add( new LockKarmaEntry( mobile, Addon as AnkhOfSacrificeAddon ) );
|
||||
|
||||
list.Add( new ResurrectEntry( from, Addon as AnkhOfSacrificeAddon ) );
|
||||
}
|
||||
|
|
@ -140,9 +140,9 @@ namespace Server.Items
|
|||
return;
|
||||
}
|
||||
|
||||
if ( from is PlayerMobile )
|
||||
if ( from is PlayerMobile mobile )
|
||||
{
|
||||
((PlayerMobile) from).AnkhNextUse = DateTime.UtcNow + TimeSpan.FromHours( 1 );
|
||||
mobile.AnkhNextUse = DateTime.UtcNow + TimeSpan.FromHours( 1 );
|
||||
}
|
||||
|
||||
base.OnResponse( state, info );
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Addon is CannonAddon )
|
||||
if ( Addon is CannonAddon addon )
|
||||
{
|
||||
if ( ((CannonAddon) Addon).IsRewardItem )
|
||||
if ( addon.IsRewardItem )
|
||||
list.Add( 1076223 ); // 7th Year Veteran Reward
|
||||
|
||||
list.Add( 1076207, ((CannonAddon) Addon).Charges.ToString() ); // Remaining Charges: ~1_val~
|
||||
list.Add( 1076207, addon.Charges.ToString() ); // Remaining Charges: ~1_val~
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -260,9 +260,7 @@ namespace Server.Items
|
|||
if ( m_Cannon == null || m_Cannon.Deleted )
|
||||
return;
|
||||
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if ( p == null )
|
||||
if ( !(targeted is IPoint3D p) )
|
||||
return;
|
||||
|
||||
if ( from.InLOS( new Point3D( p ) ) )
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Server.Items
|
|||
{
|
||||
base.GetProperties( list );
|
||||
|
||||
if ( Addon is StoneAnkh && ((StoneAnkh) Addon).IsRewardItem )
|
||||
if ( Addon is StoneAnkh ankh && ankh.IsRewardItem )
|
||||
list.Add( 1076221 ); // 5th Year Veteran Reward
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,10 +189,8 @@ namespace Server.Items
|
|||
if ( m_Tool == null || m_Tool.Deleted )
|
||||
return;
|
||||
|
||||
if ( targeted is BaseWeapon )
|
||||
if ( targeted is BaseWeapon item )
|
||||
{
|
||||
BaseWeapon item = (BaseWeapon) targeted;
|
||||
|
||||
from.CloseGump( typeof( InternalGump ) );
|
||||
from.SendGump( new InternalGump( m_Tool, item ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue