Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -7,7 +7,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class TalkEntry : ContextMenuEntry
|
||||
{
|
||||
private BaseQuester m_Quester;
|
||||
private readonly BaseQuester m_Quester;
|
||||
|
||||
public TalkEntry(BaseQuester quester) : base(quester.TalkNumber) => m_Quester = quester;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Server.Items
|
|||
|
||||
private const double m_ShortDistance = 5.0;
|
||||
|
||||
//TODO: Trammel/Haven
|
||||
// TODO: Trammel/Haven
|
||||
private static readonly Point2D[] m_TrammelBanks =
|
||||
{
|
||||
new Point2D(652, 820),
|
||||
|
|
@ -99,8 +99,8 @@ namespace Server.Items
|
|||
else if (from.Map == Map.Ilshenar)
|
||||
{
|
||||
#if false
|
||||
banks = m_IlshenarBanks;
|
||||
moongates = PMList.Ilshenar;
|
||||
banks = m_IlshenarBanks;
|
||||
moongates = PMList.Ilshenar;
|
||||
#else
|
||||
from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, 1061684, "",
|
||||
"")); // The magic of the sextant fails...
|
||||
|
|
@ -183,4 +183,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ namespace Server.Engines.Quests
|
|||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D DestLoc{ get; set; }
|
||||
public Point3D DestLoc { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Map DestMap{ get; set; }
|
||||
public Map DestMap { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges
|
||||
|
|
@ -120,19 +120,19 @@ namespace Server.Engines.Quests
|
|||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
DestLoc = reader.ReadPoint3D();
|
||||
DestMap = reader.ReadMap();
|
||||
m_Charges = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
{
|
||||
DestLoc = reader.ReadPoint3D();
|
||||
DestMap = reader.ReadMap();
|
||||
m_Charges = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class HornOfRetreatMoongate : Moongate
|
||||
{
|
||||
private Mobile m_Caster;
|
||||
private readonly Mobile m_Caster;
|
||||
|
||||
public HornOfRetreatMoongate(Point3D destLoc, Map destMap, Mobile caster, int hue)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestCallbackEntry : ContextMenuEntry
|
||||
{
|
||||
private QuestCallback m_Callback;
|
||||
private readonly QuestCallback m_Callback;
|
||||
|
||||
public QuestCallbackEntry(int number, QuestCallback callback) : this(number, -1, callback)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public abstract class QuestConversation
|
||||
{
|
||||
public abstract object Message{ get; }
|
||||
public abstract object Message { get; }
|
||||
|
||||
public virtual QuestItemInfo[] Info => null;
|
||||
public virtual bool Logged => true;
|
||||
|
||||
public QuestSystem System{ get; set; }
|
||||
public QuestSystem System { get; set; }
|
||||
|
||||
public bool HasBeenRead{ get; set; }
|
||||
public bool HasBeenRead { get; set; }
|
||||
|
||||
public virtual void BaseDeserialize(IGenericReader reader)
|
||||
{
|
||||
|
|
@ -22,11 +22,11 @@ namespace Server.Engines.Quests
|
|||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
HasBeenRead = reader.ReadBool();
|
||||
{
|
||||
HasBeenRead = reader.ReadBool();
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ChildDeserialize(reader);
|
||||
|
|
@ -58,9 +58,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public class QuestConversationsGump : BaseQuestGump
|
||||
{
|
||||
private List<QuestConversation> m_Conversations;
|
||||
private readonly List<QuestConversation> m_Conversations;
|
||||
|
||||
public QuestConversationsGump(QuestConversation conv) : this(new List<QuestConversation>{ conv })
|
||||
public QuestConversationsGump(QuestConversation conv) : this(new List<QuestConversation> { conv })
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ namespace Server.Engines.Quests
|
|||
ItemID = itemID;
|
||||
}
|
||||
|
||||
public object Name{ get; set; }
|
||||
public object Name { get; set; }
|
||||
|
||||
public int ItemID{ get; set; }
|
||||
public int ItemID { get; set; }
|
||||
}
|
||||
|
||||
public class QuestItemInfoGump : BaseQuestGump
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
private int m_CurProgress;
|
||||
|
||||
public abstract object Message{ get; }
|
||||
public abstract object Message { get; }
|
||||
|
||||
public virtual int MaxProgress => 1;
|
||||
public virtual QuestItemInfo[] Info => null;
|
||||
|
||||
public QuestSystem System{ get; set; }
|
||||
public QuestSystem System { get; set; }
|
||||
|
||||
public bool HasBeenRead{ get; set; }
|
||||
public bool HasBeenRead { get; set; }
|
||||
|
||||
public int CurProgress
|
||||
{
|
||||
|
|
@ -29,7 +29,7 @@ namespace Server.Engines.Quests
|
|||
}
|
||||
}
|
||||
|
||||
public bool HasCompleted{ get; set; }
|
||||
public bool HasCompleted { get; set; }
|
||||
|
||||
public virtual bool Completed => m_CurProgress >= MaxProgress;
|
||||
|
||||
|
|
@ -42,17 +42,17 @@ namespace Server.Engines.Quests
|
|||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
HasBeenRead = reader.ReadBool();
|
||||
goto case 0;
|
||||
}
|
||||
{
|
||||
HasBeenRead = reader.ReadBool();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
m_CurProgress = reader.ReadEncodedInt();
|
||||
HasCompleted = reader.ReadBool();
|
||||
{
|
||||
m_CurProgress = reader.ReadEncodedInt();
|
||||
HasCompleted = reader.ReadBool();
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ChildDeserialize(reader);
|
||||
|
|
@ -128,7 +128,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
public class QuestLogUpdatedGump : BaseQuestGump
|
||||
{
|
||||
private QuestSystem m_System;
|
||||
private readonly QuestSystem m_System;
|
||||
|
||||
public QuestLogUpdatedGump(QuestSystem system) : base(3, 30)
|
||||
{
|
||||
|
|
@ -155,9 +155,9 @@ namespace Server.Engines.Quests
|
|||
|
||||
public class QuestObjectivesGump : BaseQuestGump
|
||||
{
|
||||
private List<QuestObjective> m_Objectives;
|
||||
private readonly List<QuestObjective> m_Objectives;
|
||||
|
||||
public QuestObjectivesGump(QuestObjective obj) : this(new List<QuestObjective>{ obj })
|
||||
public QuestObjectivesGump(QuestObjective obj) : this(new List<QuestObjective> { obj })
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ namespace Server.Engines.Quests
|
|||
RestartTime = restartTime;
|
||||
}
|
||||
|
||||
public Type QuestType{ get; set; }
|
||||
public Type QuestType { get; set; }
|
||||
|
||||
public DateTime RestartTime{ get; set; }
|
||||
public DateTime RestartTime { get; set; }
|
||||
|
||||
public void Reset(TimeSpan restartDelay)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using Server.Utilities;
|
||||
using System;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Engines.Quests
|
||||
{
|
||||
|
|
@ -45,27 +45,27 @@ namespace Server.Engines.Quests
|
|||
switch (encoding)
|
||||
{
|
||||
default:
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case 0x01: // indexed
|
||||
{
|
||||
int index = reader.ReadEncodedInt();
|
||||
|
||||
if (index >= 0 && index < referenceTable.Length)
|
||||
return referenceTable[index];
|
||||
|
||||
return null;
|
||||
}
|
||||
case 0x02: // by name
|
||||
{
|
||||
string fullName = reader.ReadString();
|
||||
|
||||
if (fullName == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case 0x01: // indexed
|
||||
{
|
||||
int index = reader.ReadEncodedInt();
|
||||
|
||||
return AssemblyHandler.FindFirstTypeForName(fullName, false);
|
||||
}
|
||||
if (index >= 0 && index < referenceTable.Length)
|
||||
return referenceTable[index];
|
||||
|
||||
return null;
|
||||
}
|
||||
case 0x02: // by name
|
||||
{
|
||||
string fullName = reader.ReadString();
|
||||
|
||||
if (fullName == null)
|
||||
return null;
|
||||
|
||||
return AssemblyHandler.FindFirstTypeForName(fullName, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -76,19 +76,19 @@ namespace Server.Engines.Quests
|
|||
switch (encoding)
|
||||
{
|
||||
default:
|
||||
{
|
||||
return null;
|
||||
}
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case 0x01:
|
||||
{
|
||||
Type type = ReadType(QuestSystem.QuestTypes, reader);
|
||||
{
|
||||
Type type = ReadType(QuestSystem.QuestTypes, reader);
|
||||
|
||||
QuestSystem qs = Construct(type) as QuestSystem;
|
||||
QuestSystem qs = Construct(type) as QuestSystem;
|
||||
|
||||
qs?.BaseDeserialize(reader);
|
||||
qs?.BaseDeserialize(reader);
|
||||
|
||||
return qs;
|
||||
}
|
||||
return qs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -115,19 +115,19 @@ namespace Server.Engines.Quests
|
|||
switch (encoding)
|
||||
{
|
||||
default:
|
||||
{
|
||||
return null;
|
||||
}
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case 0x01:
|
||||
{
|
||||
Type type = ReadType(referenceTable, reader);
|
||||
{
|
||||
Type type = ReadType(referenceTable, reader);
|
||||
|
||||
QuestObjective obj = Construct(type) as QuestObjective;
|
||||
QuestObjective obj = Construct(type) as QuestObjective;
|
||||
|
||||
obj?.BaseDeserialize(reader);
|
||||
obj?.BaseDeserialize(reader);
|
||||
|
||||
return obj;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,19 +154,19 @@ namespace Server.Engines.Quests
|
|||
switch (encoding)
|
||||
{
|
||||
default:
|
||||
{
|
||||
return null;
|
||||
}
|
||||
{
|
||||
return null;
|
||||
}
|
||||
case 0x01:
|
||||
{
|
||||
Type type = ReadType(referenceTable, reader);
|
||||
{
|
||||
Type type = ReadType(referenceTable, reader);
|
||||
|
||||
QuestConversation conv = Construct(type) as QuestConversation;
|
||||
QuestConversation conv = Construct(type) as QuestConversation;
|
||||
|
||||
conv?.BaseDeserialize(reader);
|
||||
conv?.BaseDeserialize(reader);
|
||||
|
||||
return conv;
|
||||
}
|
||||
return conv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,21 +51,21 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
}
|
||||
|
||||
public abstract object Name{ get; }
|
||||
public abstract object OfferMessage{ get; }
|
||||
public abstract object Name { get; }
|
||||
public abstract object OfferMessage { get; }
|
||||
|
||||
public abstract int Picture{ get; }
|
||||
public abstract int Picture { get; }
|
||||
|
||||
public abstract bool IsTutorial{ get; }
|
||||
public abstract TimeSpan RestartDelay{ get; }
|
||||
public abstract bool IsTutorial { get; }
|
||||
public abstract TimeSpan RestartDelay { get; }
|
||||
|
||||
public abstract Type[] TypeReferenceTable{ get; }
|
||||
public abstract Type[] TypeReferenceTable { get; }
|
||||
|
||||
public PlayerMobile From{ get; set; }
|
||||
public PlayerMobile From { get; set; }
|
||||
|
||||
public List<QuestObjective> Objectives{ get; set; }
|
||||
public List<QuestObjective> Objectives { get; set; }
|
||||
|
||||
public List<QuestConversation> Conversations{ get; set; }
|
||||
public List<QuestConversation> Conversations { get; set; }
|
||||
|
||||
public virtual void StartTimer()
|
||||
{
|
||||
|
|
@ -126,39 +126,39 @@ namespace Server.Engines.Quests
|
|||
switch (version)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
Objectives = new List<QuestObjective>(count);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
QuestObjective obj = QuestSerializer.DeserializeObjective(referenceTable, reader);
|
||||
int count = reader.ReadEncodedInt();
|
||||
|
||||
if (obj != null)
|
||||
Objectives = new List<QuestObjective>(count);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
obj.System = this;
|
||||
Objectives.Add(obj);
|
||||
QuestObjective obj = QuestSerializer.DeserializeObjective(referenceTable, reader);
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
obj.System = this;
|
||||
Objectives.Add(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
count = reader.ReadEncodedInt();
|
||||
count = reader.ReadEncodedInt();
|
||||
|
||||
Conversations = new List<QuestConversation>(count);
|
||||
Conversations = new List<QuestConversation>(count);
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
QuestConversation conv = QuestSerializer.DeserializeConversation(referenceTable, reader);
|
||||
|
||||
if (conv != null)
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
conv.System = this;
|
||||
Conversations.Add(conv);
|
||||
}
|
||||
}
|
||||
QuestConversation conv = QuestSerializer.DeserializeConversation(referenceTable, reader);
|
||||
|
||||
break;
|
||||
}
|
||||
if (conv != null)
|
||||
{
|
||||
conv.System = this;
|
||||
Conversations.Add(conv);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ChildDeserialize(reader);
|
||||
|
|
@ -324,7 +324,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
TimeSpan restartDelay = RestartDelay;
|
||||
|
||||
if (completed && restartDelay > TimeSpan.Zero || !completed && restartDelay == TimeSpan.MaxValue)
|
||||
if ((completed && restartDelay > TimeSpan.Zero) || (!completed && restartDelay == TimeSpan.MaxValue))
|
||||
{
|
||||
From.DoneQuests ??= new List<QuestRestartInfo>();
|
||||
|
||||
|
|
@ -405,8 +405,7 @@ namespace Server.Engines.Quests
|
|||
if (questType == typeof(DarkTidesQuest) && pm.Profession != 4) // necromancer
|
||||
return false;
|
||||
|
||||
if (questType == typeof(UzeraanTurmoilQuest) && pm.Profession != 1 && pm.Profession != 2 && pm.Profession != 5
|
||||
) // warrior / magician / paladin
|
||||
if (questType == typeof(UzeraanTurmoilQuest) && pm.Profession != 1 && pm.Profession != 2 && pm.Profession != 5) // warrior / magician / paladin
|
||||
return false;
|
||||
|
||||
if (questType == typeof(HaochisTrialsQuest) && pm.Profession != 6) // samurai
|
||||
|
|
@ -463,7 +462,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
public static int RandomBrightHue()
|
||||
{
|
||||
if (0.1 > Utility.RandomDouble())
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
return Utility.RandomList(0x62, 0x71);
|
||||
|
||||
return Utility.RandomList(0x03, 0x0D, 0x13, 0x1C, 0x21, 0x30, 0x37, 0x3A, 0x44, 0x59);
|
||||
|
|
@ -472,7 +471,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
public class QuestCancelGump : BaseQuestGump
|
||||
{
|
||||
private QuestSystem m_System;
|
||||
private readonly QuestSystem m_System;
|
||||
|
||||
public QuestCancelGump(QuestSystem system) : base(120, 50)
|
||||
{
|
||||
|
|
@ -542,7 +541,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
public class QuestOfferGump : BaseQuestGump
|
||||
{
|
||||
private QuestSystem m_System;
|
||||
private readonly QuestSystem m_System;
|
||||
|
||||
public QuestOfferGump(QuestSystem system) : base(75, 25)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class CancelQuestRegion : BaseRegion
|
||||
{
|
||||
private Type m_Quest;
|
||||
private readonly Type m_Quest;
|
||||
|
||||
public CancelQuestRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestCompleteObjectiveRegion : BaseRegion
|
||||
{
|
||||
private Type m_Objective;
|
||||
private Type m_Quest;
|
||||
private readonly Type m_Objective;
|
||||
private readonly Type m_Quest;
|
||||
|
||||
public QuestCompleteObjectiveRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestNoEntryRegion : BaseRegion
|
||||
{
|
||||
private Type m_MaxObjective;
|
||||
private int m_Message;
|
||||
private Type m_MinObjective;
|
||||
private Type m_Quest;
|
||||
private readonly Type m_MaxObjective;
|
||||
private readonly int m_Message;
|
||||
private readonly Type m_MinObjective;
|
||||
private readonly Type m_Quest;
|
||||
|
||||
public QuestNoEntryRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace Server.Engines.Quests
|
|||
{
|
||||
public class QuestOfferRegion : BaseRegion
|
||||
{
|
||||
private Type m_Quest;
|
||||
private readonly Type m_Quest;
|
||||
|
||||
public QuestOfferRegion(XmlElement xml, Map map, Region parent) : base(xml, map, parent)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue