Upgrades code style - First batch (#22)

This commit is contained in:
Kamron Batman 2018-08-14 06:16:50 +08:00 committed by GitHub
parent 8ee42c8ea2
commit 632e8b4757
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1834 changed files with 10245 additions and 10437 deletions

View file

@ -12,10 +12,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 0.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 0.5 );
public override double RequiredSkill { get { return 0.0; } }
public override int RequiredMana { get { return 24; } }
public override double RequiredSkill => 0.0;
public override int RequiredMana => 24;
public ArcaneCircleSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -66,7 +66,7 @@ namespace Server.Spells.Spellweaving
private static bool IsValidLocation( Point3D location, Map map )
{
LandTile lt = map.Tiles.GetLandTile( location.X, location.Y ); // Land Tiles
LandTile lt = map.Tiles.GetLandTile( location.X, location.Y ); // Land Tiles
if( IsValidTile( lt.ID ) && lt.Z == location.Z )
return true;
@ -91,7 +91,7 @@ namespace Server.Spells.Spellweaving
foreach( Item item in eable )
{
ItemData id = item.ItemData;
if( item == null || item.Z + id.CalcHeight != location.Z )
continue;
else if( IsValidTile( item.ItemID ) )

View file

@ -13,13 +13,13 @@ namespace Server.Spells.Spellweaving
public abstract class ArcaneForm : ArcanistSpell, ITransformationSpell
{
public abstract int Body { get; }
public virtual int Hue { get { return 0; } }
public virtual int Hue => 0;
public virtual int PhysResistOffset { get { return 0; } }
public virtual int FireResistOffset { get { return 0; } }
public virtual int ColdResistOffset { get { return 0; } }
public virtual int PoisResistOffset { get { return 0; } }
public virtual int NrgyResistOffset { get { return 0; } }
public virtual int PhysResistOffset => 0;
public virtual int FireResistOffset => 0;
public virtual int ColdResistOffset => 0;
public virtual int PoisResistOffset => 0;
public virtual int NrgyResistOffset => 0;
public ArcaneForm( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
{
@ -57,4 +57,4 @@ namespace Server.Spells.Spellweaving
{
}
}
}
}

View file

@ -11,8 +11,8 @@ namespace Server.Spells.Spellweaving
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill { get { return SkillName.Spellweaving; } }
public override SkillName DamageSkill { get { return SkillName.Spellweaving; } }
public override SkillName CastSkill => SkillName.Spellweaving;
public override SkillName DamageSkill => SkillName.Spellweaving;
public override bool ClearHandsOnCast => false;

View file

@ -11,10 +11,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.0 );
public override double RequiredSkill { get { return 0.0; } }
public override int RequiredMana { get { return 24; } }
public override double RequiredSkill => 0.0;
public override int RequiredMana => 24;
public AttuneWeaponSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -90,8 +90,7 @@ namespace Server.Spells.Spellweaving
public static void StopAbsorbing( Mobile m, bool message )
{
ExpireTimer t;
if( m_Table.TryGetValue( m, out t ) )
if (m_Table.TryGetValue( m, out ExpireTimer t ))
{
t.DoExpire( message );
}
@ -131,4 +130,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -8,10 +8,10 @@ namespace Server.Spells.Spellweaving
{
private static SpellInfo m_Info = new SpellInfo( "Essence of Wind", "Anathrae", -1 );
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 3.0 );
public override double RequiredSkill { get { return 52.0; } }
public override int RequiredMana { get { return 40; } }
public override double RequiredSkill => 52.0;
public override int RequiredMana => 40;
public EssenceOfWindSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
@ -70,10 +70,10 @@ namespace Server.Spells.Spellweaving
private int m_SSIMalus;
private ExpireTimer m_Timer;
public Mobile Defender { get { return m_Defender; } }
public int FCMalus { get { return m_FCMalus; } }
public int SSIMalus { get { return m_SSIMalus; } }
public ExpireTimer Timer { get { return m_Timer; } }
public Mobile Defender => m_Defender;
public int FCMalus => m_FCMalus;
public int SSIMalus => m_SSIMalus;
public ExpireTimer Timer => m_Timer;
public EssenceOfWindInfo( Mobile defender, int fcMalus, int ssiMalus, TimeSpan duration )
{
@ -88,9 +88,7 @@ namespace Server.Spells.Spellweaving
public static int GetFCMalus( Mobile m )
{
EssenceOfWindInfo info;
if( m_Table.TryGetValue( m, out info ) )
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
return info.FCMalus;
return 0;
@ -98,9 +96,7 @@ namespace Server.Spells.Spellweaving
public static int GetSSIMalus( Mobile m )
{
EssenceOfWindInfo info;
if( m_Table.TryGetValue( m, out info ) )
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
return info.SSIMalus;
return 0;
@ -113,9 +109,7 @@ namespace Server.Spells.Spellweaving
public static void StopDebuffing( Mobile m, bool message )
{
EssenceOfWindInfo info;
if( m_Table.TryGetValue( m, out info ) )
if (m_Table.TryGetValue( m, out EssenceOfWindInfo info ))
info.Timer.DoExpire( message );
}
@ -147,4 +141,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -9,13 +9,13 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 3.5 );
public override double RequiredSkill { get { return 24.0; } }
public override int RequiredMana { get { return 32; } }
public override double RequiredSkill => 24.0;
public override int RequiredMana => 32;
public override int Body { get { return 0x302; } }
public override int Hue { get { return 0x48F; } }
public override int Body => 0x302;
public override int Hue => 0x48F;
public EtherealVoyageSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -85,4 +85,4 @@ namespace Server.Spells.Spellweaving
BuffInfo.RemoveBuff( m, BuffIcon.EtherealVoyage );
}
}
}
}

