Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -17,11 +17,11 @@ namespace Server.Items
|
|||
Hues = hues;
|
||||
}
|
||||
|
||||
public int Name{ get; }
|
||||
public int Name { get; }
|
||||
|
||||
public string NameString{ get; }
|
||||
public string NameString { get; }
|
||||
|
||||
public int[] Hues{ get; }
|
||||
public int[] Hues { get; }
|
||||
}
|
||||
|
||||
public class CustomHuePicker
|
||||
|
|
@ -94,26 +94,25 @@ namespace Server.Items
|
|||
TitleString = title;
|
||||
}
|
||||
|
||||
public bool DefaultSupported{ get; }
|
||||
public bool DefaultSupported { get; }
|
||||
|
||||
public CustomHueGroup[] Groups{ get; }
|
||||
public CustomHueGroup[] Groups { get; }
|
||||
|
||||
public int Title{ get; }
|
||||
public int Title { get; }
|
||||
|
||||
public string TitleString{ get; }
|
||||
public string TitleString { get; }
|
||||
}
|
||||
|
||||
public delegate void CustomHuePickerCallback<in T>(Mobile from, T state, int hue);
|
||||
|
||||
public class CustomHuePickerGump<T> : Gump
|
||||
{
|
||||
private CustomHuePickerCallback<T> m_Callback;
|
||||
private CustomHuePicker m_Definition;
|
||||
private Mobile m_From;
|
||||
private T m_State;
|
||||
private readonly CustomHuePickerCallback<T> m_Callback;
|
||||
private readonly CustomHuePicker m_Definition;
|
||||
private readonly Mobile m_From;
|
||||
private readonly T m_State;
|
||||
|
||||
public CustomHuePickerGump(Mobile from, CustomHuePicker definition, CustomHuePickerCallback<T> callback, T state) :
|
||||
base(50, 50)
|
||||
public CustomHuePickerGump(Mobile from, CustomHuePicker definition, CustomHuePickerCallback<T> callback, T state) : base(50, 50)
|
||||
{
|
||||
m_From = from;
|
||||
m_Definition = definition;
|
||||
|
|
@ -181,34 +180,34 @@ namespace Server.Items
|
|||
switch (info.ButtonID)
|
||||
{
|
||||
case 1: // Okay
|
||||
{
|
||||
int[] switches = info.Switches;
|
||||
|
||||
if (switches.Length > 0)
|
||||
{
|
||||
int index = switches[0];
|
||||
int[] switches = info.Switches;
|
||||
|
||||
int group = index % m_Definition.Groups.Length;
|
||||
index /= m_Definition.Groups.Length;
|
||||
|
||||
if (group >= 0 && group < m_Definition.Groups.Length)
|
||||
if (switches.Length > 0)
|
||||
{
|
||||
int[] hues = m_Definition.Groups[group].Hues;
|
||||
int index = switches[0];
|
||||
|
||||
if (index >= 0 && index < hues.Length)
|
||||
m_Callback(m_From, m_State, hues[index]);
|
||||
int group = index % m_Definition.Groups.Length;
|
||||
index /= m_Definition.Groups.Length;
|
||||
|
||||
if (group >= 0 && group < m_Definition.Groups.Length)
|
||||
{
|
||||
int[] hues = m_Definition.Groups[group].Hues;
|
||||
|
||||
if (index >= 0 && index < hues.Length)
|
||||
m_Callback(m_From, m_State, hues[index]);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // Default
|
||||
{
|
||||
if (m_Definition.DefaultSupported)
|
||||
m_Callback(m_From, m_State, 0);
|
||||
{
|
||||
if (m_Definition.DefaultSupported)
|
||||
m_Callback(m_From, m_State, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace Server.Items
|
|||
public virtual int FailMessage => 1042083;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SecureLevel Level{ get; set; }
|
||||
public SecureLevel Level { get; set; }
|
||||
|
||||
public override void Serialize(IGenericWriter writer)
|
||||
{
|
||||
|
|
@ -92,17 +92,17 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
{
|
||||
Level = (SecureLevel)reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_Redyable = reader.ReadBool();
|
||||
m_DyedHue = reader.ReadInt();
|
||||
{
|
||||
m_Redyable = reader.ReadBool();
|
||||
m_DyedHue = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ namespace Server.Items
|
|||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private DyeTub m_Tub;
|
||||
private readonly DyeTub m_Tub;
|
||||
|
||||
public InternalTarget(DyeTub tub) : base(1, false, TargetFlags.None) => m_Tub = tub;
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ namespace Server.Items
|
|||
{
|
||||
BaseHouse house = BaseHouse.FindHouseAt(item);
|
||||
|
||||
if (house == null || !house.HasLockedDownItem(item) && !house.HasSecureItem(item))
|
||||
if (house == null || (!house.HasLockedDownItem(item) && !house.HasSecureItem(item)))
|
||||
from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
|
||||
else if (!house.IsCoOwner(from))
|
||||
from.SendLocalizedMessage(501023); // You must be the owner to use this item.
|
||||
|
|
@ -217,9 +217,9 @@ namespace Server.Items
|
|||
from.PlaySound(0x23E);
|
||||
}
|
||||
}
|
||||
else if ((item is BaseArmor armor &&
|
||||
else if (((item is BaseArmor armor &&
|
||||
(armor.MaterialType == ArmorMaterialType.Leather ||
|
||||
armor.MaterialType == ArmorMaterialType.Studded) || item is ElvenBoots ||
|
||||
armor.MaterialType == ArmorMaterialType.Studded)) || item is ElvenBoots ||
|
||||
item is WoodlandBelt) && m_Tub.AllowLeather)
|
||||
{
|
||||
if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1041246; // Furniture Dye Tub
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -54,10 +54,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (LootType == LootType.Regular)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Items
|
|||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -55,10 +55,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace Server.Items
|
|||
{
|
||||
public class MetallicHuePicker<T> : Gump
|
||||
{
|
||||
private CustomHuePickerCallback<T> m_Callback;
|
||||
private readonly CustomHuePickerCallback<T> m_Callback;
|
||||
|
||||
private Mobile m_From;
|
||||
private T m_State;
|
||||
private readonly Mobile m_From;
|
||||
private readonly T m_State;
|
||||
|
||||
public MetallicHuePicker(Mobile from, CustomHuePickerCallback<T> callback, T state)
|
||||
: base(450, 450)
|
||||
|
|
@ -61,16 +61,16 @@ namespace Server.Items
|
|||
switch (info.ButtonID)
|
||||
{
|
||||
case 1: // Okay
|
||||
{
|
||||
if (info.Switches.Length > 0) m_Callback(m_From, m_State, info.Switches[0]);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (info.Switches.Length > 0) m_Callback(m_From, m_State, info.Switches[0]);
|
||||
break;
|
||||
}
|
||||
case 2: // Default
|
||||
{
|
||||
m_Callback(m_From, m_State, 0);
|
||||
{
|
||||
m_Callback(m_From, m_State, 0);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1006008; // Black Dye Tub
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -55,10 +55,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Items
|
|||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -55,10 +55,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Server.Items
|
|||
public override int LabelNumber => 1041285; // Special Dye Tub
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -51,10 +51,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Items
|
|||
public override CustomHuePicker CustomHuePicker => CustomHuePicker.LeatherDyeTub;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsRewardItem{ get; set; }
|
||||
public bool IsRewardItem { get; set; }
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
@ -55,10 +55,10 @@ namespace Server.Items
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
{
|
||||
IsRewardItem = reader.ReadBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ namespace Server.Items
|
|||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
|
||||
public WhiteLeatherDyeTub(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Server.Items
|
|||
|
||||
private class InternalPicker : HuePicker
|
||||
{
|
||||
private DyeTub m_Tub;
|
||||
private readonly DyeTub m_Tub;
|
||||
|
||||
public InternalPicker(DyeTub tub) : base(tub.ItemID) => m_Tub = tub;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace Server.Items
|
|||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private Scissors m_Item;
|
||||
private readonly Scissors m_Item;
|
||||
|
||||
public InternalTarget(Scissors item) : base(2, false, TargetFlags.None) => m_Item = item;
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ namespace Server.Items
|
|||
if (m_Item.Deleted)
|
||||
return;
|
||||
|
||||
/*if ( targeted is Item && !((Item)targeted).IsStandardLoot() )
|
||||
/*if (targeted is Item && !((Item)targeted).IsStandardLoot())
|
||||
{
|
||||
from.SendLocalizedMessage( 502440 ); // Scissors can not be used on that to produce anything.
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ namespace Server.Items
|
|||
{
|
||||
from.SendLocalizedMessage(
|
||||
1062845 + Utility
|
||||
.Random(3)); //"That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
|
||||
.Random(3)); // "That doesn't seem like the smartest thing to do." / "That was an encounter you don't wish to repeat." / "Ha! You missed!"
|
||||
}
|
||||
else if (Core.SE && Utility.RandomDouble() > .20 && (from.Direction & Direction.Running) != 0 &&
|
||||
Core.TickCount - from.LastMoveTime < from.ComputeMovementSpeed(from.Direction))
|
||||
|
|
@ -110,4 +110,4 @@ namespace Server.Items
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue