Esempio n. 1
0
        /// <summary>
        /// Gets a new instance of PlantData based on param
        /// </summary>
        /// <param name="defaultPlantData">DefaultPlantData to copy</param>
        /// <returns></returns>
        public static PlantData CreateNewPlant(DefaultPlantData defaultPlantData)
        {
            PlantData newPlant = new PlantData();

            newPlant.SetValues(defaultPlantData);
            newPlant.Health = 100;
            newPlant.Age    = 0;
            return(newPlant);
        }
Esempio n. 2
0
 public void copyFrom(DefaultPlantData defaultPlantData)
 {
     WeedResistanceChange    = defaultPlantData.WeedResistanceChange;
     WeedGrowthRateChange    = defaultPlantData.WeedGrowthRateChange;
     GrowthSpeedChange       = defaultPlantData.GrowthSpeedChange;
     PotencyChange           = defaultPlantData.PotencyChange;;
     EnduranceChange         = defaultPlantData.EnduranceChange;
     YieldChange             = defaultPlantData.YieldChange;
     LifespanChange          = defaultPlantData.LifespanChange;
     PlantTrays              = defaultPlantData.PlantTrays;
     ReagentProduction       = defaultPlantData.ReagentProduction;
     RemovePlantTrays        = defaultPlantData.RemovePlantTrays;
     RemoveReagentProduction = defaultPlantData.RemoveReagentProduction;
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes plant with data from default plant
        /// </summary>
        /// <param name="DefaultPlantData">DefaultPlantData.plantdata's values are copied</param>
        private void SetValues(DefaultPlantData DefaultPlantData)
        {
            var _PlantData = DefaultPlantData.plantData;

            Name        = _PlantData.Name;
            Plantname   = _PlantData.Plantname;
            Description = _PlantData.Description;
            if (ProduceObject == null)
            {
                ProduceObject = _PlantData.ProduceObject;
            }

            if (GrowthSpritesSOs.Count == 0)
            {
                GrowthSpritesSOs = _PlantData.GrowthSpritesSOs;
            }

            if (FullyGrownSpriteSO == null)
            {
                FullyGrownSpriteSO = _PlantData.FullyGrownSpriteSO;
            }

            if (DeadSpriteSO == null)
            {
                DeadSpriteSO = _PlantData.DeadSpriteSO;
            }

            WeedResistance = _PlantData.WeedResistance;
            WeedGrowthRate = _PlantData.WeedGrowthRate;
            GrowthSpeed    = _PlantData.GrowthSpeed;
            Potency        = _PlantData.Potency;
            Endurance      = _PlantData.Endurance;
            Yield          = _PlantData.Yield;
            Lifespan       = _PlantData.Lifespan;


            PlantTrays            = (_PlantData.PlantTrays.Union(PlantTrays)).ToList();
            MutatesInToGameObject = (_PlantData.MutatesInToGameObject.Union(MutatesInToGameObject)).ToList();
            CombineReagentProduction(_PlantData.ReagentProduction);
        }