public override MetabolismAttribute FindAttribute(MetabolismAttribute.Type type)
    {
        switch (type)
        {
        case MetabolismAttribute.Type.Poison:
        {
            return(this.poison);
        }

        case MetabolismAttribute.Type.Radiation:
        {
            return(this.radiation_poison);
        }

        case MetabolismAttribute.Type.Bleeding:
        {
            return(this.bleeding);
        }

        case MetabolismAttribute.Type.Health:
        {
            return(base.FindAttribute(type));
        }

        case MetabolismAttribute.Type.HealthOverTime:
        {
            return(this.pending_health);
        }

        default:
        {
            return(base.FindAttribute(type));
        }
        }
    }
    public void ApplyChange(MetabolismAttribute.Type type, float amount, float time)
    {
        MetabolismAttribute metabolismAttribute = this.FindAttribute(type);

        if (metabolismAttribute == null)
        {
            return;
        }
        metabolismAttribute.Add(amount);
    }
Example #3
0
 public float GetIfType(MetabolismAttribute.Type typeToPick)
 {
     for (int i = 0; i < this.effects.Count; i++)
     {
         if (this.effects[i].type == typeToPick)
         {
             return(this.effects[i].amount);
         }
     }
     return(0f);
 }
Example #4
0
    public virtual MetabolismAttribute FindAttribute(MetabolismAttribute.Type type)
    {
        switch (type)
        {
        case MetabolismAttribute.Type.Calories:
            return(this.calories);

        case MetabolismAttribute.Type.Hydration:
            return(this.hydration);

        case MetabolismAttribute.Type.Heartrate:
            return(this.heartrate);

        default:
            return((MetabolismAttribute)null);
        }
    }
Example #5
0
 public void ApplyChange(MetabolismAttribute.Type type, float amount, float time)
 {
     this.FindAttribute(type)?.Add(amount);
 }