public void ReplaceIndexedBonus(ShipModule module, int boostPoints1, int boostPoints2, int idx) { ParameterBonus bonus = new ParameterBonus(module, boostPoints1, boostPoints2); indexedBonuses[idx] = bonus; CalculateParameters(); }
public void ApplyBonusMultiplicative(ParameterBonus bonus) { AdjustParameterByPercent(ref StructurePoints, bonus.StructurePercent); AdjustParameterByPercent(ref ArmorPoints, bonus.ArmorPercent); AdjustParameterByPercent(ref ShieldPoints, bonus.ShieldPercent); AdjustParameterByPercent(ref ShieldRegen, bonus.ShieldRegenPercent); AdjustParameterByPercent(ref Dexterity, bonus.DexterityPercent); AdjustParameterByPercent(ref ReactorPoints, bonus.ReactorPercent); foreach (var weapon in Weapons) { AdjustParameterByPercent(ref weapon.FireRate, bonus.FireRatePercent); AdjustParameterByPercent(ref weapon.DamageAmount, bonus.DamageAmountPercent); if (weapon.Module.ModuleType.WeaponType == ShipModuleType.WeaponTypes.Laser) { AdjustParameterByPercent(ref weapon.DamageAmount, bonus.LaserDamagePercent); } else if (weapon.Module.ModuleType.WeaponType == ShipModuleType.WeaponTypes.Explosive) { AdjustParameterByPercent(ref weapon.DamageAmount, bonus.ExplosiveDamagePercent); } else if (weapon.Module.ModuleType.WeaponType == ShipModuleType.WeaponTypes.Explosive) { AdjustParameterByPercent(ref weapon.DamageAmount, bonus.KineticDamagePercent); } AdjustParameterByPercent(ref weapon.ShieldEffectiveness, bonus.ShieldEffectivenessPercent); AdjustParameterByPercent(ref weapon.ArmorEffectiveness, bonus.ArmorEffectivenessPercent); AdjustParameterByPercent(ref weapon.StructureEffectiveness, bonus.StructureEffectivenessPercent); AdjustParameterByPercent(ref weapon.CriticalChance, bonus.CriticalChancePercent); AdjustParameterByPercent(ref weapon.CriticalStrength, bonus.CriticalStrengthPercent); } }
public int AddIndexedBonus(ShipModule module, int boostPoints1, int boostPoints2) { ParameterBonus bonus = new ParameterBonus(module, boostPoints1, boostPoints2); if (indexedBonuses == null) { indexedBonuses = new List <ParameterBonus>(); } indexedBonuses.Add(bonus); CalculateParameters(); return(indexedBonuses.Count - 1); }
private void ApplyBonusAdditive(ParameterBonus bonus) { StructurePoints += (int)bonus.StructureAdd; ArmorPoints += (int)bonus.ArmorAdd; ShieldPoints += (int)bonus.ShieldAdd; ShieldRegen += (int)bonus.ShieldRegenAdd; Dexterity += bonus.DexterityAdd; ReactorPoints += (int)bonus.ReactorAdd; foreach (var weapon in Weapons) { weapon.FireRate += bonus.FireRateAdd; weapon.DamageAmount += bonus.DamageAmountAdd; weapon.ShieldEffectiveness += bonus.ShieldEffectivenessAdd; weapon.ArmorEffectiveness += bonus.ArmorEffectivenessAdd; weapon.StructureEffectiveness += bonus.StructureEffectivenessAdd; weapon.CriticalChance += bonus.CriticalChanceAdd; weapon.CriticalStrength += bonus.CriticalStrengthAdd; } }
public void AddBonus(ParameterBonus bonus) { Bonuses.Add(bonus); }