More casting fixes
This commit is contained in:
parent
f211efc3bd
commit
20a80ea2f3
40 changed files with 125 additions and 211 deletions
|
|
@ -114,8 +114,7 @@ namespace Server.Mobiles
|
|||
this.PlaySound( 0xEE );
|
||||
defender.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You have been stunned by a colossal blow!" );
|
||||
|
||||
BaseWeapon weapon = this.Weapon as BaseWeapon;
|
||||
if ( weapon != null )
|
||||
if ( this.Weapon is BaseWeapon weapon )
|
||||
weapon.OnHit( this, defender );
|
||||
|
||||
if ( defender.Alive )
|
||||
|
|
@ -128,9 +127,7 @@ namespace Server.Mobiles
|
|||
|
||||
private void Recover_Callback( object state )
|
||||
{
|
||||
Mobile defender = state as Mobile;
|
||||
|
||||
if ( defender != null )
|
||||
if ( state is Mobile defender )
|
||||
{
|
||||
defender.Frozen = false;
|
||||
defender.Combatant = null;
|
||||
|
|
|
|||
|
|
@ -60,9 +60,8 @@ namespace Server.Mobiles
|
|||
|
||||
public void AddArcane( Item item )
|
||||
{
|
||||
if ( item is IArcaneEquip )
|
||||
if ( item is IArcaneEquip eq )
|
||||
{
|
||||
IArcaneEquip eq = (IArcaneEquip)item;
|
||||
eq.CurArcaneCharges = eq.MaxArcaneCharges = 20;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ namespace Server.Mobiles
|
|||
aggressor.PlaySound( 0x307 );
|
||||
aggressor.SendLocalizedMessage( 1040008 ); // Your skin is scorched as the tribal paint burns away!
|
||||
|
||||
if ( aggressor is PlayerMobile )
|
||||
((PlayerMobile)aggressor).SavagePaintExpiration = TimeSpan.Zero;
|
||||
if ( aggressor is PlayerMobile mobile )
|
||||
mobile.SavagePaintExpiration = TimeSpan.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace Server.Mobiles
|
|||
if ( m == this || !CanBeHarmful( m ) )
|
||||
continue;
|
||||
|
||||
if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team) )
|
||||
if ( m is BaseCreature creature && (creature.Controlled || creature.Summoned || creature.Team != this.Team) )
|
||||
list.Add( m );
|
||||
else if ( m.Player )
|
||||
list.Add( m );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue