/// <summary> /// This action upgrades the attack range of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="attackRangeUpgrade">The amount of the upgrade on the attack range.</param> private static void IncreaseAttackRange(IScenarioElementTypeUpgrade upgradeInterface, int attackRangeUpgrade) { foreach (IWeaponDataUpgrade weaponUpgradeInterface in upgradeInterface.StandardWeaponUpgrades) { weaponUpgradeInterface.RangeMaxUpgrade = attackRangeUpgrade; } }
/// <summary> /// This action sets the weapon level of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="weaponLevel">The new weapon level.</param> private static void SetWeaponLevel(IScenarioElementTypeUpgrade upgradeInterface, int weaponLevel) { foreach (IWeaponDataUpgrade weaponUpgradeInterface in upgradeInterface.StandardWeaponUpgrades) { weaponUpgradeInterface.DamageLevel = weaponLevel; } }
/// <see cref="UpgradeEffectBase.Perform"/> public override void Perform(IScenarioMetadataUpgrade metadataUpgrade) { if (metadataUpgrade == null) { throw new ArgumentNullException("metadataUpgrade"); } IScenarioElementTypeUpgrade targetType = metadataUpgrade.GetElementTypeUpgrade(this.TargetTypeName); this.action(targetType, this.actionParam); }
/// <summary> /// This action upgrades the sight range of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="sightRangeUpgrade">The amount of the upgrade on the sight range.</param> private static void IncreaseSightRange(IScenarioElementTypeUpgrade upgradeInterface, int sightRangeUpgrade) { upgradeInterface.SightRangeUpgrade = sightRangeUpgrade; }
/// <summary> /// This action upgrades the energy of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="energyUpgrade">The amount of the upgrade on the energy.</param> private static void IncreaseEnergy(IScenarioElementTypeUpgrade upgradeInterface, int energyUpgrade) { upgradeInterface.MaxEnergyUpgrade = energyUpgrade; }
/// <summary> /// This action upgrades the speed of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="speedUpgrade">The amount of the upgrade on the speed.</param> private static void IncreaseSpeed(IScenarioElementTypeUpgrade upgradeInterface, RCNumber speedUpgrade) { upgradeInterface.SpeedUpgrade = speedUpgrade; }
/// <summary> /// This action sets the armor level of a given type. /// </summary> /// <param name="upgradeInterface">The upgrade interface of the type.</param> /// <param name="armorLevel">The new armor level.</param> private static void SetArmorLevel(IScenarioElementTypeUpgrade upgradeInterface, int armorLevel) { upgradeInterface.ArmorLevel = armorLevel; }