Example #1
0
        /// <summary>
        /// Returns a deep copy of the instance
        /// </summary>
        /// <returns></returns>
        public HealthModifierSet Clone()
        {
            HealthModifierSet hms = (HealthModifierSet)this.MemberwiseClone();

            hms.BonusSums       = new Dictionary <string, double>(BonusSums);
            hms.FreeMultipliers = new Dictionary <string, double>(FreeMultipliers);
            hms.MinMultipliers  = new Dictionary <string, double>(MinMultipliers);
            hms.MaxMultipliers  = new Dictionary <string, double>(MaxMultipliers);
            return(hms);
        }
Example #2
0
 public void Apply(HealthModifierSet hms)
 {
     Core.Log("Applying effect:\n" + this);
     hms.ExposureMultiplier *= Exposure;
     hms.HPChange           += HPChangePerDay;
     hms.RecuperationPower  += Recuperation;
     hms.MaxRecuperaction    = Math.Max(hms.MaxRecuperaction, Recuperation);
     hms.Decay += Decay;
     if (hms.FreeMultipliers.ContainsKey(MultiplyFactor))
     {
         hms.FreeMultipliers[MultiplyFactor] *= Multiplier;
     }
     else
     {
         hms.FreeMultipliers[MultiplyFactor] = Multiplier;
     }
     hms.Space          += Space;
     hms.Shielding      += Shielding;
     hms.PartsRadiation += Radioactivity;
 }
Example #3
0
 public override double ChangePerDay(ProtoCrewMember pcm)
 => ((Core.IsInEditor && !IsEnabledInEditor()) || Core.KerbalHealthList[pcm].IsOnEVA)
     ? 0
     : BaseChangePerDay *Core.GetCrewCount(pcm) / Math.Max(HealthModifierSet.GetVesselModifiers(pcm).Space, 0.1);