Code cleanup (#188)

This commit is contained in:
Kamron Batman 2020-08-01 08:40:06 -07:00 • committed by GitHub
parent df53c16620
commit 010fd9402a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
185 changed files with 1052 additions and 1271 deletions

View file

@ -13,7 +13,7 @@ namespace Server.Engines.Craft
NoSkill
}
public class Resmelt
public static class Resmelt
{
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
{
@ -61,7 +61,7 @@ namespace Server.Engines.Craft
if (craftItem == null || craftItem.Resources.Count == 0)
return SmeltResult.Invalid;
CraftRes craftResource = craftItem.Resources.GetAt(0);
CraftRes craftResource = craftItem.Resources[0];
if (craftResource.Amount < 2)
return SmeltResult.Invalid; // Not enough metal to resmelt
@ -85,9 +85,9 @@ namespace Server.Engines.Craft
Type resourceType = info.ResourceTypes[0];
Item ingot = (Item)ActivatorUtil.CreateInstance(resourceType);
if (item is DragonBardingDeed || (item is BaseArmor armor && armor.PlayerConstructed) ||
(item is BaseWeapon weapon && weapon.PlayerConstructed) ||
(item is BaseClothing clothing && clothing.PlayerConstructed))
if (item is DragonBardingDeed || item is BaseArmor armor && armor.PlayerConstructed ||
item is BaseWeapon weapon && weapon.PlayerConstructed ||
item is BaseClothing clothing && clothing.PlayerConstructed)
ingot.Amount = craftResource.Amount / 2;
else
ingot.Amount = 1;
@ -144,7 +144,6 @@ namespace Server.Engines.Craft
else if (targeted is DragonBardingDeed deed)
{
result = Resmelt(from, deed, deed.Resource);
isStoreBought = false;
}
message = result switch