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

@ -24,7 +24,7 @@ namespace Server.Items
public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability
{
private string m_EngravedText;
[CommandProperty( AccessLevel.GameMaster )]
public string EngravedText
{
@ -51,7 +51,7 @@ namespace Server.Items
#endregion
/* Weapon internals work differently now (Mar 13 2003)
*
*
* The attributes defined below default to -1.
* If the value is -1, the corresponding virtual 'Aos/Old' property is used.
* If not, the attribute value itself is used. Here's the list:
@ -147,13 +147,13 @@ namespace Server.Items
public virtual bool CanFortify{ get{ return true; } }
public override int PhysicalResistance{ get{ return m_AosWeaponAttributes.ResistPhysicalBonus; } }
public override int FireResistance{ get{ return m_AosWeaponAttributes.ResistFireBonus; } }
public override int ColdResistance{ get{ return m_AosWeaponAttributes.ResistColdBonus; } }
public override int PoisonResistance{ get{ return m_AosWeaponAttributes.ResistPoisonBonus; } }
public override int EnergyResistance{ get{ return m_AosWeaponAttributes.ResistEnergyBonus; } }
public override int PhysicalResistance => m_AosWeaponAttributes.ResistPhysicalBonus;
public override int FireResistance => m_AosWeaponAttributes.ResistFireBonus;
public override int ColdResistance => m_AosWeaponAttributes.ResistColdBonus;
public override int PoisonResistance => m_AosWeaponAttributes.ResistPoisonBonus;
public override int EnergyResistance => m_AosWeaponAttributes.ResistEnergyBonus;
public virtual SkillName AccuracySkill { get { return SkillName.Tactics; } }
public virtual SkillName AccuracySkill => SkillName.Tactics;
#endregion
#region Getters & Setters
@ -311,7 +311,7 @@ namespace Server.Items
[CommandProperty( AccessLevel.GameMaster )]
public WeaponAnimation Animation
{
get{ return ( m_Animation == (WeaponAnimation)(-1) ? Core.AOS ? AosAnimation : OldAnimation : m_Animation ); }
get{ return ( m_Animation == (WeaponAnimation)(-1) ? Core.AOS ? AosAnimation : OldAnimation : m_Animation ); }
set{ m_Animation = value; }
}
@ -571,7 +571,7 @@ namespace Server.Items
return base.AllowSecureTrade( from, to, newOwner, accepted );
}
public virtual Race RequiredRace { get { return null; } } //On OSI, there are no weapons with race requirements, this is for custom stuff
public virtual Race RequiredRace => null; //On OSI, there are no weapons with race requirements, this is for custom stuff
public override bool CanEquip( Mobile from )
{
@ -591,7 +591,7 @@ namespace Server.Items
{
from.SendMessage( "You are not nimble enough to equip that." );
return false;
}
}
else if ( from.Str < AOS.Scale( StrRequirement, 100 - GetLowerStatReq() ) )
{
from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that.
@ -821,7 +821,7 @@ namespace Server.Items
if ( HitLower.IsUnderDefenseEffect( defender ) )
bonus -= 25; // Under Hit Lower Defense effect -> 25% malus
int blockBonus = 0;
if ( Block.GetBonus( defender, ref blockBonus ) )
@ -915,7 +915,7 @@ namespace Server.Items
if ( bonus > 60 )
bonus = 60;
double ticks;
if ( Core.ML )
@ -934,7 +934,7 @@ namespace Server.Items
ticks = Math.Floor( ( 80000.0 / ( ( m.Stam + 100 ) * speed ) ) - 2 );
}
// Swing speed currently capped at one swing every 1.25 seconds (5 ticks).
if ( ticks < 5 )
ticks = 5;
@ -963,7 +963,7 @@ namespace Server.Items
delayInSeconds = Math.Floor( 40000.0 / v ) * 0.5;
// Maximum swing rate capped at one swing per second
// Maximum swing rate capped at one swing per second
// OSI dev said that it has and is supposed to be 1.25
if ( delayInSeconds < 1.25 )
delayInSeconds = 1.25;
@ -1108,7 +1108,7 @@ namespace Server.Items
double chance = (parry - bushidoNonRacial) / 400.0; // As per OSI, no genitive effect from the Racial stuffs, ie, 120 parry and '0' bushido with humans
if ( chance < 0 ) // chance shouldn't go below 0
chance = 0;
chance = 0;
// Parry/Bushido over 100 grants a 5% bonus.
if ( parry >= 100.0 || bushido >= 100.0)
@ -1514,7 +1514,7 @@ namespace Server.Items
damage = 1;
else if ( Core.AOS && damage == 0 ) // parried
{
if ( a != null && a.Validate( attacker ) /*&& a.CheckMana( attacker, true )*/ ) // Parried special moves have no mana cost
if ( a != null && a.Validate( attacker ) /*&& a.CheckMana( attacker, true )*/ ) // Parried special moves have no mana cost
{
a = null;
WeaponAbility.ClearCurrentAbility( attacker );
@ -3079,16 +3079,16 @@ namespace Server.Items
list.Add( LabelNumber );
else
list.Add( Name );
/*
* Want to move this to the engraving tool, let the non-harmful
* Want to move this to the engraving tool, let the non-harmful
* formatting show, and remove CLILOCs embedded: more like OSI
* did with the books that had markup, etc.
*
* This will have a negative effect on a few event things imgame
*
* This will have a negative effect on a few event things imgame
* as is.
*
* If we cant find a more OSI-ish way to clean it up, we can
*
* If we cant find a more OSI-ish way to clean it up, we can
* easily put this back, and use it in the deserialize
* method and engraving tool, to make it perm cleaned up.
*/