Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], "softGroundResistanceFactor", _softGroundResistanceFactor);
     sandbox.SetValue(this.EffectiveDomains[0], "mediumGroundResistanceFactor", _mediumGroundResistanceFactor);
 }
Exemplo n.º 5
0
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "crewLevelIncrease", _crewLevelIncrease);
 }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 protected override void Clear(ModificationContext context)
 {
 }
Exemplo n.º 8
0
 protected abstract void Execute(ModificationContext context, double level);
 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);
 }
Exemplo n.º 12
0
 public override void Execute(ModificationContext sandbox, object args)
 {
     sandbox.SetValue(this.EffectiveDomains[0], _attributeName, _value);
 }
Exemplo n.º 13
0
 protected abstract void Clear(ModificationContext context);
Exemplo n.º 14
0
 public override void Execute(ModificationContext context, object args)
 {
 }
Exemplo n.º 15
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);
 }
Exemplo n.º 16
0
 public abstract void Execute(ModificationContext context, object args);
Exemplo n.º 17
0
 public override void Execute(ModificationContext context, object args)
 {
     context.SetValue(this.EffectiveDomains[0], "enginePowerFactor", _enginePowerFactor);
     context.SetValue(this.EffectiveDomains[0], "turretRotationSpeedFactor", _turretRotationSpeedFactor);
 }