diff --git a/NethackHelper/Item.cs b/NethackHelper/Item.cs index 483fb14..d428b26 100644 --- a/NethackHelper/Item.cs +++ b/NethackHelper/Item.cs @@ -8,6 +8,8 @@ public string School { get; set; } = string.Empty; public string? Appearance { get; set; } public bool UsuallyCursed { get; set; } = false; + public bool UniqueAppearance { get; set; } = true; + public string Slot { get; set; } = string.Empty; } public class ItemList { @@ -21,5 +23,6 @@ School = 4, Appearance = 3, UsuallyCursed = 5, + Slot = 6, } } diff --git a/NethackHelper/ItemDisplay.cs b/NethackHelper/ItemDisplay.cs index 9a5e45e..675a80e 100644 --- a/NethackHelper/ItemDisplay.cs +++ b/NethackHelper/ItemDisplay.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Windows.Forms; using static System.Windows.Forms.ListViewItem; using System.ComponentModel; +using System.Runtime.CompilerServices; namespace NethackHelper { public partial class ItemDisplay : UserControl { @@ -20,6 +21,7 @@ namespace NethackHelper { [ItemAttribute.School] = item => item.School.ToString(), [ItemAttribute.Appearance] = item => item.Appearance ?? UNIDENTIFIED, [ItemAttribute.UsuallyCursed] = item => item.UsuallyCursed ? "C" : string.Empty, + [ItemAttribute.Slot] = item => item.Slot.ToString(), }; [Browsable(false)] @@ -29,13 +31,17 @@ namespace NethackHelper { [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public List Columns { get; set; } = new(); + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] + public ItemAttribute Grouping { get; set; } = ItemAttribute.Cost; + private int[] GroupCosts { get; set; } = []; private Dictionary AppearanceMap { get; set; } = new(); + private Dictionary ItemMap { get; set; } = new(); public ItemDisplay() { InitializeComponent(); - this.itemListView.ListViewItemSorter = Comparer.Create(CompareItems); + this.itemListView.ListViewItemSorter = Comparer.Create(this.CompareItems); } protected override void OnLoad(EventArgs e) { @@ -56,14 +62,19 @@ namespace NethackHelper { this.itemListView.Groups.Clear(); this.itemListView.Items.Clear(); this.AppearanceMap.Clear(); + this.ItemMap.Clear(); - this.GroupCosts = itemList.Items.Select(item => item.Cost).Distinct().Order().ToArray(); - var costDictionary = new Dictionary(); + if (this.Grouping == ItemAttribute.Cost) { + this.GroupCosts = itemList.Items.Select(item => item.Cost).Distinct().Order().ToArray(); + } - foreach (var cost in this.GroupCosts) { - var group = new ListViewGroup(this.CostFormatter.Invoke(cost), HorizontalAlignment.Center); - this.itemListView.Groups.Add(group); - costDictionary.Add(cost, group); + var groups = itemList.Items.Select(item => COLUMN_MAP[this.Grouping].Invoke(item)).Distinct().Order(); + var groupDictionary = new Dictionary(); + + foreach (var group in groups) { + var listViewGroup = new ListViewGroup(group, HorizontalAlignment.Center); + this.itemListView.Groups.Add(listViewGroup); + groupDictionary.Add(group, listViewGroup); } foreach (var item in itemList.Items) { @@ -79,14 +90,16 @@ namespace NethackHelper { Name = item.Name, Appearance = item.Appearance, }; - identified = true; + identified = item.UniqueAppearance; } - AppearanceMap[item.Name] = record.Appearance; + this.ItemMap[item.Name] = item; + this.AppearanceMap[item.Name] = record.Appearance; var columns = this.Columns.Select(col => COLUMN_MAP[col.Attribute].Invoke(item)).ToArray(); + var groupName = COLUMN_MAP[this.Grouping].Invoke(item); - var listViewItem = new ListViewItem(columns, costDictionary[item.Cost]); + var listViewItem = new ListViewItem(columns, groupDictionary[groupName]); listViewItem.UseItemStyleForSubItems = false; var baseFont = new Font(this.itemListView.Font, FontStyle.Regular); var baseColor = UNSELECTED_COLOR; @@ -115,6 +128,8 @@ namespace NethackHelper { } this.itemListView.Items.Add(listViewItem); } + + this.UpdateCostHeaders(); } public IdentificationRecord Export() { @@ -132,8 +147,10 @@ namespace NethackHelper { } public void UpdateCostHeaders() { - for (int i = 0; i < this.GroupCosts.Length; i++) { - this.itemListView.Groups[i].Header = this.CostFormatter.Invoke(this.GroupCosts[i]); + if (this.Grouping == ItemAttribute.Cost) { + for (int i = 0; i < this.GroupCosts.Length; i++) { + this.itemListView.Groups[i].Header = this.CostFormatter.Invoke(this.GroupCosts[i]); + } } } @@ -163,9 +180,11 @@ namespace NethackHelper { } } - private static int CompareItems(ListViewItem a, ListViewItem b) { + private int CompareItems(ListViewItem a, ListViewItem b) { if (a.Checked != b.Checked) { return a.Checked.CompareTo(b.Checked); + } else if (this.ItemMap[a.Text].Cost != this.ItemMap[b.Text].Cost) { + return this.ItemMap[a.Text].Cost.CompareTo(this.ItemMap[b.Text].Cost); } else { return a.Text.CompareTo(b.Text); } @@ -174,10 +193,10 @@ namespace NethackHelper { [Serializable] public class ItemDisplayColumn { - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public ItemAttribute Attribute { get; set; } - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)] public int Width { get; set; } } } diff --git a/NethackHelper/MainForm.Designer.cs b/NethackHelper/MainForm.Designer.cs index 5d269be..ebf00e0 100644 --- a/NethackHelper/MainForm.Designer.cs +++ b/NethackHelper/MainForm.Designer.cs @@ -42,6 +42,9 @@ namespace NethackHelper { spellbookTab = new TabPage(); amuletDisplay = new ItemDisplay(); spellbookDisplay = new ItemDisplay(); + toolsTab = new TabPage(); + armorDisplay = new ItemDisplay(); + toolDisplay = new ItemDisplay(); charismaSelector = new ComboBox(); intrinsicsTab = new TabPage(); label2 = new Label(); @@ -75,6 +78,7 @@ namespace NethackHelper { mainMenu = new MenuStrip(); fileToolStripMenuItem = new ToolStripMenuItem(); resetToolStripMenuItem = new ToolStripMenuItem(); + toolTip1 = new ToolTip(components); mainTabControl.SuspendLayout(); itemsTab.SuspendLayout(); ((System.ComponentModel.ISupportInitialize) saveSourceBindingSource).BeginInit(); @@ -82,6 +86,7 @@ namespace NethackHelper { scrollPotionTab.SuspendLayout(); wandRingTab.SuspendLayout(); spellbookTab.SuspendLayout(); + toolsTab.SuspendLayout(); intrinsicsTab.SuspendLayout(); ((System.ComponentModel.ISupportInitialize) lastPrayerPicker).BeginInit(); ((System.ComponentModel.ISupportInitialize) intrinsicsBindingSource).BeginInit(); @@ -119,12 +124,14 @@ namespace NethackHelper { // suckerBox // suckerBox.AutoSize = true; + suckerBox.Cursor = Cursors.Help; suckerBox.DataBindings.Add(new Binding("Checked", saveSourceBindingSource, "Sucker", true)); suckerBox.Location = new Point(133, 8); suckerBox.Name = "suckerBox"; suckerBox.Size = new Size(61, 19); suckerBox.TabIndex = 2; suckerBox.Text = "Sucker"; + toolTip1.SetToolTip(suckerBox, "Check this box if you are a tourist under level 15, are wearing a dunce cap, or are wearing a visible shirt."); suckerBox.UseVisualStyleBackColor = true; suckerBox.CheckedChanged += suckerBox_CheckedChanged; // @@ -139,6 +146,7 @@ namespace NethackHelper { itemTabControl.Controls.Add(scrollPotionTab); itemTabControl.Controls.Add(wandRingTab); itemTabControl.Controls.Add(spellbookTab); + itemTabControl.Controls.Add(toolsTab); itemTabControl.Location = new Point(6, 35); itemTabControl.Name = "itemTabControl"; itemTabControl.SelectedIndex = 0; @@ -161,6 +169,7 @@ namespace NethackHelper { // potionDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; potionDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("potionDisplay.Columns"); + potionDisplay.Grouping = ItemAttribute.Cost; potionDisplay.Location = new Point(325, 6); potionDisplay.Name = "potionDisplay"; potionDisplay.Size = new Size(313, 515); @@ -170,6 +179,7 @@ namespace NethackHelper { // scrollDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; scrollDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("scrollDisplay.Columns"); + scrollDisplay.Grouping = ItemAttribute.Cost; scrollDisplay.Location = new Point(6, 6); scrollDisplay.Name = "scrollDisplay"; scrollDisplay.Size = new Size(313, 515); @@ -191,6 +201,7 @@ namespace NethackHelper { // ringDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right; ringDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("ringDisplay.Columns"); + ringDisplay.Grouping = ItemAttribute.Cost; ringDisplay.Location = new Point(325, 6); ringDisplay.Name = "ringDisplay"; ringDisplay.Size = new Size(313, 515); @@ -200,6 +211,7 @@ namespace NethackHelper { // wandDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; wandDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("wandDisplay.Columns"); + wandDisplay.Grouping = ItemAttribute.Cost; wandDisplay.Location = new Point(6, 6); wandDisplay.Name = "wandDisplay"; wandDisplay.Size = new Size(313, 515); @@ -221,6 +233,7 @@ namespace NethackHelper { // amuletDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right; amuletDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("amuletDisplay.Columns"); + amuletDisplay.Grouping = ItemAttribute.Cost; amuletDisplay.Location = new Point(325, 6); amuletDisplay.Name = "amuletDisplay"; amuletDisplay.Size = new Size(313, 515); @@ -230,11 +243,44 @@ namespace NethackHelper { // spellbookDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; spellbookDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("spellbookDisplay.Columns"); + spellbookDisplay.Grouping = ItemAttribute.Cost; spellbookDisplay.Location = new Point(6, 6); spellbookDisplay.Name = "spellbookDisplay"; spellbookDisplay.Size = new Size(313, 515); spellbookDisplay.TabIndex = 0; // + // toolsTab + // + toolsTab.Controls.Add(armorDisplay); + toolsTab.Controls.Add(toolDisplay); + toolsTab.Location = new Point(4, 24); + toolsTab.Name = "toolsTab"; + toolsTab.Padding = new Padding(3); + toolsTab.Size = new Size(644, 527); + toolsTab.TabIndex = 4; + toolsTab.Text = "Tools / Armor"; + toolsTab.UseVisualStyleBackColor = true; + // + // armorDisplay + // + armorDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right; + armorDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("armorDisplay.Columns"); + armorDisplay.Grouping = ItemAttribute.Slot; + armorDisplay.Location = new Point(225, 6); + armorDisplay.Name = "armorDisplay"; + armorDisplay.Size = new Size(413, 515); + armorDisplay.TabIndex = 1; + // + // toolDisplay + // + toolDisplay.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left; + toolDisplay.Columns = (System.Collections.Generic.List) resources.GetObject("toolDisplay.Columns"); + toolDisplay.Grouping = ItemAttribute.Appearance; + toolDisplay.Location = new Point(6, 6); + toolDisplay.Name = "toolDisplay"; + toolDisplay.Size = new Size(213, 515); + toolDisplay.TabIndex = 0; + // // charismaSelector // charismaSelector.DataBindings.Add(new Binding("SelectedItem", saveSourceBindingSource, "CharismaClass", true)); @@ -617,6 +663,7 @@ namespace NethackHelper { scrollPotionTab.ResumeLayout(false); wandRingTab.ResumeLayout(false); spellbookTab.ResumeLayout(false); + toolsTab.ResumeLayout(false); intrinsicsTab.ResumeLayout(false); intrinsicsTab.PerformLayout(); ((System.ComponentModel.ISupportInitialize) lastPrayerPicker).EndInit(); @@ -680,5 +727,9 @@ namespace NethackHelper { private TabPage spellbookTab; private ItemDisplay spellbookDisplay; private ItemDisplay amuletDisplay; + private ToolTip toolTip1; + private TabPage toolsTab; + private ItemDisplay toolDisplay; + private ItemDisplay armorDisplay; } } \ No newline at end of file diff --git a/NethackHelper/MainForm.cs b/NethackHelper/MainForm.cs index 407f7b5..3d31c21 100644 --- a/NethackHelper/MainForm.cs +++ b/NethackHelper/MainForm.cs @@ -20,6 +20,8 @@ namespace NethackHelper { this.ringDisplay.CostFormatter = GetCostString; this.spellbookDisplay.CostFormatter = GetCostString; this.amuletDisplay.CostFormatter = GetCostString; + this.toolDisplay.CostFormatter = GetCostString; + this.armorDisplay.CostFormatter = GetCostString; } protected override void OnLoad(EventArgs e) { @@ -80,6 +82,12 @@ namespace NethackHelper { var amulets = YamlOptions.DeserializeFile(Path.Join("items", version.Amulets)); this.amuletDisplay.DisplayItemList(amulets, save.Amulets); + + var tools = YamlOptions.DeserializeFile(Path.Join("items", version.Tools)); + this.toolDisplay.DisplayItemList(tools, save.Tools); + + var armor = YamlOptions.DeserializeFile(Path.Join("items", version.Armor)); + this.armorDisplay.DisplayItemList(armor, save.Armor); } private string GetCostString(int cost) { @@ -164,6 +172,8 @@ namespace NethackHelper { this.ringDisplay.UpdateCostHeaders(); this.spellbookDisplay.UpdateCostHeaders(); this.amuletDisplay.UpdateCostHeaders(); + this.toolDisplay.UpdateCostHeaders(); + this.armorDisplay.UpdateCostHeaders(); } private void charismaSelector_SelectedIndexChanged(object sender, EventArgs e) { @@ -192,6 +202,8 @@ namespace NethackHelper { save.Wands = this.wandDisplay.Export(); save.Spellbooks = this.spellbookDisplay.Export(); save.Amulets = this.amuletDisplay.Export(); + save.Tools = this.toolDisplay.Export(); + save.Armor = this.armorDisplay.Export(); save.Save(); } diff --git a/NethackHelper/MainForm.resx b/NethackHelper/MainForm.resx index 24ec6e2..2279cf5 100644 --- a/NethackHelper/MainForm.resx +++ b/NethackHelper/MainForm.resx @@ -120,13 +120,16 @@ 410, 17 + + 712, 17 + AAEAAAD/////AQAAAAAAAAAMAgAAAEROZXRoYWNrSGVscGVyLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1 cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbAQBAAAAeVN5c3RlbS5Db2xsZWN0aW9ucy5HZW5l cmljLkxpc3RgMVtbTmV0aGFja0hlbHBlci5JdGVtRGlzcGxheUNvbHVtbiwgTmV0aGFja0hlbHBlciwg Q3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsXV0DAAAABl9pdGVtcwVfc2l6ZQhfdmVy - c2lvbgQAACFOZXRoYWNrSGVscGVyLkl0ZW1EaXNwbGF5Q29sdW1uW10CAAAACAgJAwAAAAIAAAAIAAAA + c2lvbgQAACFOZXRoYWNrSGVscGVyLkl0ZW1EaXNwbGF5Q29sdW1uW10CAAAACAgJAwAAAAIAAAACAAAA DAQAAAAzTmV0aGFja0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AG05ldGhhY2tIZWxwZXIuSXRlbUF0dHJpYnV0 + ZQQAAAAIBAAAAAX5////G05ldGhhY2tIZWxwZXIuSXRlbUF0dHJpYnV0ZQEAAAAHdmFsdWVfXwAIBAAA + AAAAAACPAAAAAQYAAAAFAAAAAfj////5////AQAAAC0AAAAL diff --git a/NethackHelper/SaveData.cs b/NethackHelper/SaveData.cs index ea0bbf9..896585b 100644 --- a/NethackHelper/SaveData.cs +++ b/NethackHelper/SaveData.cs @@ -43,6 +43,12 @@ if (save.Amulets != null && save.Amulets.Count > 0) { this.Amulets = new(save.Amulets); } + if (save.Tools != null && save.Tools.Count > 0) { + this.Tools = new(save.Tools); + } + if (save.Armor != null && save.Armor.Count > 0) { + this.Armor = new(save.Armor); + } } } @@ -60,6 +66,8 @@ Wands = this.Wands?.Export() ?? [], Spellbooks = this.Spellbooks?.Export() ?? [], Amulets = this.Amulets?.Export() ?? [], + Tools = this.Tools?.Export() ?? [], + Armor = this.Armor?.Export() ?? [], }; YamlOptions.SerializeToFile(fileName, save); @@ -75,6 +83,8 @@ this.Wands = null; this.Spellbooks = null; this.Amulets = null; + this.Tools = null; + this.Armor = null; this.Intrinsics = new(); } @@ -88,6 +98,8 @@ public IdentificationRecord? Wands { get; set; } public IdentificationRecord? Spellbooks { get; set; } public IdentificationRecord? Amulets { get; set; } + public IdentificationRecord? Tools { get; set; } + public IdentificationRecord? Armor { get; set; } } public struct ItemRecord { @@ -127,6 +139,8 @@ public List Wands { get; set; } = new(); public List Spellbooks { get; set; } = new(); public List Amulets { get; set; } = new(); + public List Tools { get; set; } = new(); + public List Armor { get; set; } = new(); } public class Intrinsics { diff --git a/NethackHelper/Versions.cs b/NethackHelper/Versions.cs index 7bd0fca..3c43521 100644 --- a/NethackHelper/Versions.cs +++ b/NethackHelper/Versions.cs @@ -7,5 +7,7 @@ public string Rings { get; set; } public string Spellbooks { get; set; } public string Amulets { get; set; } + public string Tools { get; set; } + public string Armor { get; set; } } } diff --git a/NethackHelper/items/armor-36.yaml b/NethackHelper/items/armor-36.yaml new file mode 100644 index 0000000..1539e5c --- /dev/null +++ b/NethackHelper/items/armor-36.yaml @@ -0,0 +1,71 @@ +items: + - name: Cloak of Displacement + cost: 50 + slot: cloak + - name: Cloak of Invisibility + cost: 60 + slot: cloak + - name: Cloak of Magic Resistance + cost: 60 + slot: cloak + - name: Cloak of Protection + cost: 50 + slot: cloak + - name: Dunce Cap + cost: 1 + appearance: conical hat + slot: helm + uniqueAppearance: false + - name: Cornuthaum + cost: 80 + appearance: conical hat + slot: helm + uniqueAppearance: false + - name: Helmet + cost: 10 + slot: helm + - name: Helm of Brilliance + cost: 50 + slot: helm + - name: Helm of Opposite Alignment + cost: 50 + slot: helm + - name: Helm of Telepathy + cost: 50 + slot: helm + - name: Leather Gloves + cost: 8 + slot: gloves + - name: Gauntlets of Dexterity + cost: 50 + slot: gloves + - name: Gauntlets of Fumbling + cost: 50 + slot: gloves + usuallyCursed: true + - name: Gauntlets of Power + cost: 50 + slot: gloves + - name: Elven Boots + cost: 8 + slot: boots + - name: Kicking Boots + cost: 8 + slot: boots + - name: Fumble Boots + cost: 30 + slot: boots + usuallyCursed: true + - name: Levitation Boots + cost: 30 + slot: boots + usuallyCursed: true + - name: Jumping Boots + cost: 50 + slot: boots + - name: Speed Boots + cost: 50 + slot: boots + - name: Water Walking Boots + cost: 50 + slot: boots \ No newline at end of file diff --git a/NethackHelper/items/armor-37.yaml b/NethackHelper/items/armor-37.yaml new file mode 100644 index 0000000..cbca8e7 --- /dev/null +++ b/NethackHelper/items/armor-37.yaml @@ -0,0 +1,75 @@ +items: + - name: Cloak of Displacement + cost: 50 + slot: cloak + - name: Cloak of Invisibility + cost: 60 + slot: cloak + - name: Cloak of Magic Resistance + cost: 60 + slot: cloak + - name: Cloak of Protection + cost: 50 + slot: cloak + - name: Dunce Cap + cost: 1 + appearance: conical hat + slot: helm + uniqueAppearance: false + - name: Cornuthaum + cost: 80 + appearance: conical hat + slot: helm + uniqueAppearance: false + - name: Helmet + cost: 10 + slot: helm + - name: Helm of Brilliance + cost: 50 + slot: helm + appearance: crystal helm + - name: Helm of Caution + cost: 50 + slot: helm + - name: Helm of Opposite Alignment + cost: 50 + slot: helm + - name: Helm of Telepathy + cost: 50 + slot: helm + - name: Leather Gloves + cost: 8 + slot: gloves + - name: Gauntlets of Dexterity + cost: 50 + slot: gloves + - name: Gauntlets of Fumbling + cost: 50 + slot: gloves + usuallyCursed: true + - name: Gauntlets of Power + cost: 50 + slot: gloves + - name: Elven Boots + cost: 8 + slot: boots + - name: Kicking Boots + cost: 8 + slot: boots + - name: Fumble Boots + cost: 30 + slot: boots + usuallyCursed: true + - name: Levitation Boots + cost: 30 + slot: boots + usuallyCursed: true + - name: Jumping Boots + cost: 50 + slot: boots + - name: Speed Boots + cost: 50 + slot: boots + - name: Water Walking Boots + cost: 50 + slot: boots \ No newline at end of file diff --git a/NethackHelper/items/tools-stones.yaml b/NethackHelper/items/tools-stones.yaml new file mode 100644 index 0000000..c4f9288 --- /dev/null +++ b/NethackHelper/items/tools-stones.yaml @@ -0,0 +1,97 @@ +items: + - name: Bag of Holding + cost: 100 + appearance: bag + uniqueAppearance: false + - name: Bag of Tricks + cost: 100 + appearance: bag + uniqueAppearance: false + - name: Oilskin Sack + cost: 100 + appearance: bag + uniqueAppearance: false + - name: Sack + cost: 2 + appearance: bag + uniqueAppearance: false + - name: Fire Horn + cost: 50 + appearance: horn + uniqueAppearance: false + - name: Frost Horn + cost: 50 + appearance: horn + uniqueAppearance: false + - name: Horn of Plenty + cost: 50 + appearance: horn + uniqueAppearance: false + - name: Tooled Horn + cost: 15 + appearance: horn + uniqueAppearance: false + - name: Magic Flute + cost: 36 + appearance: flute + uniqueAppearance: false + - name: Wooden Flute + cost: 12 + appearance: flute + uniqueAppearance: false + - name: Magic Harp + cost: 50 + appearance: harp + uniqueAppearance: false + - name: Wooden Harp + cost: 50 + appearance: harp + uniqueAppearance: false + - name: Drum of Earthquake + cost: 25 + appearance: drum + uniqueAppearance: false + - name: Leather Drum + cost: 25 + appearance: drum + uniqueAppearance: false + - name: Magic Whistle + cost: 10 + appearance: whistle + uniqueAppearance: false + - name: Tin Whistle + cost: 10 + appearance: whistle + uniqueAppearance: false + - name: Magic Lamp + cost: 50 + appearance: lamp + uniqueAppearance: false + - name: Oil Lamp + cost: 10 + appearance: lamp + uniqueAppearance: false + - name: Wax Candle + cost: 20 + appearance: candle + uniqueAppearance: false + - name: Tallow Candle + cost: 10 + appearance: candle + uniqueAppearance: false + - name: Loadstone + cost: 1 + appearance: gray stone + uniqueAppearance: false + - name: Flint Stone + cost: 1 + appearance: gray stone + uniqueAppearance: false + - name: Touchstone + cost: 45 + appearance: gray stone + uniqueAppearance: false + - name: Luckstone + cost: 60 + appearance: gray stone + uniqueAppearance: false \ No newline at end of file diff --git a/NethackHelper/items/versions.yaml b/NethackHelper/items/versions.yaml index dd33647..650f95b 100644 --- a/NethackHelper/items/versions.yaml +++ b/NethackHelper/items/versions.yaml @@ -5,10 +5,14 @@ wands: wands.yaml spellbooks: spellbooks-36.yaml amulets: amulets-36.yaml + tools: tools-stones.yaml + armor: armor-36.yaml - name: Vanilla 3.7 scrolls: scrolls.yaml rings: rings.yaml potions: potions-37.yaml wands: wands.yaml spellbooks: spellbooks-37.yaml - amulets: amulets-37.yaml \ No newline at end of file + amulets: amulets-37.yaml + tools: tools-stones.yaml + armor: armor-37.yaml \ No newline at end of file