Formatting FIxes (#58)
This commit is contained in:
parent
57fb9fb525
commit
096d39609e
1318 changed files with 11633 additions and 22129 deletions
|
|
@ -9,17 +9,11 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public virtual bool IsTimed => false;
|
||||
public virtual TimeSpan Duration => TimeSpan.Zero;
|
||||
|
||||
public virtual bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public virtual bool CanOffer(IQuestGiver quester, PlayerMobile pm, bool message) => true;
|
||||
|
||||
public abstract void WriteToGump(Gump g, ref int y);
|
||||
|
||||
public virtual BaseObjectiveInstance CreateInstance(MLQuestInstance instance)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public virtual BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => null;
|
||||
}
|
||||
|
||||
public abstract class BaseObjectiveInstance
|
||||
|
|
@ -63,15 +57,9 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
y += 16;
|
||||
}
|
||||
|
||||
public virtual bool AllowsQuestItem(Item item, Type type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public virtual bool AllowsQuestItem(Item item, Type type) => false;
|
||||
|
||||
public virtual bool IsCompleted()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public virtual bool IsCompleted() => false;
|
||||
|
||||
public virtual void CheckComplete()
|
||||
{
|
||||
|
|
@ -94,10 +82,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
}
|
||||
|
||||
public virtual bool OnBeforeClaimReward()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public virtual bool OnBeforeClaimReward() => true;
|
||||
|
||||
public virtual void OnClaimReward()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,15 +31,9 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
|
||||
public virtual bool ShowDetailed => true;
|
||||
|
||||
public bool CheckType(Type type)
|
||||
{
|
||||
return AcceptedType?.IsAssignableFrom(type) == true;
|
||||
}
|
||||
public bool CheckType(Type type) => AcceptedType?.IsAssignableFrom(type) == true;
|
||||
|
||||
public virtual bool CheckItem(Item item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public virtual bool CheckItem(Item item) => true;
|
||||
|
||||
public static int LabelToItemID(int label)
|
||||
{
|
||||
|
|
@ -78,10 +72,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
y += 32;
|
||||
}
|
||||
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance)
|
||||
{
|
||||
return new CollectObjectiveInstance(this, instance);
|
||||
}
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new CollectObjectiveInstance(this, instance);
|
||||
}
|
||||
|
||||
#region Timed
|
||||
|
|
@ -89,10 +80,8 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public class TimedCollectObjective : CollectObjective
|
||||
{
|
||||
public TimedCollectObjective(TimeSpan duration, int amount, Type type, TextDefinition name)
|
||||
: base(amount, type, name)
|
||||
{
|
||||
: base(amount, type, name) =>
|
||||
Duration = duration;
|
||||
}
|
||||
|
||||
public override bool IsTimed => true;
|
||||
public override TimeSpan Duration{ get; }
|
||||
|
|
@ -103,10 +92,8 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public class CollectObjectiveInstance : BaseObjectiveInstance
|
||||
{
|
||||
public CollectObjectiveInstance(CollectObjective objective, MLQuestInstance instance)
|
||||
: base(instance, objective)
|
||||
{
|
||||
: base(instance, objective) =>
|
||||
Objective = objective;
|
||||
}
|
||||
|
||||
public CollectObjective Objective{ get; set; }
|
||||
|
||||
|
|
@ -121,15 +108,9 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
return items.Where(item => item.QuestItem && Objective.CheckItem(item)).Sum(item => item.Amount);
|
||||
}
|
||||
|
||||
public override bool AllowsQuestItem(Item item, Type type)
|
||||
{
|
||||
return Objective.CheckType(type) && Objective.CheckItem(item);
|
||||
}
|
||||
public override bool AllowsQuestItem(Item item, Type type) => Objective.CheckType(type) && Objective.CheckItem(item);
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
return GetCurrentTotal() >= Objective.DesiredAmount;
|
||||
}
|
||||
public override bool IsCompleted() => GetCurrentTotal() >= Objective.DesiredAmount;
|
||||
|
||||
public override void OnQuestCancelled()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -86,10 +86,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
y += 16;
|
||||
}
|
||||
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance)
|
||||
{
|
||||
return new DeliverObjectiveInstance(this, instance);
|
||||
}
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new DeliverObjectiveInstance(this, instance);
|
||||
}
|
||||
|
||||
#region Timed
|
||||
|
|
@ -98,10 +95,8 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
public TimedDeliverObjective(TimeSpan duration, Type delivery, int amount, TextDefinition name, Type destination,
|
||||
bool spawnsDelivery = true)
|
||||
: base(delivery, amount, name, destination, spawnsDelivery)
|
||||
{
|
||||
: base(delivery, amount, name, destination, spawnsDelivery) =>
|
||||
Duration = duration;
|
||||
}
|
||||
|
||||
public override bool IsTimed => true;
|
||||
public override TimeSpan Duration{ get; }
|
||||
|
|
@ -112,10 +107,8 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public class DeliverObjectiveInstance : BaseObjectiveInstance
|
||||
{
|
||||
public DeliverObjectiveInstance(DeliverObjective objective, MLQuestInstance instance)
|
||||
: base(instance, objective)
|
||||
{
|
||||
: base(instance, objective) =>
|
||||
Objective = objective;
|
||||
}
|
||||
|
||||
public DeliverObjective Objective{ get; set; }
|
||||
|
||||
|
|
@ -130,10 +123,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
return destType?.IsAssignableFrom(type) == true;
|
||||
}
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
return HasCompleted;
|
||||
}
|
||||
public override bool IsCompleted() => HasCompleted;
|
||||
|
||||
public override void OnQuestAccepted()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,10 +7,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
{
|
||||
public class EscortObjective : BaseObjective
|
||||
{
|
||||
public EscortObjective(QuestArea destination = null)
|
||||
{
|
||||
Destination = destination;
|
||||
}
|
||||
public EscortObjective(QuestArea destination = null) => Destination = destination;
|
||||
|
||||
public QuestArea Destination{ get; set; }
|
||||
|
||||
|
|
@ -99,10 +96,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
|
||||
public override DataType ExtraDataType => DataType.EscortObjective;
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
return HasCompleted;
|
||||
}
|
||||
public override bool IsCompleted() => HasCompleted;
|
||||
|
||||
private void CheckDestination()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,15 +71,9 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
y += 16;
|
||||
}
|
||||
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance)
|
||||
{
|
||||
return new GainSkillObjectiveInstance(this, instance);
|
||||
}
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new GainSkillObjectiveInstance(this, instance);
|
||||
|
||||
private bool GetFlag(GainSkillObjectiveFlags flag)
|
||||
{
|
||||
return (m_Flags & flag) != 0;
|
||||
}
|
||||
private bool GetFlag(GainSkillObjectiveFlags flag) => (m_Flags & flag) != 0;
|
||||
|
||||
private void SetFlag(GainSkillObjectiveFlags flag, bool value)
|
||||
{
|
||||
|
|
@ -94,17 +88,12 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public class GainSkillObjectiveInstance : BaseObjectiveInstance
|
||||
{
|
||||
public GainSkillObjectiveInstance(GainSkillObjective objective, MLQuestInstance instance)
|
||||
: base(instance, objective)
|
||||
{
|
||||
: base(instance, objective) =>
|
||||
Objective = objective;
|
||||
}
|
||||
|
||||
public GainSkillObjective Objective{ get; set; }
|
||||
|
||||
public bool Handles(SkillName skill)
|
||||
{
|
||||
return Objective.Skill == skill;
|
||||
}
|
||||
public bool Handles(SkillName skill) => Objective.Skill == skill;
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,10 +55,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
#endregion
|
||||
}
|
||||
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance)
|
||||
{
|
||||
return new KillObjectiveInstance(this, instance);
|
||||
}
|
||||
public override BaseObjectiveInstance CreateInstance(MLQuestInstance instance) => new KillObjectiveInstance(this, instance);
|
||||
}
|
||||
|
||||
#region Timed
|
||||
|
|
@ -66,10 +63,8 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
public class TimedKillObjective : KillObjective
|
||||
{
|
||||
public TimedKillObjective(TimeSpan duration, int amount, Type[] types, TextDefinition name, QuestArea area = null)
|
||||
: base(amount, types, name, area)
|
||||
{
|
||||
: base(amount, types, name, area) =>
|
||||
Duration = duration;
|
||||
}
|
||||
|
||||
public override bool IsTimed => true;
|
||||
public override TimeSpan Duration{ get; }
|
||||
|
|
@ -116,10 +111,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
return false;
|
||||
}
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
return Slain >= Objective.DesiredAmount;
|
||||
}
|
||||
public override bool IsCompleted() => Slain >= Objective.DesiredAmount;
|
||||
|
||||
public override void WriteToGump(Gump g, ref int y)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue