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); }
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); }
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); } }
public void ApplyChange(MetabolismAttribute.Type type, float amount, float time) { this.FindAttribute(type)?.Add(amount); }