using System;
using Server.Items;

namespace Server.Engines.Craft
{

	public class DefSeafood : CraftSystem
	{
		public override SkillName MainSkill
		{
			get	{ return SkillName.Cooking; }
		}
		public override string GumpTitleString
		{
			get { return "<basefont color=#FFFFFF><CENTER>SEAFOOD MENU</CENTER></basefont>"; } 
		}

		private static CraftSystem m_CraftSystem;

		public static CraftSystem CraftSystem
		{
			get
			{
				if ( m_CraftSystem == null )
					m_CraftSystem = new DefSeafood();

				return m_CraftSystem;
			}
		}
		

		public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }

		public override double GetChanceAtMin( CraftItem item )
		{
			return 0.5; // 50%
		}

		private DefSeafood() : base( 1, 1, 1.25 )// base( 1, 1, 4.5 )
		{
		}

		public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
		{
			if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!
			else if ( !BaseTool.CheckAccessible( tool, from ) )
				return 1044263; // The tool must be on your person to use.

			return 0;
		}

		public override void PlayCraftEffect( Mobile from )
		{
			from.PlaySound( 32 );
		}

		public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
		{
			if ( toolBroken )
				from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

			if ( failed )
			{
				if ( lostMaterial )
					return 1044043; // You failed to create the item, and some of your materials are lost.
				else
					return 1044157; // You failed to create the item, but no materials were lost.
			}
			else
			{
				if ( quality == 0 )
					return 502785; // You were barely able to make this item.  It's quality is below average.
				else if ( makersMark && quality == 2 )
					return 1044156; // You create an exceptional quality item and affix your maker's mark.
				else if ( quality == 2 )
					return 1044155; // You create an exceptional quality item.
				else				
					return 1044154; // You create the item.
			}
		}

		public override void InitCraftList()
		{
			int index = -1;

			#region Seafood
			
			index = AddCraft( typeof( SteamedCrab ), "SEAFOOD", "Steamed Crab", 60.0, 110.0, typeof( Crab ), "Crab", 1, "You don't have enough crab to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedBlueCrab ), "SEAFOOD", "Steamed Blue Crab", 60.0, 110.0, typeof( BlueCrab ), "Blue Crab", 1, "You don't have enough blue crab to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedSnowCrab ), "SEAFOOD", "Steamed Snow Crab", 60.0, 110.0, typeof( SnowCrab ), "Snow Crab", 1, "You don't have enough snow crab to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedRedRockCrab ), "SEAFOOD", "Steamed Red Rock Crab", 60.0, 110.0, typeof( RedRockCrab ), "Crab", 1, "You don't have enough red rock crab to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedLobster ), "SEAFOOD", "Steamed Lobster", 60.0, 110.0, typeof( Lobster ), "Lobster", 1, "You don't have enough lobster to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedRockLobster ), "SEAFOOD", "Steamed Rock Lobster", 60.0, 110.0, typeof( RockLobster ), "Rock Lobster", 1, "You don't have enough rock lobster to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );
			
			index = AddCraft( typeof( SteamedSpineyLobster ), "SEAFOOD", "Steamed Spiney Lobster", 60.0, 110.0, typeof( SpineyLobster ), "Spiney Lobster", 1, "You don't have enough spiney lobster to make that." );
			AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
			SetNeedOven( index, true );

			#endregion	
			
		}
	}
}
