Formatting FIxes (#58)
This commit is contained in:
parent
57fb9fb525
commit
096d39609e
1318 changed files with 11633 additions and 22129 deletions
|
|
@ -59,10 +59,7 @@ namespace Server.Items
|
|||
{
|
||||
private GreenThorns m_Thorn;
|
||||
|
||||
public InternalTarget(GreenThorns thorn) : base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_Thorn = thorn;
|
||||
}
|
||||
public InternalTarget(GreenThorns thorn) : base(3, true, TargetFlags.None) => m_Thorn = thorn;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,10 +85,7 @@ namespace Server.Items
|
|||
return context;
|
||||
}
|
||||
|
||||
public static bool UnderEffect(Mobile m)
|
||||
{
|
||||
return m_Table.ContainsKey(m);
|
||||
}
|
||||
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m);
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
|
|
@ -108,10 +105,7 @@ namespace Server.Items
|
|||
{
|
||||
private Mobile m_Mobile;
|
||||
|
||||
public OrangePetalsTimer(Mobile from) : base(TimeSpan.FromMinutes(5.0))
|
||||
{
|
||||
m_Mobile = from;
|
||||
}
|
||||
public OrangePetalsTimer(Mobile from) : base(TimeSpan.FromMinutes(5.0)) => m_Mobile = from;
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
|
|
@ -125,10 +119,7 @@ namespace Server.Items
|
|||
|
||||
private class OrangePetalsContext
|
||||
{
|
||||
public OrangePetalsContext(Timer timer)
|
||||
{
|
||||
Timer = timer;
|
||||
}
|
||||
public OrangePetalsContext(Timer timer) => Timer = timer;
|
||||
|
||||
public Timer Timer{ get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,10 +50,7 @@ namespace Server.Items
|
|||
{
|
||||
private RedLeaves m_RedLeaves;
|
||||
|
||||
public InternalTarget(RedLeaves redLeaves) : base(3, false, TargetFlags.None)
|
||||
{
|
||||
m_RedLeaves = redLeaves;
|
||||
}
|
||||
public InternalTarget(RedLeaves redLeaves) : base(3, false, TargetFlags.None) => m_RedLeaves = redLeaves;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,10 +48,7 @@ namespace Server.Engines.Plants
|
|||
};
|
||||
|
||||
[Constructible]
|
||||
public PlantBowl() : base(0x15FD)
|
||||
{
|
||||
Weight = 1.0;
|
||||
}
|
||||
public PlantBowl() : base(0x15FD) => Weight = 1.0;
|
||||
|
||||
public PlantBowl(Serial serial) : base(serial)
|
||||
{
|
||||
|
|
@ -110,10 +107,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
private PlantBowl m_PlantBowl;
|
||||
|
||||
public InternalTarget(PlantBowl plantBowl) : base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_PlantBowl = plantBowl;
|
||||
}
|
||||
public InternalTarget(PlantBowl plantBowl) : base(3, true, TargetFlags.None) => m_PlantBowl = plantBowl;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
private static Dictionary<PlantHue, PlantHueInfo> m_Table;
|
||||
|
||||
static PlantHueInfo()
|
||||
{
|
||||
static PlantHueInfo() =>
|
||||
m_Table = new Dictionary<PlantHue, PlantHueInfo>
|
||||
{
|
||||
[PlantHue.Plain] = new PlantHueInfo(0, 1060813, PlantHue.Plain, 0x835),
|
||||
|
|
@ -66,8 +65,6 @@ namespace Server.Engines.Plants
|
|||
[PlantHue.FireRed] = new PlantHueInfo(0x489, 1061855, PlantHue.FireRed)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
private PlantHueInfo(int hue, int name, PlantHue plantHue) : this(hue, name, plantHue, hue)
|
||||
{
|
||||
}
|
||||
|
|
@ -88,10 +85,7 @@ namespace Server.Engines.Plants
|
|||
|
||||
public int GumpHue{ get; }
|
||||
|
||||
public static PlantHueInfo GetInfo(PlantHue plantHue)
|
||||
{
|
||||
return m_Table.TryGetValue(plantHue, out PlantHueInfo info) ? info : m_Table[PlantHue.Plain];
|
||||
}
|
||||
public static PlantHueInfo GetInfo(PlantHue plantHue) => m_Table.TryGetValue(plantHue, out PlantHueInfo info) ? info : m_Table[PlantHue.Plain];
|
||||
|
||||
public static PlantHue RandomFirstGeneration()
|
||||
{
|
||||
|
|
@ -104,30 +98,15 @@ namespace Server.Engines.Plants
|
|||
}
|
||||
}
|
||||
|
||||
public static bool CanReproduce(PlantHue plantHue)
|
||||
{
|
||||
return (plantHue & PlantHue.Reproduces) != PlantHue.None;
|
||||
}
|
||||
public static bool CanReproduce(PlantHue plantHue) => (plantHue & PlantHue.Reproduces) != PlantHue.None;
|
||||
|
||||
public static bool IsCrossable(PlantHue plantHue)
|
||||
{
|
||||
return (plantHue & PlantHue.Crossable) != PlantHue.None;
|
||||
}
|
||||
public static bool IsCrossable(PlantHue plantHue) => (plantHue & PlantHue.Crossable) != PlantHue.None;
|
||||
|
||||
public static bool IsBright(PlantHue plantHue)
|
||||
{
|
||||
return (plantHue & PlantHue.Bright) != PlantHue.None;
|
||||
}
|
||||
public static bool IsBright(PlantHue plantHue) => (plantHue & PlantHue.Bright) != PlantHue.None;
|
||||
|
||||
public static PlantHue GetNotBright(PlantHue plantHue)
|
||||
{
|
||||
return plantHue & ~PlantHue.Bright;
|
||||
}
|
||||
public static PlantHue GetNotBright(PlantHue plantHue) => plantHue & ~PlantHue.Bright;
|
||||
|
||||
public static bool IsPrimary(PlantHue plantHue)
|
||||
{
|
||||
return plantHue == PlantHue.Red || plantHue == PlantHue.Blue || plantHue == PlantHue.Yellow;
|
||||
}
|
||||
public static bool IsPrimary(PlantHue plantHue) => plantHue == PlantHue.Red || plantHue == PlantHue.Blue || plantHue == PlantHue.Yellow;
|
||||
|
||||
public static PlantHue Cross(PlantHue first, PlantHue second)
|
||||
{
|
||||
|
|
@ -161,24 +140,12 @@ namespace Server.Engines.Plants
|
|||
return notBrightFirst & notBrightSecond;
|
||||
}
|
||||
|
||||
public bool IsCrossable()
|
||||
{
|
||||
return IsCrossable(PlantHue);
|
||||
}
|
||||
public bool IsCrossable() => IsCrossable(PlantHue);
|
||||
|
||||
public bool IsBright()
|
||||
{
|
||||
return IsBright(PlantHue);
|
||||
}
|
||||
public bool IsBright() => IsBright(PlantHue);
|
||||
|
||||
public PlantHue GetNotBright()
|
||||
{
|
||||
return GetNotBright(PlantHue);
|
||||
}
|
||||
public PlantHue GetNotBright() => GetNotBright(PlantHue);
|
||||
|
||||
public bool IsPrimary()
|
||||
{
|
||||
return IsPrimary(PlantHue);
|
||||
}
|
||||
public bool IsPrimary() => IsPrimary(PlantHue);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,10 +191,7 @@ namespace Server.Engines.Plants
|
|||
return 1026951; // dirt
|
||||
}
|
||||
|
||||
public int GetLocalizedContainerType()
|
||||
{
|
||||
return 1150435; // bowl
|
||||
}
|
||||
public int GetLocalizedContainerType() => 1150435;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
|
@ -284,11 +281,9 @@ namespace Server.Engines.Plants
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsUsableBy(Mobile from)
|
||||
{
|
||||
return IsChildOf(from.Backpack) || IsChildOf(from.FindBankNoCreate()) || IsLockedDown && IsAccessibleTo(from) ||
|
||||
RootParent is Item root && root.IsSecure && root.IsAccessibleTo(from);
|
||||
}
|
||||
public bool IsUsableBy(Mobile from) =>
|
||||
IsChildOf(from.Backpack) || IsChildOf(from.FindBankNoCreate()) || IsLockedDown && IsAccessibleTo(from) ||
|
||||
RootParent is Item root && root.IsSecure && root.IsAccessibleTo(from);
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
private PlantItem m_Plant;
|
||||
|
||||
public PlantPourTarget(PlantItem plant) : base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_Plant = plant;
|
||||
}
|
||||
public PlantPourTarget(PlantItem plant) : base(3, true, TargetFlags.None) => m_Plant = plant;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ namespace Server.Engines.Plants
|
|||
return null;
|
||||
}
|
||||
|
||||
public Item CreateResource()
|
||||
{
|
||||
return (Item)Activator.CreateInstance(ResourceType);
|
||||
}
|
||||
public Item CreateResource() => (Item)Activator.CreateInstance(ResourceType);
|
||||
}
|
||||
}
|
||||
|
|
@ -278,10 +278,7 @@ namespace Server.Engines.Plants
|
|||
return PlantType.ExoticBonsai;
|
||||
}
|
||||
|
||||
public static bool IsCrossable(PlantType plantType)
|
||||
{
|
||||
return GetInfo(plantType).Crossable;
|
||||
}
|
||||
public static bool IsCrossable(PlantType plantType) => GetInfo(plantType).Crossable;
|
||||
|
||||
public static PlantType Cross(PlantType first, PlantType second)
|
||||
{
|
||||
|
|
@ -296,10 +293,7 @@ namespace Server.Engines.Plants
|
|||
return (PlantType)((firstIndex + secondIndex) / 2);
|
||||
}
|
||||
|
||||
public static bool CanReproduce(PlantType plantType)
|
||||
{
|
||||
return GetInfo(plantType).Reproduces;
|
||||
}
|
||||
public static bool CanReproduce(PlantType plantType) => GetInfo(plantType).Reproduces;
|
||||
|
||||
public int GetPlantLabelSeed(PlantHueInfo hueInfo)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,10 +6,7 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
private PlantItem m_Plant;
|
||||
|
||||
public PollinateTarget(PlantItem plant) : base(3, true, TargetFlags.None)
|
||||
{
|
||||
m_Plant = plant;
|
||||
}
|
||||
public PollinateTarget(PlantItem plant) : base(3, true, TargetFlags.None) => m_Plant = plant;
|
||||
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -68,15 +68,9 @@ namespace Server.Engines.Plants
|
|||
|
||||
public override bool ForceShowProperties => ObjectPropertyList.Enabled;
|
||||
|
||||
public static Seed RandomBonsaiSeed()
|
||||
{
|
||||
return RandomBonsaiSeed(0.5);
|
||||
}
|
||||
public static Seed RandomBonsaiSeed() => RandomBonsaiSeed(0.5);
|
||||
|
||||
public static Seed RandomBonsaiSeed(double increaseRatio)
|
||||
{
|
||||
return new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain);
|
||||
}
|
||||
public static Seed RandomBonsaiSeed(double increaseRatio) => new Seed(PlantTypeInfo.RandomBonsai(increaseRatio), PlantHue.Plain);
|
||||
|
||||
public static Seed RandomPeculiarSeed(int group)
|
||||
{
|
||||
|
|
@ -145,11 +139,9 @@ namespace Server.Engines.Plants
|
|||
LabelTo(from, 1061916); // Choose a bowl of dirt to plant this seed in.
|
||||
}
|
||||
|
||||
public override bool StackWith(Mobile from, Item dropped, bool playSound)
|
||||
{
|
||||
return dropped is Seed other && other.PlantType == m_PlantType && other.PlantHue == m_PlantHue &&
|
||||
other.ShowType == m_ShowType && base.StackWith(from, other, playSound);
|
||||
}
|
||||
public override bool StackWith(Mobile from, Item dropped, bool playSound) =>
|
||||
dropped is Seed other && other.PlantType == m_PlantType && other.PlantHue == m_PlantHue &&
|
||||
other.ShowType == m_ShowType && base.StackWith(from, other, playSound);
|
||||
|
||||
public override void OnAfterDuped(Item newItem)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue