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

@ -17,7 +17,6 @@ namespace Server.Items
int ICommodity.DescriptionNumber => LabelNumber;
bool ICommodity.IsDeedable => Core.ML;
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);

View file

@ -11,10 +11,8 @@ namespace Server.Items
[DispellableField]
public class Moongate : Item
{
[Constructible]
public Moongate(bool dispellable = true) :
this(Point3D.Zero, null, dispellable)
[Constructible]
public Moongate(bool dispellable = true) : this(Point3D.Zero, null, dispellable)
{
}
@ -34,13 +32,13 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public Point3D Target{ get; set; }
public Point3D Target { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public Map TargetMap{ get; set; }
public Map TargetMap { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public bool Dispellable{ get; set; }
public bool Dispellable { get; set; }
public virtual bool ShowFeluccaWarning => false;
@ -65,13 +63,9 @@ namespace Server.Items
public virtual void CheckGate(Mobile m, int range)
{
#region Mondain's Legacy
if (m.Hidden && m.AccessLevel == AccessLevel.Player && Core.ML)
m.RevealingAction();
#endregion
new DelayTimer(m, this, range).Start();
}
@ -91,10 +85,10 @@ namespace Server.Items
{
mobile.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
}
else if (m.Kills >= 5 && TargetMap != Map.Felucca ||
TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0 ||
TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0 ||
TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0)
else if ((m.Kills >= 5 && TargetMap != Map.Felucca) ||
(TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0) ||
(TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0) ||
(TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0))
{
m.SendLocalizedMessage(1019004); // You are not allowed to travel there.
}
@ -163,8 +157,8 @@ namespace Server.Items
public virtual void BeginConfirmation(Mobile from)
{
if (IsInTown(from.Location, from.Map) && !IsInTown(Target, TargetMap) ||
from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning)
if ((IsInTown(from.Location, from.Map) && !IsInTown(Target, TargetMap)) ||
(from.Map != Map.Felucca && TargetMap == Map.Felucca && ShowFeluccaWarning))
{
if (from.AccessLevel == AccessLevel.Player || !from.Hidden)
from.Send(new PlaySound(0x20E, from.Location));
@ -200,9 +194,9 @@ namespace Server.Items
private class DelayTimer : Timer
{
private Mobile m_From;
private Moongate m_Gate;
private int m_Range;
private readonly Mobile m_From;
private readonly Moongate m_Gate;
private readonly int m_Range;
public DelayTimer(Mobile from, Moongate gate, int range) : base(TimeSpan.FromSeconds(1.0))
{
@ -235,25 +229,25 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public int GumpWidth{ get; set; }
public int GumpWidth { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int GumpHeight{ get; set; }
public int GumpHeight { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int TitleColor{ get; set; }
public int TitleColor { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int MessageColor{ get; set; }
public int MessageColor { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int TitleNumber{ get; set; }
public int TitleNumber { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int MessageNumber{ get; set; }
public int MessageNumber { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public string MessageString{ get; set; }
public string MessageString { get; set; }
public virtual void Warning_Callback(Mobile from, bool okay)
{
@ -267,7 +261,7 @@ namespace Server.Items
{
from.CloseGump<WarningGump>();
from.SendGump(new WarningGump(TitleNumber, TitleColor,
MessageString == null ? MessageNumber : (object)MessageString, MessageColor, GumpWidth, GumpHeight,
MessageString ?? (object)MessageNumber, MessageColor, GumpWidth, GumpHeight,
okay => Warning_Callback(from, okay)));
}
else
@ -303,28 +297,28 @@ namespace Server.Items
switch (version)
{
case 0:
{
GumpWidth = reader.ReadEncodedInt();
GumpHeight = reader.ReadEncodedInt();
{
GumpWidth = reader.ReadEncodedInt();
GumpHeight = reader.ReadEncodedInt();
TitleColor = reader.ReadEncodedInt();
MessageColor = reader.ReadEncodedInt();
TitleColor = reader.ReadEncodedInt();
MessageColor = reader.ReadEncodedInt();
TitleNumber = reader.ReadEncodedInt();
MessageNumber = reader.ReadEncodedInt();
TitleNumber = reader.ReadEncodedInt();
MessageNumber = reader.ReadEncodedInt();
MessageString = reader.ReadString();
MessageString = reader.ReadString();
break;
}
break;
}
}
}
}
public class MoongateConfirmGump : Gump
{
private Mobile m_From;
private Moongate m_Gate;
private readonly Mobile m_From;
private readonly Moongate m_Gate;
public MoongateConfirmGump(Mobile from, Moongate gate) : base(Core.AOS ? 110 : 20, Core.AOS ? 100 : 30)
{

View file

@ -82,12 +82,12 @@ namespace Server.Items
{
case 1:
case 0:
{
m_Type = (PotionEffect)reader.ReadInt();
m_Held = reader.ReadInt();
{
m_Type = (PotionEffect)reader.ReadInt();
m_Held = reader.ReadInt();
break;
}
break;
}
}
if (version < 1)
@ -220,16 +220,12 @@ namespace Server.Items
if (m_Held == 0)
{
#region Mondain's Legacy
if ((int)pot.PotionEffect >= (int)PotionEffect.Invisibility)
{
from.SendLocalizedMessage(502232); // The keg is not designed to hold that type of object.
return false;
}
#endregion
if (GiveBottle(from, toHold))
{
m_Type = pot.PotionEffect;

View file

@ -69,7 +69,7 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Point3D Target{ get; set; }
public Point3D Target { get; set; }
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Map TargetMap
@ -116,21 +116,21 @@ namespace Server.Items
switch (version)
{
case 1:
{
m_House = reader.ReadItem() as BaseHouse;
goto case 0;
}
{
m_House = reader.ReadItem() as BaseHouse;
goto case 0;
}
case 0:
{
m_Description = reader.ReadString();
m_Marked = reader.ReadBool();
Target = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
{
m_Description = reader.ReadString();
m_Marked = reader.ReadBool();
Target = reader.ReadPoint3D();
m_TargetMap = reader.ReadMap();
CalculateHue();
CalculateHue();
break;
}
break;
}
}
}
@ -288,7 +288,7 @@ namespace Server.Items
private class RenamePrompt : Prompt
{
private RecallRune m_Rune;
private readonly RecallRune m_Rune;
public RenamePrompt(RecallRune rune) => m_Rune = rune;