예제 #1
0
        internal override void Export(string table)
        {
            base.Export(table);

            table = GetType().Name;

            var vals = new List <object>
            {
                Id,
                HfId.DBExport(),
                EntityId.DBExport(),
                SiteId.DBExport(),
                SkillAtTime,
                ItemType.DBExport(Item.ItemTypes),
                ItemSubType.DBExport(Item.ItemSubTypes),
                Mat.DBExport(Item.Materials),
                ImprovementType.DBExport(ImprovementTypes),
                //ImprovementSubType.DBExport(), //TODO: Uncomment this
                ImprovementMat.DBExport(Item.Materials),
                ArtId.DBExport(),
                ArtSubId.DBExport()
            };

            Database.ExportWorldItem(table, vals);
        }
예제 #2
0
 void ImproveSelectedCell(ImprovementType type)
 {
     if (hoveringCell != null)
     {
         gameManager.ImproveCell(hoveringCell, type);
     }
 }
예제 #3
0
 public Cluster(String n, Implant s, Implant b, Implant f, ImprovementType type)
 {
     ClusterName = n;
     Shining     = s;
     Bright      = b;
     Faded       = f;
     Category    = type;
     ID          = NextID++;
 }
예제 #4
0
 public CityViewTiles(int id, ImprovementType type, Bitmap sourceBmp, Rectangle sourceRect, Point drawOffset, int altTileId)
 {
     id                = id;
     Type              = type;
     SourceBmp         = sourceBmp;
     SourceRect        = sourceRect;
     DrawOffset        = drawOffset;
     AlternativeTileId = altTileId;
 }
예제 #5
0
    public void ImproveCell(HexCell cell, ImprovementType type)
    {
        if (cell.owner.gold < cell.GetImprovementCost(type))
        {
            return;
        }
        if (cell.goldImprovementCount == cell.maxImprovementCount && type == ImprovementType.GoldProductionRate || cell.unitRateImprovementCount == cell.maxImprovementCount && type == ImprovementType.UnitSpawnRate || cell.unitCapacityImprovementCount == cell.maxImprovementCount && type == ImprovementType.UnitCapacity)
        {
            return;
        }


        cell.owner.gold -= cell.GetImprovementCost(type);
        cell.Improve(type);
    }
예제 #6
0
 public bool CanBeImproved(ImprovementType type)
 {
     if (type == ImprovementType.GoldProductionRate)
     {
         return(owner.gold >= GetImprovementCost(ImprovementType.GoldProductionRate) && goldImprovementCount < maxImprovementCount);
     }
     if (type == ImprovementType.UnitCapacity)
     {
         return(owner.gold >= GetImprovementCost(ImprovementType.UnitCapacity) && unitCapacityImprovementCount < maxImprovementCount);
     }
     if (type == ImprovementType.UnitSpawnRate)
     {
         return(owner.gold >= GetImprovementCost(ImprovementType.UnitSpawnRate) && unitRateImprovementCount < maxImprovementCount);
     }
     return(false);
 }
예제 #7
0
 public int GetImprovementCost(ImprovementType type)
 {
     if (type == ImprovementType.GoldProductionRate)
     {
         return(goldImprovementCount * costMuliplier + 15);
     }
     if (type == ImprovementType.UnitCapacity)
     {
         return(unitCapacityImprovementCount * costMuliplier + 8);
     }
     if (type == ImprovementType.UnitSpawnRate)
     {
         return(unitRateImprovementCount * costMuliplier + 12);
     }
     return(0);
 }
예제 #8
0
 public void Improve(ImprovementType type)
 {
     if (type == ImprovementType.GoldProductionRate && goldImprovementCount < maxImprovementCount)
     {
         goldImprovementCount++;
     }
     if (type == ImprovementType.UnitCapacity && unitCapacityImprovementCount < maxImprovementCount)
     {
         unitCapacityImprovementCount++;
     }
     if (type == ImprovementType.UnitSpawnRate && unitRateImprovementCount < maxImprovementCount)
     {
         unitRateImprovementCount++;
     }
     UpdateStats();
 }
예제 #9
0
 public bool ImprovementExists(ImprovementType improvement) => _improvements.Exists(i => i.Type == improvement);
예제 #10
0
        /// <summary>
        /// Load the CharacterAttribute from the XmlNode.
        /// </summary>
        /// <param name="objNode">XmlNode to load.</param>
        public void Load(XmlNode objNode)
        {
            Log.Enter("Load");

            try
            {
                _strUniqueName = objNode["unique"].InnerText;
            }
            catch
            {
            }
            _strImprovedName = objNode["improvedname"].InnerText;
            _strSourceName = objNode["sourcename"].InnerText;
            try
            {
                _intMin = Convert.ToInt32(objNode["min"].InnerText);
            }
            catch
            {
            }
            _intMax = Convert.ToInt32(objNode["max"].InnerText);
            _intAug = Convert.ToInt32(objNode["aug"].InnerText);
            _intAugMax = Convert.ToInt32(objNode["augmax"].InnerText);
            _intVal = Convert.ToInt32(objNode["val"].InnerText);
            _intRating = Convert.ToInt32(objNode["rating"].InnerText);
            _strExclude = objNode["exclude"].InnerText;
            _objImprovementType = ConvertToImprovementType(objNode["improvementttype"].InnerText);
            _objImprovementSource = ConvertToImprovementSource(objNode["improvementsource"].InnerText);
            _blnCustom = Convert.ToBoolean(objNode["custom"].InnerText);
            _strCustomName = objNode["customname"].InnerText;
            try
            {
                _strCustomId = objNode["customid"].InnerText;
            }
            catch
            {
            }
            try
            {
                _strCustomGroup = objNode["customgroup"].InnerText;
            }
            catch
            {
            }
            try
            {
                _blnAddToRating = Convert.ToBoolean(objNode["addtorating"].InnerText);
            }
            catch
            {
            }
            try
            {
                _blnEnabled = Convert.ToBoolean(objNode["enabled"].InnerText);
            }
            catch
            {
            }
            try
            {
                _strNotes = objNode["notes"].InnerText;
            }
            catch
            {
            }
            try
            {
                _intOrder = Convert.ToInt32(objNode["order"].InnerText);
            }
            catch
            {
            }

            Log.Exit("Load");
        }
예제 #11
0
 public Improvement(ImprovementType type)
 {
     Type = type;
 }