Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 • committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -4,10 +4,7 @@ namespace Server.Engines.Craft
{
public class CraftGroupCol : CollectionBase
{
public int Add(CraftGroup craftGroup)
{
return List.Add(craftGroup);
}
public int Add(CraftGroup craftGroup) => List.Add(craftGroup);
public void Remove(int index)
{
@ -20,10 +17,7 @@ namespace Server.Engines.Craft
}
}
public CraftGroup GetAt(int index)
{
return (CraftGroup)List[index];
}
public CraftGroup GetAt(int index) => (CraftGroup)List[index];
public int SearchFor(TextDefinition groupName)
{

View file

@ -339,10 +339,7 @@ namespace Server.Engines.Craft
return craftGroupCol.Count;
}
public static int GetButtonID(int type, int index)
{
return 1 + type + index * 7;
}
public static int GetButtonID(int type, int index) => 1 + type + index * 7;
public void CraftItem(CraftItem item)
{

View file

@ -424,10 +424,8 @@ namespace Server.Engines.Craft
}
public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount,
ConsumeType consumeType, ref object message)
{
return ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false);
}
ConsumeType consumeType, ref object message) =>
ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false);
public bool ConsumeRes(Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount,
ConsumeType consumeType, ref object message, bool isFailure)
@ -639,10 +637,7 @@ namespace Server.Engines.Craft
}
}
private int CheckHueGrouping(Item a, Item b)
{
return b.Hue.CompareTo(a.Hue);
}
private int CheckHueGrouping(Item a, Item b) => b.Hue.CompareTo(a.Hue);
public double GetExceptionalChance(CraftSystem system, double chance, Mobile from)
{
@ -686,10 +681,8 @@ namespace Server.Engines.Craft
}
public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality,
ref bool allRequiredSkills)
{
return CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true);
}
ref bool allRequiredSkills) =>
CheckSkills(from, typeRes, craftSystem, ref quality, ref allRequiredSkills, true);
public bool CheckSkills(Mobile from, Type typeRes, CraftSystem craftSystem, ref int quality,
ref bool allRequiredSkills, bool gainSkills)

View file

@ -5,10 +5,7 @@ namespace Server.Engines.Craft
{
public class CraftItemCol : CollectionBase
{
public int Add(CraftItem craftItem)
{
return List.Add(craftItem);
}
public int Add(CraftItem craftItem) => List.Add(craftItem);
public void Remove(int index)
{
@ -21,10 +18,7 @@ namespace Server.Engines.Craft
}
}
public CraftItem GetAt(int index)
{
return (CraftItem)List[index];
}
public CraftItem GetAt(int index) => (CraftItem)List[index];
public CraftItem SearchForSubclass(Type type)
{

View file

@ -5,10 +5,7 @@ namespace Server.Engines.Craft
[AttributeUsage(AttributeTargets.Class)]
public class CraftItemIDAttribute : Attribute
{
public CraftItemIDAttribute(int itemID)
{
ItemID = itemID;
}
public CraftItemIDAttribute(int itemID) => ItemID = itemID;
public int ItemID{ get; }
}

View file

@ -20,9 +20,6 @@ namespace Server.Engines.Craft
}
}
public CraftRes GetAt(int index)
{
return (CraftRes)List[index];
}
public CraftRes GetAt(int index) => (CraftRes)List[index];
}
}

View file

@ -20,9 +20,6 @@ namespace Server.Engines.Craft
}
}
public CraftSkill GetAt(int index)
{
return (CraftSkill)List[index];
}
public CraftSkill GetAt(int index) => (CraftSkill)List[index];
}
}

View file

@ -5,10 +5,7 @@ namespace Server.Engines.Craft
{
public class CraftSubResCol : CollectionBase
{
public CraftSubResCol()
{
Init = false;
}
public CraftSubResCol() => Init = false;
public bool Init{ get; set; }
@ -34,10 +31,7 @@ namespace Server.Engines.Craft
}
}
public CraftSubRes GetAt(int index)
{
return (CraftSubRes)List[index];
}
public CraftSubRes GetAt(int index) => (CraftSubRes)List[index];
public CraftSubRes SearchFor(Type type)
{

View file

@ -65,10 +65,7 @@ namespace Server.Engines.Craft
public abstract double GetChanceAtMin(CraftItem item);
public virtual bool RetainsColorFrom(CraftItem item, Type type)
{
return false;
}
public virtual bool RetainsColorFrom(CraftItem item, Type type) => false;
public CraftContext GetContext(Mobile m)
{
@ -92,10 +89,7 @@ namespace Server.Engines.Craft
GetContext(m)?.OnMade(item);
}
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem)
{
return true;
}
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem) => true;
public void CreateItem(Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem)
{
@ -122,22 +116,16 @@ namespace Server.Engines.Craft
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
Type typeRes, TextDefinition nameRes, int amount) =>
AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
}
Type typeRes, TextDefinition nameRes, int amount, TextDefinition message) =>
AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
double maxSkill, Type typeRes, TextDefinition nameRes, int amount) =>
AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)

View file

@ -37,21 +37,11 @@ namespace Server.Engines.Craft
m_Deed = deed;
}
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits)
{
// 40% - (1% per hp lost) - (1% per 10 craft skill)
return 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
}
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits) => 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits)
{
return GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100);
}
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits) => GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100);
private int GetRepairDifficulty(int curHits, int maxHits)
{
return (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250;
}
private int GetRepairDifficulty(int curHits, int maxHits) => (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250;
private bool CheckRepairDifficulty(Mobile mob, SkillName skill, int curHits, int maxHits)
{