Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -95,7 +95,7 @@ namespace Server.Items
private class InternalTarget : Target
{
private Bandage m_Bandage;
private readonly Bandage m_Bandage;
public InternalTarget(Bandage bandage) : base(Bandage.Range, false, TargetFlags.Beneficial) => m_Bandage = bandage;
@ -144,7 +144,7 @@ namespace Server.Items
public class BandageContext
{
private static Dictionary<Mobile, BandageContext> m_Table = new Dictionary<Mobile, BandageContext>();
private static readonly Dictionary<Mobile, BandageContext> m_Table = new Dictionary<Mobile, BandageContext>();
public BandageContext(Mobile healer, Mobile patient, TimeSpan delay)
{
@ -155,13 +155,13 @@ namespace Server.Items
Timer.Start();
}
public Mobile Healer{ get; }
public Mobile Healer { get; }
public Mobile Patient{ get; }
public Mobile Patient { get; }
public int Slips{ get; set; }
public int Slips { get; set; }
public Timer Timer{ get; private set; }
public Timer Timer { get; private set; }
public void Slip()
{
@ -227,9 +227,8 @@ namespace Server.Items
double anatomy = Healer.Skills[secondarySkill].Value;
double chance = (healing - 68.0) / 50.0 - Slips * 0.02;
if ((checkSkills = healing >= 80.0 && anatomy >= 80.0) && chance > Utility.RandomDouble()
|| Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == Healer
) //TODO: Dbl check doesn't check for faction of the horse here?
if (((checkSkills = healing >= 80.0 && anatomy >= 80.0) && chance > Utility.RandomDouble())
|| (Core.SE && petPatient is FactionWarHorse && petPatient.ControlMaster == Healer)) // TODO: Dbl check doesn't check for faction of the horse here?
{
if (Patient.Map?.CanFit(Patient.Location, 16, false, false) != true)
{
@ -494,7 +493,7 @@ namespace Server.Items
m_Table[healer] = context;
if (!onSelf)
patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you.
patient.SendLocalizedMessage(1008078, false, healer.Name); // : Attempting to heal you.
healer.SendLocalizedMessage(500956); // You begin applying the bandages.
return context;
@ -505,7 +504,7 @@ namespace Server.Items
private class InternalTimer : Timer
{
private BandageContext m_Context;
private readonly BandageContext m_Context;
public InternalTimer(BandageContext context, TimeSpan delay) : base(delay)
{

View file

@ -89,14 +89,13 @@ namespace Server.Items
List<Mobile> targets = eable.Where(m =>
{
if (from == m || !SpellHelper.ValidIndirectTarget(from, m) || !from.CanBeHarmful(m, false)
|| Core.AOS && !from.InLOS(m))
|| (Core.AOS && !from.InLOS(m)))
return false;
if (m.Player)
playerVsPlayer = true;
return true;
}).ToList();
eable.Free();
@ -194,7 +193,7 @@ namespace Server.Items
private class InternalTarget : Target
{
private FireHorn m_Horn;
private readonly FireHorn m_Horn;
public InternalTarget(FireHorn horn) : base(Core.AOS ? 3 : 2, true, TargetFlags.Harmful) => m_Horn = horn;

View file

@ -105,11 +105,11 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_RecipeID = reader.ReadInt();
{
m_RecipeID = reader.ReadInt();
break;
}
break;
}
}
}
}

View file

@ -23,8 +23,7 @@ namespace Server.Items
private double m_SkillLevel;
[Constructible]
public RepairDeed(RepairSkillType skill, double level, bool normalizeLevel) :
this(skill, level, null, normalizeLevel)
public RepairDeed(RepairSkillType skill, double level, bool normalizeLevel) : this(skill, level, null, normalizeLevel)
{
}
@ -95,7 +94,7 @@ namespace Server.Items
if (m_Crafter != null)
list.Add(1050043, m_Crafter.Name); // crafted by ~1_NAME~
//On OSI it says it's exceptional. Intentional difference.
// On OSI it says it's exceptional. Intentional difference.
}
public override void OnSingleClick(Mobile from)
@ -176,13 +175,13 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_Skill = (RepairSkillType)reader.ReadInt();
m_SkillLevel = reader.ReadDouble();
m_Crafter = reader.ReadMobile();
{
m_Skill = (RepairSkillType)reader.ReadInt();
m_SkillLevel = reader.ReadDouble();
m_Crafter = reader.ReadMobile();
break;
}
break;
}
}
}
@ -202,16 +201,15 @@ namespace Server.Items
{
}
public TextDefinition NotNearbyMessage{ get; }
public TextDefinition NotNearbyMessage { get; }
public TextDefinition Name{ get; }
public TextDefinition Name { get; }
public CraftSystem System { get; }
public CraftSystem System{ get; }
public Type[] NearbyTypes { get; }
public Type[] NearbyTypes{ get; }
public static RepairSkillInfo[] Table{ get; } =
public static RepairSkillInfo[] Table { get; } =
{
new RepairSkillInfo(DefBlacksmithy.CraftSystem, typeof(Blacksmith), 1047013, 1023015),
new RepairSkillInfo(DefTailoring.CraftSystem, typeof(Tailor), 1061132, 1022981),