Exemple #1
0
 public void EatIt(PlayerStats ps)
 {
     if (conditionState == Condition.Regeneration)
         ps.GoodBerry(amount, duration);
     else if (conditionState == Condition.Degenration)
         ps.BadBerry(amount, duration, ps.transform);
     else //if (conditionState == Condition.Random)
         RandomCondition(ps);
 }
Exemple #2
0
 /// <summary>
 /// Receive a psuedo random condition.
 /// </summary>
 public void RandomCondition(PlayerStats ps)
 {
     System.Array values = Condition.GetValues(typeof(Condition));
     System.Random random = new System.Random();
     conditionState = (Condition)values.GetValue(random.Next(values.Length));
     while (conditionState == Condition.None || conditionState == Condition.Random) {
         conditionState = (Condition)values.GetValue(random.Next(values.Length));
     }
     if (conditionState == Condition.Regeneration)
         ps.GoodBerry(amount, duration);
     if (conditionState == Condition.Degenration)
         ps.BadBerry(amount, duration, ps.transform);
 }