View file

@ -14,10 +14,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 4.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 4.0 );
public override double RequiredSkill { get { return 38.0; } }
public override int RequiredMana { get { return 70; } }
public override double RequiredSkill => 38.0;
public override int RequiredMana => 70;
public GiftOfLifeSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -99,9 +99,7 @@ namespace Server.Spells.Spellweaving
private static void HandleDeath_OnCallback( Mobile m )
{
ExpireTimer timer;
if( m_Table.TryGetValue( m, out timer ) )
if (m_Table.TryGetValue( m, out ExpireTimer timer ))
{
double hitsScalar = timer.Spell.HitsScalar;
@ -162,7 +160,7 @@ namespace Server.Spells.Spellweaving
private GiftOfLifeSpell m_Spell;
public GiftOfLifeSpell Spell { get { return m_Spell; } }
public GiftOfLifeSpell Spell => m_Spell;
public ExpireTimer( Mobile m, TimeSpan delay, GiftOfLifeSpell spell )
: base( delay )
@ -215,4 +213,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -12,10 +12,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 3.0 );
public override double RequiredSkill { get { return 0.0; } }
public override int RequiredMana { get { return 24; } }
public override double RequiredSkill => 0.0;
public override int RequiredMana => 24;
public GiftOfRenewalSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -143,9 +143,7 @@ namespace Server.Spells.Spellweaving
public static bool StopEffect( Mobile m )
{
GiftOfRenewalInfo info;
if( m_Table.TryGetValue( m, out info ) )
if (m_Table.TryGetValue( m, out GiftOfRenewalInfo info ))
{
m_Table.Remove( m );
@ -184,4 +182,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -12,10 +12,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.0 );
public override double RequiredSkill { get { return 10.0; } }
public override int RequiredMana { get { return 32; } }
public override double RequiredSkill => 10.0;
public override int RequiredMana => 32;
public ImmolatingWeaponSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -74,9 +74,7 @@ namespace Server.Spells.Spellweaving
public static int GetImmolatingDamage( BaseWeapon weapon )
{
ImmolatingWeaponEntry entry;
if ( m_WeaponDamageTable.TryGetValue( weapon, out entry ) )
if (m_WeaponDamageTable.TryGetValue( weapon, out ImmolatingWeaponEntry entry ))
return entry.m_Damage;
return 0;
@ -89,17 +87,13 @@ namespace Server.Spells.Spellweaving
private static void FinishEffect( DelayedEffectEntry effect )
{
ImmolatingWeaponEntry entry;
if ( m_WeaponDamageTable.TryGetValue( effect.m_Weapon, out entry ) )
if (m_WeaponDamageTable.TryGetValue( effect.m_Weapon, out ImmolatingWeaponEntry entry ))
AOS.Damage( effect.m_Target, entry.m_Caster, entry.m_Damage, 0, 100, 0, 0, 0 );
}
public static void StopImmolating( BaseWeapon weapon )
{
ImmolatingWeaponEntry entry;
if ( m_WeaponDamageTable.TryGetValue( weapon, out entry ) )
if (m_WeaponDamageTable.TryGetValue( weapon, out ImmolatingWeaponEntry entry ))
{
if ( entry.m_Caster != null )
entry.m_Caster.PlaySound( 0x27 );

View file

@ -5,7 +5,7 @@ namespace Server.Items
{
public class ArcaneFocus : TransientItem
{
public override int LabelNumber { get { return 1032629; } } // Arcane Focus
public override int LabelNumber => 1032629; // Arcane Focus
private int m_StrengthBonus;
@ -45,7 +45,7 @@ namespace Server.Items
list.Add( 1060485, m_StrengthBonus.ToString() ); // strength bonus ~1_val~
}
public override TextDefinition InvalidTransferMessage{ get { return 1073480; } } // Your arcane focus disappears.
public override TextDefinition InvalidTransferMessage => 1073480; // Your arcane focus disappears.
public override bool Nontransferable => true;
public override void Serialize( GenericWriter writer )

View file

@ -36,7 +36,7 @@ namespace Server.Items
this.Delete();
}
public virtual TextDefinition InvalidTransferMessage { get { return null; } }
public virtual TextDefinition InvalidTransferMessage => null;
public virtual void Expire( Mobile parent )

View file

@ -7,10 +7,10 @@ namespace Server.Mobiles
[CorpseName( "a pixie corpse" )]
public class ArcaneFey : BaseCreature
{
public override double DispelDifficulty { get { return 70.0; } }
public override double DispelFocus { get { return 20.0; } }
public override double DispelDifficulty => 70.0;
public override double DispelFocus => 20.0;
public override OppositionGroup OppositionGroup { get { return OppositionGroup.FeyAndUndead; } }
public override OppositionGroup OppositionGroup => OppositionGroup.FeyAndUndead;
public override bool InitialInnocent => true;
[Constructible]

View file

@ -7,10 +7,10 @@ namespace Server.Mobiles
[CorpseName( "an imp corpse" )]
public class ArcaneFiend : BaseCreature
{
public override double DispelDifficulty { get { return 70.0; } }
public override double DispelFocus { get { return 20.0; } }
public override double DispelDifficulty => 70.0;
public override double DispelFocus => 20.0;
public override PackInstinct PackInstinct { get { return PackInstinct.Daemon; } }
public override PackInstinct PackInstinct => PackInstinct.Daemon;
public override bool BleedImmune => true; //TODO: Verify on OSI. Guide says this.
public override string DefaultName => "an imp";

View file

@ -6,14 +6,14 @@ namespace Server.Mobiles
{
public class NatureFury : BaseCreature
{
public override bool DeleteCorpseOnDeath { get { return Core.AOS; } }
public override bool DeleteCorpseOnDeath => Core.AOS;
public override bool IsHouseSummonable => true;
public override double DispelDifficulty { get { return 125.0; } }
public override double DispelFocus { get { return 90.0; } }
public override double DispelDifficulty => 125.0;
public override double DispelFocus => 90.0;
public override bool BleedImmune => true;
public override Poison PoisonImmune { get { return Poison.Lethal; } }
public override Poison PoisonImmune => Poison.Lethal;
public override bool AlwaysMurderer => true;
public override string DefaultName => "a nature's fury";

View file

@ -13,10 +13,10 @@ namespace Server.Spells.Spellweaving
false
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public override double RequiredSkill { get { return 0.0; } }
public override int RequiredMana { get { return 24; } }
public override double RequiredSkill => 0.0;
public override int RequiredMana => 24;
public NatureFurySpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -119,4 +119,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Spellweaving
{
private static SpellInfo m_Info = new SpellInfo( "Reaper Form", "Tarisstree", -1 );
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 2.5 );
public static void Initialize()
{
@ -22,16 +22,16 @@ namespace Server.Spells.Spellweaving
e.Mobile.Send( SpeedControl.WalkSpeed );
}
public override double RequiredSkill { get { return 24.0; } }
public override int RequiredMana { get { return 34; } }
public override double RequiredSkill => 24.0;
public override int RequiredMana => 34;
public override int Body { get { return 0x11D; } }
public override int Body => 0x11D;
public override int FireResistOffset { get { return -25; } }
public override int PhysResistOffset { get { return 5 + FocusLevel; } }
public override int ColdResistOffset { get { return 5 + FocusLevel; } }
public override int PoisResistOffset { get { return 5 + FocusLevel; } }
public override int NrgyResistOffset { get { return 5 + FocusLevel; } }
public override int FireResistOffset => -25;
public override int PhysResistOffset => 5 + FocusLevel;
public override int ColdResistOffset => 5 + FocusLevel;
public override int PoisResistOffset => 5 + FocusLevel;
public override int NrgyResistOffset => 5 + FocusLevel;
public virtual int SwingSpeedBonus { get { return 10 + FocusLevel; } }
public virtual int SpellDamageBonus { get { return 10 + FocusLevel; } }
@ -52,4 +52,4 @@ namespace Server.Spells.Spellweaving
m.Send( SpeedControl.Disable );
}
}
}
}

View file

@ -11,17 +11,17 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public override double RequiredSkill { get { return 38.0; } }
public override int RequiredMana { get { return 10; } }
public override double RequiredSkill => 38.0;
public override int RequiredMana => 10;
public SummonFeySpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
{
}
public override int Sound { get { return 0x217; } }
public override int Sound => 0x217;
public override bool CheckSequence()
{

View file

@ -11,17 +11,17 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 2.0 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 2.0 );
public override double RequiredSkill { get { return 38.0; } }
public override int RequiredMana { get { return 10; } }
public override double RequiredSkill => 38.0;
public override int RequiredMana => 10;
public SummonFiendSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
{
}
public override int Sound { get { return 0x216; } }
public override int Sound => 0x216;
public override bool CheckSequence()
{

View file

@ -11,10 +11,10 @@ namespace Server.Spells.Spellweaving
-1
);
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 1.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 1.5 );
public override double RequiredSkill { get { return 10.0; } }
public override int RequiredMana { get { return 32; } }
public override double RequiredSkill => 10.0;
public override int RequiredMana => 32;
public ThunderstormSpell( Mobile caster, Item scroll )
: base( caster, scroll, m_Info )
@ -32,13 +32,13 @@ namespace Server.Spells.Spellweaving
int damage = Math.Max( 11, 10 + (int)(skill / 24) ) + FocusLevel;
int sdiBonus = AosAttributes.GetValue( Caster, AosAttribute.SpellDamage );
int pvmDamage = damage * ( 100 + sdiBonus );
pvmDamage /= 100;
if ( sdiBonus > 15 )
sdiBonus = 15;
int pvpDamage = damage * ( 100 + sdiBonus );
pvpDamage /= 100;
@ -87,9 +87,7 @@ namespace Server.Spells.Spellweaving
public static void DoExpire( Mobile m )
{
Timer t;
if( m_Table.TryGetValue( m, out t ) )
if (m_Table.TryGetValue( m, out Timer t ))
{
t.Stop();
m_Table.Remove( m );
@ -98,4 +96,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}

View file

@ -8,10 +8,10 @@ namespace Server.Spells.Spellweaving
{
private static SpellInfo m_Info = new SpellInfo( "Word of Death", "Nyraxle", -1 );
public override TimeSpan CastDelayBase { get { return TimeSpan.FromSeconds( 3.5 ); } }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds( 3.5 );
public override double RequiredSkill { get { return 80.0; } }
public override int RequiredMana { get { return 50; } }
public override double RequiredSkill => 80.0;
public override int RequiredMana => 50;
public WordOfDeathSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
@ -90,4 +90,4 @@ namespace Server.Spells.Spellweaving
}
}
}
}
}