public int FindItemLevel() { MagicItem magicItem = Session.FindMagicItem(this.fMagicItemID, SearchType.Global); if (magicItem != null) { return(magicItem.Level); } int num = Treasure.PlaceholderIDs.IndexOf(this.fMagicItemID); if (num != -1) { return(num + 1); } if (this.fValue > 0) { for (int i = 30; i >= 1; i--) { if (Treasure.GetItemValue(i) < this.fValue) { return(i); } } } return(-1); }
/// <summary> /// Calculates the level of the contained magic item. /// </summary> /// <returns>Returns the level.</returns> public int FindItemLevel() { MagicItem item = Session.FindMagicItem(fMagicItemID, SearchType.Global); if (item != null) { return(item.Level); } int index = Treasure.PlaceholderIDs.IndexOf(fMagicItemID); if (index != -1) { return(index + 1); } if (fValue > 0) { for (int level = 30; level >= 1; --level) { int value = Treasure.GetItemValue(level); if (value < fValue) { return(level); } } } return(-1); }
public MagicItemProfileForm(Masterplan.Data.MagicItem item) { this.InitializeComponent(); this.TypeBox.Items.Add("Armour"); this.TypeBox.Items.Add("Weapon"); this.TypeBox.Items.Add("Ammunition"); this.TypeBox.Items.Add("Item Slot (head)"); this.TypeBox.Items.Add("Item Slot (neck)"); this.TypeBox.Items.Add("Item Slot (waist)"); this.TypeBox.Items.Add("Item Slot (arms)"); this.TypeBox.Items.Add("Item Slot (hands)"); this.TypeBox.Items.Add("Item Slot (feet)"); this.TypeBox.Items.Add("Item Slot (ring)"); this.TypeBox.Items.Add("Implement"); this.TypeBox.Items.Add("Alchemical Item"); this.TypeBox.Items.Add("Divine Boon"); this.TypeBox.Items.Add("Grandmaster Training"); this.TypeBox.Items.Add("Potion"); this.TypeBox.Items.Add("Reagent"); this.TypeBox.Items.Add("Whetstone"); this.TypeBox.Items.Add("Wondrous Item"); foreach (MagicItemRarity value in Enum.GetValues(typeof(MagicItemRarity))) { this.RarityBox.Items.Add(value); } this.fItem = item.Copy(); this.NameBox.Text = this.fItem.Name; this.LevelBox.Value = this.fItem.Level; this.TypeBox.Text = this.fItem.Type; this.RarityBox.SelectedItem = this.fItem.Rarity; }
public void SetAsMagicItem(MagicItem item) { this.fName = item.Name; this.fDetails = item.Description; this.fMagicItemID = item.ID; this.fArtifactID = Guid.Empty; this.fValue = Treasure.GetItemValue(item.Level); }
private bool match_token(Masterplan.Data.MagicItem item, string token) { if (item.Name.ToLower().Contains(token)) { return(true); } return(false); }
private void OptionsVariant_Click(object sender, EventArgs e) { MagicItemSelectForm magicItemSelectForm = new MagicItemSelectForm(this.fMagicItem.Level); if (magicItemSelectForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.fMagicItem = magicItemSelectForm.MagicItem.Copy(); this.fMagicItem.ID = Guid.NewGuid(); this.update_statblock(); } }
private bool match(Masterplan.Data.MagicItem item, string query) { string[] strArrays = query.ToLower().Split(new char[0]); for (int i = 0; i < (int)strArrays.Length; i++) { if (!this.match_token(item, strArrays[i])) { return(false); } } return(true); }
public MagicItem FindMagicItem(string item_name, int level) { MagicItem magicItem; List <MagicItem> .Enumerator enumerator = this.fMagicItems.GetEnumerator(); try { while (enumerator.MoveNext()) { MagicItem current = enumerator.Current; if (current == null || !(current.Name == item_name) || current.Level != level) { continue; } magicItem = current; return(magicItem); } return(null); } finally { ((IDisposable)enumerator).Dispose(); } }
public MagicItem FindMagicItem(Guid item_id) { MagicItem magicItem; List <MagicItem> .Enumerator enumerator = this.fMagicItems.GetEnumerator(); try { while (enumerator.MoveNext()) { MagicItem current = enumerator.Current; if (current == null || !(current.ID == item_id)) { continue; } magicItem = current; return(magicItem); } return(null); } finally { ((IDisposable)enumerator).Dispose(); } }
public Parcel(MagicItem item) { this.SetAsMagicItem(item); }
/// <summary> /// Constructor. /// </summary> /// <param name="item">The magic item to create the parcel with.</param> public Parcel(MagicItem item) { SetAsMagicItem(item); }
public MagicItemBuilderForm(Masterplan.Data.MagicItem item) { this.InitializeComponent(); this.fMagicItem = item.Copy(); this.update_statblock(); }