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

@ -55,7 +55,7 @@ namespace Server.Items
}
else if (house.FindGuildstone() != null)
{
from.SendLocalizedMessage(501142); //Only one guildstone may reside in a given house.
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
}
else if (!house.IsOwner(from))
{
@ -71,7 +71,7 @@ namespace Server.Items
private class InternalPrompt : Prompt
{
private GuildDeed m_Deed;
private readonly GuildDeed m_Deed;
public InternalPrompt(GuildDeed deed) => m_Deed = deed;
@ -98,7 +98,7 @@ namespace Server.Items
}
else if (house.FindGuildstone() != null)
{
from.SendLocalizedMessage(501142); //Only one guildstone may reside in a given house.
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
}
else if (!house.IsOwner(from))
{

View file

@ -43,11 +43,11 @@ namespace Server.Items
switch (version)
{
case 0:
{
m_Stone = reader.ReadItem();
{
m_Stone = reader.ReadItem();
break;
}
break;
}
}
if (Weight == 0.0)
@ -83,7 +83,7 @@ namespace Server.Items
}
else if (house.FindGuildstone() != null)
{
from.SendLocalizedMessage(501142); //Only one guildstone may reside in a given house.
from.SendLocalizedMessage(501142); // Only one guildstone may reside in a given house.
}
else
{

View file

@ -8,7 +8,7 @@ using Server.Targeting;
namespace Server.Items
{
public class Guildstone : Item, IAddon, IChopable
public class Guildstone : Item, IAddon, IChoppable
{
private bool m_BeforeChangeover;
private string m_GuildAbbrev;
@ -54,12 +54,10 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public Guild Guild{ get; private set; }
public Guild Guild { get; private set; }
public override int LabelNumber => 1041429; // a guildstone
#region IChopable Members
public void OnChop(Mobile from)
{
if (!Guild.NewGuildSystem)
@ -69,7 +67,7 @@ namespace Server.Items
bool contains = false;
if (house == null && m_BeforeChangeover || house?.IsOwner(from) == true && (contains = house.Addons.Contains(this)))
if ((house == null && m_BeforeChangeover) || (house?.IsOwner(from) == true && (contains = house.Addons.Contains(this))))
{
Effects.PlaySound(GetWorldLocation(), Map, 0x3B3);
from.SendLocalizedMessage(500461); // You destroy the item.
@ -86,8 +84,6 @@ namespace Server.Items
}
}
#endregion
public override void Serialize(IGenericWriter writer)
{
base.Serialize(writer);
@ -117,27 +113,27 @@ namespace Server.Items
switch (version)
{
case 3:
{
m_BeforeChangeover = reader.ReadBool();
goto case 2;
}
{
m_BeforeChangeover = reader.ReadBool();
goto case 2;
}
case 2:
{
m_GuildName = reader.ReadString();
m_GuildAbbrev = reader.ReadString();
{
m_GuildName = reader.ReadString();
m_GuildAbbrev = reader.ReadString();
goto case 1;
}
goto case 1;
}
case 1:
{
Guild = reader.ReadGuild() as Guild;
{
Guild = reader.ReadGuild() as Guild;
goto case 0;
}
goto case 0;
}
case 0:
{
break;
}
{
break;
}
}
if (Guild.NewGuildSystem && ItemID == 0xED4)
@ -179,7 +175,7 @@ namespace Server.Items
if ((abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
abbr = "";
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
}
else if (m_GuildName != null && m_GuildAbbrev != null)
@ -228,8 +224,6 @@ namespace Server.Items
}
else if (Guild.Accepted.Contains(from))
{
#region Factions
PlayerState guildState = PlayerState.Find(Guild.Leader);
PlayerState targetState = PlayerState.Find(from);
@ -242,8 +236,6 @@ namespace Server.Items
if (guildState != null && targetState != null)
targetState.Leaving = guildState.Leaving;
#endregion
Guild.Accepted.Remove(from);
Guild.AddMember(from);
@ -262,13 +254,9 @@ namespace Server.Items
}
}
#region IAddon Members
public Item Deed => new GuildstoneDeed(Guild, m_GuildName, m_GuildAbbrev);
public bool CouldFit(IPoint3D p, Map map) => map.CanFit(p.X, p.Y, p.Z, ItemData.Height);
#endregion
}
[Flippable(0x14F0, 0x14EF)]
@ -279,8 +267,7 @@ namespace Server.Items
private string m_GuildName;
[Constructible]
public GuildstoneDeed(Guild g = null, string guildName = null, string abbrev = null) :
base(0x14F0)
public GuildstoneDeed(Guild g = null, string guildName = null, string abbrev = null) : base(0x14F0)
{
Guild = g;
m_GuildName = guildName;
@ -318,7 +305,7 @@ namespace Server.Items
}
[CommandProperty(AccessLevel.GameMaster)]
public Guild Guild{ get; private set; }
public Guild Guild { get; private set; }
public override void Serialize(IGenericWriter writer)
{
@ -347,14 +334,14 @@ namespace Server.Items
switch (version)
{
case 1:
{
m_GuildName = reader.ReadString();
m_GuildAbbrev = reader.ReadString();
{
m_GuildName = reader.ReadString();
m_GuildAbbrev = reader.ReadString();
Guild = reader.ReadGuild() as Guild;
Guild = reader.ReadGuild() as Guild;
break;
}
break;
}
}
}
@ -373,7 +360,7 @@ namespace Server.Items
if ((abbr = Guild.Abbreviation) == null || (abbr = abbr.Trim()).Length <= 0)
abbr = "";
//list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
// list.Add( 1060802, Utility.FixHtml( name ) ); // Guild name: ~1_val~
list.Add(1060802, $"{Utility.FixHtml(name)} [{Utility.FixHtml(abbr)}]");
}
else if (m_GuildName != null && m_GuildAbbrev != null)