public override void Select(MainForm frm) { if (frm.grpEngraving.Text == ToString() && frm.MainTab.SelectedTab == frm.tabEngraving) { return; } Program.MakeSelected(frm.tabEngraving, frm.lstEngraving, this); frm.grpEngraving.Text = ToString(); frm.grpEngraving.Show(); #if DEBUG frm.grpEngraving.Text += $" - ID: {Id}"; #endif frm.lblEngravingArtist.Data = Artist; frm.lblEngravingSkill.Text = SkillRating.ToString(); frm.lblEngravingCoords.Text = Coords.ToString(); frm.lblEngravingTile.Text = TileID.ToString(); frm.lblEngravingArtID.Text = ArtID.ToString(); frm.lblEngravingArtSubID.Text = ArtSubID.ToString(); frm.lblEngravingQuality.Text = Quality.ToString(); frm.lblEngravingLocation.Text = Location.ToString(); frm.lblEngravingHidden.Text = Hidden.ToString(); frm.lblEngravingCreatedEvent.Data = CreatedEvent; frm.lblEngravingName.Text = ToString(); }
public float GetTileIncome() { tileLevel = UpgradeLevelDictionary.GetUpgradeLevel(tileID.ToString()); var totalIncome = MathFunctions.CalculateTileIncome(tileBaseIncome, tileLevel, totalMultiplier); return(totalIncome); }
private void Start() { tileID = selectedTileSO.tileID; tileType = selectedTileSO.tileType; gameObject.name = selectedTileSO.name; tileName = selectedTileSO.tileName; tileSprite = selectedTileSO.tileSprite; tileBaseIncome = selectedTileSO.tileBaseIncome; tileBaseCost = selectedTileSO.tileBaseCost; TileAdjacencyBonus = selectedTileSO.tileAdjacencyBonus; tileLevel = UpgradeLevelDictionary.GetUpgradeLevel(tileID.ToString()); GetComponent <SpriteRenderer>().sprite = tileSprite; var tileCost = MathFunctions.CalculateTileCost(tileBaseCost); Board.instance.placedTiles += 1; }
public override string ToString() { return(enumId.ToString()); }
/// <summary> /// Saves the item definition /// </summary> /// <param name="writer">Xml writer handle</param> /// <returns>True if saved, or false</returns> public bool Save(XmlWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.WriteStartElement("item"); writer.WriteAttributeString("name", Name); writer.WriteStartElement("tile"); writer.WriteAttributeString("name", TileSetName); writer.WriteAttributeString("inventory", TileID.ToString()); writer.WriteAttributeString("ground", GroundTileID.ToString()); writer.WriteAttributeString("incoming", IncomingTileID.ToString()); writer.WriteAttributeString("moveaway", ThrowTileID.ToString()); writer.WriteEndElement(); writer.WriteStartElement("type"); writer.WriteAttributeString("value", Type.ToString()); writer.WriteEndElement(); writer.WriteStartElement("damagetype"); writer.WriteAttributeString("value", DamageType.ToString()); writer.WriteEndElement(); writer.WriteStartElement("ac"); writer.WriteAttributeString("value", ArmorClass.ToString()); writer.WriteEndElement(); writer.WriteStartElement("slot"); writer.WriteAttributeString("value", Slot.ToString()); writer.WriteEndElement(); writer.WriteStartElement("classes"); writer.WriteAttributeString("value", AllowedClasses.ToString()); writer.WriteEndElement(); writer.WriteStartElement("weight"); writer.WriteAttributeString("value", Weight.ToString()); writer.WriteEndElement(); Damage.Save("damage", writer); DamageVsBig.Save("damagevsbig", writer); DamageVsSmall.Save("damagevssmall", writer); writer.WriteStartElement("critical"); writer.WriteAttributeString("min", Critical.X.ToString()); writer.WriteAttributeString("max", Critical.Y.ToString()); writer.WriteAttributeString("multiplier", CriticalMultiplier.ToString()); writer.WriteEndElement(); Script.Save("script", writer); if (IsCursed) { writer.WriteStartElement("iscursed"); writer.WriteAttributeString("value", IsCursed.ToString()); writer.WriteEndElement(); } if (IsIdentified) { writer.WriteStartElement("isidentified"); writer.WriteAttributeString("value", IsCursed.ToString()); writer.WriteEndElement(); } if (CanIdentify) { writer.WriteStartElement("canidentify"); writer.WriteAttributeString("value", IsCursed.ToString()); writer.WriteEndElement(); } if (IsBig) { writer.WriteStartElement("isbig"); writer.WriteAttributeString("value", IsBig.ToString()); writer.WriteEndElement(); } writer.WriteStartElement("allowedhands"); writer.WriteAttributeString("value", AllowedHands.ToString()); writer.WriteEndElement(); writer.WriteElementString("shortname", ShortName); writer.WriteElementString("identifiedname", IdentifiedName); writer.WriteStartElement("speed"); writer.WriteAttributeString("value", AttackSpeed.TotalMilliseconds.ToString()); writer.WriteEndElement(); writer.WriteEndElement(); return(true); }