コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
ファイル: Affecter.cs プロジェクト: UVASGD/fall-2017-vector
 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;
 }