private bool CheckTools(Creature creature, string method)
{
var right = "";
var left = "";
switch (method)
{
case CookingMethod.Mixing:
right = "/cooking/cooking_knife/";
left = "/cooking/cooking_table/";
break;
case CookingMethod.Kneading:
case CookingMethod.NoodleMaking:
case CookingMethod.PastaMaking:
case CookingMethod.PieMaking:
right = "/cooking/cooking_kneader/";
left = "/cooking/cooking_table/";
break;
case CookingMethod.Baking:
case CookingMethod.Simmering:
case CookingMethod.Boiling:
case CookingMethod.DeepFrying:
case CookingMethod.StirFrying:
case CookingMethod.JamMaking:
case CookingMethod.Steaming:
right = "/cooking/cooking_dipper/";
left = "/cooking/cooking_pot/";
break;
default:
Log.Error("Cooking.CheckTools: Unknown cooking method.");
return false;
}
// Check right hand
if (right != "")
{
if ((creature.RightHand == null || !creature.RightHand.HasTag(right)))
return false;
if (creature.RightHand.Durability == 0)
{
Send.Notice(creature, Localization.Get("You can't use this {0} anymore."), creature.RightHand.Data.Name);
return false;
}
}
// Check left hand
if (left != "")
{
if ((creature.LeftHand == null || !creature.LeftHand.HasTag(left)))
return false;
if (creature.LeftHand.Durability == 0)
{
Send.Notice(creature, Localization.Get("You can't use this {0} anymore."), creature.RightHand.Data.Name);
return false;
}
}
return true;
}