public BlindFoldItem() : base("Blindfold") { _putOnVerb = new Verb(new FormattedString("Put on the ", "Blindfold".Cyan()), s => { Game.Instace.OutputPane.Write("No, that would be silly..."); _putOnVerb.Enabled = false; }); InnerVerbs.Add(_putOnVerb); }
public NotebookItem() : base("Notebook") { _inspectVerb = new Verb(new FormattedString("Inspect the ", "Notebook".Cyan()), s => { Game.Instace.OutputPane.Write("It was written by 'Ricky'. It is full of sorrowful notes."); InnerVerbs.Remove(_inspectVerb); }); InnerVerbs.Add(_inspectVerb); }
public MugItem() : base("Mug", new LiquidDef("Coffee", "oz", 8)) { LiquidStorage["Coffee"] = (float)(Game.Random.NextDouble() * 8); _drinkVerb = new Verb("Drink some", () => LiquidStorage.Where(o => o.Value > 0).Select(o => new CommandPart(o.Key)), s => { var t = s.Split(' ').Last(); var k = LiquidStorage.First(o => o.Key.Equals(t, StringComparison.InvariantCultureIgnoreCase)).Key; if (k == null) { return; } LiquidStorage[k] -= Math.Min(LiquidStorage[k], 0.5f); _drinkVerb.Enabled = LiquidStorage.Any(o => o.Value > 0); }); InnerVerbs.Add(_drinkVerb); }