protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is SackFlourOpen) { m_Item.Delete(); ((SackFlourOpen)targeted).Quantity--; from.AddToBackpack(new CakeMix()); } else if (CookableFood.IsHeatSource(targeted)) { from.PlaySound(0x225); m_Item.Consume(); CookableFood.InternalTarget.InternalTimer t = new CookableFood.InternalTarget.InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else if (targeted is JarHoney) { m_Item.Consume(); ((JarHoney)targeted).Delete(); from.AddToBackpack(new CookieMix()); } }
public InternalTimer(Mobile from, IPoint3D p, Map map, CookableFood cookableFood) : base(TimeSpan.FromSeconds(5.0)) { m_From = from; m_Point = p; m_Map = map; m_CookableFood = cookableFood; }
public InternalTimer(Mobile from, IPoint3D p, Map map, CookableFood cookableFood) : base(TimeSpan.FromSeconds(2.5)) { m_From = from; m_Point = p; m_Map = map; m_CookableFood = cookableFood; if (from is PlayerMobile) { ((PlayerMobile)from).ResetPlayerAction(this); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { if (from.BeginAction(typeof(CookableFood))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else { from.SendLocalizedMessage(500119); } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { if (from.BeginAction(typeof(CookableFood))) { from.PlaySound(0x225); m_Item.Consume(); InternalTimer t = new InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else { from.SendMessage("Vous devez attendre avant de faire cuire à nouveau"); // You must wait to perform another action } } }
public InternalTimer( Mobile from, IPoint3D p, Map map, CookableFood cookableFood ) : base(TimeSpan.FromSeconds( 5.0 )) { m_From = from; m_Point = p; m_Map = map; m_CookableFood = cookableFood; }
public InternalTarget( CookableFood item ) : base(1, false, TargetFlags.None) { m_Item = item; }
public InternalTarget(CookableFood item) : base(1, false, TargetFlags.None) { m_Item = item; }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { from.PlaySound(0x225); m_Item.Consume(); CookableFood.InternalTarget.InternalTimer t = new CookableFood.InternalTarget.InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else if (targeted is Eggs) { m_Item.Delete(); ((Eggs)targeted).Consume(); from.AddToBackpack(new UnbakedQuiche()); } else if (targeted is JarHoney) { m_Item.Delete(); ((JarHoney)targeted).Consume(); from.AddToBackpack(new SweetDough()); } else if (targeted is CookedBird) { m_Item.Delete(); ((CookedBird)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is Ham) { m_Item.Delete(); ((Ham)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is Pear) { m_Item.Delete(); ((Pear)targeted).Consume(); from.AddToBackpack(new UnbakedFruitPie()); } else if (targeted is CheeseWheel) { m_Item.Delete(); ((CheeseWheel)targeted).Consume(); from.AddToBackpack(new UncookedCheesePizza()); } else if (targeted is HumanJerky) { m_Item.Delete(); ((HumanJerky)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is FishSteak) { m_Item.Delete(); ((FishSteak)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is Pumpkin) { m_Item.Delete(); ((Pumpkin)targeted).Consume(); from.AddToBackpack(new UnbakedPumpkinPie()); } else if (targeted is Sausage) { m_Item.Delete(); ((Sausage)targeted).Consume(); from.AddToBackpack(new UncookedSausagePizza()); } else if (targeted is Apple) { m_Item.Delete(); ((Apple)targeted).Consume(); from.AddToBackpack(new UnbakedApplePie()); } else if (targeted is Peach) { m_Item.Delete(); ((Peach)targeted).Consume(); from.AddToBackpack(new UnbakedPeachCobbler()); } }
public InternalTimer( Mobile from, IPoint3D p, Map map, CookableFood cookableFood ) : base( TimeSpan.FromSeconds( 2.5 ) ) { m_From = from; m_Point = p; m_Map = map; m_CookableFood = cookableFood; if (from is PlayerMobile) ((PlayerMobile)from).ResetPlayerAction(this); }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (CookableFood.IsHeatSource(targeted)) { from.PlaySound(0x225); m_Item.Consume(); CookableFood.InternalTarget.InternalTimer t = new CookableFood.InternalTarget.InternalTimer(from, targeted as IPoint3D, from.Map, m_Item); t.Start(); } else if (targeted is Eggs) { m_Item.Delete(); ((Eggs)targeted).Consume(); from.AddToBackpack(new UnbakedQuiche()); } else if (targeted is JarHoney) { m_Item.Delete(); ((JarHoney)targeted).Consume(); from.AddToBackpack(new SweetDough()); } /*else if ( targeted is CheeseWheel ) * { * m_Item.Delete(); * * ((CheeseWheel)targeted).Consume(); * * from.AddToBackpack( new CheesePizza() ); * } * else if ( targeted is Sausage ) * { * m_Item.Delete(); * * ((Sausage)targeted).Consume(); * * from.AddToBackpack( new SausagePizza() ); * }*/ else if (targeted is Apple) { m_Item.Delete(); ((Apple)targeted).Consume(); from.AddToBackpack(new UnbakedApplePie()); } else if (targeted is Peach) { m_Item.Delete(); ((Peach)targeted).Consume(); from.AddToBackpack(new UnbakedPeachCobbler()); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Item.Deleted) { return; } if (targeted is Eggs) { m_Item.Consume(); ((Eggs)targeted).Consume(); from.AddToBackpack(new UnbakedQuiche()); from.AddToBackpack(new Eggshells()); } else if (targeted is CheeseWheel) { m_Item.Consume(); ((CheeseWheel)targeted).Consume(); from.AddToBackpack(new UncookedCheesePizza()); } else if (targeted is Sausage) { m_Item.Consume(); ((Sausage)targeted).Consume(); from.AddToBackpack(new UncookedSausagePizza()); } else if (targeted is Apple) { m_Item.Consume(); ((Apple)targeted).Consume(); from.AddToBackpack(new UnbakedApplePie()); } else if (targeted is Pear) { m_Item.Consume(); ((Pear)targeted).Consume(); from.AddToBackpack(new UnbakedFruitPie()); } else if (targeted is CookedBird) { m_Item.Consume(); ((Item)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is FishSteak) { m_Item.Consume(); ((Item)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is Ribs) { m_Item.Consume(); ((Item)targeted).Consume(); from.AddToBackpack(new UnbakedMeatPie()); } else if (targeted is Peach) { m_Item.Consume(); ((Peach)targeted).Consume(); from.AddToBackpack(new UnbakedPeachCobbler()); } else if (targeted is JarHoney) { m_Item.Consume(); ((JarHoney)targeted).Consume(); from.AddToBackpack(new SweetDough()); } else if (CookableFood.IsHeatSource(targeted)) { if (from.BeginAction(typeof(CookableFood))) { from.PlaySound(0x225); m_Item.Consume(); Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(OnCooked), from); } else { from.SendAsciiMessage("You are already cooking something."); } } }
public void DetermineTarget(Mobile pm, Item target) { if (Contains.Exists(x => x == target.GetType())) { pm.SendMessage(61, "The mortar already contains this ingredient."); return; } if (target is VileTentacles) { var tentacles = target as VileTentacles; if (tentacles.ChoppedUp) { ContainsTentacles = true; pm.SendMessage(54, "You place the chopped tentacles into the mortar and grind them up."); } else { WrongStep = true; pm.SendMessage(54, "You place the tentacles into the mortar and grind them up."); } Contains.Add(typeof(VileTentacles)); target.Consume(); pm.PlaySound(0x242); } else if (target is UndyingFlesh) { var flesh = target as UndyingFlesh; if (flesh.ChoppedUp) { ContainsFlesh = true; pm.SendMessage(54, "You place the diced flesh into the mortar and grind it up."); } else { WrongStep = true; pm.SendMessage(54, "You place the undying flesh into the mortar and grind it up."); } Contains.Add(typeof(UndyingFlesh)); target.Consume(); pm.PlaySound(0x242); } else if (target is FeyWings) { pm.SendMessage(54, "You place fey wings into the mortar and grind them up into a fine powder."); target.Consume(); ContainsWings = true; Contains.Add(typeof(FeyWings)); pm.PlaySound(0x242); } else if (target is VialofVitriol) { pm.SendMessage(54, "You dump the vial of vitriol into the mortar."); target.Consume(); ContainsVitriol = true; Contains.Add(typeof(VialofVitriol)); pm.PlaySound(0x242); } else if (target is DaemonClaw) { pm.SendMessage(54, "You rip off one of the daemon claws fingers and place it into the mortar."); target.Consume(); WrongStep = true; Contains.Add(typeof(DaemonClaw)); pm.PlaySound(0x242); } else if (target is SeedofRenewal) { pm.SendMessage(54, "You place the seed of renewal into the mortar and grind it up."); target.Consume(); WrongStep = true; Contains.Add(typeof(SeedofRenewal)); pm.PlaySound(0x242); } else if (target is SpiderCarapace) { pm.SendMessage(54, "You rip off of the spider carapace and place it into the mortar."); target.Consume(); WrongStep = true; Contains.Add(typeof(SpiderCarapace)); pm.PlaySound(0x242); } else if (CookableFood.IsHeatSource(target)) { if (ContainsFlesh && ContainsTentacles && ContainsVitriol && ContainsWings) { pm.SendMessage(61, "You place the mortar over the heat source and the ingredients inside begin to bubble and fizzle gently."); Hue = 61; Completed = true; } else if (Contains != null && Contains.Count > 0) { Effects.SendLocationEffect(pm, pm.Map, 0x36B0, 25, 1); Effects.PlaySound(pm, pm.Map, Utility.RandomList(0x11B, 0x11C, 0x11D)); pm.SendMessage(61, "You place the mortar over the heat source and the ingredients begin to bubble violently. Suddenly, the mortar explodes in your hands!"); Consume(); pm.Damage(90); } else { pm.SendMessage(61, "There is nothing in the mortar to heat up."); } } else if (target is PewterBowlZombie) { var bowl = target as PewterBowlZombie; pm.SendMessage(61, "You dump the concoction into the pewter bowl."); if (WrongStep || !Completed) { bowl.WrongStep = true; } Consume(); bowl.ContainsConcoction = true; pm.PlaySound(0x240); } else { pm.SendMessage(61, "That doesn't look like it should go in the mortar."); } }