Exemplo n.º 1
0
        public CreatureGenePack()
        {
            GatheringEffectiveness = SimulationGlobals.AttributeValues[nameof(SimulationStateEnums.AttributeKeys.CowEffectivenessCap)] * (float)SimulationGlobals.random.NextDouble();
            var numOfNutrients = SimulationGlobals.random.Next(1, 4);

            TargetNutrients       = new NutrientTypes[numOfNutrients];
            MaxNutrients          = ((float)SimulationGlobals.random.NextDouble() * 30.0f) + 20.0f;
            StarvingNutrientLevel = ((float)SimulationGlobals.random.NextDouble() * 15.0f) + 10.0f;

            List <NutrientTypes> typeHolder = Enum.GetValues(typeof(NutrientTypes)).Cast <NutrientTypes>().ToList();

            for (int i = 0; i < numOfNutrients; i++)
            {
                var chosenIndex = SimulationGlobals.random.Next(0, typeHolder.Count);
                TargetNutrients[i] = typeHolder[chosenIndex];
                typeHolder.RemoveAt(chosenIndex);
            }



            BreedingCooldown = SimulationGlobals.random.Next((int)SimulationGlobals.AttributeValues[nameof(SimulationStateEnums.AttributeKeys.CowBreedCooldownMin)], 1500);
            BreedingChance   = (float)SimulationGlobals.random.NextDouble() * SimulationGlobals.AttributeValues[nameof(AttributeKeys.CowBreedabilityCap)];

            MaxHealth         = SimulationGlobals.random.Next(50, 101);
            RestoreHealthRate = (float)SimulationGlobals.random.NextDouble() * 0.1f;
        }
 public NutrientPack(NutrientTypes type, float amount)
 {
     this.type   = type;
     this.amount = amount;
 }
Exemplo n.º 3
0
 public NutrientRegain(NutrientTypes nutrientType, float regain)
 {
     this.nutrientType = nutrientType;
     this.regain       = regain;
 }
 public NutrientRequest(NutrientTypes target, float effectiveness)
 {
     targetNutrient         = target;
     gatheringEffectiveness = effectiveness;
 }