public virtual void AffectVitality(float _delta) { if (Mathf.Sign(_delta) == -1 && Mathf.Abs(_delta) > vitality) { _delta = -vitality; } else if ((_delta + vitality) > fullVitality) { _delta = fullVitality - vitality; } vitality += _delta; if (linkMod != Mathf.NegativeInfinity) { if (linkMod == Mathf.Infinity) { parentAffecter.AffectVitality(_delta); } else { parentAffecter.AffectVitality(_delta * linkMod); } } }
public virtual void Combine(Affecter combiner) { combiner.AffectVitality(vitality); for (int i = 0; i < reactorList.Count; i++) { Reactor ownReactor = reactorList.ElementAt(i); for (int j = 0; j < combiner.reactorList.Count; j++) { Reactor otherReactor = combiner.reactorList.ElementAt(j); if (ownReactor.GetType() != otherReactor.GetType()) { combiner.reactorList.Add(ownReactor.CloneReactor(ownReactor, combiner)); } } } //Deact(); //DELETE THE AFFECTER present = false; }