示例#1
0
        public void Execute(ModificationContext context, object args)
        {
            var currentLevel = (double)args;

            var levels = new List <double>();

            levels.Add(currentLevel);

            int i = 0;

            for (; ; ++i)
            {
                var level = context.GetValue(this.EffectiveDomains[0], $"__level{i}");
                if (level == null)
                {
                    break;
                }
                levels.Add(level.Value);
            }

            context.SetValue(this.EffectiveDomains[0], $"__level{i}", currentLevel);

            double actualValue;

            switch (this.DuplicatedCrewSkillPolicy)
            {
            case DuplicatedCrewSkillPolicy.Average:
                actualValue = levels.Average();
                break;

            case DuplicatedCrewSkillPolicy.Highest:
                actualValue = levels.Max();
                break;

            case DuplicatedCrewSkillPolicy.Lowest:
                actualValue = levels.Min();
                break;

            default:
                throw new NotSupportedException();
            }

            if (this.Type == CrewSkillType.Skill || (this.Type == CrewSkillType.Perk && actualValue >= 100))
            {
                this.Execute(context, actualValue);
            }
            else
            {
                this.Clear(context);
            }
        }
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "enginePowerFactor", _enginePowerFactor);
     context.SetValue(this.EffectiveDomains[0], "engineHpLossPerSecond", _engineHpLossPerSecond);
 }
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "activateWhenStillSec", _activateWhenStillSec);
 }
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "softGroundResistanceFactor", _softGroundResistanceFactor);
     sandbox.SetValue(this.EffectiveDomains[0], "mediumGroundResistanceFactor", _mediumGroundResistanceFactor);
 }
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "crewLevelIncrease", _crewLevelIncrease);
 }
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "bonusValue", _bonusValue);
     context.SetValue(this.EffectiveDomains[0], "repairAll", _repairAll ? 1.0 : 0.0);
 }
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "fireStartingChanceFactor", _fireStartingChanceFactor);
     context.SetValue(this.EffectiveDomains[0], "autoactivate", _autoactivate ? 1.0 : 0.0);
 }
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "activateWhenStillSec", _activateWhenStillSec);
     sandbox.SetValue(this.EffectiveDomains[0], "circularVisionRadiusFactor", _circularVisionRadiusFactor);
 }
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "chassisMaxLoadFactor", _chassisMaxLoadFactor);
     sandbox.SetValue(this.EffectiveDomains[0], "chassisHealthFactor", _chassisHealthFactor);
     sandbox.SetValue(this.EffectiveDomains[0], "vehicleByChassisDamageFactor", _vehicleByChassisDamageFactor);
 }
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "antifragmentationLiningFactor", _antifragmentationLiningFactor);
     sandbox.SetValue(this.EffectiveDomains[0], "increaseCrewChanceToEvadeHit", _increaseCrewChanceToEvadeHit);
 }
示例#11
0
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], _attributeName, _value);
 }
示例#12
0
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "enginePowerFactor", _enginePowerFactor);
     context.SetValue(this.EffectiveDomains[0], "turretRotationSpeedFactor", _turretRotationSpeedFactor);
 }